From 06961a1a8b896a9e2b8b7f9c26d4ab9d16975b3c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 10 Dec 2024 21:03:51 +0000 Subject: [PATCH 1/2] fix: Add compatibility for PHP 8.4 docs: Add documentation for logger client option PiperOrigin-RevId: 704769822 Source-Link: https://github.com/googleapis/googleapis/commit/68e77625374a91c46fe47980209fedd108c756e8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/724f6fc2efd4597d2e1c14709a0686ae070280ea Copy-Tag: eyJwIjoiUGFyYWxsZWxzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiNzI0ZjZmYzJlZmQ0NTk3ZDJlMWMxNDcwOWEwNjg2YWUwNzAyODBlYSJ9 Copy-Tag: eyJwIjoiUG9saWN5U2ltdWxhdG9yLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUG9saWN5VHJvdWJsZXNob290ZXIvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUG9saWN5VHJvdWJsZXNob290ZXJJYW0vLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUHJpdmF0ZUNhdGFsb2cvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUHJpdmlsZWdlZEFjY2Vzc01hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUHJvZmlsZXIvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUXVvdGFzLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUmFwaWRNaWdyYXRpb25Bc3Nlc3NtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUmVjYXB0Y2hhRW50ZXJwcmlzZS8uT3dsQm90LnlhbWwiLCJoIjoiNzI0ZjZmYzJlZmQ0NTk3ZDJlMWMxNDcwOWEwNjg2YWUwNzAyODBlYSJ9 Copy-Tag: eyJwIjoiUmVjb21tZW5kYXRpb25FbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUmVjb21tZW5kZXIvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUmVkaXMvLk93bEJvdC55YW1sIiwiaCI6IjcyNGY2ZmMyZWZkNDU5N2QyZTFjMTQ3MDlhMDY4NmFlMDcwMjgwZWEifQ== Copy-Tag: eyJwIjoiUmVkaXNDbHVzdGVyLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUmVzb3VyY2VNYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUmVzb3VyY2VTZXR0aW5ncy8uT3dsQm90LnlhbWwiLCJoIjoiNzI0ZjZmYzJlZmQ0NTk3ZDJlMWMxNDcwOWEwNjg2YWUwNzAyODBlYSJ9 Copy-Tag: eyJwIjoiUmV0YWlsLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiUnVuLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= Copy-Tag: eyJwIjoiU2NoZWR1bGVyLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= --- .../Cloud/Parallelstore/V1/Parallelstore.php | Bin 0 -> 8431 bytes .../V1/CreateInstanceRequest.php | 273 ++ .../V1/DeleteInstanceRequest.php | 155 + .../Parallelstore/V1/DestinationGcsBucket.php | 75 + .../V1/DestinationParallelstore.php | 71 + .../Parallelstore/V1/DirectoryStripeLevel.php | 68 + .../Parallelstore/V1/ExportDataMetadata.php | 351 +++ .../Parallelstore/V1/ExportDataRequest.php | 287 ++ .../Parallelstore/V1/ExportDataResponse.php | 33 + .../Parallelstore/V1/FileStripeLevel.php | 68 + .../Parallelstore/V1/GetInstanceRequest.php | 86 + .../Parallelstore/V1/ImportDataMetadata.php | 351 +++ .../Parallelstore/V1/ImportDataRequest.php | 287 ++ .../Parallelstore/V1/ImportDataResponse.php | 33 + .../Cloud/Parallelstore/V1/Instance.php | 625 ++++ .../Cloud/Parallelstore/V1/Instance/State.php | 85 + .../Parallelstore/V1/ListInstancesRequest.php | 237 ++ .../V1/ListInstancesResponse.php | 136 + .../Parallelstore/V1/OperationMetadata.php | 307 ++ .../Parallelstore/V1/SourceGcsBucket.php | 75 + .../Parallelstore/V1/SourceParallelstore.php | 71 + .../Parallelstore/V1/TransferCounters.php | 261 ++ .../V1/TransferOperationMetadata.php | 261 ++ .../Cloud/Parallelstore/V1/TransferType.php | 61 + .../V1/UpdateInstanceRequest.php | 225 ++ .../ParallelstoreClient/create_instance.php | 104 + .../ParallelstoreClient/delete_instance.php | 80 + .../V1/ParallelstoreClient/export_data.php | 83 + .../V1/ParallelstoreClient/get_instance.php | 72 + .../V1/ParallelstoreClient/get_location.php | 57 + .../V1/ParallelstoreClient/import_data.php | 83 + .../V1/ParallelstoreClient/list_instances.php | 80 + .../V1/ParallelstoreClient/list_locations.php | 62 + .../ParallelstoreClient/update_instance.php | 89 + .../v1/src/V1/Client/ParallelstoreClient.php | 611 ++++ .../v1/src/V1/gapic_metadata.json | 63 + .../parallelstore_client_config.json | 67 + .../parallelstore_descriptor_config.php | 197 ++ .../parallelstore_rest_client_config.php | 188 ++ .../V1/Client/ParallelstoreClientTest.php | 1100 ++++++++ .../Parallelstore/V1Beta/Parallelstore.php | Bin 0 -> 8766 bytes .../V1beta/CreateInstanceRequest.php | 273 ++ .../V1beta/DeleteInstanceRequest.php | 155 + .../Parallelstore/V1beta/DeploymentType.php | 62 + .../V1beta/DestinationGcsBucket.php | 75 + .../V1beta/DestinationParallelstore.php | 71 + .../V1beta/DirectoryStripeLevel.php | 68 + .../V1beta/ExportDataMetadata.php | 351 +++ .../V1beta/ExportDataRequest.php | 287 ++ .../V1beta/ExportDataResponse.php | 33 + .../Parallelstore/V1beta/FileStripeLevel.php | 68 + .../V1beta/GetInstanceRequest.php | 86 + .../V1beta/ImportDataMetadata.php | 351 +++ .../V1beta/ImportDataRequest.php | 287 ++ .../V1beta/ImportDataResponse.php | 33 + .../Cloud/Parallelstore/V1beta/Instance.php | 667 +++++ .../Parallelstore/V1beta/Instance/State.php | 85 + .../V1beta/ListInstancesRequest.php | 237 ++ .../V1beta/ListInstancesResponse.php | 136 + .../V1beta/OperationMetadata.php | 307 ++ .../Parallelstore/V1beta/SourceGcsBucket.php | 75 + .../V1beta/SourceParallelstore.php | 71 + .../Parallelstore/V1beta/TransferCounters.php | 261 ++ .../V1beta/TransferOperationMetadata.php | 261 ++ .../Parallelstore/V1beta/TransferType.php | 61 + .../V1beta/UpdateInstanceRequest.php | 225 ++ .../ParallelstoreClient/create_instance.php | 104 + .../ParallelstoreClient/delete_instance.php | 80 + .../ParallelstoreClient/export_data.php | 83 + .../ParallelstoreClient/get_instance.php | 72 + .../ParallelstoreClient/get_location.php | 57 + .../ParallelstoreClient/import_data.php | 83 + .../ParallelstoreClient/list_instances.php | 80 + .../ParallelstoreClient/list_locations.php | 62 + .../ParallelstoreClient/update_instance.php | 89 + .../src/V1beta/Client/ParallelstoreClient.php | 651 +++++ .../v1beta/src/V1beta/gapic_metadata.json | 63 + .../parallelstore_client_config.json | 67 + .../parallelstore_descriptor_config.php | 197 ++ .../parallelstore_rest_client_config.php | 187 ++ .../V1beta/Client/ParallelstoreClientTest.php | 1100 ++++++++ .../Cloud/Policysimulator/V1/Explanations.php | Bin 0 -> 2854 bytes .../Cloud/Policysimulator/V1/Simulator.php | Bin 0 -> 5717 bytes .../Cloud/PolicySimulator/V1/AccessState.php | 78 + .../PolicySimulator/V1/AccessStateDiff.php | 181 ++ .../V1/AccessStateDiff/AccessChangeType.php | 109 + .../Cloud/PolicySimulator/V1/AccessTuple.php | 187 ++ .../PolicySimulator/V1/BindingExplanation.php | 398 +++ .../AnnotatedMembership.php | 108 + .../V1/BindingExplanation/Membership.php | 86 + .../V1/BindingExplanation/RolePermission.php | 73 + .../V1/CreateReplayRequest.php | 148 + .../PolicySimulator/V1/ExplainedAccess.php | 170 ++ .../PolicySimulator/V1/ExplainedPolicy.php | 306 ++ .../PolicySimulator/V1/GetReplayRequest.php | 114 + .../PolicySimulator/V1/HeuristicRelevance.php | 65 + .../V1/ListReplayResultsRequest.php | 204 ++ .../V1/ListReplayResultsResponse.php | 110 + .../Cloud/PolicySimulator/V1/Replay.php | 213 ++ .../V1/Replay/ResultsSummary.php | 268 ++ .../Cloud/PolicySimulator/V1/Replay/State.php | 78 + .../Cloud/PolicySimulator/V1/ReplayConfig.php | 146 + .../V1/ReplayConfig/LogSource.php | 62 + .../Cloud/PolicySimulator/V1/ReplayDiff.php | 96 + .../V1/ReplayOperationMetadata.php | 77 + .../Cloud/PolicySimulator/V1/ReplayResult.php | 317 +++ .../V1/SimulatorClient/create_replay.php | 92 + .../samples/V1/SimulatorClient/get_replay.php | 80 + .../SimulatorClient/list_replay_results.php | 83 + .../v1/src/V1/Client/SimulatorClient.php | 428 +++ .../v1/src/V1/gapic_metadata.json | 33 + .../V1/resources/simulator_client_config.json | 59 + .../resources/simulator_descriptor_config.php | 85 + .../simulator_rest_client_config.php | 147 + .../Unit/V1/Client/SimulatorClientTest.php | 412 +++ .../Cloud/Policytroubleshooter/V1/Checker.php | Bin 0 -> 1904 bytes .../Policytroubleshooter/V1/Explanations.php | Bin 0 -> 2901 bytes .../PolicyTroubleshooter/V1/AccessState.php | 77 + .../PolicyTroubleshooter/V1/AccessTuple.php | 187 ++ .../V1/BindingExplanation.php | 398 +++ .../AnnotatedMembership.php | 108 + .../V1/BindingExplanation/Membership.php | 84 + .../V1/BindingExplanation/RolePermission.php | 71 + .../V1/ExplainedPolicy.php | 290 ++ .../V1/HeuristicRelevance.php | 65 + .../V1/TroubleshootIamPolicyRequest.php | 82 + .../V1/TroubleshootIamPolicyResponse.php | 168 ++ .../troubleshoot_iam_policy.php | 59 + .../v1/src/V1/Client/IamCheckerClient.php | 197 ++ .../v1/src/V1/gapic_metadata.json | 23 + .../resources/iam_checker_client_config.json | 50 + .../iam_checker_descriptor_config.php | 32 + .../iam_checker_rest_client_config.php | 34 + .../Unit/V1/Client/IamCheckerClientTest.php | 138 + .../Iam/V3/Troubleshooter.php | Bin 0 -> 10091 bytes .../Iam/V3/AccessTuple.php | 281 ++ .../Iam/V3/AllowAccessState.php | 79 + .../Iam/V3/AllowBindingExplanation.php | 486 ++++ .../AnnotatedAllowMembership.php | 108 + .../Iam/V3/AllowPolicyExplanation.php | 168 ++ .../Iam/V3/ConditionContext.php | 220 ++ .../Iam/V3/ConditionContext/EffectiveTag.php | 292 ++ .../Iam/V3/ConditionContext/Peer.php | 107 + .../Iam/V3/ConditionContext/Request.php | 86 + .../Iam/V3/ConditionContext/Resource.php | 184 ++ .../Iam/V3/ConditionExplanation.php | 153 + .../ConditionExplanation/EvaluationState.php | 194 ++ .../Iam/V3/DenyAccessState.php | 79 + .../Iam/V3/DenyPolicyExplanation.php | 218 ++ .../Iam/V3/DenyRuleExplanation.php | 630 +++++ .../AnnotatedDenyPrincipalMatching.php | 114 + .../AnnotatedPermissionMatching.php | 113 + .../Iam/V3/ExplainedAllowPolicy.php | 294 ++ .../Iam/V3/ExplainedDenyPolicy.php | 240 ++ .../Iam/V3/ExplainedDenyResource.php | 238 ++ .../Iam/V3/HeuristicRelevance.php | 64 + .../Iam/V3/MembershipMatchingState.php | 83 + .../Iam/V3/PermissionPatternMatchingState.php | 61 + .../Iam/V3/RolePermissionInclusionState.php | 68 + .../Iam/V3/TroubleshootIamPolicyRequest.php | 82 + .../Iam/V3/TroubleshootIamPolicyResponse.php | 220 ++ .../OverallAccessState.php | 81 + .../troubleshoot_iam_policy.php | 59 + .../V3/Client/PolicyTroubleshooterClient.php | 198 ++ .../v3/src/V3/gapic_metadata.json | 23 + .../policy_troubleshooter_client_config.json | 39 + ...olicy_troubleshooter_descriptor_config.php | 32 + ...licy_troubleshooter_rest_client_config.php | 34 + .../Client/PolicyTroubleshooterClientTest.php | 138 + .../Privatecatalog/V1Beta1/PrivateCatalog.php | Bin 0 -> 5198 bytes .../PrivateCatalog/V1beta1/AssetReference.php | 511 ++++ .../AssetReference/AssetValidationState.php | 71 + .../Cloud/PrivateCatalog/V1beta1/Catalog.php | 228 ++ .../PrivateCatalog/V1beta1/GcsSource.php | 149 + .../PrivateCatalog/V1beta1/GitSource.php | 217 ++ .../Cloud/PrivateCatalog/V1beta1/Inputs.php | 77 + .../Cloud/PrivateCatalog/V1beta1/Product.php | 922 ++++++ .../V1beta1/SearchCatalogsRequest.php | 189 ++ .../V1beta1/SearchCatalogsResponse.php | 105 + .../V1beta1/SearchProductsRequest.php | 197 ++ .../V1beta1/SearchProductsResponse.php | 105 + .../V1beta1/SearchVersionsRequest.php | 197 ++ .../V1beta1/SearchVersionsResponse.php | 105 + .../Cloud/PrivateCatalog/V1beta1/Version.php | 254 ++ .../PrivateCatalogClient/search_catalogs.php | 80 + .../PrivateCatalogClient/search_products.php | 77 + .../PrivateCatalogClient/search_versions.php | 86 + .../V1beta1/Client/PrivateCatalogClient.php | 284 ++ .../Gapic/PrivateCatalogGapicClient.php | 452 +++ .../src/V1beta1/PrivateCatalogClient.php | 36 + .../v1beta1/src/V1beta1/gapic_metadata.json | 33 + .../private_catalog_client_config.json | 37 + .../private_catalog_descriptor_config.php | 88 + .../private_catalog_rest_client_config.php | 92 + .../Client/PrivateCatalogClientTest.php | 328 +++ .../Unit/V1beta1/PrivateCatalogClientTest.php | 274 ++ .../V1/Privilegedaccessmanager.php | Bin 0 -> 16268 bytes .../V1/AccessControlEntry.php | 75 + .../V1/ApprovalWorkflow.php | 79 + .../V1/ApproveGrantRequest.php | 109 + .../V1/CheckOnboardingStatusRequest.php | 83 + .../V1/CheckOnboardingStatusResponse.php | 109 + .../CheckOnboardingStatusResponse/Finding.php | 79 + .../Finding/IAMAccessDenied.php | 73 + .../V1/CreateEntitlementRequest.php | 289 ++ .../V1/CreateGrantRequest.php | 206 ++ .../V1/DeleteEntitlementRequest.php | 193 ++ .../V1/DenyGrantRequest.php | 109 + .../V1/Entitlement.php | 531 ++++ .../AdditionalNotificationTargets.php | 112 + .../RequesterJustificationConfig.php | 121 + .../NotMandatory.php | 37 + .../Unstructured.php | 36 + .../V1/Entitlement/State.php | 85 + .../V1/GetEntitlementRequest.php | 81 + .../V1/GetGrantRequest.php | 81 + .../PrivilegedAccessManager/V1/Grant.php | 560 ++++ .../V1/Grant/AuditTrail.php | 132 + .../V1/Grant/State.php | 126 + .../V1/Grant/Timeline.php | 82 + .../V1/Grant/Timeline/Event.php | 425 +++ .../V1/Grant/Timeline/Event/Activated.php | 37 + .../Grant/Timeline/Event/ActivationFailed.php | 80 + .../V1/Grant/Timeline/Event/Approved.php | 108 + .../V1/Grant/Timeline/Event/Denied.php | 108 + .../V1/Grant/Timeline/Event/Ended.php | 36 + .../V1/Grant/Timeline/Event/Expired.php | 36 + .../Timeline/Event/ExternallyModified.php | 37 + .../V1/Grant/Timeline/Event/Requested.php | 84 + .../V1/Grant/Timeline/Event/Revoked.php | 104 + .../V1/Grant/Timeline/Event/Scheduled.php | 81 + .../V1/Justification.php | 78 + .../V1/ListEntitlementsRequest.php | 221 ++ .../V1/ListEntitlementsResponse.php | 135 + .../V1/ListGrantsRequest.php | 221 ++ .../V1/ListGrantsResponse.php | 135 + .../V1/ManualApprovals.php | 120 + .../V1/ManualApprovals/Step.php | 154 + .../V1/OperationMetadata.php | 307 ++ .../V1/PrivilegedAccess.php | 75 + .../V1/PrivilegedAccess/GcpIamAccess.php | 140 + .../GcpIamAccess/RoleBinding.php | 132 + .../V1/RevokeGrantRequest.php | 101 + .../V1/SearchEntitlementsRequest.php | 215 ++ .../CallerAccessType.php | 65 + .../V1/SearchEntitlementsResponse.php | 101 + .../V1/SearchGrantsRequest.php | 211 ++ .../CallerRelationshipType.php | 72 + .../V1/SearchGrantsResponse.php | 101 + .../V1/UpdateEntitlementRequest.php | 176 ++ .../approve_grant.php | 78 + .../check_onboarding_status.php | 81 + .../create_entitlement.php | 110 + .../create_grant.php | 82 + .../delete_entitlement.php | 89 + .../deny_grant.php | 78 + .../get_entitlement.php | 75 + .../get_grant.php | 76 + .../get_location.php | 57 + .../list_entitlements.php | 79 + .../list_grants.php | 80 + .../list_locations.php | 62 + .../revoke_grant.php | 89 + .../search_entitlements.php | 85 + .../search_grants.php | 86 + .../update_entitlement.php | 99 + .../Client/PrivilegedAccessManagerClient.php | 982 +++++++ .../v1/src/V1/gapic_metadata.json | 98 + ...ivileged_access_manager_client_config.json | 106 + ...leged_access_manager_descriptor_config.php | 304 ++ ...eged_access_manager_rest_client_config.php | 469 +++ .../PrivilegedAccessManagerClientTest.php | 1499 ++++++++++ .../Devtools/Cloudprofiler/V2/Profiler.php | Bin 0 -> 4189 bytes .../V2/CreateOfflineProfileRequest.php | 127 + .../Profiler/V2/CreateProfileRequest.php | 148 + .../Google/Cloud/Profiler/V2/Deployment.php | 199 ++ .../Cloud/Profiler/V2/ListProfilesRequest.php | 171 ++ .../Profiler/V2/ListProfilesResponse.php | 152 + .../src/Google/Cloud/Profiler/V2/Profile.php | 345 +++ .../Google/Cloud/Profiler/V2/ProfileType.php | 104 + .../Profiler/V2/UpdateProfileRequest.php | 151 + .../V2/ExportServiceClient/list_profiles.php | 78 + .../create_offline_profile.php | 64 + .../ProfilerServiceClient/create_profile.php | 75 + .../ProfilerServiceClient/update_profile.php | 65 + .../v2/src/V2/Client/ExportServiceClient.php | 243 ++ .../src/V2/Client/ProfilerServiceClient.php | 352 +++ .../Profiler/v2/src/V2/gapic_metadata.json | 47 + .../export_service_client_config.json | 39 + .../export_service_descriptor_config.php | 51 + .../export_service_rest_client_config.php | 40 + .../profiler_service_client_config.json | 69 + .../profiler_service_descriptor_config.php | 69 + .../profiler_service_rest_client_config.php | 66 + .../V2/Client/ExportServiceClientTest.php | 176 ++ .../V2/Client/ProfilerServiceClientTest.php | 264 ++ .../GPBMetadata/Google/Pubsub/V1/Pubsub.php | Bin 0 -> 17622 bytes .../GPBMetadata/Google/Pubsub/V1/Schema.php | Bin 0 -> 5034 bytes .../Cloud/PubSub/V1/AcknowledgeRequest.php | 132 + .../Google/Cloud/PubSub/V1/BigQueryConfig.php | 347 +++ .../Cloud/PubSub/V1/BigQueryConfig/State.php | 91 + .../Cloud/PubSub/V1/CloudStorageConfig.php | 506 ++++ .../V1/CloudStorageConfig/AvroConfig.php | 129 + .../PubSub/V1/CloudStorageConfig/State.php | 88 + .../V1/CloudStorageConfig/TextConfig.php | 38 + .../Cloud/PubSub/V1/CommitSchemaRequest.php | 132 + .../Cloud/PubSub/V1/CreateSchemaRequest.php | 200 ++ .../Cloud/PubSub/V1/CreateSnapshotRequest.php | 221 ++ .../Cloud/PubSub/V1/DeadLetterPolicy.php | 164 ++ .../Cloud/PubSub/V1/DeleteSchemaRequest.php | 86 + .../PubSub/V1/DeleteSchemaRevisionRequest.php | 143 + .../Cloud/PubSub/V1/DeleteSnapshotRequest.php | 86 + .../PubSub/V1/DeleteSubscriptionRequest.php | 86 + .../Cloud/PubSub/V1/DeleteTopicRequest.php | 86 + .../PubSub/V1/DetachSubscriptionRequest.php | 71 + .../PubSub/V1/DetachSubscriptionResponse.php | 34 + .../src/Google/Cloud/PubSub/V1/Encoding.php | 62 + .../Cloud/PubSub/V1/ExpirationPolicy.php | 98 + .../Cloud/PubSub/V1/GetSchemaRequest.php | 124 + .../Cloud/PubSub/V1/GetSnapshotRequest.php | 86 + .../PubSub/V1/GetSubscriptionRequest.php | 86 + .../Cloud/PubSub/V1/GetTopicRequest.php | 86 + .../PubSub/V1/IngestionDataSourceSettings.php | 156 + .../AwsKinesis.php | 234 ++ .../AwsKinesis/State.php | 95 + .../CloudStorage.php | 320 +++ .../CloudStorage/AvroFormat.php | 38 + .../CloudStorage/PubSubAvroFormat.php | 39 + .../CloudStorage/State.php | 94 + .../CloudStorage/TextFormat.php | 82 + .../Cloud/PubSub/V1/IngestionFailureEvent.php | 148 + .../ApiViolationReason.php | 43 + .../AvroFailureReason.php | 37 + .../CloudStorageFailure.php | 224 ++ .../PubSub/V1/ListSchemaRevisionsRequest.php | 195 ++ .../PubSub/V1/ListSchemaRevisionsResponse.php | 105 + .../Cloud/PubSub/V1/ListSchemasRequest.php | 204 ++ .../Cloud/PubSub/V1/ListSchemasResponse.php | 105 + .../Cloud/PubSub/V1/ListSnapshotsRequest.php | 162 ++ .../Cloud/PubSub/V1/ListSnapshotsResponse.php | 109 + .../PubSub/V1/ListSubscriptionsRequest.php | 162 ++ .../PubSub/V1/ListSubscriptionsResponse.php | 109 + .../PubSub/V1/ListTopicSnapshotsRequest.php | 162 ++ .../PubSub/V1/ListTopicSnapshotsResponse.php | 109 + .../V1/ListTopicSubscriptionsRequest.php | 162 ++ .../V1/ListTopicSubscriptionsResponse.php | 113 + .../Cloud/PubSub/V1/ListTopicsRequest.php | 162 ++ .../Cloud/PubSub/V1/ListTopicsResponse.php | 105 + .../Cloud/PubSub/V1/MessageStoragePolicy.php | 137 + .../PubSub/V1/ModifyAckDeadlineRequest.php | 198 ++ .../PubSub/V1/ModifyPushConfigRequest.php | 153 + .../Cloud/PubSub/V1/PlatformLogsSettings.php | 67 + .../V1/PlatformLogsSettings/Severity.php | 85 + .../Google/Cloud/PubSub/V1/PublishRequest.php | 122 + .../Cloud/PubSub/V1/PublishResponse.php | 75 + .../Google/Cloud/PubSub/V1/PubsubMessage.php | 280 ++ .../Google/Cloud/PubSub/V1/PullRequest.php | 222 ++ .../Google/Cloud/PubSub/V1/PullResponse.php | 83 + .../src/Google/Cloud/PubSub/V1/PushConfig.php | 294 ++ .../Cloud/PubSub/V1/PushConfig/NoWrapper.php | 78 + .../Cloud/PubSub/V1/PushConfig/OidcToken.php | 146 + .../PubSub/V1/PushConfig/PubsubWrapper.php | 38 + .../Cloud/PubSub/V1/ReceivedMessage.php | 189 ++ .../Google/Cloud/PubSub/V1/RetryPolicy.php | 140 + .../Cloud/PubSub/V1/RollbackSchemaRequest.php | 128 + .../src/Google/Cloud/PubSub/V1/Schema.php | 225 ++ .../Google/Cloud/PubSub/V1/Schema/Type.php | 64 + .../Google/Cloud/PubSub/V1/SchemaSettings.php | 197 ++ .../src/Google/Cloud/PubSub/V1/SchemaView.php | 62 + .../Google/Cloud/PubSub/V1/SeekRequest.php | 178 ++ .../Google/Cloud/PubSub/V1/SeekResponse.php | 33 + .../src/Google/Cloud/PubSub/V1/Snapshot.php | 227 ++ .../Cloud/PubSub/V1/StreamingPullRequest.php | 491 ++++ .../Cloud/PubSub/V1/StreamingPullResponse.php | 208 ++ .../AcknowledgeConfirmation.php | 181 ++ .../ModifyAckDeadlineConfirmation.php | 147 + .../SubscriptionProperties.php | 108 + .../Google/Cloud/PubSub/V1/Subscription.php | 1138 ++++++++ .../AnalyticsHubSubscriptionInfo.php | 121 + .../Cloud/PubSub/V1/Subscription/State.php | 66 + .../src/Google/Cloud/PubSub/V1/Topic.php | 473 ++++ .../Google/Cloud/PubSub/V1/Topic/State.php | 66 + .../Cloud/PubSub/V1/UpdateSnapshotRequest.php | 141 + .../PubSub/V1/UpdateSubscriptionRequest.php | 141 + .../Cloud/PubSub/V1/UpdateTopicRequest.php | 156 + .../PubSub/V1/ValidateMessageRequest.php | 217 ++ .../PubSub/V1/ValidateMessageResponse.php | 34 + .../Cloud/PubSub/V1/ValidateSchemaRequest.php | 132 + .../PubSub/V1/ValidateSchemaResponse.php | 34 + .../V1/PublisherClient/create_topic.php | 75 + .../V1/PublisherClient/delete_topic.php | 74 + .../PublisherClient/detach_subscription.php | 75 + .../V1/PublisherClient/get_iam_policy.php | 72 + .../samples/V1/PublisherClient/get_topic.php | 72 + .../PublisherClient/list_topic_snapshots.php | 80 + .../list_topic_subscriptions.php | 76 + .../V1/PublisherClient/list_topics.php | 77 + .../v1/samples/V1/PublisherClient/publish.php | 76 + .../V1/PublisherClient/set_iam_policy.php | 77 + .../PublisherClient/test_iam_permissions.php | 84 + .../V1/PublisherClient/update_topic.php | 81 + .../V1/SchemaServiceClient/commit_schema.php | 78 + .../V1/SchemaServiceClient/create_schema.php | 78 + .../V1/SchemaServiceClient/delete_schema.php | 70 + .../delete_schema_revision.php | 79 + .../V1/SchemaServiceClient/get_iam_policy.php | 72 + .../V1/SchemaServiceClient/get_schema.php | 72 + .../list_schema_revisions.php | 76 + .../V1/SchemaServiceClient/list_schemas.php | 77 + .../SchemaServiceClient/rollback_schema.php | 77 + .../V1/SchemaServiceClient/set_iam_policy.php | 77 + .../test_iam_permissions.php | 84 + .../SchemaServiceClient/validate_message.php | 72 + .../SchemaServiceClient/validate_schema.php | 79 + .../V1/SubscriberClient/acknowledge.php | 82 + .../V1/SubscriberClient/create_snapshot.php | 103 + .../SubscriberClient/create_subscription.php | 90 + .../V1/SubscriberClient/delete_snapshot.php | 78 + .../SubscriberClient/delete_subscription.php | 74 + .../V1/SubscriberClient/get_iam_policy.php | 72 + .../V1/SubscriberClient/get_snapshot.php | 76 + .../V1/SubscriberClient/get_subscription.php | 72 + .../V1/SubscriberClient/list_snapshots.php | 81 + .../SubscriberClient/list_subscriptions.php | 77 + .../SubscriberClient/modify_ack_deadline.php | 92 + .../SubscriberClient/modify_push_config.php | 78 + .../v1/samples/V1/SubscriberClient/pull.php | 77 + .../v1/samples/V1/SubscriberClient/seek.php | 77 + .../V1/SubscriberClient/set_iam_policy.php | 77 + .../V1/SubscriberClient/streaming_pull.php | 92 + .../SubscriberClient/test_iam_permissions.php | 84 + .../V1/SubscriberClient/update_snapshot.php | 67 + .../SubscriberClient/update_subscription.php | 90 + .../v1/src/V1/Client/PublisherClient.php | 660 +++++ .../v1/src/V1/Client/SchemaServiceClient.php | 608 ++++ .../v1/src/V1/Client/SubscriberClient.php | 909 ++++++ .../PubSub/v1/src/V1/gapic_metadata.json | 256 ++ .../V1/resources/publisher_client_config.json | 132 + .../resources/publisher_descriptor_config.php | 208 ++ .../publisher_rest_client_config.php | 217 ++ .../schema_service_client_config.json | 99 + .../schema_service_descriptor_config.php | 207 ++ .../schema_service_rest_client_config.php | 229 ++ .../resources/subscriber_client_config.json | 172 ++ .../subscriber_descriptor_config.php | 280 ++ .../subscriber_rest_client_config.php | 290 ++ .../Unit/V1/Client/PublisherClientTest.php | 941 +++++++ .../V1/Client/SchemaServiceClientTest.php | 1037 +++++++ .../Unit/V1/Client/SubscriberClientTest.php | 1494 ++++++++++ .../Google/Api/Cloudquotas/V1/Cloudquotas.php | 78 + .../Google/Api/Cloudquotas/V1/Resources.php | Bin 0 -> 4114 bytes .../V1/CreateQuotaPreferenceRequest.php | 232 ++ .../Cloud/CloudQuotas/V1/DimensionsInfo.php | 186 ++ .../CloudQuotas/V1/GetQuotaInfoRequest.php | 92 + .../V1/GetQuotaPreferenceRequest.php | 92 + .../CloudQuotas/V1/ListQuotaInfosRequest.php | 184 ++ .../CloudQuotas/V1/ListQuotaInfosResponse.php | 105 + .../V1/ListQuotaPreferencesRequest.php | 290 ++ .../V1/ListQuotaPreferencesResponse.php | 139 + .../Cloud/CloudQuotas/V1/QuotaConfig.php | 302 ++ .../CloudQuotas/V1/QuotaConfig/Origin.php | 64 + .../Cloud/CloudQuotas/V1/QuotaDetails.php | 119 + .../V1/QuotaIncreaseEligibility.php | 109 + .../IneligibilityReason.php | 79 + .../Google/Cloud/CloudQuotas/V1/QuotaInfo.php | 648 +++++ .../V1/QuotaInfo/ContainerType.php | 71 + .../Cloud/CloudQuotas/V1/QuotaPreference.php | 543 ++++ .../Cloud/CloudQuotas/V1/QuotaSafetyCheck.php | 63 + .../Cloud/CloudQuotas/V1/RolloutInfo.php | 67 + .../V1/UpdateQuotaPreferenceRequest.php | 270 ++ .../create_quota_preference.php | 99 + .../V1/CloudQuotasClient/get_quota_info.php | 79 + .../get_quota_preference.php | 78 + .../V1/CloudQuotasClient/list_quota_infos.php | 83 + .../list_quota_preferences.php | 85 + .../update_quota_preference.php | 91 + .../v1/src/V1/Client/CloudQuotasClient.php | 692 +++++ .../Quotas/v1/src/V1/gapic_metadata.json | 48 + .../resources/cloud_quotas_client_config.json | 64 + .../cloud_quotas_descriptor_config.php | 135 + .../cloud_quotas_rest_client_config.php | 162 ++ .../Unit/V1/Client/CloudQuotasClientTest.php | 620 ++++ .../V1/ApiEntities.php | Bin 0 -> 2874 bytes .../V1/Rapidmigrationassessment.php | 121 + .../V1/Annotation.php | 223 ++ .../V1/Annotation/Type.php | 64 + .../RapidMigrationAssessment/V1/Collector.php | 587 ++++ .../V1/Collector/State.php | 113 + .../V1/CreateAnnotationRequest.php | 161 ++ .../V1/CreateCollectorRequest.php | 197 ++ .../V1/DeleteCollectorRequest.php | 155 + .../V1/GetAnnotationRequest.php | 81 + .../V1/GetCollectorRequest.php | 81 + .../V1/GuestOsScan.php | 67 + .../V1/ListCollectorsRequest.php | 221 ++ .../V1/ListCollectorsResponse.php | 135 + .../V1/OperationMetadata.php | 307 ++ .../V1/PauseCollectorRequest.php | 155 + .../V1/RegisterCollectorRequest.php | 155 + .../V1/ResumeCollectorRequest.php | 155 + .../V1/UpdateCollectorRequest.php | 230 ++ .../V1/VSphereScan.php | 67 + .../create_annotation.php | 85 + .../create_collector.php | 89 + .../delete_collector.php | 88 + .../get_annotation.php | 75 + .../get_collector.php | 75 + .../get_location.php | 57 + .../list_collectors.php | 76 + .../list_locations.php | 62 + .../pause_collector.php | 87 + .../register_collector.php | 87 + .../resume_collector.php | 87 + .../update_collector.php | 74 + .../Client/RapidMigrationAssessmentClient.php | 659 +++++ .../v1/src/V1/gapic_metadata.json | 78 + ...id_migration_assessment_client_config.json | 105 + ...migration_assessment_descriptor_config.php | 245 ++ ...igration_assessment_rest_client_config.php | 223 ++ .../RapidMigrationAssessmentClientTest.php | 1473 ++++++++++ .../V1/Recaptchaenterprise.php | Bin 0 -> 24700 bytes .../V1/AccountDefenderAssessment.php | 67 + .../AccountDefenderLabel.php | 82 + .../V1/AccountVerificationInfo.php | 182 ++ .../V1/AccountVerificationInfo/Result.php | 123 + .../V1/AddIpOverrideRequest.php | 132 + .../V1/AddIpOverrideResponse.php | 33 + .../V1/AndroidKeySettings.php | 147 + .../V1/AnnotateAssessmentRequest.php | 303 ++ .../AnnotateAssessmentRequest/Annotation.php | 82 + .../V1/AnnotateAssessmentRequest/Reason.php | 165 ++ .../V1/AnnotateAssessmentResponse.php | 33 + .../V1/AppleDeveloperId.php | 147 + .../RecaptchaEnterprise/V1/Assessment.php | 599 ++++ .../V1/AssessmentEnvironment.php | 126 + .../V1/ChallengeMetrics.php | 185 ++ .../V1/CreateAssessmentRequest.php | 132 + .../V1/CreateFirewallPolicyRequest.php | 132 + .../V1/CreateKeyRequest.php | 132 + .../V1/DeleteFirewallPolicyRequest.php | 86 + .../V1/DeleteKeyRequest.php | 86 + .../V1/EndpointVerificationInfo.php | 197 ++ .../Cloud/RecaptchaEnterprise/V1/Event.php | 640 +++++ .../V1/Event/FraudPrevention.php | 70 + .../V1/ExpressKeySettings.php | 33 + .../RecaptchaEnterprise/V1/FirewallAction.php | 259 ++ .../V1/FirewallAction/AllowAction.php | 36 + .../V1/FirewallAction/BlockAction.php | 37 + .../IncludeRecaptchaScriptAction.php | 40 + .../V1/FirewallAction/RedirectAction.php | 37 + .../V1/FirewallAction/SetHeaderAction.php | 106 + .../V1/FirewallAction/SubstituteAction.php | 75 + .../RecaptchaEnterprise/V1/FirewallPolicy.php | 280 ++ .../V1/FirewallPolicyAssessment.php | 133 + .../V1/FraudPreventionAssessment.php | 215 ++ .../BehavioralTrustVerdict.php | 78 + .../CardTestingVerdict.php | 75 + .../StolenInstrumentVerdict.php | 75 + .../RecaptchaEnterprise/V1/FraudSignals.php | 125 + .../V1/FraudSignals/CardSignals.php | 70 + .../V1/FraudSignals/CardSignals/CardLabel.php | 74 + .../V1/FraudSignals/UserSignals.php | 116 + .../V1/GetFirewallPolicyRequest.php | 86 + .../RecaptchaEnterprise/V1/GetKeyRequest.php | 86 + .../V1/GetMetricsRequest.php | 86 + .../RecaptchaEnterprise/V1/IOSKeySettings.php | 165 ++ .../RecaptchaEnterprise/V1/IpOverrideData.php | 125 + .../V1/IpOverrideData/OverrideType.php | 58 + .../Cloud/RecaptchaEnterprise/V1/Key.php | 417 +++ .../V1/ListFirewallPoliciesRequest.php | 162 ++ .../V1/ListFirewallPoliciesResponse.php | 105 + .../V1/ListIpOverridesRequest.php | 170 ++ .../V1/ListIpOverridesResponse.php | 105 + .../V1/ListKeysRequest.php | 162 ++ .../V1/ListKeysResponse.php | 105 + ...tRelatedAccountGroupMembershipsRequest.php | 178 ++ ...RelatedAccountGroupMembershipsResponse.php | 105 + .../V1/ListRelatedAccountGroupsRequest.php | 178 ++ .../V1/ListRelatedAccountGroupsResponse.php | 105 + .../Cloud/RecaptchaEnterprise/V1/Metrics.php | 195 ++ .../V1/MigrateKeyRequest.php | 133 + .../V1/PhoneFraudAssessment.php | 77 + .../V1/PrivatePasswordLeakVerification.php | 201 ++ .../V1/RelatedAccountGroup.php | 75 + .../V1/RelatedAccountGroupMembership.php | 164 ++ .../V1/RemoveIpOverrideRequest.php | 132 + .../V1/RemoveIpOverrideResponse.php | 33 + .../V1/ReorderFirewallPoliciesRequest.php | 128 + .../V1/ReorderFirewallPoliciesResponse.php | 33 + .../V1/RetrieveLegacySecretKeyRequest.php | 86 + .../V1/RetrieveLegacySecretKeyResponse.php | 80 + .../RecaptchaEnterprise/V1/RiskAnalysis.php | 185 ++ .../V1/RiskAnalysis/Challenge.php | 72 + .../V1/RiskAnalysis/ClassificationReason.php | 101 + .../V1/ScoreDistribution.php | 75 + .../RecaptchaEnterprise/V1/ScoreMetrics.php | 115 + ...hRelatedAccountGroupMembershipsRequest.php | 294 ++ ...RelatedAccountGroupMembershipsResponse.php | 105 + .../V1/SmsTollFraudVerdict.php | 105 + .../SmsTollFraudReason.php | 57 + .../RecaptchaEnterprise/V1/TestingOptions.php | 113 + .../V1/TestingOptions/TestingChallenge.php | 68 + .../V1/TokenProperties.php | 309 ++ .../V1/TokenProperties/InvalidReason.php | 93 + .../V1/TransactionData.php | 581 ++++ .../V1/TransactionData/Address.php | 256 ++ .../V1/TransactionData/GatewayInfo.php | 184 ++ .../V1/TransactionData/Item.php | 180 ++ .../V1/TransactionData/User.php | 256 ++ .../V1/TransactionEvent.php | 199 ++ .../TransactionEvent/TransactionEventType.php | 214 ++ .../V1/UpdateFirewallPolicyRequest.php | 141 + .../V1/UpdateKeyRequest.php | 141 + .../Cloud/RecaptchaEnterprise/V1/UserId.php | 147 + .../Cloud/RecaptchaEnterprise/V1/UserInfo.php | 169 ++ .../RecaptchaEnterprise/V1/WafSettings.php | 102 + .../V1/WafSettings/WafFeature.php | 81 + .../V1/WafSettings/WafService.php | 78 + .../RecaptchaEnterprise/V1/WebKeySettings.php | 227 ++ .../ChallengeSecurityPreference.php | 72 + .../V1/WebKeySettings/IntegrationType.php | 76 + .../add_ip_override.php | 94 + .../annotate_assessment.php | 79 + .../create_assessment.php | 74 + .../create_firewall_policy.php | 76 + .../create_key.php | 77 + .../delete_firewall_policy.php | 73 + .../delete_key.php | 70 + .../get_firewall_policy.php | 75 + .../get_key.php | 72 + .../get_metrics.php | 73 + .../list_firewall_policies.php | 77 + .../list_ip_overrides.php | 77 + .../list_keys.php | 77 + ...list_related_account_group_memberships.php | 80 + .../list_related_account_groups.php | 77 + .../migrate_key.php | 77 + .../remove_ip_override.php | 95 + .../reorder_firewall_policies.php | 83 + .../retrieve_legacy_secret_key.php | 74 + ...arch_related_account_group_memberships.php | 78 + .../update_firewall_policy.php | 59 + .../update_key.php | 72 + .../RecaptchaEnterpriseServiceClient.php | 959 +++++++ .../RecaptchaEnterpriseServiceGapicClient.php | 1610 +++++++++++ .../V1/RecaptchaEnterpriseServiceClient.php | 34 + .../v1/src/V1/gapic_metadata.json | 128 + ...tcha_enterprise_service_client_config.json | 142 + ...a_enterprise_service_descriptor_config.php | 350 +++ ..._enterprise_service_rest_client_config.php | 284 ++ .../RecaptchaEnterpriseServiceClientTest.php | 1676 +++++++++++ .../RecaptchaEnterpriseServiceClientTest.php | 1517 ++++++++++ .../Recommendationengine/V1Beta1/Catalog.php | Bin 0 -> 2636 bytes .../V1Beta1/CatalogService.php | 70 + .../Recommendationengine/V1Beta1/Common.php | 42 + .../Recommendationengine/V1Beta1/Import.php | Bin 0 -> 3672 bytes .../PredictionApikeyRegistryService.php | 55 + .../V1Beta1/PredictionService.php | 70 + .../V1Beta1/RecommendationengineResources.php | 33 + .../V1Beta1/UserEvent.php | Bin 0 -> 3437 bytes .../V1Beta1/UserEventService.php | 78 + .../V1beta1/CatalogInlineSource.php | 71 + .../V1beta1/CatalogItem.php | 473 ++++ .../V1beta1/CatalogItem/CategoryHierarchy.php | 82 + .../V1beta1/CollectUserEventRequest.php | 219 ++ .../V1beta1/CreateCatalogItemRequest.php | 132 + ...atePredictionApiKeyRegistrationRequest.php | 132 + .../V1beta1/DeleteCatalogItemRequest.php | 86 + ...etePredictionApiKeyRegistrationRequest.php | 86 + .../V1beta1/EventDetail.php | 359 +++ .../V1beta1/FeatureMap.php | 139 + .../V1beta1/FeatureMap/FloatList.php | 70 + .../V1beta1/FeatureMap/StringList.php | 70 + .../V1beta1/GcsSource.php | 92 + .../V1beta1/GetCatalogItemRequest.php | 86 + .../RecommendationEngine/V1beta1/Image.php | 135 + .../V1beta1/ImportCatalogItemsRequest.php | 224 ++ .../V1beta1/ImportCatalogItemsResponse.php | 113 + .../V1beta1/ImportErrorsConfig.php | 84 + .../V1beta1/ImportMetadata.php | 266 ++ .../V1beta1/ImportUserEventsRequest.php | 239 ++ .../V1beta1/ImportUserEventsResponse.php | 161 ++ .../V1beta1/InputConfig.php | 141 + .../V1beta1/ListCatalogItemsRequest.php | 194 ++ .../V1beta1/ListCatalogItemsResponse.php | 105 + ...stPredictionApiKeyRegistrationsRequest.php | 158 ++ ...tPredictionApiKeyRegistrationsResponse.php | 105 + .../V1beta1/ListUserEventsRequest.php | 325 +++ .../V1beta1/ListUserEventsResponse.php | 105 + .../V1beta1/PredictRequest.php | 598 ++++ .../V1beta1/PredictResponse.php | 253 ++ .../PredictResponse/PredictionResult.php | 124 + .../V1beta1/PredictionApiKeyRegistration.php | 67 + .../V1beta1/ProductCatalogItem.php | 340 +++ .../V1beta1/ProductCatalogItem/ExactPrice.php | 108 + .../V1beta1/ProductCatalogItem/PriceRange.php | 105 + .../V1beta1/ProductCatalogItem/StockState.php | 79 + .../V1beta1/ProductDetail.php | 371 +++ .../V1beta1/ProductEventDetail.php | 368 +++ .../V1beta1/PurchaseTransaction.php | 251 ++ .../V1beta1/PurgeUserEventsMetadata.php | 112 + .../V1beta1/PurgeUserEventsRequest.php | 258 ++ .../V1beta1/PurgeUserEventsResponse.php | 107 + .../V1beta1/UpdateCatalogItemRequest.php | 188 ++ .../V1beta1/UserEvent.php | 422 +++ .../V1beta1/UserEvent/EventSource.php | 73 + .../V1beta1/UserEventImportSummary.php | 106 + .../V1beta1/UserEventInlineSource.php | 67 + .../RecommendationEngine/V1beta1/UserInfo.php | 271 ++ .../V1beta1/WriteUserEventRequest.php | 132 + .../create_catalog_item.php | 107 + .../delete_catalog_item.php | 75 + .../CatalogServiceClient/get_catalog_item.php | 77 + .../import_catalog_items.php | 91 + .../list_catalog_items.php | 77 + .../update_catalog_item.php | 113 + ...create_prediction_api_key_registration.php | 79 + ...delete_prediction_api_key_registration.php | 76 + .../list_prediction_api_key_registrations.php | 82 + .../PredictionServiceClient/predict.php | 151 + .../collect_user_event.php | 84 + .../import_user_events.php | 98 + .../list_user_events.php | 82 + .../purge_user_events.php | 113 + .../write_user_event.php | 114 + .../src/V1beta1/CatalogServiceClient.php | 36 + .../V1beta1/Client/CatalogServiceClient.php | 473 ++++ .../Client/PredictionApiKeyRegistryClient.php | 352 +++ .../Client/PredictionServiceClient.php | 262 ++ .../V1beta1/Client/UserEventServiceClient.php | 432 +++ .../Gapic/CatalogServiceGapicClient.php | 695 +++++ .../PredictionApiKeyRegistryGapicClient.php | 467 +++ .../Gapic/PredictionServiceGapicClient.php | 451 +++ .../Gapic/UserEventServiceGapicClient.php | 724 +++++ .../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 | 119 + .../catalog_service_rest_client_config.php | 134 + ...iction_api_key_registry_client_config.json | 50 + ...ion_api_key_registry_descriptor_config.php | 76 + ...on_api_key_registry_rest_client_config.php | 99 + .../prediction_service_client_config.json | 40 + .../prediction_service_descriptor_config.php | 51 + .../prediction_service_rest_client_config.php | 77 + .../user_event_service_client_config.json | 60 + .../user_event_service_descriptor_config.php | 113 + .../user_event_service_rest_client_config.php | 123 + .../Unit/V1beta1/CatalogServiceClientTest.php | 551 ++++ .../Client/CatalogServiceClientTest.php | 634 +++++ .../PredictionApiKeyRegistryClientTest.php | 302 ++ .../Client/PredictionServiceClientTest.php | 210 ++ .../Client/UserEventServiceClientTest.php | 593 ++++ .../PredictionApiKeyRegistryClientTest.php | 252 ++ .../V1beta1/PredictionServiceClientTest.php | 152 + .../V1beta1/UserEventServiceClientTest.php | 525 ++++ .../Google/Cloud/Recommender/V1/Insight.php | Bin 0 -> 3007 bytes .../Recommender/V1/InsightTypeConfig.php | 45 + .../Cloud/Recommender/V1/Recommendation.php | Bin 0 -> 5056 bytes .../Recommender/V1/RecommenderConfig.php | 45 + .../Recommender/V1/RecommenderService.php | 127 + .../Cloud/Recommender/V1/CostProjection.php | 181 ++ .../Recommender/V1/GetInsightRequest.php | 81 + .../V1/GetInsightTypeConfigRequest.php | 111 + .../V1/GetRecommendationRequest.php | 81 + .../V1/GetRecommenderConfigRequest.php | 111 + .../Google/Cloud/Recommender/V1/Impact.php | 208 ++ .../Cloud/Recommender/V1/Impact/Category.php | 92 + .../Google/Cloud/Recommender/V1/Insight.php | 502 ++++ .../Cloud/Recommender/V1/Insight/Category.php | 92 + .../V1/Insight/RecommendationReference.php | 74 + .../Cloud/Recommender/V1/Insight/Severity.php | 78 + .../Cloud/Recommender/V1/InsightStateInfo.php | 101 + .../Recommender/V1/InsightStateInfo/State.php | 77 + .../Recommender/V1/InsightTypeConfig.php | 347 +++ .../V1/InsightTypeGenerationConfig.php | 83 + .../Recommender/V1/ListInsightsRequest.php | 319 +++ .../Recommender/V1/ListInsightsResponse.php | 105 + .../V1/ListRecommendationsRequest.php | 378 +++ .../V1/ListRecommendationsResponse.php | 105 + .../V1/MarkInsightAcceptedRequest.php | 158 ++ .../V1/MarkRecommendationClaimedRequest.php | 168 ++ .../V1/MarkRecommendationDismissedRequest.php | 101 + .../V1/MarkRecommendationFailedRequest.php | 168 ++ .../V1/MarkRecommendationSucceededRequest.php | 168 ++ .../Google/Cloud/Recommender/V1/Operation.php | 564 ++++ .../Cloud/Recommender/V1/OperationGroup.php | 71 + .../Cloud/Recommender/V1/Recommendation.php | 546 ++++ .../V1/Recommendation/InsightReference.php | 74 + .../V1/Recommendation/Priority.php | 78 + .../Recommender/V1/RecommendationContent.php | 119 + .../V1/RecommendationStateInfo.php | 101 + .../V1/RecommendationStateInfo/State.php | 95 + .../Recommender/V1/RecommenderConfig.php | 347 +++ .../V1/RecommenderGenerationConfig.php | 83 + .../Recommender/V1/ReliabilityProjection.php | 111 + .../V1/ReliabilityProjection/RiskType.php | 72 + .../Recommender/V1/SecurityProjection.php | 77 + .../V1/SustainabilityProjection.php | 116 + .../V1/UpdateInsightTypeConfigRequest.php | 174 ++ .../V1/UpdateRecommenderConfigRequest.php | 174 ++ .../Cloud/Recommender/V1/ValueMatcher.php | 81 + .../V1/RecommenderClient/get_insight.php | 77 + .../get_insight_type_config.php | 86 + .../RecommenderClient/get_recommendation.php | 77 + .../get_recommender_config.php | 86 + .../V1/RecommenderClient/list_insights.php | 93 + .../list_recommendations.php | 93 + .../mark_insight_accepted.php | 84 + .../mark_recommendation_claimed.php | 88 + .../mark_recommendation_dismissed.php | 84 + .../mark_recommendation_failed.php | 89 + .../mark_recommendation_succeeded.php | 89 + .../update_insight_type_config.php | 60 + .../update_recommender_config.php | 60 + .../v1/src/V1/Client/RecommenderClient.php | 1199 ++++++++ .../Recommender/v1/src/V1/gapic_metadata.json | 83 + .../resources/recommender_client_config.json | 110 + .../recommender_descriptor_config.php | 232 ++ .../recommender_rest_client_config.php | 366 +++ .../Unit/V1/Client/RecommenderClientTest.php | 1062 +++++++ .../Google/Cloud/Redis/V1/CloudRedis.php | Bin 0 -> 10724 bytes .../Cloud/Redis/V1/CreateInstanceRequest.php | 205 ++ .../Cloud/Redis/V1/DeleteInstanceRequest.php | 92 + .../Cloud/Redis/V1/ExportInstanceRequest.php | 136 + .../Redis/V1/FailoverInstanceRequest.php | 133 + .../DataProtectionMode.php | 68 + .../Google/Cloud/Redis/V1/GcsDestination.php | 71 + .../src/Google/Cloud/Redis/V1/GcsSource.php | 67 + .../Redis/V1/GetInstanceAuthStringRequest.php | 92 + .../Cloud/Redis/V1/GetInstanceRequest.php | 91 + .../Cloud/Redis/V1/ImportInstanceRequest.php | 136 + .../src/Google/Cloud/Redis/V1/InputConfig.php | 75 + .../src/Google/Cloud/Redis/V1/Instance.php | 1567 +++++++++++ .../Cloud/Redis/V1/Instance/ConnectMode.php | 66 + .../Redis/V1/Instance/ReadReplicasMode.php | 67 + .../Google/Cloud/Redis/V1/Instance/State.php | 108 + .../Redis/V1/Instance/SuspensionReason.php | 57 + .../Google/Cloud/Redis/V1/Instance/Tier.php | 64 + .../V1/Instance/TransitEncryptionMode.php | 64 + .../Cloud/Redis/V1/InstanceAuthString.php | 67 + .../Cloud/Redis/V1/ListInstancesRequest.php | 187 ++ .../Cloud/Redis/V1/ListInstancesResponse.php | 175 ++ .../Cloud/Redis/V1/LocationMetadata.php | 82 + .../Cloud/Redis/V1/MaintenancePolicy.php | 201 ++ .../Cloud/Redis/V1/MaintenanceSchedule.php | 217 ++ .../src/Google/Cloud/Redis/V1/NodeInfo.php | 101 + .../Cloud/Redis/V1/OperationMetadata.php | 291 ++ .../Google/Cloud/Redis/V1/OutputConfig.php | 75 + .../Cloud/Redis/V1/PersistenceConfig.php | 221 ++ .../V1/PersistenceConfig/PersistenceMode.php | 65 + .../V1/PersistenceConfig/SnapshotPeriod.php | 78 + .../Redis/V1/RescheduleMaintenanceRequest.php | 190 ++ .../RescheduleType.php | 72 + .../Google/Cloud/Redis/V1/TlsCertificate.php | 239 ++ .../Cloud/Redis/V1/UpdateInstanceRequest.php | 178 ++ .../Cloud/Redis/V1/UpgradeInstanceRequest.php | 128 + .../Redis/V1/WeeklyMaintenanceWindow.php | 160 ++ .../Google/Cloud/Redis/V1/ZoneMetadata.php | 34 + .../V1/CloudRedisClient/create_instance.php | 139 + .../V1/CloudRedisClient/delete_instance.php | 83 + .../V1/CloudRedisClient/export_instance.php | 92 + .../V1/CloudRedisClient/failover_instance.php | 86 + .../V1/CloudRedisClient/get_instance.php | 73 + .../get_instance_auth_string.php | 75 + .../V1/CloudRedisClient/get_location.php | 57 + .../V1/CloudRedisClient/import_instance.php | 94 + .../V1/CloudRedisClient/list_instances.php | 86 + .../V1/CloudRedisClient/list_locations.php | 62 + .../reschedule_maintenance.php | 91 + .../V1/CloudRedisClient/update_instance.php | 111 + .../V1/CloudRedisClient/upgrade_instance.php | 89 + .../v1/src/V1/Client/CloudRedisClient.php | 709 +++++ .../Redis/v1/src/V1/gapic_metadata.json | 83 + .../resources/cloud_redis_client_config.json | 97 + .../cloud_redis_descriptor_config.php | 263 ++ .../cloud_redis_rest_client_config.php | 234 ++ .../Unit/V1/Client/CloudRedisClientTest.php | 1882 +++++++++++++ .../Redis/Cluster/V1/CloudRedisCluster.php | Bin 0 -> 8132 bytes .../Redis/Cluster/V1/AuthorizationMode.php | 61 + .../Redis/Cluster/V1/CertificateAuthority.php | 112 + .../ManagedCertificateAuthority.php | 72 + .../ManagedCertificateAuthority/CertChain.php | 68 + .../Google/Cloud/Redis/Cluster/V1/Cluster.php | 821 ++++++ .../Cloud/Redis/Cluster/V1/Cluster/State.php | 78 + .../Redis/Cluster/V1/Cluster/StateInfo.php | 78 + .../V1/Cluster/StateInfo/UpdateInfo.php | 124 + .../Cluster/V1/ClusterPersistenceConfig.php | 155 + .../V1/ClusterPersistenceConfig/AOFConfig.php | 70 + .../AOFConfig/AppendFsync.php | 74 + .../PersistenceMode.php | 71 + .../V1/ClusterPersistenceConfig/RDBConfig.php | 122 + .../RDBConfig/SnapshotPeriod.php | 78 + .../Redis/Cluster/V1/CreateClusterRequest.php | 238 ++ .../Redis/Cluster/V1/DeleteClusterRequest.php | 125 + .../Redis/Cluster/V1/DiscoveryEndpoint.php | 153 + .../GetClusterCertificateAuthorityRequest.php | 92 + .../Redis/Cluster/V1/GetClusterRequest.php | 91 + .../Redis/Cluster/V1/ListClustersRequest.php | 183 ++ .../Redis/Cluster/V1/ListClustersResponse.php | 175 ++ .../Cloud/Redis/Cluster/V1/NodeType.php | 73 + .../Redis/Cluster/V1/OperationMetadata.php | 307 ++ .../Cloud/Redis/Cluster/V1/PscConfig.php | 73 + .../Cloud/Redis/Cluster/V1/PscConnection.php | 227 ++ .../Cluster/V1/TransitEncryptionMode.php | 61 + .../Redis/Cluster/V1/UpdateClusterRequest.php | 196 ++ .../Cluster/V1/ZoneDistributionConfig.php | 113 + .../ZoneDistributionMode.php | 69 + .../create_cluster.php | 132 + .../delete_cluster.php | 83 + .../CloudRedisClusterClient/get_cluster.php | 73 + .../get_cluster_certificate_authority.php | 77 + .../CloudRedisClusterClient/get_location.php | 57 + .../CloudRedisClusterClient/list_clusters.php | 86 + .../list_locations.php | 62 + .../update_cluster.php | 108 + .../src/V1/Client/CloudRedisClusterClient.php | 576 ++++ .../v1/src/V1/gapic_metadata.json | 58 + .../cloud_redis_cluster_client_config.json | 72 + .../cloud_redis_cluster_descriptor_config.php | 169 ++ ...cloud_redis_cluster_rest_client_config.php | 174 ++ .../V1/Client/CloudRedisClusterClientTest.php | 940 +++++++ .../Cloud/Resourcemanager/V3/Folders.php | Bin 0 -> 5416 bytes .../Resourcemanager/V3/Organizations.php | Bin 0 -> 3389 bytes .../Cloud/Resourcemanager/V3/Projects.php | Bin 0 -> 5620 bytes .../Cloud/Resourcemanager/V3/TagBindings.php | 81 + .../Cloud/Resourcemanager/V3/TagHolds.php | 66 + .../Cloud/Resourcemanager/V3/TagKeys.php | Bin 0 -> 4764 bytes .../Cloud/Resourcemanager/V3/TagValues.php | 90 + .../V3/CreateFolderMetadata.php | 105 + .../V3/CreateFolderRequest.php | 95 + .../V3/CreateProjectMetadata.php | 155 + .../V3/CreateProjectRequest.php | 124 + .../V3/CreateTagBindingMetadata.php | 33 + .../V3/CreateTagBindingRequest.php | 128 + .../V3/CreateTagHoldMetadata.php | 35 + .../V3/CreateTagHoldRequest.php | 170 ++ .../V3/CreateTagKeyMetadata.php | 33 + .../V3/CreateTagKeyRequest.php | 133 + .../V3/CreateTagValueMetadata.php | 33 + .../V3/CreateTagValueRequest.php | 133 + .../V3/DeleteFolderMetadata.php | 34 + .../V3/DeleteFolderRequest.php | 86 + .../V3/DeleteOrganizationMetadata.php | 34 + .../V3/DeleteProjectMetadata.php | 34 + .../V3/DeleteProjectRequest.php | 82 + .../V3/DeleteTagBindingMetadata.php | 33 + .../V3/DeleteTagBindingRequest.php | 91 + .../V3/DeleteTagHoldMetadata.php | 35 + .../V3/DeleteTagHoldRequest.php | 124 + .../V3/DeleteTagKeyMetadata.php | 33 + .../V3/DeleteTagKeyRequest.php | 167 ++ .../V3/DeleteTagValueMetadata.php | 33 + .../V3/DeleteTagValueRequest.php | 162 ++ .../Cloud/ResourceManager/V3/EffectiveTag.php | 289 ++ .../Cloud/ResourceManager/V3/Folder.php | 392 +++ .../Cloud/ResourceManager/V3/Folder/State.php | 64 + .../ResourceManager/V3/GetFolderRequest.php | 86 + .../V3/GetNamespacedTagKeyRequest.php | 96 + .../V3/GetNamespacedTagValueRequest.php | 113 + .../V3/GetOrganizationRequest.php | 92 + .../ResourceManager/V3/GetProjectRequest.php | 83 + .../ResourceManager/V3/GetTagKeyRequest.php | 86 + .../ResourceManager/V3/GetTagValueRequest.php | 86 + .../V3/ListEffectiveTagsRequest.php | 170 ++ .../V3/ListEffectiveTagsResponse.php | 129 + .../ResourceManager/V3/ListFoldersRequest.php | 234 ++ .../V3/ListFoldersResponse.php | 109 + .../V3/ListProjectsRequest.php | 225 ++ .../V3/ListProjectsResponse.php | 136 + .../V3/ListTagBindingsRequest.php | 170 ++ .../V3/ListTagBindingsResponse.php | 129 + .../V3/ListTagHoldsRequest.php | 236 ++ .../V3/ListTagHoldsResponse.php | 129 + .../ResourceManager/V3/ListTagKeysRequest.php | 170 ++ .../V3/ListTagKeysResponse.php | 105 + .../V3/ListTagValuesRequest.php | 162 ++ .../V3/ListTagValuesResponse.php | 113 + .../ResourceManager/V3/MoveFolderMetadata.php | 135 + .../ResourceManager/V3/MoveFolderRequest.php | 132 + .../V3/MoveProjectMetadata.php | 34 + .../ResourceManager/V3/MoveProjectRequest.php | 119 + .../Cloud/ResourceManager/V3/Organization.php | 372 +++ .../ResourceManager/V3/Organization/State.php | 64 + .../Cloud/ResourceManager/V3/Project.php | 489 ++++ .../ResourceManager/V3/Project/State.php | 70 + .../Cloud/ResourceManager/V3/Purpose.php | 66 + .../V3/SearchFoldersRequest.php | 290 ++ .../V3/SearchFoldersResponse.php | 109 + .../V3/SearchOrganizationsRequest.php | 234 ++ .../V3/SearchOrganizationsResponse.php | 121 + .../V3/SearchProjectsRequest.php | 302 ++ .../V3/SearchProjectsResponse.php | 138 + .../Cloud/ResourceManager/V3/TagBinding.php | 207 ++ .../Cloud/ResourceManager/V3/TagHold.php | 256 ++ .../Cloud/ResourceManager/V3/TagKey.php | 477 ++++ .../Cloud/ResourceManager/V3/TagValue.php | 374 +++ .../V3/UndeleteFolderMetadata.php | 34 + .../V3/UndeleteFolderRequest.php | 86 + .../V3/UndeleteOrganizationMetadata.php | 34 + .../V3/UndeleteProjectMetadata.php | 34 + .../V3/UndeleteProjectRequest.php | 89 + .../V3/UpdateFolderMetadata.php | 34 + .../V3/UpdateFolderRequest.php | 152 + .../V3/UpdateProjectMetadata.php | 34 + .../V3/UpdateProjectRequest.php | 141 + .../V3/UpdateTagKeyMetadata.php | 33 + .../V3/UpdateTagKeyRequest.php | 199 ++ .../V3/UpdateTagValueMetadata.php | 33 + .../V3/UpdateTagValueRequest.php | 189 ++ .../V3/FoldersClient/create_folder.php | 112 + .../V3/FoldersClient/delete_folder.php | 94 + .../samples/V3/FoldersClient/get_folder.php | 76 + .../V3/FoldersClient/get_iam_policy.php | 75 + .../samples/V3/FoldersClient/list_folders.php | 89 + .../samples/V3/FoldersClient/move_folder.php | 105 + .../V3/FoldersClient/search_folders.php | 67 + .../V3/FoldersClient/set_iam_policy.php | 77 + .../V3/FoldersClient/test_iam_permissions.php | 82 + .../V3/FoldersClient/undelete_folder.php | 94 + .../V3/FoldersClient/update_folder.php | 105 + .../V3/OrganizationsClient/get_iam_policy.php | 76 + .../OrganizationsClient/get_organization.php | 73 + .../search_organizations.php | 68 + .../V3/OrganizationsClient/set_iam_policy.php | 78 + .../test_iam_permissions.php | 82 + .../V3/ProjectsClient/create_project.php | 75 + .../V3/ProjectsClient/delete_project.php | 115 + .../V3/ProjectsClient/get_iam_policy.php | 73 + .../samples/V3/ProjectsClient/get_project.php | 75 + .../V3/ProjectsClient/list_projects.php | 85 + .../V3/ProjectsClient/move_project.php | 101 + .../V3/ProjectsClient/search_projects.php | 71 + .../V3/ProjectsClient/set_iam_policy.php | 113 + .../ProjectsClient/test_iam_permissions.php | 79 + .../V3/ProjectsClient/undelete_project.php | 93 + .../V3/ProjectsClient/update_project.php | 76 + .../TagBindingsClient/create_tag_binding.php | 71 + .../TagBindingsClient/delete_tag_binding.php | 82 + .../TagBindingsClient/list_effective_tags.php | 78 + .../TagBindingsClient/list_tag_bindings.php | 81 + .../V3/TagHoldsClient/create_tag_hold.php | 92 + .../V3/TagHoldsClient/delete_tag_hold.php | 81 + .../V3/TagHoldsClient/list_tag_holds.php | 77 + .../V3/TagKeysClient/create_tag_key.php | 92 + .../V3/TagKeysClient/delete_tag_key.php | 86 + .../V3/TagKeysClient/get_iam_policy.php | 76 + .../TagKeysClient/get_namespaced_tag_key.php | 76 + .../samples/V3/TagKeysClient/get_tag_key.php | 73 + .../V3/TagKeysClient/list_tag_keys.php | 77 + .../V3/TagKeysClient/set_iam_policy.php | 77 + .../V3/TagKeysClient/test_iam_permissions.php | 82 + .../V3/TagKeysClient/update_tag_key.php | 89 + .../V3/TagValuesClient/create_tag_value.php | 92 + .../V3/TagValuesClient/delete_tag_value.php | 85 + .../V3/TagValuesClient/get_iam_policy.php | 76 + .../get_namespaced_tag_value.php | 81 + .../V3/TagValuesClient/get_tag_value.php | 73 + .../V3/TagValuesClient/list_tag_values.php | 75 + .../V3/TagValuesClient/set_iam_policy.php | 77 + .../TagValuesClient/test_iam_permissions.php | 82 + .../V3/TagValuesClient/update_tag_value.php | 89 + .../v3/src/V3/Client/FoldersClient.php | 684 +++++ .../v3/src/V3/Client/OrganizationsClient.php | 375 +++ .../v3/src/V3/Client/ProjectsClient.php | 702 +++++ .../v3/src/V3/Client/TagBindingsClient.php | 385 +++ .../v3/src/V3/Client/TagHoldsClient.php | 374 +++ .../v3/src/V3/Client/TagKeysClient.php | 541 ++++ .../v3/src/V3/Client/TagValuesClient.php | 541 ++++ .../v3/src/V3/gapic_metadata.json | 332 +++ .../V3/resources/folders_client_config.json | 99 + .../resources/folders_descriptor_config.php | 191 ++ .../resources/folders_rest_client_config.php | 156 + .../organizations_client_config.json | 69 + .../organizations_descriptor_config.php | 91 + .../organizations_rest_client_config.php | 93 + .../V3/resources/projects_client_config.json | 99 + .../resources/projects_descriptor_config.php | 191 ++ .../resources/projects_rest_client_config.php | 153 + .../resources/tag_bindings_client_config.json | 64 + .../tag_bindings_descriptor_config.php | 85 + .../tag_bindings_rest_client_config.php | 72 + .../V3/resources/tag_holds_client_config.json | 37 + .../resources/tag_holds_descriptor_config.php | 90 + .../tag_holds_rest_client_config.php | 76 + .../V3/resources/tag_keys_client_config.json | 89 + .../resources/tag_keys_descriptor_config.php | 145 + .../resources/tag_keys_rest_client_config.php | 132 + .../resources/tag_values_client_config.json | 89 + .../tag_values_descriptor_config.php | 145 + .../tag_values_rest_client_config.php | 132 + .../Unit/V3/Client/FoldersClientTest.php | 1232 ++++++++ .../V3/Client/OrganizationsClientTest.php | 440 +++ .../Unit/V3/Client/ProjectsClientTest.php | 1229 ++++++++ .../Unit/V3/Client/TagBindingsClientTest.php | 539 ++++ .../Unit/V3/Client/TagHoldsClientTest.php | 480 ++++ .../Unit/V3/Client/TagKeysClientTest.php | 988 +++++++ .../Unit/V3/Client/TagValuesClientTest.php | 988 +++++++ .../Resourcesettings/V1/ResourceSettings.php | Bin 0 -> 3819 bytes .../ResourceSettings/V1/GetSettingRequest.php | 125 + .../V1/ListSettingsRequest.php | 208 ++ .../V1/ListSettingsResponse.php | 101 + .../Cloud/ResourceSettings/V1/Setting.php | 329 +++ .../ResourceSettings/V1/SettingMetadata.php | 229 ++ .../V1/SettingMetadata/DataType.php | 80 + .../Cloud/ResourceSettings/V1/SettingView.php | 76 + .../V1/UpdateSettingRequest.php | 81 + .../Cloud/ResourceSettings/V1/Value.php | 174 ++ .../ResourceSettings/V1/Value/EnumValue.php | 72 + .../ResourceSettings/V1/Value/StringSet.php | 72 + .../get_setting.php | 76 + .../list_settings.php | 81 + .../update_setting.php | 74 + .../Client/ResourceSettingsServiceClient.php | 387 +++ .../v1/src/V1/gapic_metadata.json | 33 + ...source_settings_service_client_config.json | 50 + ...rce_settings_service_descriptor_config.php | 79 + ...ce_settings_service_rest_client_config.php | 96 + .../ResourceSettingsServiceClientTest.php | 300 ++ .../Cloud/Retail/V2/AnalyticsService.php | 36 + .../Google/Cloud/Retail/V2/Catalog.php | Bin 0 -> 4735 bytes .../Google/Cloud/Retail/V2/CatalogService.php | 99 + .../Google/Cloud/Retail/V2/Common.php | Bin 0 -> 4745 bytes .../Cloud/Retail/V2/CompletionService.php | 71 + .../Google/Cloud/Retail/V2/Control.php | Bin 0 -> 1465 bytes .../Google/Cloud/Retail/V2/ControlService.php | 66 + .../Google/Cloud/Retail/V2/ExportConfig.php | Bin 0 -> 2256 bytes .../Cloud/Retail/V2/GenerativeQuestion.php | 40 + .../Retail/V2/GenerativeQuestionService.php | 59 + .../Google/Cloud/Retail/V2/ImportConfig.php | Bin 0 -> 4253 bytes .../Google/Cloud/Retail/V2/Model.php | Bin 0 -> 2944 bytes .../Google/Cloud/Retail/V2/ModelService.php | 84 + .../Cloud/Retail/V2/PredictionService.php | 64 + .../Google/Cloud/Retail/V2/Product.php | Bin 0 -> 3387 bytes .../Google/Cloud/Retail/V2/ProductService.php | 129 + .../Google/Cloud/Retail/V2/Promotion.php | 29 + .../Google/Cloud/Retail/V2/PurgeConfig.php | 52 + .../Google/Cloud/Retail/V2/SearchService.php | Bin 0 -> 8443 bytes .../Google/Cloud/Retail/V2/ServingConfig.php | Bin 0 -> 2231 bytes .../Cloud/Retail/V2/ServingConfigService.php | 76 + .../Google/Cloud/Retail/V2/UserEvent.php | 77 + .../Cloud/Retail/V2/UserEventService.php | Bin 0 -> 3520 bytes .../Retail/V2/AddCatalogAttributeRequest.php | 121 + .../Cloud/Retail/V2/AddControlRequest.php | 124 + .../V2/AddFulfillmentPlacesMetadata.php | 36 + .../Retail/V2/AddFulfillmentPlacesRequest.php | 391 +++ .../V2/AddFulfillmentPlacesResponse.php | 36 + .../Retail/V2/AddLocalInventoriesMetadata.php | 36 + .../Retail/V2/AddLocalInventoriesRequest.php | 337 +++ .../Retail/V2/AddLocalInventoriesResponse.php | 38 + .../Cloud/Retail/V2/AttributeConfigLevel.php | 64 + .../Cloud/Retail/V2/AttributesConfig.php | 171 ++ .../src/Google/Cloud/Retail/V2/Audience.php | 178 ++ ...UpdateGenerativeQuestionConfigsRequest.php | 121 + ...pdateGenerativeQuestionConfigsResponse.php | 67 + .../Cloud/Retail/V2/BigQueryOutputResult.php | 101 + .../Google/Cloud/Retail/V2/BigQuerySource.php | 351 +++ .../src/Google/Cloud/Retail/V2/Catalog.php | 153 + .../Cloud/Retail/V2/CatalogAttribute.php | 578 ++++ .../V2/CatalogAttribute/AttributeType.php | 66 + .../DynamicFacetableOption.php | 64 + .../ExactSearchableOption.php | 64 + .../V2/CatalogAttribute/FacetConfig.php | 315 +++ .../FacetConfig/IgnoredFacetValues.php | 202 ++ .../FacetConfig/MergedFacet.php | 94 + .../FacetConfig/MergedFacetValue.php | 123 + .../FacetConfig/RerankConfig.php | 123 + .../V2/CatalogAttribute/IndexableOption.php | 64 + .../V2/CatalogAttribute/RetrievableOption.php | 64 + .../V2/CatalogAttribute/SearchableOption.php | 64 + .../Retail/V2/CollectUserEventRequest.php | 288 ++ .../src/Google/Cloud/Retail/V2/ColorInfo.php | 177 ++ .../Cloud/Retail/V2/CompleteQueryRequest.php | 511 ++++ .../Cloud/Retail/V2/CompleteQueryResponse.php | 262 ++ .../CompleteQueryResponse/AttributeResult.php | 64 + .../CompletionResult.php | 128 + .../RecentSearchResult.php | 71 + .../Cloud/Retail/V2/CompletionConfig.php | 546 ++++ .../Retail/V2/CompletionDataInputConfig.php | 84 + .../Cloud/Retail/V2/CompletionDetail.php | 152 + .../src/Google/Cloud/Retail/V2/Condition.php | 168 ++ .../Cloud/Retail/V2/Condition/QueryTerm.php | 124 + .../Cloud/Retail/V2/Condition/TimeRange.php | 125 + .../src/Google/Cloud/Retail/V2/Control.php | 325 +++ .../Cloud/Retail/V2/CreateControlRequest.php | 184 ++ .../Cloud/Retail/V2/CreateModelMetadata.php | 75 + .../Cloud/Retail/V2/CreateModelRequest.php | 175 ++ .../Cloud/Retail/V2/CreateProductRequest.php | 228 ++ .../Retail/V2/CreateServingConfigRequest.php | 184 ++ .../Cloud/Retail/V2/CustomAttribute.php | 340 +++ .../Cloud/Retail/V2/DeleteControlRequest.php | 86 + .../Cloud/Retail/V2/DeleteModelRequest.php | 91 + .../Cloud/Retail/V2/DeleteProductRequest.php | 167 ++ .../Retail/V2/DeleteServingConfigRequest.php | 86 + .../Google/Cloud/Retail/V2/ExperimentInfo.php | 120 + .../ServingConfigExperiment.php | 128 + .../V2/ExportAnalyticsMetricsRequest.php | 197 ++ .../V2/ExportAnalyticsMetricsResponse.php | 157 ++ .../Cloud/Retail/V2/ExportErrorsConfig.php | 84 + .../Google/Cloud/Retail/V2/ExportMetadata.php | 126 + .../Cloud/Retail/V2/FulfillmentInfo.php | 190 ++ .../Cloud/Retail/V2/GcsOutputResult.php | 67 + .../src/Google/Cloud/Retail/V2/GcsSource.php | 197 ++ .../Retail/V2/GenerativeQuestionConfig.php | 283 ++ .../V2/GenerativeQuestionsFeatureConfig.php | 151 + .../Retail/V2/GetAttributesConfigRequest.php | 88 + .../Retail/V2/GetCompletionConfigRequest.php | 88 + .../Cloud/Retail/V2/GetControlRequest.php | 86 + .../Retail/V2/GetDefaultBranchRequest.php | 85 + .../Retail/V2/GetDefaultBranchResponse.php | 154 + ...enerativeQuestionsFeatureConfigRequest.php | 86 + .../Cloud/Retail/V2/GetModelRequest.php | 91 + .../Cloud/Retail/V2/GetProductRequest.php | 120 + .../Retail/V2/GetServingConfigRequest.php | 86 + .../src/Google/Cloud/Retail/V2/Image.php | 174 ++ .../Retail/V2/ImportCompletionDataRequest.php | 165 ++ .../V2/ImportCompletionDataResponse.php | 70 + .../Cloud/Retail/V2/ImportErrorsConfig.php | 84 + .../Google/Cloud/Retail/V2/ImportMetadata.php | 283 ++ .../Cloud/Retail/V2/ImportProductsRequest.php | 386 +++ .../ReconciliationMode.php | 66 + .../Retail/V2/ImportProductsResponse.php | 114 + .../Retail/V2/ImportUserEventsRequest.php | 159 ++ .../Retail/V2/ImportUserEventsResponse.php | 161 ++ .../src/Google/Cloud/Retail/V2/Interval.php | 183 ++ .../Cloud/Retail/V2/ListCatalogsRequest.php | 216 ++ .../Cloud/Retail/V2/ListCatalogsResponse.php | 115 + .../Cloud/Retail/V2/ListControlsRequest.php | 212 ++ .../Cloud/Retail/V2/ListControlsResponse.php | 101 + .../ListGenerativeQuestionConfigsRequest.php | 86 + .../ListGenerativeQuestionConfigsResponse.php | 67 + .../Cloud/Retail/V2/ListModelsRequest.php | 167 ++ .../Cloud/Retail/V2/ListModelsResponse.php | 101 + .../Cloud/Retail/V2/ListProductsRequest.php | 452 +++ .../Cloud/Retail/V2/ListProductsResponse.php | 115 + .../Retail/V2/ListServingConfigsRequest.php | 166 ++ .../Retail/V2/ListServingConfigsResponse.php | 101 + .../Google/Cloud/Retail/V2/LocalInventory.php | 316 +++ .../src/Google/Cloud/Retail/V2/Model.php | 811 ++++++ .../Retail/V2/Model/ContextProductsType.php | 68 + .../Cloud/Retail/V2/Model/DataState.php | 66 + ...FrequentlyBoughtTogetherFeaturesConfig.php | 82 + .../Retail/V2/Model/ModelFeaturesConfig.php | 78 + .../Retail/V2/Model/PeriodicTuningState.php | 82 + .../Retail/V2/Model/ServingConfigList.php | 75 + .../Cloud/Retail/V2/Model/ServingState.php | 72 + .../Cloud/Retail/V2/Model/TrainingState.php | 64 + .../Google/Cloud/Retail/V2/OutputConfig.php | 108 + .../V2/OutputConfig/BigQueryDestination.php | 146 + .../Retail/V2/OutputConfig/GcsDestination.php | 94 + .../Google/Cloud/Retail/V2/OutputResult.php | 102 + .../Cloud/Retail/V2/PauseModelRequest.php | 91 + .../Google/Cloud/Retail/V2/PredictRequest.php | 708 +++++ .../Cloud/Retail/V2/PredictResponse.php | 185 ++ .../V2/PredictResponse/PredictionResult.php | 124 + .../src/Google/Cloud/Retail/V2/PriceInfo.php | 505 ++++ .../Cloud/Retail/V2/PriceInfo/PriceRange.php | 159 ++ .../src/Google/Cloud/Retail/V2/Product.php | 2502 +++++++++++++++++ .../Cloud/Retail/V2/Product/Availability.php | 81 + .../Google/Cloud/Retail/V2/Product/Type.php | 89 + .../Retail/V2/ProductAttributeInterval.php | 111 + .../Cloud/Retail/V2/ProductAttributeValue.php | 103 + .../Google/Cloud/Retail/V2/ProductDetail.php | 206 ++ .../Cloud/Retail/V2/ProductInlineSource.php | 75 + .../Cloud/Retail/V2/ProductInputConfig.php | 141 + .../Cloud/Retail/V2/ProductLevelConfig.php | 246 ++ .../src/Google/Cloud/Retail/V2/Promotion.php | 91 + .../Cloud/Retail/V2/PurchaseTransaction.php | 235 ++ .../Google/Cloud/Retail/V2/PurgeMetadata.php | 34 + .../Cloud/Retail/V2/PurgeProductsMetadata.php | 194 ++ .../Cloud/Retail/V2/PurgeProductsRequest.php | 263 ++ .../Cloud/Retail/V2/PurgeProductsResponse.php | 111 + .../Retail/V2/PurgeUserEventsRequest.php | 223 ++ .../Retail/V2/PurgeUserEventsResponse.php | 69 + .../src/Google/Cloud/Retail/V2/Rating.php | 175 ++ .../V2/RecommendationsFilteringOption.php | 63 + .../Retail/V2/RejoinUserEventsMetadata.php | 33 + .../Retail/V2/RejoinUserEventsRequest.php | 117 + .../UserEventRejoinScope.php | 71 + .../Retail/V2/RejoinUserEventsResponse.php | 67 + .../V2/RemoveCatalogAttributeRequest.php | 111 + .../Cloud/Retail/V2/RemoveControlRequest.php | 124 + .../V2/RemoveFulfillmentPlacesMetadata.php | 36 + .../V2/RemoveFulfillmentPlacesRequest.php | 375 +++ .../V2/RemoveFulfillmentPlacesResponse.php | 36 + .../V2/RemoveLocalInventoriesMetadata.php | 36 + .../V2/RemoveLocalInventoriesRequest.php | 253 ++ .../V2/RemoveLocalInventoriesResponse.php | 38 + .../V2/ReplaceCatalogAttributeRequest.php | 181 ++ .../Cloud/Retail/V2/ResumeModelRequest.php | 90 + .../proto/src/Google/Cloud/Retail/V2/Rule.php | 427 +++ .../Cloud/Retail/V2/Rule/BoostAction.php | 200 ++ .../Retail/V2/Rule/DoNotAssociateAction.php | 152 + .../Cloud/Retail/V2/Rule/FilterAction.php | 127 + .../Retail/V2/Rule/ForceReturnFacetAction.php | 95 + .../FacetPositionAdjustment.php | 117 + .../Cloud/Retail/V2/Rule/IgnoreAction.php | 71 + .../Retail/V2/Rule/OnewaySynonymsAction.php | 162 ++ .../Cloud/Retail/V2/Rule/RedirectAction.php | 75 + .../Retail/V2/Rule/RemoveFacetAction.php | 95 + .../Retail/V2/Rule/ReplacementAction.php | 148 + .../Retail/V2/Rule/TwowaySynonymsAction.php | 81 + .../Google/Cloud/Retail/V2/SearchRequest.php | 1625 +++++++++++ .../Retail/V2/SearchRequest/BoostSpec.php | 146 + .../BoostSpec/ConditionBoostSpec.php | 192 ++ .../ConversationalSearchSpec.php | 181 ++ .../ConversationalSearchSpec/UserAnswer.php | 122 + .../UserAnswer/SelectedAnswer.php | 124 + .../V2/SearchRequest/DynamicFacetSpec.php | 82 + .../SearchRequest/DynamicFacetSpec/Mode.php | 64 + .../Retail/V2/SearchRequest/FacetSpec.php | 362 +++ .../V2/SearchRequest/FacetSpec/FacetKey.php | 770 +++++ .../V2/SearchRequest/PersonalizationSpec.php | 74 + .../PersonalizationSpec/Mode.php | 66 + .../V2/SearchRequest/QueryExpansionSpec.php | 117 + .../QueryExpansionSpec/Condition.php | 68 + .../Retail/V2/SearchRequest/SearchMode.php | 88 + .../V2/SearchRequest/SpellCorrectionSpec.php | 78 + .../SpellCorrectionSpec/Mode.php | 70 + .../V2/SearchRequest/TileNavigationSpec.php | 120 + .../Google/Cloud/Retail/V2/SearchResponse.php | 590 ++++ .../ConversationalSearchResult.php | 324 +++ .../AdditionalFilter.php | 84 + .../SuggestedAnswer.php | 84 + .../Cloud/Retail/V2/SearchResponse/Facet.php | 142 + .../V2/SearchResponse/Facet/FacetValue.php | 245 ++ .../V2/SearchResponse/QueryExpansionInfo.php | 117 + .../Retail/V2/SearchResponse/SearchResult.php | 486 ++++ .../SearchResponse/TileNavigationResult.php | 75 + .../Cloud/Retail/V2/SearchSolutionUseCase.php | 64 + .../Google/Cloud/Retail/V2/ServingConfig.php | 1258 +++++++++ .../Retail/V2/ServingConfig/DiversityType.php | 64 + .../Retail/V2/SetDefaultBranchRequest.php | 231 ++ .../Cloud/Retail/V2/SetInventoryMetadata.php | 36 + .../Cloud/Retail/V2/SetInventoryRequest.php | 507 ++++ .../Cloud/Retail/V2/SetInventoryResponse.php | 36 + .../Google/Cloud/Retail/V2/SolutionType.php | 61 + .../proto/src/Google/Cloud/Retail/V2/Tile.php | 144 + .../Cloud/Retail/V2/TuneModelMetadata.php | 75 + .../Cloud/Retail/V2/TuneModelRequest.php | 92 + .../Cloud/Retail/V2/TuneModelResponse.php | 33 + .../V2/UpdateAttributesConfigRequest.php | 165 ++ .../Cloud/Retail/V2/UpdateCatalogRequest.php | 181 ++ .../V2/UpdateCompletionConfigRequest.php | 207 ++ .../Cloud/Retail/V2/UpdateControlRequest.php | 158 ++ .../UpdateGenerativeQuestionConfigRequest.php | 158 ++ ...enerativeQuestionsFeatureConfigRequest.php | 146 + .../Cloud/Retail/V2/UpdateModelRequest.php | 141 + .../Cloud/Retail/V2/UpdateProductRequest.php | 264 ++ .../Retail/V2/UpdateServingConfigRequest.php | 158 ++ .../src/Google/Cloud/Retail/V2/UserEvent.php | 1360 +++++++++ .../Retail/V2/UserEventImportSummary.php | 106 + .../Cloud/Retail/V2/UserEventInlineSource.php | 67 + .../Cloud/Retail/V2/UserEventInputConfig.php | 141 + .../src/Google/Cloud/Retail/V2/UserInfo.php | 309 ++ .../Cloud/Retail/V2/WriteUserEventRequest.php | 161 ++ .../export_analytics_metrics.php | 89 + .../add_catalog_attribute.php | 99 + .../get_attributes_config.php | 72 + .../get_completion_config.php | 72 + .../get_default_branch.php | 59 + .../V2/CatalogServiceClient/list_catalogs.php | 82 + .../remove_catalog_attribute.php | 85 + .../replace_catalog_attribute.php | 101 + .../set_default_branch.php | 87 + .../update_attributes_config.php | 80 + .../CatalogServiceClient/update_catalog.php | 81 + .../update_completion_config.php | 73 + .../complete_query.php | 82 + .../import_completion_data.php | 114 + .../ControlServiceClient/create_control.php | 109 + .../ControlServiceClient/delete_control.php | 78 + .../V2/ControlServiceClient/get_control.php | 77 + .../V2/ControlServiceClient/list_controls.php | 78 + .../ControlServiceClient/update_control.php | 90 + ...tch_update_generative_question_configs.php | 86 + ...et_generative_questions_feature_config.php | 77 + .../list_generative_question_configs.php | 76 + .../update_generative_question_config.php | 81 + ...te_generative_questions_feature_config.php | 75 + .../V2/ModelServiceClient/create_model.php | 123 + .../V2/ModelServiceClient/delete_model.php | 71 + .../V2/ModelServiceClient/get_model.php | 73 + .../V2/ModelServiceClient/list_models.php | 78 + .../V2/ModelServiceClient/pause_model.php | 73 + .../V2/ModelServiceClient/resume_model.php | 72 + .../V2/ModelServiceClient/tune_model.php | 85 + .../V2/ModelServiceClient/update_model.php | 105 + .../V2/PredictionServiceClient/predict.php | 123 + .../add_fulfillment_places.php | 167 ++ .../add_local_inventories.php | 125 + .../ProductServiceClient/create_product.php | 109 + .../ProductServiceClient/delete_product.php | 95 + .../V2/ProductServiceClient/get_product.php | 86 + .../ProductServiceClient/import_products.php | 101 + .../V2/ProductServiceClient/list_products.php | 88 + .../ProductServiceClient/purge_products.php | 147 + .../remove_fulfillment_places.php | 162 ++ .../remove_local_inventories.php | 125 + .../V2/ProductServiceClient/set_inventory.php | 140 + .../ProductServiceClient/update_product.php | 79 + .../samples/V2/SearchServiceClient/search.php | 95 + .../add_control.php | 87 + .../create_serving_config.php | 107 + .../delete_serving_config.php | 77 + .../get_serving_config.php | 79 + .../list_serving_configs.php | 77 + .../remove_control.php | 84 + .../update_serving_config.php | 84 + .../collect_user_event.php | 79 + .../import_user_events.php | 140 + .../purge_user_events.php | 113 + .../rejoin_user_events.php | 90 + .../write_user_event.php | 110 + .../src/V2/Client/AnalyticsServiceClient.php | 253 ++ .../v2/src/V2/Client/CatalogServiceClient.php | 668 +++++ .../src/V2/Client/CompletionServiceClient.php | 340 +++ .../v2/src/V2/Client/ControlServiceClient.php | 388 +++ .../GenerativeQuestionServiceClient.php | 368 +++ .../v2/src/V2/Client/ModelServiceClient.php | 528 ++++ .../src/V2/Client/PredictionServiceClient.php | 247 ++ .../v2/src/V2/Client/ProductServiceClient.php | 813 ++++++ .../v2/src/V2/Client/SearchServiceClient.php | 251 ++ .../V2/Client/ServingConfigServiceClient.php | 454 +++ .../src/V2/Client/UserEventServiceClient.php | 455 +++ .../Retail/v2/src/V2/gapic_metadata.json | 398 +++ .../analytics_service_client_config.json | 40 + .../analytics_service_descriptor_config.php | 47 + .../analytics_service_rest_client_config.php | 89 + .../catalog_service_client_config.json | 90 + .../catalog_service_descriptor_config.php | 178 ++ .../catalog_service_rest_client_config.php | 208 ++ .../completion_service_client_config.json | 45 + .../completion_service_descriptor_config.php | 62 + .../completion_service_rest_client_config.php | 100 + .../control_service_client_config.json | 47 + .../control_service_descriptor_config.php | 101 + .../control_service_rest_client_config.php | 138 + ...rative_question_service_client_config.json | 47 + ...ive_question_service_descriptor_config.php | 93 + ...ve_question_service_rest_client_config.php | 137 + .../model_service_client_config.json | 75 + .../model_service_descriptor_config.php | 151 + .../model_service_rest_client_config.php | 171 ++ .../prediction_service_client_config.json | 40 + .../prediction_service_descriptor_config.php | 43 + .../prediction_service_rest_client_config.php | 96 + .../product_service_client_config.json | 108 + .../product_service_descriptor_config.php | 235 ++ .../product_service_rest_client_config.php | 223 ++ .../search_service_client_config.json | 40 + .../search_service_descriptor_config.php | 51 + .../search_service_rest_client_config.php | 96 + .../serving_config_service_client_config.json | 57 + ...rving_config_service_descriptor_config.php | 125 + ...ving_config_service_rest_client_config.php | 162 ++ .../user_event_service_client_config.json | 86 + .../user_event_service_descriptor_config.php | 113 + .../user_event_service_rest_client_config.php | 136 + .../V2/Client/AnalyticsServiceClientTest.php | 262 ++ .../V2/Client/CatalogServiceClientTest.php | 885 ++++++ .../V2/Client/CompletionServiceClientTest.php | 312 ++ .../V2/Client/ControlServiceClientTest.php | 470 ++++ .../GenerativeQuestionServiceClientTest.php | 442 +++ .../Unit/V2/Client/ModelServiceClientTest.php | 863 ++++++ .../V2/Client/PredictionServiceClientTest.php | 182 ++ .../V2/Client/ProductServiceClientTest.php | 1447 ++++++++++ .../V2/Client/SearchServiceClientTest.php | 198 ++ .../Client/ServingConfigServiceClientTest.php | 668 +++++ .../V2/Client/UserEventServiceClientTest.php | 672 +++++ .../GPBMetadata/Google/Cloud/Run/V2/Build.php | Bin 0 -> 2450 bytes .../Google/Cloud/Run/V2/Condition.php | Bin 0 -> 2428 bytes .../Google/Cloud/Run/V2/Execution.php | 109 + .../Google/Cloud/Run/V2/ExecutionTemplate.php | 42 + .../GPBMetadata/Google/Cloud/Run/V2/Job.php | Bin 0 -> 6807 bytes .../Google/Cloud/Run/V2/K8SMin.php | Bin 0 -> 3770 bytes .../Google/Cloud/Run/V2/Revision.php | 112 + .../Google/Cloud/Run/V2/RevisionTemplate.php | 62 + .../Google/Cloud/Run/V2/Service.php | 135 + .../Google/Cloud/Run/V2/Status.php | 29 + .../GPBMetadata/Google/Cloud/Run/V2/Task.php | 103 + .../Google/Cloud/Run/V2/TaskTemplate.php | Bin 0 -> 1579 bytes .../Google/Cloud/Run/V2/TrafficTarget.php | Bin 0 -> 1280 bytes .../Google/Cloud/Run/V2/VendorSettings.php | Bin 0 -> 2510 bytes .../Cloud/Run/V2/BinaryAuthorization.php | 160 ++ .../Cloud/Run/V2/CancelExecutionRequest.php | 172 ++ .../Google/Cloud/Run/V2/CloudSqlInstance.php | 86 + .../src/Google/Cloud/Run/V2/Condition.php | 337 +++ .../Cloud/Run/V2/Condition/CommonReason.php | 148 + .../Run/V2/Condition/ExecutionReason.php | 86 + .../Cloud/Run/V2/Condition/RevisionReason.php | 141 + .../Cloud/Run/V2/Condition/Severity.php | 71 + .../Google/Cloud/Run/V2/Condition/State.php | 78 + .../src/Google/Cloud/Run/V2/Container.php | 531 ++++ .../src/Google/Cloud/Run/V2/ContainerPort.php | 109 + .../Google/Cloud/Run/V2/CreateJobRequest.php | 216 ++ .../Cloud/Run/V2/CreateServiceRequest.php | 221 ++ .../Cloud/Run/V2/DeleteExecutionRequest.php | 172 ++ .../Google/Cloud/Run/V2/DeleteJobRequest.php | 167 ++ .../Cloud/Run/V2/DeleteRevisionRequest.php | 169 ++ .../Cloud/Run/V2/DeleteServiceRequest.php | 167 ++ .../Cloud/Run/V2/EmptyDirVolumeSource.php | 143 + .../Run/V2/EmptyDirVolumeSource/Medium.php | 58 + .../Run/V2/EncryptionKeyRevocationAction.php | 61 + .../proto/src/Google/Cloud/Run/V2/EnvVar.php | 152 + .../src/Google/Cloud/Run/V2/EnvVarSource.php | 77 + .../src/Google/Cloud/Run/V2/Execution.php | 1183 ++++++++ .../Cloud/Run/V2/ExecutionEnvironment.php | 61 + .../Cloud/Run/V2/ExecutionReference.php | 238 ++ .../ExecutionReference/CompletionStatus.php | 85 + .../Google/Cloud/Run/V2/ExecutionTemplate.php | 322 +++ .../Google/Cloud/Run/V2/GCSVolumeSource.php | 140 + .../src/Google/Cloud/Run/V2/GRPCAction.php | 121 + .../Cloud/Run/V2/GetExecutionRequest.php | 96 + .../src/Google/Cloud/Run/V2/GetJobRequest.php | 91 + .../Cloud/Run/V2/GetRevisionRequest.php | 91 + .../Google/Cloud/Run/V2/GetServiceRequest.php | 91 + .../Google/Cloud/Run/V2/GetTaskRequest.php | 91 + .../src/Google/Cloud/Run/V2/HTTPGetAction.php | 147 + .../src/Google/Cloud/Run/V2/HTTPHeader.php | 101 + .../Google/Cloud/Run/V2/IngressTraffic.php | 75 + .../v2/proto/src/Google/Cloud/Run/V2/Job.php | 1249 ++++++++ .../Cloud/Run/V2/ListExecutionsRequest.php | 202 ++ .../Cloud/Run/V2/ListExecutionsResponse.php | 105 + .../Google/Cloud/Run/V2/ListJobsRequest.php | 197 ++ .../Google/Cloud/Run/V2/ListJobsResponse.php | 105 + .../Cloud/Run/V2/ListRevisionsRequest.php | 202 ++ .../Cloud/Run/V2/ListRevisionsResponse.php | 105 + .../Cloud/Run/V2/ListServicesRequest.php | 202 ++ .../Cloud/Run/V2/ListServicesResponse.php | 105 + .../Google/Cloud/Run/V2/ListTasksRequest.php | 202 ++ .../Google/Cloud/Run/V2/ListTasksResponse.php | 105 + .../Google/Cloud/Run/V2/NFSVolumeSource.php | 135 + .../src/Google/Cloud/Run/V2/NodeSelector.php | 67 + .../proto/src/Google/Cloud/Run/V2/Probe.php | 319 +++ .../Cloud/Run/V2/ResourceRequirements.php | 175 ++ .../src/Google/Cloud/Run/V2/Revision.php | 1373 +++++++++ .../Google/Cloud/Run/V2/RevisionScaling.php | 117 + .../Cloud/Run/V2/RevisionScalingStatus.php | 67 + .../Google/Cloud/Run/V2/RevisionTemplate.php | 822 ++++++ .../src/Google/Cloud/Run/V2/RunJobRequest.php | 215 ++ .../Cloud/Run/V2/RunJobRequest/Overrides.php | 160 ++ .../Overrides/ContainerOverride.php | 180 ++ .../Google/Cloud/Run/V2/SecretKeySelector.php | 121 + .../Cloud/Run/V2/SecretVolumeSource.php | 217 ++ .../proto/src/Google/Cloud/Run/V2/Service.php | 1609 +++++++++++ .../src/Google/Cloud/Run/V2/ServiceMesh.php | 76 + .../Google/Cloud/Run/V2/ServiceScaling.php | 162 ++ .../Run/V2/ServiceScaling/ScalingMode.php | 65 + .../src/Google/Cloud/Run/V2/StorageSource.php | 155 + .../Cloud/Run/V2/SubmitBuildRequest.php | 356 +++ .../V2/SubmitBuildRequest/BuildpacksBuild.php | 273 ++ .../Run/V2/SubmitBuildRequest/DockerBuild.php | 36 + .../Cloud/Run/V2/SubmitBuildResponse.php | 149 + .../Google/Cloud/Run/V2/TCPSocketAction.php | 75 + .../v2/proto/src/Google/Cloud/Run/V2/Task.php | 1339 +++++++++ .../Google/Cloud/Run/V2/TaskAttemptResult.php | 127 + .../src/Google/Cloud/Run/V2/TaskTemplate.php | 381 +++ .../src/Google/Cloud/Run/V2/TrafficTarget.php | 182 ++ .../Run/V2/TrafficTargetAllocationType.php | 61 + .../Cloud/Run/V2/TrafficTargetStatus.php | 203 ++ .../Google/Cloud/Run/V2/UpdateJobRequest.php | 170 ++ .../Cloud/Run/V2/UpdateServiceRequest.php | 229 ++ .../src/Google/Cloud/Run/V2/VersionToPath.php | 188 ++ .../proto/src/Google/Cloud/Run/V2/Volume.php | 247 ++ .../src/Google/Cloud/Run/V2/VolumeMount.php | 117 + .../src/Google/Cloud/Run/V2/VpcAccess.php | 160 ++ .../Run/V2/VpcAccess/NetworkInterface.php | 170 ++ .../Cloud/Run/V2/VpcAccess/VpcEgress.php | 64 + .../samples/V2/BuildsClient/submit_build.php | 94 + .../V2/ExecutionsClient/cancel_execution.php | 86 + .../V2/ExecutionsClient/delete_execution.php | 86 + .../V2/ExecutionsClient/get_execution.php | 74 + .../V2/ExecutionsClient/list_executions.php | 80 + .../v2/samples/V2/JobsClient/create_job.php | 97 + .../v2/samples/V2/JobsClient/delete_job.php | 85 + .../samples/V2/JobsClient/get_iam_policy.php | 72 + .../Run/v2/samples/V2/JobsClient/get_job.php | 73 + .../v2/samples/V2/JobsClient/list_jobs.php | 78 + .../Run/v2/samples/V2/JobsClient/run_job.php | 85 + .../samples/V2/JobsClient/set_iam_policy.php | 74 + .../V2/JobsClient/test_iam_permissions.php | 80 + .../v2/samples/V2/JobsClient/update_job.php | 77 + .../V2/RevisionsClient/delete_revision.php | 90 + .../V2/RevisionsClient/get_revision.php | 78 + .../V2/RevisionsClient/list_revisions.php | 80 + .../V2/ServicesClient/create_service.php | 95 + .../V2/ServicesClient/delete_service.php | 87 + .../V2/ServicesClient/get_iam_policy.php | 72 + .../samples/V2/ServicesClient/get_service.php | 73 + .../V2/ServicesClient/list_services.php | 79 + .../V2/ServicesClient/set_iam_policy.php | 74 + .../ServicesClient/test_iam_permissions.php | 80 + .../V2/ServicesClient/update_service.php | 74 + .../v2/samples/V2/TasksClient/get_task.php | 73 + .../v2/samples/V2/TasksClient/list_tasks.php | 79 + .../Run/v2/src/V2/Client/BuildsClient.php | 243 ++ .../Run/v2/src/V2/Client/ExecutionsClient.php | 405 +++ .../Run/v2/src/V2/Client/JobsClient.php | 697 +++++ .../Run/v2/src/V2/Client/RevisionsClient.php | 377 +++ .../Run/v2/src/V2/Client/ServicesClient.php | 690 +++++ .../Run/v2/src/V2/Client/TasksClient.php | 298 ++ .../Run/v2/src/V2/gapic_metadata.json | 198 ++ .../V2/resources/builds_client_config.json | 27 + .../V2/resources/builds_descriptor_config.php | 43 + .../resources/builds_rest_client_config.php | 88 + .../resources/executions_client_config.json | 42 + .../executions_descriptor_config.php | 102 + .../executions_rest_client_config.php | 121 + .../src/V2/resources/jobs_client_config.json | 67 + .../V2/resources/jobs_descriptor_config.php | 191 ++ .../V2/resources/jobs_rest_client_config.php | 184 ++ .../V2/resources/revisions_client_config.json | 37 + .../resources/revisions_descriptor_config.php | 86 + .../revisions_rest_client_config.php | 109 + .../V2/resources/services_client_config.json | 94 + .../resources/services_descriptor_config.php | 172 ++ .../resources/services_rest_client_config.php | 172 ++ .../src/V2/resources/tasks_client_config.json | 32 + .../V2/resources/tasks_descriptor_config.php | 64 + .../V2/resources/tasks_rest_client_config.php | 98 + .../tests/Unit/V2/Client/BuildsClientTest.php | 192 ++ .../Unit/V2/Client/ExecutionsClientTest.php | 638 +++++ .../tests/Unit/V2/Client/JobsClientTest.php | 1170 ++++++++ .../Unit/V2/Client/RevisionsClientTest.php | 466 +++ .../Unit/V2/Client/ServicesClientTest.php | 1044 +++++++ .../tests/Unit/V2/Client/TasksClientTest.php | 285 ++ .../Cloud/Scheduler/V1/Cloudscheduler.php | 74 + .../Google/Cloud/Scheduler/V1/Job.php | Bin 0 -> 2214 bytes .../Google/Cloud/Scheduler/V1/Target.php | Bin 0 -> 2072 bytes .../Scheduler/V1/AppEngineHttpTarget.php | 370 +++ .../Cloud/Scheduler/V1/AppEngineRouting.php | 414 +++ .../Cloud/Scheduler/V1/CreateJobRequest.php | 158 ++ .../Cloud/Scheduler/V1/DeleteJobRequest.php | 87 + .../Cloud/Scheduler/V1/GetJobRequest.php | 87 + .../Google/Cloud/Scheduler/V1/HttpMethod.php | 96 + .../Google/Cloud/Scheduler/V1/HttpTarget.php | 383 +++ .../src/Google/Cloud/Scheduler/V1/Job.php | 832 ++++++ .../Google/Cloud/Scheduler/V1/Job/State.php | 85 + .../Cloud/Scheduler/V1/ListJobsRequest.php | 207 ++ .../Cloud/Scheduler/V1/ListJobsResponse.php | 126 + .../Google/Cloud/Scheduler/V1/OAuthToken.php | 124 + .../Google/Cloud/Scheduler/V1/OidcToken.php | 122 + .../Cloud/Scheduler/V1/PauseJobRequest.php | 87 + .../Cloud/Scheduler/V1/PubsubTarget.php | 172 ++ .../Cloud/Scheduler/V1/ResumeJobRequest.php | 87 + .../Google/Cloud/Scheduler/V1/RetryConfig.php | 397 +++ .../Cloud/Scheduler/V1/RunJobRequest.php | 87 + .../Cloud/Scheduler/V1/UpdateJobRequest.php | 153 + .../V1/CloudSchedulerClient/create_job.php | 74 + .../V1/CloudSchedulerClient/delete_job.php | 70 + .../V1/CloudSchedulerClient/get_job.php | 72 + .../V1/CloudSchedulerClient/get_location.php | 57 + .../V1/CloudSchedulerClient/list_jobs.php | 77 + .../CloudSchedulerClient/list_locations.php | 62 + .../V1/CloudSchedulerClient/pause_job.php | 81 + .../V1/CloudSchedulerClient/resume_job.php | 80 + .../V1/CloudSchedulerClient/run_job.php | 75 + .../V1/CloudSchedulerClient/update_job.php | 71 + .../v1/src/V1/Client/CloudSchedulerClient.php | 561 ++++ .../Scheduler/v1/src/V1/gapic_metadata.json | 68 + .../cloud_scheduler_client_config.json | 95 + .../cloud_scheduler_descriptor_config.php | 172 ++ .../cloud_scheduler_rest_client_config.php | 150 + .../V1/Client/CloudSchedulerClientTest.php | 804 ++++++ 1667 files changed, 285303 insertions(+) create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php create mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php create mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php create mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json create mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php create mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php create mode 100644 owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json create mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json create mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php create mode 100644 owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php create mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php create mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php create mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php create mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php create mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php create mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json create mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php create mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php create mode 100644 owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php create mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AccessTuple.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php create mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_client_config.json create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_descriptor_config.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php create mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateOfflineProfileRequest.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php create mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php create mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php create mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php create mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php create mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php create mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php create mode 100644 owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php create mode 100644 owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php create mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php create mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php create mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php create mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php create mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php create mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/CreateQuotaPreferenceRequest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php create mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php create mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php create mode 100644 owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php create mode 100644 owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json create mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php create mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php create mode 100644 owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php create mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_client_config.json create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_descriptor_config.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php create mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php 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/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/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/PredictionApiKeyRegistration.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/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/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/samples/V1beta1/CatalogServiceClient/create_catalog_item.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/CatalogServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.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/Client/CatalogServiceClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.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 create mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php create mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php create mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php create mode 100644 owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php create mode 100644 owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json create mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php create mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php create mode 100644 owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php create mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php create mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php create mode 100644 owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php create mode 100644 owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json create mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php create mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php create mode 100644 owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php create mode 100644 owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Organizations.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php create mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php create mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php create mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php create mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php create mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php create mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json create mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php create mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php create mode 100644 owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/CatalogService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/CompletionService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ControlService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Model.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ModelService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PredictionService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php create mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php create mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php create mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php create mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Execution.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/ExecutionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Revision.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TrafficTarget.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/BinaryAuthorization.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineHttpTarget.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php create mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php create mode 100644 owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php create mode 100644 owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json create mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php create mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php create mode 100644 owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php new file mode 100644 index 0000000000000000000000000000000000000000..0da87d8cc8afb9f56b4d726ce21300ad34db8e43 GIT binary patch literal 8431 zcmeHM&2QVt6<><6R~diL+KJ+Jh;FiDYMf<-8*;<+KK_G;_HV_ zcUl&qOZSZ+9@R!848ILX+l4S-X!zVfpMQjw&z-M$j+10qif3Xeo;g~cy&Q1V9RpB+ zh7r&6*=v!7JsK-oEeMui!_`w83L7rA_g;G|%O5I)@D3s3M3>0c#LvS@*C05$Lwx0#fD_(*1#5>e(dzKureE`gsK6)SZC7>%sV3PwWa zOc*^ORm%aa4XB0&qk4dbO}z$~o*GtU_{<05Gu`8%E$0^7E z^t+5~i&Am3KS7roh70o9?s1&yBxBmoq3eRUlk@Bn8i_a=k0AMg9P=c=V`%6|H(P{9 zelBrGO6zEd#W0>hQ@a(lQqUf4@0JQ{#f@TNeex|lijr&Pf?6qVZ%#@Wp<#8cQhZ#P zOwg6}!d8K;$aG~xEp7qL1^CRxN2SfOx=x9PawlJ@pQ3NXF^Z>G=zNh+_#WiR55X*6 z_IdDhk~Qr*FA>@2;_)PF1ZfT%#pB81Me*pZB*kO;4-%T*GCaR1D9YqVEdX%5iiSZb zz{UU~mLTH4R;xGgfU;gf7ahF`F##u4 zAjme-vH-s7`+Ci!FbK(<{yxH+Bs83`+uazj3abt1;q;$Cu{DO1LMXxaP5lArE}X6z zjW)U`@O>191M|l@EJj_L0J9;NM-Amnp*?WZZ$O(z48J?IfpQQ4JFQ?W#JZJ(uo2-O zib_fy^M;brY8FU(h-TJ_Nqo{N=o`7S!!qrPn*K=wO@-Z^7$`c6B(2TetkO{=mr;^f z4PIBdRr=Od$TeSgq4#empiEl=sARRa17&;_jnl&4@-%4bJV@tu63TcUT?*U|#i&lZ z3e#jz1Z7uRNK%){w5b3b3rpnN!sK##9!>1BiEOj(yq6g&>a2amw)*p znMg`Fk0xkGV$_KSJ&)ajlEI-G`Wk3z=FxRSKkRI1b~%O03Gzua%*~k}V_m2)MVeZ_ z@JXlj%V;{Ve%w?%{8##ziaQ|YcyPiaXgVT3h`5#FME@=_;(#zt|Hq9#jc_#bd5KMb zk%+zy!K;FBIMM)I@H3JC+3)o6NCg^M4^D6TLgIk<7KKFay>mcfSistl7`7hWAd#XS zD+y)Yk&-^h=4Su zZncAk!MSUP;P`P*?4mR2>tPq?En)qv+JqSU*R4(B6B{VW>ITfwLAA>c2pDU$+yEKl zgg4QcA0Ub5A3KCKBI7IH8jx89NEoBu<>)gBO^S#S--h9E%&xJyOxpu_8VvMgIyBUd zec}Z#DRjwn#1MPE1H*AhgJ~>NCVaPeO<_pJm(aM_U$-3two@#U@iZFc+k>|>Ddfch z8Wqw}W$+xtcUj%u-6)i`%F|Nk_zGib@nLDFT;aoO;R$$f1>f$mkIOcXuJu@t2zUk)D&@*AM$uTTqriWZ&{%9n#r=*gV!MMz zbM|(h;O!s^YR3JSYB0Y4?C)RxI+4Xo^lsxhbW1SNuZG76i;?4l#mKP%{;h;YBEv0S z?juEHuMm9Tu{(Y5rOFN?W1`a2$sU46jyD!h@Rt%AkB`i_pUvXig}`${$H*ydChSPk zCoj~w=mBcDA}aDr^(wdTEh9Kg2_IlCX3Bk(KA#_Q;be~g32Me?>Aq^lw-2c1kNc}R z9qJdE;hBE+gxZZX{Q@a~e!KwW&F}KNXs55KyhB_1bSmyEa3$b1euCP1qu;CK>tAxT? zVt+3#<&#jxLUDM5Ma1#Ot)xi^-hd=GfP+T~C*oC1>n)IeL z`UD^QX2*;-~Ql6c!hb3-;hTx)ahZG SQSWk@&UW%k?-O)_(0>5sx$5iy literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php new file mode 100644 index 00000000000..602bfbf612b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php @@ -0,0 +1,273 @@ +google.cloud.parallelstore.v1.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to create. + * @param string $instanceId Required. The name of the Parallelstore instance. + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * @return \Google\Cloud\Parallelstore\V1\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Parallelstore\V1\Instance $instance, string $instanceId): self + { + return (new self()) + ->setParent($parent) + ->setInstance($instance) + ->setInstanceId($instanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * @type string $instance_id + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Parallelstore\V1\Instance $instance + * Required. The instance to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * 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 instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * 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 name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php new file mode 100644 index 00000000000..af5164d5b83 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php @@ -0,0 +1,155 @@ +google.cloud.parallelstore.v1.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * 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. Name of the resource + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php new file mode 100644 index 00000000000..0acc29d5985 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1.DestinationGcsBucket + */ +class DestinationGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php new file mode 100644 index 00000000000..79e74ab6adf --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1.DestinationParallelstore + */ +class DestinationParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php new file mode 100644 index 00000000000..d55b9050370 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1.DirectoryStripeLevel + */ +class DirectoryStripeLevel +{ + /** + * If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MIN = 1; + */ + const DIRECTORY_STRIPE_LEVEL_MIN = 1; + /** + * Medium directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + */ + const DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MAX = 3; + */ + const DIRECTORY_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::DIRECTORY_STRIPE_LEVEL_UNSPECIFIED => 'DIRECTORY_STRIPE_LEVEL_UNSPECIFIED', + self::DIRECTORY_STRIPE_LEVEL_MIN => 'DIRECTORY_STRIPE_LEVEL_MIN', + self::DIRECTORY_STRIPE_LEVEL_BALANCED => 'DIRECTORY_STRIPE_LEVEL_BALANCED', + self::DIRECTORY_STRIPE_LEVEL_MAX => 'DIRECTORY_STRIPE_LEVEL_MAX', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php new file mode 100644 index 00000000000..946a522a2a0 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1.ExportDataMetadata + */ +class ExportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php new file mode 100644 index 00000000000..25a1ed7d4d1 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1.ExportDataRequest + */ +class ExportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore + * Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket + * Cloud Storage destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; + * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(2); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(2); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; + * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; + * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(3); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(3); + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; + * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php new file mode 100644 index 00000000000..7a2a7ca3f97 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1.ExportDataResponse + */ +class ExportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php new file mode 100644 index 00000000000..7f349e1ef99 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1.FileStripeLevel + */ +class FileStripeLevel +{ + /** + * If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MIN = 1; + */ + const FILE_STRIPE_LEVEL_MIN = 1; + /** + * Medium file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_BALANCED = 2; + */ + const FILE_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MAX = 3; + */ + const FILE_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::FILE_STRIPE_LEVEL_UNSPECIFIED => 'FILE_STRIPE_LEVEL_UNSPECIFIED', + self::FILE_STRIPE_LEVEL_MIN => 'FILE_STRIPE_LEVEL_MIN', + self::FILE_STRIPE_LEVEL_BALANCED => 'FILE_STRIPE_LEVEL_BALANCED', + self::FILE_STRIPE_LEVEL_MAX => 'FILE_STRIPE_LEVEL_MAX', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php new file mode 100644 index 00000000000..1faa91f6339 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php @@ -0,0 +1,86 @@ +google.cloud.parallelstore.v1.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. Please see + * {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_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. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_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/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php new file mode 100644 index 00000000000..e64fbf40267 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1.ImportDataMetadata + */ +class ImportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php new file mode 100644 index 00000000000..e9822439ab5 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1.ImportDataRequest + */ +class ImportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore + * Parallelstore destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; + * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(2); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; + * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; + * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(3); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(3); + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; + * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php new file mode 100644 index 00000000000..49d0ebaf5ae --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1.ImportDataResponse + */ +class ImportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php new file mode 100644 index 00000000000..af2dc82ba62 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php @@ -0,0 +1,625 @@ +google.cloud.parallelstore.v1.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $capacity_gib = 0; + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $daos_version = ''; + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $access_points; + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $reserved_ip_range = ''; + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $effective_reserved_ip_range = ''; + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file_stripe_level = 0; + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $directory_stripe_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * @type string $description + * Optional. The description of the instance. 2048 characters or less. + * @type int $state + * Output only. The instance state. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * @type int|string $capacity_gib + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * @type string $daos_version + * Output only. The version of DAOS software running in the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $access_points + * Output only. A list of IPv4 addresses used for client side configuration. + * @type string $network + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * @type string $reserved_ip_range + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * @type string $effective_reserved_ip_range + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * @type int $file_stripe_level + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * @type int $directory_stripe_level + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.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; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getCapacityGib() + { + return $this->capacity_gib; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setCapacityGib($var) + { + GPBUtil::checkInt64($var); + $this->capacity_gib = $var; + + return $this; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDaosVersion() + { + return $this->daos_version; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDaosVersion($var) + { + GPBUtil::checkString($var, True); + $this->daos_version = $var; + + return $this; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessPoints() + { + return $this->access_points; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->access_points = $arr; + + return $this; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getReservedIpRange() + { + return $this->reserved_ip_range; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_ip_range = $var; + + return $this; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEffectiveReservedIpRange() + { + return $this->effective_reserved_ip_range; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEffectiveReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->effective_reserved_ip_range = $var; + + return $this; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFileStripeLevel() + { + return $this->file_stripe_level; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFileStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\FileStripeLevel::class); + $this->file_stripe_level = $var; + + return $this; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDirectoryStripeLevel() + { + return $this->directory_stripe_level; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDirectoryStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\DirectoryStripeLevel::class); + $this->directory_stripe_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php new file mode 100644 index 00000000000..8eabb8656dc --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php @@ -0,0 +1,85 @@ +google.cloud.parallelstore.v1.Instance.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The instance is available for use. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The instance is not usable. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The instance is being upgraded. + * + * Generated from protobuf enum UPGRADING = 5; + */ + const UPGRADING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::UPGRADING => 'UPGRADING', + ]; + + 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(State::class, \Google\Cloud\Parallelstore\V1\Instance_State::class); + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php new file mode 100644 index 00000000000..0a02c88d308 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php @@ -0,0 +1,237 @@ +google.cloud.parallelstore.v1.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * 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 project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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 results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering 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; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php new file mode 100644 index 00000000000..c8b9fd39f5d --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php @@ -0,0 +1,136 @@ +google.cloud.parallelstore.v1.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + */ + private $instances; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Parallelstore instances. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + * @param array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php new file mode 100644 index 00000000000..98a34bef679 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.parallelstore.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php new file mode 100644 index 00000000000..6b042397ff3 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1.SourceGcsBucket + */ +class SourceGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php new file mode 100644 index 00000000000..63a37aaeebf --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1.SourceParallelstore + */ +class SourceParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php new file mode 100644 index 00000000000..9b4b96f6fd4 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1.TransferCounters + */ +class TransferCounters extends \Google\Protobuf\Internal\Message +{ + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + */ + protected $objects_found = 0; + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + */ + protected $bytes_found = 0; + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + */ + protected $objects_skipped = 0; + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + */ + protected $bytes_skipped = 0; + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + */ + protected $objects_copied = 0; + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + */ + protected $bytes_copied = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $objects_found + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $bytes_found + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $objects_skipped + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $bytes_skipped + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $objects_copied + * Objects that are copied to the data destination. + * @type int|string $bytes_copied + * Bytes that are copied to the data destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @return int|string + */ + public function getObjectsFound() + { + return $this->objects_found; + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @param int|string $var + * @return $this + */ + public function setObjectsFound($var) + { + GPBUtil::checkInt64($var); + $this->objects_found = $var; + + return $this; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @return int|string + */ + public function getBytesFound() + { + return $this->bytes_found; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @param int|string $var + * @return $this + */ + public function setBytesFound($var) + { + GPBUtil::checkInt64($var); + $this->bytes_found = $var; + + return $this; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @return int|string + */ + public function getObjectsSkipped() + { + return $this->objects_skipped; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @param int|string $var + * @return $this + */ + public function setObjectsSkipped($var) + { + GPBUtil::checkInt64($var); + $this->objects_skipped = $var; + + return $this; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @return int|string + */ + public function getBytesSkipped() + { + return $this->bytes_skipped; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @param int|string $var + * @return $this + */ + public function setBytesSkipped($var) + { + GPBUtil::checkInt64($var); + $this->bytes_skipped = $var; + + return $this; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @return int|string + */ + public function getObjectsCopied() + { + return $this->objects_copied; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @param int|string $var + * @return $this + */ + public function setObjectsCopied($var) + { + GPBUtil::checkInt64($var); + $this->objects_copied = $var; + + return $this; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @return int|string + */ + public function getBytesCopied() + { + return $this->bytes_copied; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @param int|string $var + * @return $this + */ + public function setBytesCopied($var) + { + GPBUtil::checkInt64($var); + $this->bytes_copied = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php new file mode 100644 index 00000000000..0cdbf05167a --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1.TransferOperationMetadata + */ +class TransferOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $counters = null; + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $transfer_type = 0; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore + * Output only. Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket + * Output only. Cloud Storage source. + * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket + * Output only. Cloud Storage destination. + * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore + * Output only. Parallelstore destination. + * @type \Google\Cloud\Parallelstore\V1\TransferCounters $counters + * Output only. The progress of the transfer operation. + * @type int $transfer_type + * Output only. The type of transfer occurring. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(7); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(7); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(8); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(8); + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(9); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(9); + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(10); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(10); + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\TransferCounters|null + */ + public function getCounters() + { + return $this->counters; + } + + public function hasCounters() + { + return isset($this->counters); + } + + public function clearCounters() + { + unset($this->counters); + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\TransferCounters $var + * @return $this + */ + public function setCounters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferCounters::class); + $this->counters = $var; + + return $this; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTransferType() + { + return $this->transfer_type; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTransferType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\TransferType::class); + $this->transfer_type = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php new file mode 100644 index 00000000000..cecde2a1b64 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php @@ -0,0 +1,61 @@ +google.cloud.parallelstore.v1.TransferType + */ +class TransferType +{ + /** + * Zero is an illegal value. + * + * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; + */ + const TRANSFER_TYPE_UNSPECIFIED = 0; + /** + * Imports to Parallelstore. + * + * Generated from protobuf enum IMPORT = 1; + */ + const IMPORT = 1; + /** + * Exports from Parallelstore. + * + * Generated from protobuf enum EXPORT = 2; + */ + const EXPORT = 2; + + private static $valueToName = [ + self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', + self::IMPORT => 'IMPORT', + self::EXPORT => 'EXPORT', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php new file mode 100644 index 00000000000..e2e23b6223a --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php @@ -0,0 +1,225 @@ +google.cloud.parallelstore.v1.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * @return \Google\Cloud\Parallelstore\V1\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Parallelstore\V1\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * @type \Google\Cloud\Parallelstore\V1\Instance $instance + * Required. The instance to update. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php new file mode 100644 index 00000000000..56f45bf3e94 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php @@ -0,0 +1,104 @@ +setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + $instanceId = '[INSTANCE_ID]'; + $instanceCapacityGib = 0; + + create_instance_sample($formattedParent, $instanceId, $instanceCapacityGib); +} +// [END parallelstore_v1_generated_Parallelstore_CreateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php new file mode 100644 index 00000000000..8202d349d9b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->deleteInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + delete_instance_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_DeleteInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php new file mode 100644 index 00000000000..9a64b7551fe --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->exportData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + export_data_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_ExportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php new file mode 100644 index 00000000000..aba7bdaedf3 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $parallelstoreClient->getInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_GetInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php new file mode 100644 index 00000000000..0950b50a4c6 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1_generated_Parallelstore_GetLocation_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php new file mode 100644 index 00000000000..a4e745a904e --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->importData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + import_data_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_ImportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php new file mode 100644 index 00000000000..8388dfa1a88 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $parallelstoreClient->listInstances($request); + + /** @var Instance $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + + list_instances_sample($formattedParent); +} +// [END parallelstore_v1_generated_Parallelstore_ListInstances_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php new file mode 100644 index 00000000000..05b2ed1ff36 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1_generated_Parallelstore_ListLocations_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php new file mode 100644 index 00000000000..a4aff2499ae --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php @@ -0,0 +1,89 @@ +setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceCapacityGib = 0; + + update_instance_sample($instanceCapacityGib); +} +// [END parallelstore_v1_generated_Parallelstore_UpdateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php b/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php new file mode 100644 index 00000000000..fd45a4b287c --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php @@ -0,0 +1,611 @@ + createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ParallelstoreClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.parallelstore.v1.Parallelstore'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'parallelstore.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'parallelstore.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/parallelstore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/parallelstore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/parallelstore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/parallelstore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a address + * resource. + * + * @param string $project + * @param string $region + * @param string $address + * + * @return string The formatted address resource. + */ + public static function addressName(string $project, string $region, string $address): string + { + return self::getPathTemplate('address')->render([ + 'project' => $project, + 'region' => $region, + 'address' => $address, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_account resource. + * + * @param string $project + * @param string $serviceAccount + * + * @return string The formatted service_account resource. + */ + public static function serviceAccountName(string $project, string $serviceAccount): string + { + return self::getPathTemplate('serviceAccount')->render([ + 'project' => $project, + 'service_account' => $serviceAccount, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - address: projects/{project}/regions/{region}/addresses/{address} + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - serviceAccount: projects/{project}/serviceAccounts/{service_account} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'parallelstore.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Parallelstore instance in a given project and location. + * + * The async variant is {@see ParallelstoreClient::createInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/create_instance.php + * + * @param CreateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes a single instance. + * + * The async variant is {@see ParallelstoreClient::deleteInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/delete_instance.php + * + * @param DeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Parallelstore to Cloud Storage. + * + * The async variant is {@see ParallelstoreClient::exportDataAsync()} . + * + * @example samples/V1/ParallelstoreClient/export_data.php + * + * @param ExportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportData', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single instance. + * + * The async variant is {@see ParallelstoreClient::getInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/get_instance.php + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Cloud Storage to Parallelstore. + * + * The async variant is {@see ParallelstoreClient::importDataAsync()} . + * + * @example samples/V1/ParallelstoreClient/import_data.php + * + * @param ImportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportData', $request, $callOptions)->wait(); + } + + /** + * Lists all instances in a given project and location. + * + * The async variant is {@see ParallelstoreClient::listInstancesAsync()} . + * + * @example samples/V1/ParallelstoreClient/list_instances.php + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Updates the parameters of a single instance. + * + * The async variant is {@see ParallelstoreClient::updateInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/update_instance.php + * + * @param UpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParallelstoreClient::getLocationAsync()} . + * + * @example samples/V1/ParallelstoreClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ParallelstoreClient::listLocationsAsync()} . + * + * @example samples/V1/ParallelstoreClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..2eaf40bfd51 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.parallelstore.v1", + "libraryPackage": "Google\\Cloud\\Parallelstore\\V1", + "services": { + "Parallelstore": { + "clients": { + "grpc": { + "libraryClient": "ParallelstoreGapicClient", + "rpcs": { + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json new file mode 100644 index 00000000000..bc0e63dce49 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.parallelstore.v1.Parallelstore": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ExportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ImportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php new file mode 100644 index 00000000000..8f886377a79 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php @@ -0,0 +1,197 @@ + [ + 'google.cloud.parallelstore.v1.Parallelstore' => [ + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'address' => 'projects/{project}/regions/{region}/addresses/{address}', + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/global/networks/{network}', + 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php new file mode 100644 index 00000000000..f7d9fb7afb5 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php @@ -0,0 +1,188 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.parallelstore.v1.Parallelstore' => [ + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:exportData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:importData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php b/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php new file mode 100644 index 00000000000..0b34f04570c --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php @@ -0,0 +1,1100 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ParallelstoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ParallelstoreClient($options); + } + + /** @test */ + public function createInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $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.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 deleteInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $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.parallelstore.v1.Parallelstore/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 exportDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->exportData($request); + $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.parallelstore.v1.Parallelstore/ExportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + $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 exportDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportDataTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($request); + // 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 importDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->importData($request); + $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.parallelstore.v1.Parallelstore/ImportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + $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 importDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importDataTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($request); + // 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 updateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $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.parallelstore.v1.Parallelstore/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $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 + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createInstanceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstanceAsync($request)->wait(); + $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.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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()); + } +} diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php new file mode 100644 index 0000000000000000000000000000000000000000..33dd88ecf03ccdeaeac6a1a3ca83c87592d615d5 GIT binary patch literal 8766 zcmeGi&2Jl7eaF+J?#uVvq;=EncItF#8d_UTciENGEQ~*rnoSeqxK#@lW^BJWLnbrB z%sAa_6^UKM1##objoTjKe*me{3JHWj?d*b)rn>U_uoMh5)L86yV-h02_ z`+a{s-~Xn)ZKFA5m6*iQJknO0`--pt7REVv%9rL9HnLL+PXoUjG`1bl=Y38 zQYw~f*8$YEx=xGal#XR}43cdbR=1tCHAgcHVz{2=knG;wCh@fBVusy-kg4qw*VbA@ zS*_$B!m+mIY4ufxtX`nV>Xk6E`s2HKIJJaO%g|g`iEN_hNP&NLw`u4t#q~4~{=1>O z4c*i|T{HAgfWu{FOEX*o7!IG^>Y6Q2w@ifsY?v)Fe@o#w>De2$1rk|S1bG!IBoI)& zYE?1ho_Z*b0xTFhF}>5ltmwpO=gGFVr(4czfR@cI z>vUjM;#*&A-qtL$<8)0^H#_wWo7(*8WD}?y1YX*;z5VzE2cS$&4>fn^HDGHxxQnOl z+Jj-4h2Hs4_w7+_w*&KA0r#B`42GJ|P4v$t^xkXvExyjdGR)mG5qHmUcb~oFW7cdP zq5?H1?(?(PLK|DuW*SZ3X#4|L4js_JH2lrWp-sovzrQu-Zy7x$XRScVeaKn-0q4yU zsz!fPM6qC#)3*!C@=pljgA<<62tSbicM>JbCg=#F2cAObXn;#eiZp*AFTYZgIE6;q zev|;yOC`jPgiC0Mh69q4VQqZzZicgSjEpnlqRb`*q!-BeT{O~i2>jWgq@~UQvXRAE zflSby2`njq>e>){eW;;$P-|$|(3%kEQ^Sf3*Ss&TIod9IG_NtplIc17lm-dEg+^N% zZ*=r#DhWi$`QcaU&?_~8FQd`6X1R?$;>o#l)Y~M{G zpvK?Jq4Os3o>|ULYJ@@DV)&%5R0X|F(^}UfKGk5UZU&aJ>l^?V(G-{%arQ{Nq1z2d zGdmRW!8)&fIW4NHwHkkUe6gCIHL$ z;$jT>(?GDvK-VZF7k#~sF1B?Ch_syjDCS9qIgVzF0>L5l8)%|UY{S~$g)q?Y_HB}y zVrb(Sc`<;j0U)Dy_6`~enGYU8@($VOZidIu(4J;=3HPmB;sYtIp&{lWcm_>v*3??5 z@o0UsQYw^J%BAAu8+a5Y3)PZZE3dCkN*JMGwNNWRE=?xrPO-FBVmmV3Sy9Vt0CNtm zx$vm6T2+e_Xef8^rTPhaCmIR40|#a$ycOREFZ?0M+RZ-qzYem7)#Ax0`&@h;WOYA~ zz(MhOuy8?qx{FEinf|qerq^`WD+`D!`B4{A1ztwOKop4G4?=gqm%dW#H*ri_FQN;! z)&XmS;)zLgh+E7hgxI=g?GTfNEaq?$eiIFYc|t+NLXW>VgOZlhCQhTdpQ5paFQ)T)rN|xCQ(85}Gi{$6g~uBMY@a-bmMk_}JRkng)%v5Gm5% zL3ot}vJ;|PibQWAxR^>#e*wG|SRfWe3A|@j38WCA_lDl?rH};9qrf7VN=_#nUWdWpp+97KK!CEu~au_Czd8opV(bAQzQoQ zNI$J-Qfi-YddWNe;{=)t3QEz(^ygw)1`HBRUoO6jlEiHD^vwlxV)_QB^E3zAjh-jU zwEBQ#+3e|1##hidtueZ81L{Z@{JQ6jGM+;hea%C@YtaJ6Fj!22>@LkGsn%p#zd%3> zvhaB!aydPRCN^0!xY}~_-PR8A@FbGEj_yYuYF+7hG!0FXr<)A%@h9Kp=prp1Wy;pP z?H*1keFvpNI8QwOsf?z|ySC+cMd&q!Q*NLs-b^$)Ew|BR^fT8QiIr9RIDha4{sFoS zg`VIP0#T?X_MLMnMnpS`vj-ABn<-x#;O8SyhW+j5zyEVGk(3~qOwig#Z;=L6S5_BN z2oK#*K|%R6hpy||Zhz^t$stq@kWZpvF4g=Pt9ykw(o_khkNcJI7)|?1h>DAQ!8c-v zi|Zj`1E7niP~C)d5z;UX8S(1YkRk%J{U2AtG{Rv=;HfwL*F<c z$NKv*G*g4}*@aosiBU3U$O}hFuEkSC$sn!uqGV8(42qI80J6+-T$H4-aB!5QoeT$0 zgUrKrACh@*`TsJfnd!eL^WU9Amyb5T?;R0zs5(a$Uo+^iWC@X{HYlx7b9k+^BCvk{ z$aqG(;@6L79KVFgak&ezE6$R;#5LbWNtRcjqxUo7y;B5|0!>K(%CO;&(3s~(7~Wt~ z^BG^vo&uq0FXf}t)-NSADJ)6c4^8Em)nxr#V+&|%v!E!`PNTW+5!YX&VNIrei8$-- z=(bJTjB}YH;itti4N)?_h{nbFmSyX3oW>~`Poq(O++U^K$_phlDyXB(;HzNwRds!H zrBrRyo>uzXUT9~_4=Wqh8gF__PuO>2;b#(>=o=H@>*(qVbiR$vTD1&_)=G~{Ykghx zWi)g6$iwnFV1FCU9^T5UYwCIdnrS-R83d|6nUoiP1)c4n$pZcwN*Bx3QlYj{eR>>O zaQ6}CIBj$2+7bI90*^t$s9Zqh4@>K{LDC;V=Qj&gwN`il0vboC zQmSs2H*0WuGO_r@C>o1YG5EI<8jJMGIL=Ha0^!%XvmeB8iatO;Pvu{#{y5>YKmPp} ziF^32c-?sp6&p+$mV?p8LTIG15E^CR-$-aA)NSMUVo(!0FPJ#ZI3WG4mnxgY9-^9# zXOEycG<{h(!2giYc(k3zal{w}5wu?wEQdzbnV>LAe=5CDuZG9S!Ir2DUaD8Pyl?CN zz$f^CuAOnYoIbs7a>4ij{|oqycKfmTje^AF_a`yU_9ysKUE08|8(13}L=ZZ)*B}ptrc3Xps0`05>xsVdG_ z7)v(KJA>)Xs~U2mH|#NV-D zfU{*eyZO(~p?BbE<7CC>aU|_j=o@!M`tC>ERK$}MJd$**=!xq3tSj$t)5BkMmP!4%&Af?@yDBN2*sn)e4FbV!FjIA@>pkAtknABhMo`JW8; z$)gqg?f~@uyvCot0M5Pv&Ovh+pgil|&EO^YHvgeP=ywTpK&ZC{{3d~& literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php new file mode 100644 index 00000000000..fe29cbe5c78 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php @@ -0,0 +1,273 @@ +google.cloud.parallelstore.v1beta.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Parallelstore\V1beta\Instance $instance Required. The instance to create. + * @param string $instanceId Required. The name of the Parallelstore instance. + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * @return \Google\Cloud\Parallelstore\V1beta\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Parallelstore\V1beta\Instance $instance, string $instanceId): self + { + return (new self()) + ->setParent($parent) + ->setInstance($instance) + ->setInstanceId($instanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * @type string $instance_id + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Parallelstore\V1beta\Instance $instance + * Required. The instance to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * 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 instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * 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 name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1beta\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1beta\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php new file mode 100644 index 00000000000..a4a8255bf2d --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php @@ -0,0 +1,155 @@ +google.cloud.parallelstore.v1beta.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1beta\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * 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. Name of the resource + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php new file mode 100644 index 00000000000..26ed91f54fc --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php @@ -0,0 +1,62 @@ +google.cloud.parallelstore.v1beta.DeploymentType + */ +class DeploymentType +{ + /** + * Default Deployment Type + * It is equivalent to SCRATCH + * + * Generated from protobuf enum DEPLOYMENT_TYPE_UNSPECIFIED = 0; + */ + const DEPLOYMENT_TYPE_UNSPECIFIED = 0; + /** + * Scratch + * + * Generated from protobuf enum SCRATCH = 1; + */ + const SCRATCH = 1; + /** + * Persistent + * + * Generated from protobuf enum PERSISTENT = 2; + */ + const PERSISTENT = 2; + + private static $valueToName = [ + self::DEPLOYMENT_TYPE_UNSPECIFIED => 'DEPLOYMENT_TYPE_UNSPECIFIED', + self::SCRATCH => 'SCRATCH', + self::PERSISTENT => 'PERSISTENT', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php new file mode 100644 index 00000000000..8e7de4c6a1e --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1beta.DestinationGcsBucket + */ +class DestinationGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php new file mode 100644 index 00000000000..8c0d829fa41 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1beta.DestinationParallelstore + */ +class DestinationParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php new file mode 100644 index 00000000000..335a8d65009 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1beta.DirectoryStripeLevel + */ +class DirectoryStripeLevel +{ + /** + * If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MIN = 1; + */ + const DIRECTORY_STRIPE_LEVEL_MIN = 1; + /** + * Medium directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + */ + const DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MAX = 3; + */ + const DIRECTORY_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::DIRECTORY_STRIPE_LEVEL_UNSPECIFIED => 'DIRECTORY_STRIPE_LEVEL_UNSPECIFIED', + self::DIRECTORY_STRIPE_LEVEL_MIN => 'DIRECTORY_STRIPE_LEVEL_MIN', + self::DIRECTORY_STRIPE_LEVEL_BALANCED => 'DIRECTORY_STRIPE_LEVEL_BALANCED', + self::DIRECTORY_STRIPE_LEVEL_MAX => 'DIRECTORY_STRIPE_LEVEL_MAX', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php new file mode 100644 index 00000000000..22a6f8b50cf --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1beta.ExportDataMetadata + */ +class ExportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php new file mode 100644 index 00000000000..b5b2af48db2 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1beta.ExportDataRequest + */ +class ExportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore + * Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket + * Cloud Storage destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; + * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(2); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(2); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; + * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(3); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(3); + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php new file mode 100644 index 00000000000..53ef6c9be2d --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1beta.ExportDataResponse + */ +class ExportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php new file mode 100644 index 00000000000..9b2e9505754 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1beta.FileStripeLevel + */ +class FileStripeLevel +{ + /** + * If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MIN = 1; + */ + const FILE_STRIPE_LEVEL_MIN = 1; + /** + * Medium file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_BALANCED = 2; + */ + const FILE_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MAX = 3; + */ + const FILE_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::FILE_STRIPE_LEVEL_UNSPECIFIED => 'FILE_STRIPE_LEVEL_UNSPECIFIED', + self::FILE_STRIPE_LEVEL_MIN => 'FILE_STRIPE_LEVEL_MIN', + self::FILE_STRIPE_LEVEL_BALANCED => 'FILE_STRIPE_LEVEL_BALANCED', + self::FILE_STRIPE_LEVEL_MAX => 'FILE_STRIPE_LEVEL_MAX', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php new file mode 100644 index 00000000000..fd795fcc0f6 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php @@ -0,0 +1,86 @@ +google.cloud.parallelstore.v1beta.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. Please see + * {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1beta\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_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. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_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/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php new file mode 100644 index 00000000000..3c3cfac406b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1beta.ImportDataMetadata + */ +class ImportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php new file mode 100644 index 00000000000..7c2e0471a0d --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1beta.ImportDataRequest + */ +class ImportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore + * Parallelstore destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; + * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(2); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; + * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(3); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(3); + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php new file mode 100644 index 00000000000..9eb5207960b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1beta.ImportDataResponse + */ +class ImportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php new file mode 100644 index 00000000000..f7bf0900d60 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php @@ -0,0 +1,667 @@ +google.cloud.parallelstore.v1beta.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $capacity_gib = 0; + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $daos_version = ''; + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $access_points; + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $reserved_ip_range = ''; + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $effective_reserved_ip_range = ''; + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file_stripe_level = 0; + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $directory_stripe_level = 0; + /** + * Optional. The deployment type of the instance. Allowed values are: + * * `SCRATCH`: the instance is a scratch instance. + * * `PERSISTENT`: the instance is a persistent instance. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deployment_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * @type string $description + * Optional. The description of the instance. 2048 characters or less. + * @type int $state + * Output only. The instance state. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * @type int|string $capacity_gib + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * @type string $daos_version + * Output only. The version of DAOS software running in the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $access_points + * Output only. A list of IPv4 addresses used for client side configuration. + * @type string $network + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * @type string $reserved_ip_range + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * @type string $effective_reserved_ip_range + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * @type int $file_stripe_level + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * @type int $directory_stripe_level + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * @type int $deployment_type + * Optional. The deployment type of the instance. Allowed values are: + * * `SCRATCH`: the instance is a scratch instance. + * * `PERSISTENT`: the instance is a persistent instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.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; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getCapacityGib() + { + return $this->capacity_gib; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setCapacityGib($var) + { + GPBUtil::checkInt64($var); + $this->capacity_gib = $var; + + return $this; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDaosVersion() + { + return $this->daos_version; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDaosVersion($var) + { + GPBUtil::checkString($var, True); + $this->daos_version = $var; + + return $this; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessPoints() + { + return $this->access_points; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->access_points = $arr; + + return $this; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getReservedIpRange() + { + return $this->reserved_ip_range; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_ip_range = $var; + + return $this; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEffectiveReservedIpRange() + { + return $this->effective_reserved_ip_range; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEffectiveReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->effective_reserved_ip_range = $var; + + return $this; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFileStripeLevel() + { + return $this->file_stripe_level; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFileStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\FileStripeLevel::class); + $this->file_stripe_level = $var; + + return $this; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDirectoryStripeLevel() + { + return $this->directory_stripe_level; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDirectoryStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\DirectoryStripeLevel::class); + $this->directory_stripe_level = $var; + + return $this; + } + + /** + * Optional. The deployment type of the instance. Allowed values are: + * * `SCRATCH`: the instance is a scratch instance. + * * `PERSISTENT`: the instance is a persistent instance. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDeploymentType() + { + return $this->deployment_type; + } + + /** + * Optional. The deployment type of the instance. Allowed values are: + * * `SCRATCH`: the instance is a scratch instance. + * * `PERSISTENT`: the instance is a persistent instance. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDeploymentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\DeploymentType::class); + $this->deployment_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php new file mode 100644 index 00000000000..354012ed350 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php @@ -0,0 +1,85 @@ +google.cloud.parallelstore.v1beta.Instance.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The instance is available for use. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The instance is not usable. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The instance is being upgraded. + * + * Generated from protobuf enum UPGRADING = 5; + */ + const UPGRADING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::UPGRADING => 'UPGRADING', + ]; + + 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(State::class, \Google\Cloud\Parallelstore\V1beta\Instance_State::class); + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php new file mode 100644 index 00000000000..7a8b21e383d --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php @@ -0,0 +1,237 @@ +google.cloud.parallelstore.v1beta.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1beta\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * 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 project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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 results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering 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; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php new file mode 100644 index 00000000000..771809f6496 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php @@ -0,0 +1,136 @@ +google.cloud.parallelstore.v1beta.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; + */ + private $instances; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Parallelstore\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Parallelstore instances. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; + * @param array<\Google\Cloud\Parallelstore\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Parallelstore\V1beta\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php new file mode 100644 index 00000000000..4c18d216563 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.parallelstore.v1beta.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php new file mode 100644 index 00000000000..d75c59be5ee --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1beta.SourceGcsBucket + */ +class SourceGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php new file mode 100644 index 00000000000..9d009c92d2a --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1beta.SourceParallelstore + */ +class SourceParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php new file mode 100644 index 00000000000..1f3c823561c --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1beta.TransferCounters + */ +class TransferCounters extends \Google\Protobuf\Internal\Message +{ + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + */ + protected $objects_found = 0; + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + */ + protected $bytes_found = 0; + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + */ + protected $objects_skipped = 0; + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + */ + protected $bytes_skipped = 0; + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + */ + protected $objects_copied = 0; + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + */ + protected $bytes_copied = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $objects_found + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $bytes_found + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $objects_skipped + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $bytes_skipped + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $objects_copied + * Objects that are copied to the data destination. + * @type int|string $bytes_copied + * Bytes that are copied to the data destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @return int|string + */ + public function getObjectsFound() + { + return $this->objects_found; + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @param int|string $var + * @return $this + */ + public function setObjectsFound($var) + { + GPBUtil::checkInt64($var); + $this->objects_found = $var; + + return $this; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @return int|string + */ + public function getBytesFound() + { + return $this->bytes_found; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @param int|string $var + * @return $this + */ + public function setBytesFound($var) + { + GPBUtil::checkInt64($var); + $this->bytes_found = $var; + + return $this; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @return int|string + */ + public function getObjectsSkipped() + { + return $this->objects_skipped; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @param int|string $var + * @return $this + */ + public function setObjectsSkipped($var) + { + GPBUtil::checkInt64($var); + $this->objects_skipped = $var; + + return $this; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @return int|string + */ + public function getBytesSkipped() + { + return $this->bytes_skipped; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @param int|string $var + * @return $this + */ + public function setBytesSkipped($var) + { + GPBUtil::checkInt64($var); + $this->bytes_skipped = $var; + + return $this; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @return int|string + */ + public function getObjectsCopied() + { + return $this->objects_copied; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @param int|string $var + * @return $this + */ + public function setObjectsCopied($var) + { + GPBUtil::checkInt64($var); + $this->objects_copied = $var; + + return $this; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @return int|string + */ + public function getBytesCopied() + { + return $this->bytes_copied; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @param int|string $var + * @return $this + */ + public function setBytesCopied($var) + { + GPBUtil::checkInt64($var); + $this->bytes_copied = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php new file mode 100644 index 00000000000..6a51f19d65e --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1beta.TransferOperationMetadata + */ +class TransferOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $counters = null; + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $transfer_type = 0; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore + * Output only. Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket + * Output only. Cloud Storage source. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket + * Output only. Cloud Storage destination. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore + * Output only. Parallelstore destination. + * @type \Google\Cloud\Parallelstore\V1beta\TransferCounters $counters + * Output only. The progress of the transfer operation. + * @type int $transfer_type + * Output only. The type of transfer occurring. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(7); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(7); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(8); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(8); + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(9); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(9); + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(10); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(10); + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\TransferCounters|null + */ + public function getCounters() + { + return $this->counters; + } + + public function hasCounters() + { + return isset($this->counters); + } + + public function clearCounters() + { + unset($this->counters); + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\TransferCounters $var + * @return $this + */ + public function setCounters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferCounters::class); + $this->counters = $var; + + return $this; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTransferType() + { + return $this->transfer_type; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTransferType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\TransferType::class); + $this->transfer_type = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php new file mode 100644 index 00000000000..32f4f425911 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php @@ -0,0 +1,61 @@ +google.cloud.parallelstore.v1beta.TransferType + */ +class TransferType +{ + /** + * Zero is an illegal value. + * + * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; + */ + const TRANSFER_TYPE_UNSPECIFIED = 0; + /** + * Imports to Parallelstore. + * + * Generated from protobuf enum IMPORT = 1; + */ + const IMPORT = 1; + /** + * Exports from Parallelstore. + * + * Generated from protobuf enum EXPORT = 2; + */ + const EXPORT = 2; + + private static $valueToName = [ + self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', + self::IMPORT => 'IMPORT', + self::EXPORT => 'EXPORT', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php new file mode 100644 index 00000000000..4ef5ca11a7b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php @@ -0,0 +1,225 @@ +google.cloud.parallelstore.v1beta.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\Parallelstore\V1beta\Instance $instance Required. The instance to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * @return \Google\Cloud\Parallelstore\V1beta\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Parallelstore\V1beta\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * @type \Google\Cloud\Parallelstore\V1beta\Instance $instance + * Required. The instance to update. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1beta\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1beta\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php new file mode 100644 index 00000000000..a167a3c6851 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php @@ -0,0 +1,104 @@ +setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + $instanceId = '[INSTANCE_ID]'; + $instanceCapacityGib = 0; + + create_instance_sample($formattedParent, $instanceId, $instanceCapacityGib); +} +// [END parallelstore_v1beta_generated_Parallelstore_CreateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php new file mode 100644 index 00000000000..bc9e448eef1 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->deleteInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + delete_instance_sample($formattedName); +} +// [END parallelstore_v1beta_generated_Parallelstore_DeleteInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php new file mode 100644 index 00000000000..7ff721f7a80 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->exportData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + export_data_sample($formattedName); +} +// [END parallelstore_v1beta_generated_Parallelstore_ExportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php new file mode 100644 index 00000000000..4ac319b07fc --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $parallelstoreClient->getInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END parallelstore_v1beta_generated_Parallelstore_GetInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php new file mode 100644 index 00000000000..a20382fc3d3 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1beta_generated_Parallelstore_GetLocation_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php new file mode 100644 index 00000000000..2bed07a1b4b --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->importData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + import_data_sample($formattedName); +} +// [END parallelstore_v1beta_generated_Parallelstore_ImportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php new file mode 100644 index 00000000000..3c500ce1f28 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $parallelstoreClient->listInstances($request); + + /** @var Instance $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + + list_instances_sample($formattedParent); +} +// [END parallelstore_v1beta_generated_Parallelstore_ListInstances_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php new file mode 100644 index 00000000000..914034ce8fe --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1beta_generated_Parallelstore_ListLocations_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php new file mode 100644 index 00000000000..6d1a4798aee --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php @@ -0,0 +1,89 @@ +setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceCapacityGib = 0; + + update_instance_sample($instanceCapacityGib); +} +// [END parallelstore_v1beta_generated_Parallelstore_UpdateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php new file mode 100644 index 00000000000..01ad01a3daf --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php @@ -0,0 +1,651 @@ + createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ParallelstoreClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.parallelstore.v1beta.Parallelstore'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'parallelstore.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'parallelstore.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/parallelstore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/parallelstore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/parallelstore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/parallelstore_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a address + * resource. + * + * @param string $project + * @param string $region + * @param string $address + * + * @return string The formatted address resource. + * + * @experimental + */ + public static function addressName(string $project, string $region, string $address): string + { + return self::getPathTemplate('address')->render([ + 'project' => $project, + 'region' => $region, + 'address' => $address, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + * + * @experimental + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + * + * @experimental + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_account resource. + * + * @param string $project + * @param string $serviceAccount + * + * @return string The formatted service_account resource. + * + * @experimental + */ + public static function serviceAccountName(string $project, string $serviceAccount): string + { + return self::getPathTemplate('serviceAccount')->render([ + 'project' => $project, + 'service_account' => $serviceAccount, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - address: projects/{project}/regions/{region}/addresses/{address} + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - serviceAccount: projects/{project}/serviceAccounts/{service_account} + * + * 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(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'parallelstore.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Parallelstore instance in a given project and location. + * + * The async variant is {@see ParallelstoreClient::createInstanceAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/create_instance.php + * + * @param CreateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes a single instance. + * + * The async variant is {@see ParallelstoreClient::deleteInstanceAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/delete_instance.php + * + * @param DeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Parallelstore to Cloud Storage. + * + * The async variant is {@see ParallelstoreClient::exportDataAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/export_data.php + * + * @param ExportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportData', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single instance. + * + * The async variant is {@see ParallelstoreClient::getInstanceAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/get_instance.php + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Instance + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Cloud Storage to Parallelstore. + * + * The async variant is {@see ParallelstoreClient::importDataAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/import_data.php + * + * @param ImportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportData', $request, $callOptions)->wait(); + } + + /** + * Lists all instances in a given project and location. + * + * The async variant is {@see ParallelstoreClient::listInstancesAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/list_instances.php + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Updates the parameters of a single instance. + * + * The async variant is {@see ParallelstoreClient::updateInstanceAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/update_instance.php + * + * @param UpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParallelstoreClient::getLocationAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ParallelstoreClient::listLocationsAsync()} . + * + * @example samples/V1beta/ParallelstoreClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json new file mode 100644 index 00000000000..7b389692ba7 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.parallelstore.v1beta", + "libraryPackage": "Google\\Cloud\\Parallelstore\\V1beta", + "services": { + "Parallelstore": { + "clients": { + "grpc": { + "libraryClient": "ParallelstoreGapicClient", + "rpcs": { + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json new file mode 100644 index 00000000000..bc53acd55a4 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.parallelstore.v1beta.Parallelstore": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ExportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ImportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php new file mode 100644 index 00000000000..6ff219c559f --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php @@ -0,0 +1,197 @@ + [ + 'google.cloud.parallelstore.v1beta.Parallelstore' => [ + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\ExportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\ExportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\ImportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\ImportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1beta\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1beta\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'address' => 'projects/{project}/regions/{region}/addresses/{address}', + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/global/networks/{network}', + 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php new file mode 100644 index 00000000000..f1562b87eff --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php @@ -0,0 +1,187 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.parallelstore.v1beta.Parallelstore' => [ + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}:exportData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}:importData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{instance.name=projects/*/locations/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php b/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php new file mode 100644 index 00000000000..3bb333809c1 --- /dev/null +++ b/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php @@ -0,0 +1,1100 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ParallelstoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ParallelstoreClient($options); + } + + /** @test */ + public function createInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $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.parallelstore.v1beta.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 deleteInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $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.parallelstore.v1beta.Parallelstore/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 exportDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->exportData($request); + $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.parallelstore.v1beta.Parallelstore/ExportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + $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 exportDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportDataTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1beta.Parallelstore/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($request); + // 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 importDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->importData($request); + $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.parallelstore.v1beta.Parallelstore/ImportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + $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 importDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importDataTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest()) + ->setName($formattedName); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1beta.Parallelstore/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($request); + // 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 updateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $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.parallelstore.v1beta.Parallelstore/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $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 + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createInstanceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstanceAsync($request)->wait(); + $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.parallelstore.v1beta.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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()); + } +} diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php b/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php new file mode 100644 index 0000000000000000000000000000000000000000..29c6b7e51d02e9b475534b6bb9d4e8200f222e19 GIT binary patch literal 2854 zcmbtWU2o$=6vaulyS+i(?kuz+yP`u{)a+_;)$9v$w~O-OrWTD8lC%i0WI4{H9pTuP zKPpPqKf({-0f`5G1TXvqo_OXRiATns*h$k=yIcB{dhR{<+%sop?yE1{GZ!{-li0*F z0y4yd3mlvg?0Qb%n2v=9;b=rWY&v6?TEr7EZnUx5?qj*3^gm&#z7u*Tk?^VGoLXeZ zw489b<2n{KFMK)Ur_Qe<;z&6IjcMX%^W~bI7fiW}!LuNi~h)Z+s7lr@(BaD z89NGXGvbD$gtl#x@-xgaqu4FiVOs3tgj*+)he@L;c0fGau(Ss8O^>>)*$xYpq*D^4 zqDEiJ&n9IfI6A^*&QX$Xkle?C7n0fP7<(iLJ$ohi{nC#?<$j$qLzYq4aA89>z|l zHW_laqgSwG#6{y0E0q`G8(I@N#~$-NLB-p-pig0mw;fZ+S3XRTnI=pkaYEoL_+UWo zA+=9+rbT*g3pt!E=PNIhq}!AhYdksbi=TOP0Lvb+$hpDJR^cA&f8{N34oT=ypPl7y zl3M!n0iXr&)&CY*MBin&@aee=m?oM$FmQ9CQE4pk8_Zd#U@+ct~ z9X^qn#w-3Nz~icIJCUJ>Q!c0rFl}&hI$kH~?_fu92J@OTqa%AaXBIDEb&Be9)$)-2 zo?P&og6;afbHfU`!}68pU3f1LMaq0GlztLmWzJ+9@TA*5lJ$<Xo z^s@jk)rQ?rYc07|le@h`r87rr9UjlDrPT!V1lDI3=BSk5UB+%j*CdqN9)9&^e z(cJUPv~PZv(n{;h{~~IFygOO0Tcf^{#v*pH$WQJQaW?wcTwod;vXx+@aDuT+P(} z5nz)|Zg28g?a|Cd?Z>lCNBFkIk5lsUIOCmD=f+@XxHNr9({axo?D0ot=F7i=@JnW+ z8IN{iJsRyMZ%r>562+63p(#h^%DIPIj ZZl|Ng3qDrOOkuZ9U~wd$ldj+j;6FxGm-YYv literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php b/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php new file mode 100644 index 0000000000000000000000000000000000000000..133eb375f8cfb21698d888591c09b7c30cb0b795 GIT binary patch literal 5717 zcmbVQO>7&-70yzkY7TAvjGI^?&}6f6Ygx9r5$n3?+G@L`Xoav$5+vm&0s&&R98%jX zcenc^M-c?Hz4X{a&pj7N5%kbwQJ}}d$D}6%1=^y$_)?&!qNl$3*%eKZ7HM6?oq6xg z%=f=8@i@z%Lh@fM||0I2cBgUKQGJMHMv@A z$>r@z>pf5n+{ibHCih*pZxhwD-KeX2u5Fpefi;M1BXoWBXj4r-^2|0ujxivCXP89Z zsTUuU(C8YW(cWQZ+9hhHU4Pk3`^n~ggiPBA0=XI6Mkh#yKQB6fCFLMALil&x3Obf! zg_dDkpTViNuP)0z2_xUR&-P6X zoF>28V_?%gtF1eZOHpv0K-137bY^0bV#&6M6V9gd&?0uXNDhr7%k^hdZ4g17sW&-^ z6z%e-o^3d@p1EQSfKh^E)9-!Pb^3nfIF{3I*E||Fvq7COsAWL_gvP*|e(i>5wwvJG zXa?7|jy=-ehTtB*3?ulR?^}Y-dbgXf_aQ|5dcrr#z8mN-Ye=0j)bYDqAK zk2Z7Hghj)%Ac0U8@+6THnkt>>QL1$g1lNSX+e4bZAe5LYT(nIx#2TTK6FQbLpgD_g zRm`o4Is452s+;&<2*n#_IS$f<8pci*0`XCO&s1q5hypS3mM|ZJyHrSpgpVu#PNRhe z0e&Cj6*Nzi=Bgx1>zU%*-}E`GqcpWbR#PyxSh$ntRwhE7=ce+MM1-3tq6O1+dRBjR z4s2wnwozhA)J6)o&=Q~@*hrHRrEW&9>uX}0uMxwBVo*2|^J!%BI3 z`3;;!U#pj^+m-6hvP3@`d(|raNZ~6e)7&eS%H?ekoWlq$Jk%?@@OxhSyYxc;tAxHe z8bsXf5GFw$O0_Bo^8wKC$HWW+^+fzSRc+Vg8B0Bhf1av7BN&MBAE)?Uk7D7&2>&sy zUeWdYhGTseFERW%r48j@^XM`^0CzsVkLIZ(g-dS5E}4{01jn~Q<-<4d8cH)?uX0D> zSQ`S6ML`sR(BUO;B#7*l= zsYP}0O|%G2PS^Fqn2!Ut)b!h=SVNn|Mq{F{YarO1+ zGSS}tFmHf_!=F>qXp-&XCA7e|tsJ7OC7(b{$87sa1Yr%?A$EU~XjAwB)uLILaUxr2 z-?-4D+$u|uN(EixpGn6Mcf2@{5TtNF?9fuda$2^Ki;c&1B%d@3N)0XVknrU#Lxc=f zhC7gwXP~U|Qwgo^T0vry`M5zi8e1c1%xIiuY|rSEP5_NK!!C^>qp_jT{e(CyKr+e+ zdV9H|r6fHH|?oI`Kz)^hr3hyP_OQkJFSoFqn?4rp;{C3&{SZwxL18tt^KGPkEQ6CFw-bM zsXby1#tOP3#&+~dmG&9XJAGXYJ=Q-imOHU9ZMUwzG$T|Nls`&nX%y(QVhAY?nkvf4 z#lp13khf3Za2AUe3BXr0>}T*54-Wuufi(dEIEh*q(*+cMb_v?9_*DV_B84(Zn#G$J zIyI3Mc{4Y4flz)eJ=aezVFmnW$d1Ex65qWLjbZT^kZ;6VLl>xgQVx}WNYC{5lB>?7 zYWZBh!dtW390CT}ZzP37#-}ELmUOwAsO0;16%L(H8w=ifEluGN3awXwcup5TOQDr> zWe$HYMrLASJf{|7{~o?OtT-0Pae5E1 zHmvswD932$8qf51SY|kTXcTC~_nko?m zkkg{8y4b zPrbXt9z*jb`WPxob+T^$$>y_IqAlJ_#amV)(}wr07b%6C(KKd9(|Arygf#8R=D`AM hG{1c#dF{E)-y(;eE@=k0%rVcFOp-q@o}yEP{tu1_mhu1q literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php new file mode 100644 index 00000000000..077a3033f17 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php @@ -0,0 +1,78 @@ +google.cloud.policysimulator.v1.AccessState + */ +class AccessState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_STATE_UNSPECIFIED = 0; + */ + const ACCESS_STATE_UNSPECIFIED = 0; + /** + * The principal has the permission. + * + * Generated from protobuf enum GRANTED = 1; + */ + const GRANTED = 1; + /** + * The principal does not have the permission. + * + * Generated from protobuf enum NOT_GRANTED = 2; + */ + const NOT_GRANTED = 2; + /** + * The principal has the permission only if a condition expression evaluates + * to `true`. + * + * Generated from protobuf enum UNKNOWN_CONDITIONAL = 3; + */ + const UNKNOWN_CONDITIONAL = 3; + /** + * The user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to all of the policies that Policy Simulator needs to evaluate. + * + * Generated from protobuf enum UNKNOWN_INFO_DENIED = 4; + */ + const UNKNOWN_INFO_DENIED = 4; + + private static $valueToName = [ + self::ACCESS_STATE_UNSPECIFIED => 'ACCESS_STATE_UNSPECIFIED', + self::GRANTED => 'GRANTED', + self::NOT_GRANTED => 'NOT_GRANTED', + self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', + self::UNKNOWN_INFO_DENIED => 'UNKNOWN_INFO_DENIED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php new file mode 100644 index 00000000000..452fc1fa8d8 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php @@ -0,0 +1,181 @@ +google.cloud.policysimulator.v1.AccessStateDiff + */ +class AccessStateDiff extends \Google\Protobuf\Internal\Message +{ + /** + * The results of evaluating the access tuple under the current (baseline) + * policies. + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't + * be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; + */ + protected $baseline = null; + /** + * The results of evaluating the access tuple under the proposed (simulated) + * policies. + * If the AccessState couldn't be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; + */ + protected $simulated = null; + /** + * How the principal's access, specified in the AccessState field, changed + * between the current (baseline) policies and proposed (simulated) policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; + */ + protected $access_change = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicySimulator\V1\ExplainedAccess $baseline + * The results of evaluating the access tuple under the current (baseline) + * policies. + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't + * be fully evaluated, this field explains why. + * @type \Google\Cloud\PolicySimulator\V1\ExplainedAccess $simulated + * The results of evaluating the access tuple under the proposed (simulated) + * policies. + * If the AccessState couldn't be fully evaluated, this field explains why. + * @type int $access_change + * How the principal's access, specified in the AccessState field, changed + * between the current (baseline) policies and proposed (simulated) policies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * The results of evaluating the access tuple under the current (baseline) + * policies. + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't + * be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; + * @return \Google\Cloud\PolicySimulator\V1\ExplainedAccess|null + */ + public function getBaseline() + { + return $this->baseline; + } + + public function hasBaseline() + { + return isset($this->baseline); + } + + public function clearBaseline() + { + unset($this->baseline); + } + + /** + * The results of evaluating the access tuple under the current (baseline) + * policies. + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't + * be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; + * @param \Google\Cloud\PolicySimulator\V1\ExplainedAccess $var + * @return $this + */ + public function setBaseline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ExplainedAccess::class); + $this->baseline = $var; + + return $this; + } + + /** + * The results of evaluating the access tuple under the proposed (simulated) + * policies. + * If the AccessState couldn't be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; + * @return \Google\Cloud\PolicySimulator\V1\ExplainedAccess|null + */ + public function getSimulated() + { + return $this->simulated; + } + + public function hasSimulated() + { + return isset($this->simulated); + } + + public function clearSimulated() + { + unset($this->simulated); + } + + /** + * The results of evaluating the access tuple under the proposed (simulated) + * policies. + * If the AccessState couldn't be fully evaluated, this field explains why. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; + * @param \Google\Cloud\PolicySimulator\V1\ExplainedAccess $var + * @return $this + */ + public function setSimulated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ExplainedAccess::class); + $this->simulated = $var; + + return $this; + } + + /** + * How the principal's access, specified in the AccessState field, changed + * between the current (baseline) policies and proposed (simulated) policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; + * @return int + */ + public function getAccessChange() + { + return $this->access_change; + } + + /** + * How the principal's access, specified in the AccessState field, changed + * between the current (baseline) policies and proposed (simulated) policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; + * @param int $var + * @return $this + */ + public function setAccessChange($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessStateDiff\AccessChangeType::class); + $this->access_change = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php new file mode 100644 index 00000000000..ba5a4819fb9 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php @@ -0,0 +1,109 @@ +google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType + */ +class AccessChangeType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_CHANGE_TYPE_UNSPECIFIED = 0; + */ + const ACCESS_CHANGE_TYPE_UNSPECIFIED = 0; + /** + * The principal's access did not change. + * This includes the case where both baseline and simulated are UNKNOWN, + * but the unknown information is equivalent. + * + * Generated from protobuf enum NO_CHANGE = 1; + */ + const NO_CHANGE = 1; + /** + * The principal's access under both the current policies and the proposed + * policies is `UNKNOWN`, but the unknown information differs between them. + * + * Generated from protobuf enum UNKNOWN_CHANGE = 2; + */ + const UNKNOWN_CHANGE = 2; + /** + * The principal had access under the current policies (`GRANTED`), but will + * no longer have access after the proposed changes (`NOT_GRANTED`). + * + * Generated from protobuf enum ACCESS_REVOKED = 3; + */ + const ACCESS_REVOKED = 3; + /** + * The principal did not have access under the current policies + * (`NOT_GRANTED`), but will have access after the proposed changes + * (`GRANTED`). + * + * Generated from protobuf enum ACCESS_GAINED = 4; + */ + const ACCESS_GAINED = 4; + /** + * This result can occur for the following reasons: + * * The principal had access under the current policies (`GRANTED`), but + * their access after the proposed changes is `UNKNOWN`. + * * The principal's access under the current policies is `UNKNOWN`, but + * they + * will not have access after the proposed changes (`NOT_GRANTED`). + * + * Generated from protobuf enum ACCESS_MAYBE_REVOKED = 5; + */ + const ACCESS_MAYBE_REVOKED = 5; + /** + * This result can occur for the following reasons: + * * The principal did not have access under the current policies + * (`NOT_GRANTED`), but their access after the proposed changes is + * `UNKNOWN`. + * * The principal's access under the current policies is `UNKNOWN`, but + * they will have access after the proposed changes (`GRANTED`). + * + * Generated from protobuf enum ACCESS_MAYBE_GAINED = 6; + */ + const ACCESS_MAYBE_GAINED = 6; + + private static $valueToName = [ + self::ACCESS_CHANGE_TYPE_UNSPECIFIED => 'ACCESS_CHANGE_TYPE_UNSPECIFIED', + self::NO_CHANGE => 'NO_CHANGE', + self::UNKNOWN_CHANGE => 'UNKNOWN_CHANGE', + self::ACCESS_REVOKED => 'ACCESS_REVOKED', + self::ACCESS_GAINED => 'ACCESS_GAINED', + self::ACCESS_MAYBE_REVOKED => 'ACCESS_MAYBE_REVOKED', + self::ACCESS_MAYBE_GAINED => 'ACCESS_MAYBE_GAINED', + ]; + + 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(AccessChangeType::class, \Google\Cloud\PolicySimulator\V1\AccessStateDiff_AccessChangeType::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php new file mode 100644 index 00000000000..5aef864d04e --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php @@ -0,0 +1,187 @@ +google.cloud.policysimulator.v1.AccessTuple + */ +class AccessTuple extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $principal = ''; + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $full_resource_name = ''; + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $permission = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $principal + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * @type string $full_resource_name + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type string $permission + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPrincipal() + { + return $this->principal; + } + + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->principal = $var; + + return $this; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPermission() + { + return $this->permission; + } + + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPermission($var) + { + GPBUtil::checkString($var, True); + $this->permission = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php new file mode 100644 index 00000000000..f890be34bae --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php @@ -0,0 +1,398 @@ +google.cloud.policysimulator.v1.BindingExplanation + */ +class BindingExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access = 0; + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + */ + protected $role = ''; + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; + */ + protected $role_permission = 0; + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; + */ + protected $role_permission_relevance = 0; + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * The principal in the replayed access tuple is `user:bob@example.com`. This + * user is a principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + */ + private $memberships; + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; + */ + protected $relevance = 0; + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/docs/conditions-overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + */ + protected $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * @type string $role + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * @type int $role_permission + * Indicates whether the role granted by this binding contains the specified + * permission. + * @type int $role_permission_relevance + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * @type array|\Google\Protobuf\Internal\MapField $memberships + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * The principal in the replayed access tuple is `user:bob@example.com`. This + * user is a principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * @type int $relevance + * The relevance of this binding to the overall determination for the entire + * policy. + * @type \Google\Type\Expr $condition + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/docs/conditions-overview. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAccess() + { + return $this->access; + } + + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); + $this->access = $var; + + return $this; + } + + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; + * @return int + */ + public function getRolePermission() + { + return $this->role_permission; + } + + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; + * @param int $var + * @return $this + */ + public function setRolePermission($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\BindingExplanation\RolePermission::class); + $this->role_permission = $var; + + return $this; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; + * @return int + */ + public function getRolePermissionRelevance() + { + return $this->role_permission_relevance; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; + * @param int $var + * @return $this + */ + public function setRolePermissionRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); + $this->role_permission_relevance = $var; + + return $this; + } + + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * The principal in the replayed access tuple is `user:bob@example.com`. This + * user is a principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * The principal in the replayed access tuple is `user:bob@example.com`. This + * user is a principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\BindingExplanation\AnnotatedMembership::class); + $this->memberships = $arr; + + return $this; + } + + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/docs/conditions-overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/docs/conditions-overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php new file mode 100644 index 00000000000..391223fe840 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php @@ -0,0 +1,108 @@ +google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + */ +class AnnotatedMembership extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; + */ + protected $membership = 0; + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $membership + * Indicates whether the binding includes the principal. + * @type int $relevance + * The relevance of the principal's status to the overall determination for + * the binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; + * @return int + */ + public function getMembership() + { + return $this->membership; + } + + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; + * @param int $var + * @return $this + */ + public function setMembership($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\BindingExplanation\Membership::class); + $this->membership = $var; + + return $this; + } + + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnnotatedMembership::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_AnnotatedMembership::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php new file mode 100644 index 00000000000..c52085900dc --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php @@ -0,0 +1,86 @@ +google.cloud.policysimulator.v1.BindingExplanation.Membership + */ +class Membership +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum MEMBERSHIP_UNSPECIFIED = 0; + */ + const MEMBERSHIP_UNSPECIFIED = 0; + /** + * The binding includes the principal. The principal can be included + * directly or indirectly. For example: + * * A principal is included directly if that principal is listed in the + * binding. + * * A principal is included indirectly if that principal is in a Google + * group or Google Workspace domain that is listed in the binding. + * + * Generated from protobuf enum MEMBERSHIP_INCLUDED = 1; + */ + const MEMBERSHIP_INCLUDED = 1; + /** + * The binding does not include the principal. + * + * Generated from protobuf enum MEMBERSHIP_NOT_INCLUDED = 2; + */ + const MEMBERSHIP_NOT_INCLUDED = 2; + /** + * The user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] is not + * allowed to access the binding. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + */ + const MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + /** + * The principal is an unsupported type. Only Google Accounts and service + * accounts are supported. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + */ + const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + + private static $valueToName = [ + self::MEMBERSHIP_UNSPECIFIED => 'MEMBERSHIP_UNSPECIFIED', + self::MEMBERSHIP_INCLUDED => 'MEMBERSHIP_INCLUDED', + self::MEMBERSHIP_NOT_INCLUDED => 'MEMBERSHIP_NOT_INCLUDED', + self::MEMBERSHIP_UNKNOWN_INFO_DENIED => 'MEMBERSHIP_UNKNOWN_INFO_DENIED', + self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', + ]; + + 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(Membership::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_Membership::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php new file mode 100644 index 00000000000..da2637968e1 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php @@ -0,0 +1,73 @@ +google.cloud.policysimulator.v1.BindingExplanation.RolePermission + */ +class RolePermission +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ROLE_PERMISSION_UNSPECIFIED = 0; + */ + const ROLE_PERMISSION_UNSPECIFIED = 0; + /** + * The permission is included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; + */ + const ROLE_PERMISSION_INCLUDED = 1; + /** + * The permission is not included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; + */ + const ROLE_PERMISSION_NOT_INCLUDED = 2; + /** + * The user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] is not + * allowed to access the binding. + * + * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + */ + const ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + + private static $valueToName = [ + self::ROLE_PERMISSION_UNSPECIFIED => 'ROLE_PERMISSION_UNSPECIFIED', + self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', + self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', + self::ROLE_PERMISSION_UNKNOWN_INFO_DENIED => 'ROLE_PERMISSION_UNKNOWN_INFO_DENIED', + ]; + + 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(RolePermission::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_RolePermission::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php new file mode 100644 index 00000000000..a79ba5da359 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php @@ -0,0 +1,148 @@ +google.cloud.policysimulator.v1.CreateReplayRequest + */ +class CreateReplayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this + * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + * resource must be a project, folder, or organization with a location. + * Example: `projects/my-example-project/locations/global` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + * Set `Replay.ReplayConfig` to configure the replay. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $replay = null; + + /** + * @param string $parent Required. The parent resource where this + * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + * resource must be a project, folder, or organization with a location. + * + * Example: `projects/my-example-project/locations/global` + * @param \Google\Cloud\PolicySimulator\V1\Replay $replay Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + * Set `Replay.ReplayConfig` to configure the replay. + * + * @return \Google\Cloud\PolicySimulator\V1\CreateReplayRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\PolicySimulator\V1\Replay $replay): self + { + return (new self()) + ->setParent($parent) + ->setReplay($replay); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this + * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + * resource must be a project, folder, or organization with a location. + * Example: `projects/my-example-project/locations/global` + * @type \Google\Cloud\PolicySimulator\V1\Replay $replay + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + * Set `Replay.ReplayConfig` to configure the replay. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this + * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + * resource must be a project, folder, or organization with a location. + * Example: `projects/my-example-project/locations/global` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this + * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + * resource must be a project, folder, or organization with a location. + * Example: `projects/my-example-project/locations/global` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + * Set `Replay.ReplayConfig` to configure the replay. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PolicySimulator\V1\Replay|null + */ + public function getReplay() + { + return $this->replay; + } + + public function hasReplay() + { + return isset($this->replay); + } + + public function clearReplay() + { + unset($this->replay); + } + + /** + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + * Set `Replay.ReplayConfig` to configure the replay. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PolicySimulator\V1\Replay $var + * @return $this + */ + public function setReplay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\Replay::class); + $this->replay = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php new file mode 100644 index 00000000000..b6d9b5875a4 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php @@ -0,0 +1,170 @@ +google.cloud.policysimulator.v1.ExplainedAccess + */ +class ExplainedAccess extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the principal in the access tuple has permission to access the + * resource in the access tuple under the given policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; + */ + protected $access_state = 0; + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains the policies that led to that result. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; + */ + private $policies; + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains a list of errors explaining why the result + * is `UNKNOWN`. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access_state + * Whether the principal in the access tuple has permission to access the + * resource in the access tuple under the given policies. + * @type array<\Google\Cloud\PolicySimulator\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $policies + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains the policies that led to that result. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains a list of errors explaining why the result + * is `UNKNOWN`. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Whether the principal in the access tuple has permission to access the + * resource in the access tuple under the given policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; + * @return int + */ + public function getAccessState() + { + return $this->access_state; + } + + /** + * Whether the principal in the access tuple has permission to access the + * resource in the access tuple under the given policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; + * @param int $var + * @return $this + */ + public function setAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); + $this->access_state = $var; + + return $this; + } + + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains the policies that led to that result. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicies() + { + return $this->policies; + } + + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains the policies that led to that result. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; + * @param array<\Google\Cloud\PolicySimulator\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\ExplainedPolicy::class); + $this->policies = $arr; + + return $this; + } + + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains a list of errors explaining why the result + * is `UNKNOWN`. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + * `UNKNOWN`, this field contains a list of errors explaining why the result + * is `UNKNOWN`. + * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + * omitted. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php new file mode 100644 index 00000000000..1d8b50692bb --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php @@ -0,0 +1,306 @@ +google.cloud.policysimulator.v1.ExplainedPolicy + */ +class ExplainedPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; + */ + protected $access = 0; + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + */ + protected $full_resource_name = ''; + /** + * The IAM policy attached to the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + */ + protected $policy = null; + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; + */ + private $binding_explanations; + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * @type string $full_resource_name + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM policy attached to the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is empty. + * @type array<\Google\Cloud\PolicySimulator\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * @type int $relevance + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; + * @return int + */ + public function getAccess() + { + return $this->access; + } + + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; + * @param int $var + * @return $this + */ + public function setAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); + $this->access = $var; + + return $this; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The IAM policy attached to the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM policy attached to the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindingExplanations() + { + return $this->binding_explanations; + } + + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; + * @param array<\Google\Cloud\PolicySimulator\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindingExplanations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\BindingExplanation::class); + $this->binding_explanations = $arr; + + return $this; + } + + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the user who created the + * [Replay][google.cloud.policysimulator.v1.Replay] does not have + * access to the policy, this field is omitted. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php new file mode 100644 index 00000000000..937f3292e65 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php @@ -0,0 +1,114 @@ +google.cloud.policysimulator.v1.GetReplayRequest + */ +class GetReplayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] + * to retrieve, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] + * to retrieve, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * Please see {@see SimulatorClient::replayName()} for help formatting this field. + * + * @return \Google\Cloud\PolicySimulator\V1\GetReplayRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] + * to retrieve, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] + * to retrieve, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * 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 name of the [Replay][google.cloud.policysimulator.v1.Replay] + * to retrieve, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * 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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php new file mode 100644 index 00000000000..fe3763179c9 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php @@ -0,0 +1,65 @@ +google.cloud.policysimulator.v1.HeuristicRelevance + */ +class HeuristicRelevance +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + */ + const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + /** + * The data point has a limited effect on the result. Changing the data point + * is unlikely to affect the overall determination. + * + * Generated from protobuf enum NORMAL = 1; + */ + const NORMAL = 1; + /** + * The data point has a strong effect on the result. Changing the data point + * is likely to affect the overall determination. + * + * Generated from protobuf enum HIGH = 2; + */ + const HIGH = 2; + + private static $valueToName = [ + self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', + self::NORMAL => 'NORMAL', + self::HIGH => 'HIGH', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php new file mode 100644 index 00000000000..9a5d990a78f --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php @@ -0,0 +1,204 @@ +google.cloud.policysimulator.v1.ListReplayResultsRequest + */ +class ListReplayResultsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous + * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose + * results are listed, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * Please see {@see SimulatorClient::replayName()} for help formatting this field. + * + * @return \Google\Cloud\PolicySimulator\V1\ListReplayResultsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @type int $page_size + * The maximum number of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * @type string $page_token + * A page token, received from a previous + * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] must match the call that provided the page + * token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * 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 [Replay][google.cloud.policysimulator.v1.Replay] whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * 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; + } + + /** + * The maximum number of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous + * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous + * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3; + * @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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php new file mode 100644 index 00000000000..8dc33e2d81a --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php @@ -0,0 +1,110 @@ +google.cloud.policysimulator.v1.ListReplayResultsResponse + */ +class ListReplayResultsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; + */ + private $replay_results; + /** + * A token that you can use to retrieve the next page of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If + * this field is omitted, there are no subsequent pages. + * + * 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\PolicySimulator\V1\ReplayResult>|\Google\Protobuf\Internal\RepeatedField $replay_results + * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. + * @type string $next_page_token + * A token that you can use to retrieve the next page of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If + * this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplayResults() + { + return $this->replay_results; + } + + /** + * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; + * @param array<\Google\Cloud\PolicySimulator\V1\ReplayResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplayResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\ReplayResult::class); + $this->replay_results = $arr; + + return $this; + } + + /** + * A token that you can use to retrieve the next page of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If + * this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that you can use to retrieve the next page of + * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If + * this field is omitted, there are no subsequent pages. + * + * 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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php new file mode 100644 index 00000000000..5c085465e5a --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php @@ -0,0 +1,213 @@ +google.cloud.policysimulator.v1.Replay + */ +class Replay extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the `Replay`, which has the following + * format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the Replay. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The current state of the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The configuration used for the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $config = null; + /** + * Output only. Summary statistics about the replayed log entries. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $results_summary = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the `Replay`, which has the following + * format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the Replay. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @type int $state + * Output only. The current state of the `Replay`. + * @type \Google\Cloud\PolicySimulator\V1\ReplayConfig $config + * Required. The configuration used for the `Replay`. + * @type \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $results_summary + * Output only. Summary statistics about the replayed log entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the `Replay`, which has the following + * format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the Replay. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the `Replay`, which has the following + * format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the Replay. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The current state of the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\Replay\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The configuration used for the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PolicySimulator\V1\ReplayConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. The configuration used for the `Replay`. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PolicySimulator\V1\ReplayConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ReplayConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Output only. Summary statistics about the replayed log entries. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary|null + */ + public function getResultsSummary() + { + return $this->results_summary; + } + + public function hasResultsSummary() + { + return isset($this->results_summary); + } + + public function clearResultsSummary() + { + unset($this->results_summary); + } + + /** + * Output only. Summary statistics about the replayed log entries. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $var + * @return $this + */ + public function setResultsSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary::class); + $this->results_summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php new file mode 100644 index 00000000000..be8edbe1c4f --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php @@ -0,0 +1,268 @@ +google.cloud.policysimulator.v1.Replay.ResultsSummary + */ +class ResultsSummary extends \Google\Protobuf\Internal\Message +{ + /** + * The total number of log entries replayed. + * + * Generated from protobuf field int32 log_count = 1; + */ + protected $log_count = 0; + /** + * The number of replayed log entries with no difference between + * baseline and simulated policies. + * + * Generated from protobuf field int32 unchanged_count = 2; + */ + protected $unchanged_count = 0; + /** + * The number of replayed log entries with a difference between baseline and + * simulated policies. + * + * Generated from protobuf field int32 difference_count = 3; + */ + protected $difference_count = 0; + /** + * The number of log entries that could not be replayed. + * + * Generated from protobuf field int32 error_count = 4; + */ + protected $error_count = 0; + /** + * The date of the oldest log entry replayed. + * + * Generated from protobuf field .google.type.Date oldest_date = 5; + */ + protected $oldest_date = null; + /** + * The date of the newest log entry replayed. + * + * Generated from protobuf field .google.type.Date newest_date = 6; + */ + protected $newest_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $log_count + * The total number of log entries replayed. + * @type int $unchanged_count + * The number of replayed log entries with no difference between + * baseline and simulated policies. + * @type int $difference_count + * The number of replayed log entries with a difference between baseline and + * simulated policies. + * @type int $error_count + * The number of log entries that could not be replayed. + * @type \Google\Type\Date $oldest_date + * The date of the oldest log entry replayed. + * @type \Google\Type\Date $newest_date + * The date of the newest log entry replayed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * The total number of log entries replayed. + * + * Generated from protobuf field int32 log_count = 1; + * @return int + */ + public function getLogCount() + { + return $this->log_count; + } + + /** + * The total number of log entries replayed. + * + * Generated from protobuf field int32 log_count = 1; + * @param int $var + * @return $this + */ + public function setLogCount($var) + { + GPBUtil::checkInt32($var); + $this->log_count = $var; + + return $this; + } + + /** + * The number of replayed log entries with no difference between + * baseline and simulated policies. + * + * Generated from protobuf field int32 unchanged_count = 2; + * @return int + */ + public function getUnchangedCount() + { + return $this->unchanged_count; + } + + /** + * The number of replayed log entries with no difference between + * baseline and simulated policies. + * + * Generated from protobuf field int32 unchanged_count = 2; + * @param int $var + * @return $this + */ + public function setUnchangedCount($var) + { + GPBUtil::checkInt32($var); + $this->unchanged_count = $var; + + return $this; + } + + /** + * The number of replayed log entries with a difference between baseline and + * simulated policies. + * + * Generated from protobuf field int32 difference_count = 3; + * @return int + */ + public function getDifferenceCount() + { + return $this->difference_count; + } + + /** + * The number of replayed log entries with a difference between baseline and + * simulated policies. + * + * Generated from protobuf field int32 difference_count = 3; + * @param int $var + * @return $this + */ + public function setDifferenceCount($var) + { + GPBUtil::checkInt32($var); + $this->difference_count = $var; + + return $this; + } + + /** + * The number of log entries that could not be replayed. + * + * Generated from protobuf field int32 error_count = 4; + * @return int + */ + public function getErrorCount() + { + return $this->error_count; + } + + /** + * The number of log entries that could not be replayed. + * + * Generated from protobuf field int32 error_count = 4; + * @param int $var + * @return $this + */ + public function setErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->error_count = $var; + + return $this; + } + + /** + * The date of the oldest log entry replayed. + * + * Generated from protobuf field .google.type.Date oldest_date = 5; + * @return \Google\Type\Date|null + */ + public function getOldestDate() + { + return $this->oldest_date; + } + + public function hasOldestDate() + { + return isset($this->oldest_date); + } + + public function clearOldestDate() + { + unset($this->oldest_date); + } + + /** + * The date of the oldest log entry replayed. + * + * Generated from protobuf field .google.type.Date oldest_date = 5; + * @param \Google\Type\Date $var + * @return $this + */ + public function setOldestDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->oldest_date = $var; + + return $this; + } + + /** + * The date of the newest log entry replayed. + * + * Generated from protobuf field .google.type.Date newest_date = 6; + * @return \Google\Type\Date|null + */ + public function getNewestDate() + { + return $this->newest_date; + } + + public function hasNewestDate() + { + return isset($this->newest_date); + } + + public function clearNewestDate() + { + unset($this->newest_date); + } + + /** + * The date of the newest log entry replayed. + * + * Generated from protobuf field .google.type.Date newest_date = 6; + * @param \Google\Type\Date $var + * @return $this + */ + public function setNewestDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->newest_date = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResultsSummary::class, \Google\Cloud\PolicySimulator\V1\Replay_ResultsSummary::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php new file mode 100644 index 00000000000..0f54e3e57a2 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php @@ -0,0 +1,78 @@ +google.cloud.policysimulator.v1.Replay.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The `Replay` has not started yet. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The `Replay` is currently running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The `Replay` has successfully completed. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The `Replay` has finished with an error. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + 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(State::class, \Google\Cloud\PolicySimulator\V1\Replay_State::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php new file mode 100644 index 00000000000..585dca643c3 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php @@ -0,0 +1,146 @@ +google.cloud.policysimulator.v1.ReplayConfig + */ +class ReplayConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A mapping of the resources that you want to simulate policies for and the + * policies that you want to simulate. + * Keys are the full resource names for the resources. For example, + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * Values are [Policy][google.iam.v1.Policy] objects representing the policies + * that you want to simulate. + * Replays automatically take into account any IAM policies inherited through + * the resource hierarchy, and any policies set on descendant resources. You + * do not need to include these policies in the policy overlay. + * + * Generated from protobuf field map policy_overlay = 1; + */ + private $policy_overlay; + /** + * The logs to use as input for the + * [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; + */ + protected $log_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $policy_overlay + * A mapping of the resources that you want to simulate policies for and the + * policies that you want to simulate. + * Keys are the full resource names for the resources. For example, + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * Values are [Policy][google.iam.v1.Policy] objects representing the policies + * that you want to simulate. + * Replays automatically take into account any IAM policies inherited through + * the resource hierarchy, and any policies set on descendant resources. You + * do not need to include these policies in the policy overlay. + * @type int $log_source + * The logs to use as input for the + * [Replay][google.cloud.policysimulator.v1.Replay]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * A mapping of the resources that you want to simulate policies for and the + * policies that you want to simulate. + * Keys are the full resource names for the resources. For example, + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * Values are [Policy][google.iam.v1.Policy] objects representing the policies + * that you want to simulate. + * Replays automatically take into account any IAM policies inherited through + * the resource hierarchy, and any policies set on descendant resources. You + * do not need to include these policies in the policy overlay. + * + * Generated from protobuf field map policy_overlay = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPolicyOverlay() + { + return $this->policy_overlay; + } + + /** + * A mapping of the resources that you want to simulate policies for and the + * policies that you want to simulate. + * Keys are the full resource names for the resources. For example, + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * Values are [Policy][google.iam.v1.Policy] objects representing the policies + * that you want to simulate. + * Replays automatically take into account any IAM policies inherited through + * the resource hierarchy, and any policies set on descendant resources. You + * do not need to include these policies in the policy overlay. + * + * Generated from protobuf field map policy_overlay = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPolicyOverlay($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\Policy::class); + $this->policy_overlay = $arr; + + return $this; + } + + /** + * The logs to use as input for the + * [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; + * @return int + */ + public function getLogSource() + { + return $this->log_source; + } + + /** + * The logs to use as input for the + * [Replay][google.cloud.policysimulator.v1.Replay]. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; + * @param int $var + * @return $this + */ + public function setLogSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\ReplayConfig\LogSource::class); + $this->log_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php new file mode 100644 index 00000000000..c7ae9891172 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php @@ -0,0 +1,62 @@ +google.cloud.policysimulator.v1.ReplayConfig.LogSource + */ +class LogSource +{ + /** + * An unspecified log source. + * If the log source is unspecified, the + * [Replay][google.cloud.policysimulator.v1.Replay] defaults to using + * `RECENT_ACCESSES`. + * + * Generated from protobuf enum LOG_SOURCE_UNSPECIFIED = 0; + */ + const LOG_SOURCE_UNSPECIFIED = 0; + /** + * All access logs from the last 90 days. These logs may not include logs + * from the most recent 7 days. + * + * Generated from protobuf enum RECENT_ACCESSES = 1; + */ + const RECENT_ACCESSES = 1; + + private static $valueToName = [ + self::LOG_SOURCE_UNSPECIFIED => 'LOG_SOURCE_UNSPECIFIED', + self::RECENT_ACCESSES => 'RECENT_ACCESSES', + ]; + + 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(LogSource::class, \Google\Cloud\PolicySimulator\V1\ReplayConfig_LogSource::class); + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php new file mode 100644 index 00000000000..c8a1f84c59d --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php @@ -0,0 +1,96 @@ +google.cloud.policysimulator.v1.ReplayDiff + */ +class ReplayDiff extends \Google\Protobuf\Internal\Message +{ + /** + * A summary and comparison of the principal's access under the current + * (baseline) policies and the proposed (simulated) policies for a single + * access tuple. + * The evaluation of the principal's access is reported in the + * [AccessState][google.cloud.policysimulator.v1.AccessState] field. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; + */ + protected $access_diff = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicySimulator\V1\AccessStateDiff $access_diff + * A summary and comparison of the principal's access under the current + * (baseline) policies and the proposed (simulated) policies for a single + * access tuple. + * The evaluation of the principal's access is reported in the + * [AccessState][google.cloud.policysimulator.v1.AccessState] field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * A summary and comparison of the principal's access under the current + * (baseline) policies and the proposed (simulated) policies for a single + * access tuple. + * The evaluation of the principal's access is reported in the + * [AccessState][google.cloud.policysimulator.v1.AccessState] field. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; + * @return \Google\Cloud\PolicySimulator\V1\AccessStateDiff|null + */ + public function getAccessDiff() + { + return $this->access_diff; + } + + public function hasAccessDiff() + { + return isset($this->access_diff); + } + + public function clearAccessDiff() + { + unset($this->access_diff); + } + + /** + * A summary and comparison of the principal's access under the current + * (baseline) policies and the proposed (simulated) policies for a single + * access tuple. + * The evaluation of the principal's access is reported in the + * [AccessState][google.cloud.policysimulator.v1.AccessState] field. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; + * @param \Google\Cloud\PolicySimulator\V1\AccessStateDiff $var + * @return $this + */ + public function setAccessDiff($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\AccessStateDiff::class); + $this->access_diff = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php new file mode 100644 index 00000000000..f1f319951f5 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.policysimulator.v1.ReplayOperationMetadata + */ +class ReplayOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php new file mode 100644 index 00000000000..ce63810c6cf --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php @@ -0,0 +1,317 @@ +google.cloud.policysimulator.v1.ReplayResult + */ +class ReplayResult extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the `ReplayResult`, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple + * was included in. + * + * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The access tuple that was replayed. This field includes information about + * the principal, resource, and permission that were involved in the access + * attempt. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; + */ + protected $access_tuple = null; + /** + * The latest date this access tuple was seen in the logs. + * + * Generated from protobuf field .google.type.Date last_seen_date = 4; + */ + protected $last_seen_date = null; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicySimulator\V1\ReplayDiff $diff + * The difference between the principal's access under the current + * (baseline) policies and the principal's access under the proposed + * (simulated) policies. + * This field is only included for access tuples that were successfully + * replayed and had different results under the current policies and the + * proposed policies. + * @type \Google\Rpc\Status $error + * The error that caused the access tuple replay to fail. + * This field is only included for access tuples that were not replayed + * successfully. + * @type string $name + * The resource name of the `ReplayResult`, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` + * @type string $parent + * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple + * was included in. + * @type \Google\Cloud\PolicySimulator\V1\AccessTuple $access_tuple + * The access tuple that was replayed. This field includes information about + * the principal, resource, and permission that were involved in the access + * attempt. + * @type \Google\Type\Date $last_seen_date + * The latest date this access tuple was seen in the logs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); + parent::__construct($data); + } + + /** + * The difference between the principal's access under the current + * (baseline) policies and the principal's access under the proposed + * (simulated) policies. + * This field is only included for access tuples that were successfully + * replayed and had different results under the current policies and the + * proposed policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayDiff diff = 5; + * @return \Google\Cloud\PolicySimulator\V1\ReplayDiff|null + */ + public function getDiff() + { + return $this->readOneof(5); + } + + public function hasDiff() + { + return $this->hasOneof(5); + } + + /** + * The difference between the principal's access under the current + * (baseline) policies and the principal's access under the proposed + * (simulated) policies. + * This field is only included for access tuples that were successfully + * replayed and had different results under the current policies and the + * proposed policies. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayDiff diff = 5; + * @param \Google\Cloud\PolicySimulator\V1\ReplayDiff $var + * @return $this + */ + public function setDiff($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ReplayDiff::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The error that caused the access tuple replay to fail. + * This field is only included for access tuples that were not replayed + * successfully. + * + * Generated from protobuf field .google.rpc.Status error = 6; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(6); + } + + public function hasError() + { + return $this->hasOneof(6); + } + + /** + * The error that caused the access tuple replay to fail. + * This field is only included for access tuples that were not replayed + * successfully. + * + * Generated from protobuf field .google.rpc.Status error = 6; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The resource name of the `ReplayResult`, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the `ReplayResult`, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple + * was included in. + * + * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple + * was included in. + * + * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The access tuple that was replayed. This field includes information about + * the principal, resource, and permission that were involved in the access + * attempt. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; + * @return \Google\Cloud\PolicySimulator\V1\AccessTuple|null + */ + public function getAccessTuple() + { + return $this->access_tuple; + } + + public function hasAccessTuple() + { + return isset($this->access_tuple); + } + + public function clearAccessTuple() + { + unset($this->access_tuple); + } + + /** + * The access tuple that was replayed. This field includes information about + * the principal, resource, and permission that were involved in the access + * attempt. + * + * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; + * @param \Google\Cloud\PolicySimulator\V1\AccessTuple $var + * @return $this + */ + public function setAccessTuple($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\AccessTuple::class); + $this->access_tuple = $var; + + return $this; + } + + /** + * The latest date this access tuple was seen in the logs. + * + * Generated from protobuf field .google.type.Date last_seen_date = 4; + * @return \Google\Type\Date|null + */ + public function getLastSeenDate() + { + return $this->last_seen_date; + } + + public function hasLastSeenDate() + { + return isset($this->last_seen_date); + } + + public function clearLastSeenDate() + { + unset($this->last_seen_date); + } + + /** + * The latest date this access tuple was seen in the logs. + * + * Generated from protobuf field .google.type.Date last_seen_date = 4; + * @param \Google\Type\Date $var + * @return $this + */ + public function setLastSeenDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->last_seen_date = $var; + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php new file mode 100644 index 00000000000..6dba7758282 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php @@ -0,0 +1,92 @@ +setConfig($replayConfig); + $request = (new CreateReplayRequest()) + ->setParent($parent) + ->setReplay($replay); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $simulatorClient->createReplay($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Replay $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + create_replay_sample($parent); +} +// [END policysimulator_v1_generated_Simulator_CreateReplay_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php new file mode 100644 index 00000000000..0080ee90254 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Replay $response */ + $response = $simulatorClient->getReplay($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SimulatorClient::replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + + get_replay_sample($formattedName); +} +// [END policysimulator_v1_generated_Simulator_GetReplay_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php new file mode 100644 index 00000000000..5f4def94350 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $simulatorClient->listReplayResults($request); + + /** @var ReplayResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SimulatorClient::replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + + list_replay_results_sample($formattedParent); +} +// [END policysimulator_v1_generated_Simulator_ListReplayResults_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php b/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php new file mode 100644 index 00000000000..29c2f0b78e5 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php @@ -0,0 +1,428 @@ + createReplayAsync(CreateReplayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getReplayAsync(GetReplayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listReplayResultsAsync(ListReplayResultsRequest $request, array $optionalArgs = []) + */ +final class SimulatorClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.policysimulator.v1.Simulator'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'policysimulator.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'policysimulator.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/simulator_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/simulator_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/simulator_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/simulator_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_replay resource. + * + * @param string $folder + * @param string $location + * @param string $replay + * + * @return string The formatted folder_location_replay resource. + */ + public static function folderLocationReplayName(string $folder, string $location, string $replay): string + { + return self::getPathTemplate('folderLocationReplay')->render([ + 'folder' => $folder, + 'location' => $location, + 'replay' => $replay, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_replay resource. + * + * @param string $organization + * @param string $location + * @param string $replay + * + * @return string The formatted organization_location_replay resource. + */ + public static function organizationLocationReplayName(string $organization, string $location, string $replay): string + { + return self::getPathTemplate('organizationLocationReplay')->render([ + 'organization' => $organization, + 'location' => $location, + 'replay' => $replay, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_replay resource. + * + * @param string $project + * @param string $location + * @param string $replay + * + * @return string The formatted project_location_replay resource. + */ + public static function projectLocationReplayName(string $project, string $location, string $replay): string + { + return self::getPathTemplate('projectLocationReplay')->render([ + 'project' => $project, + 'location' => $location, + 'replay' => $replay, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a replay + * resource. + * + * @param string $project + * @param string $location + * @param string $replay + * + * @return string The formatted replay resource. + */ + public static function replayName(string $project, string $location, string $replay): string + { + return self::getPathTemplate('replay')->render([ + 'project' => $project, + 'location' => $location, + 'replay' => $replay, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderLocationReplay: folders/{folder}/locations/{location}/replays/{replay} + * - organizationLocationReplay: organizations/{organization}/locations/{location}/replays/{replay} + * - projectLocationReplay: projects/{project}/locations/{location}/replays/{replay} + * - replay: projects/{project}/locations/{location}/replays/{replay} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'policysimulator.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using + * the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig]. + * + * The async variant is {@see SimulatorClient::createReplayAsync()} . + * + * @example samples/V1/SimulatorClient/create_replay.php + * + * @param CreateReplayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createReplay(CreateReplayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateReplay', $request, $callOptions)->wait(); + } + + /** + * Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each + * `Replay` is available for at least 7 days. + * + * The async variant is {@see SimulatorClient::getReplayAsync()} . + * + * @example samples/V1/SimulatorClient/get_replay.php + * + * @param GetReplayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Replay + * + * @throws ApiException Thrown if the API call fails. + */ + public function getReplay(GetReplayRequest $request, array $callOptions = []): Replay + { + return $this->startApiCall('GetReplay', $request, $callOptions)->wait(); + } + + /** + * Lists the results of running a + * [Replay][google.cloud.policysimulator.v1.Replay]. + * + * The async variant is {@see SimulatorClient::listReplayResultsAsync()} . + * + * @example samples/V1/SimulatorClient/list_replay_results.php + * + * @param ListReplayResultsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listReplayResults(ListReplayResultsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReplayResults', $request, $callOptions); + } +} diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..7916061cffd --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.policysimulator.v1", + "libraryPackage": "Google\\Cloud\\PolicySimulator\\V1", + "services": { + "Simulator": { + "clients": { + "grpc": { + "libraryClient": "SimulatorGapicClient", + "rpcs": { + "CreateReplay": { + "methods": [ + "createReplay" + ] + }, + "GetReplay": { + "methods": [ + "getReplay" + ] + }, + "ListReplayResults": { + "methods": [ + "listReplayResults" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json new file mode 100644 index 00000000000..344f797062a --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.policysimulator.v1.Simulator": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateReplay": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetReplay": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListReplayResults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php new file mode 100644 index 00000000000..81964f7d8a9 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php @@ -0,0 +1,85 @@ + [ + 'google.cloud.policysimulator.v1.Simulator' => [ + 'CreateReplay' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\PolicySimulator\V1\Replay', + 'metadataReturnType' => '\Google\Cloud\PolicySimulator\V1\ReplayOperationMetadata', + 'initialPollDelayMillis' => '1000', + 'pollDelayMultiplier' => '2.0', + 'maxPollDelayMillis' => '10000', + 'totalPollTimeoutMillis' => '18000000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetReplay' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PolicySimulator\V1\Replay', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListReplayResults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReplayResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PolicySimulator\V1\ListReplayResultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'folderLocationReplay' => 'folders/{folder}/locations/{location}/replays/{replay}', + 'organizationLocationReplay' => 'organizations/{organization}/locations/{location}/replays/{replay}', + 'projectLocationReplay' => 'projects/{project}/locations/{location}/replays/{replay}', + 'replay' => 'projects/{project}/locations/{location}/replays/{replay}', + ], + ], + ], +]; diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php new file mode 100644 index 00000000000..351a9fd85c3 --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php @@ -0,0 +1,147 @@ + [ + 'google.cloud.policysimulator.v1.Simulator' => [ + 'CreateReplay' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/replays', + 'body' => 'replay', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/replays', + 'body' => 'replay', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/replays', + 'body' => 'replay', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetReplay' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListReplayResults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/replays/*}/results', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/replays/*}/results', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/replays/*}/results', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=operations/**}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*/operations/**}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*/operations/**}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*/operations/**}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=operations}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*/operations}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*/operations}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*/operations}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php b/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php new file mode 100644 index 00000000000..0efe061cf5a --- /dev/null +++ b/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php @@ -0,0 +1,412 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SimulatorClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SimulatorClient($options); + } + + /** @test */ + public function createReplayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createReplayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Replay(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createReplayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $replay = new Replay(); + $replayConfig = new ReplayConfig(); + $replay->setConfig($replayConfig); + $request = (new CreateReplayRequest()) + ->setParent($parent) + ->setReplay($replay); + $response = $gapicClient->createReplay($request); + $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.policysimulator.v1.Simulator/CreateReplay', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getReplay(); + $this->assertProtobufEquals($replay, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReplayTest'); + $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 createReplayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createReplayTest'); + $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 + $parent = 'parent-995424086'; + $replay = new Replay(); + $replayConfig = new ReplayConfig(); + $replay->setConfig($replayConfig); + $request = (new CreateReplayRequest()) + ->setParent($parent) + ->setReplay($replay); + $response = $gapicClient->createReplay($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReplayTest'); + 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 getReplayTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Replay(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + $request = (new GetReplayRequest()) + ->setName($formattedName); + $response = $gapicClient->getReplay($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policysimulator.v1.Simulator/GetReplay', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReplayExceptionTest() + { + $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->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + $request = (new GetReplayRequest()) + ->setName($formattedName); + try { + $gapicClient->getReplay($request); + // 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 listReplayResultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $replayResultsElement = new ReplayResult(); + $replayResults = [ + $replayResultsElement, + ]; + $expectedResponse = new ListReplayResultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReplayResults($replayResults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + $request = (new ListReplayResultsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listReplayResults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReplayResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policysimulator.v1.Simulator/ListReplayResults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReplayResultsExceptionTest() + { + $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->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); + $request = (new ListReplayResultsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listReplayResults($request); + // 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 createReplayAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createReplayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Replay(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createReplayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $replay = new Replay(); + $replayConfig = new ReplayConfig(); + $replay->setConfig($replayConfig); + $request = (new CreateReplayRequest()) + ->setParent($parent) + ->setReplay($replay); + $response = $gapicClient->createReplayAsync($request)->wait(); + $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.policysimulator.v1.Simulator/CreateReplay', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getReplay(); + $this->assertProtobufEquals($replay, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReplayTest'); + $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()); + } +} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php new file mode 100644 index 0000000000000000000000000000000000000000..7f0b079eb6100f908df246f5dc29f558b7f4c746 GIT binary patch literal 1904 zcmbtVL2DC16gDXo8AV}HtfAtV2AYc9B^57Qt0ZX+In>4)D#${aOeV?TW@nt4ZLQLa ze?jm+=#LP*_NXWCp8N$Kot@dF(XNuxaa{A&a{nXCcK$ zO0c*S5;6zU>{f`&l~>IqWN%0LSCD(e8? z5J?H^77@GwP(NJ9qZmqslzx?{+@}#$6ovG)u5APMP$-G^J!{*GBdjQkVB)Y7VNza! z7BjIeai+Q0fTP@62|b#cpc(1PA`}LjL}Ed?Vxpx@eZNoCnAGG?c_j^-z|kHo+Z=uW zOp+T=iI_}Ahfoj|i)h{Cod6tmv%Fgvqj zJ)|U3(+At-IC!cf#eYfAv}5%FP06ozyJM~&X_c18>?B+*gHPwd+U)XlO4i3Ul6JEs z?H*JLizzbV)I+BPS&0{}O`KxG!XF2MV=s|HEbT$D4;I@K_oj)4_6qEhmobsbX@H9e zVM8xD>JF6R()YZ>!^1SQ(V>T8HLxRkRX0WTm>AaH=RsLJPE|zha!*&9ITp{vWPf_K)lfB($oKITgevl3jh5?rf;$(HDivR647nFZHArjzQ0##o$Jh-Wp#IXJXG%30X;F#lM767#w<6McCa3U HV*q{ulJS|) literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php new file mode 100644 index 0000000000000000000000000000000000000000..8a2887fdcf49263acb3e40891bfa8fb0e2d7aa5b GIT binary patch literal 2901 zcmbtW-EQMV6vj!mOHWX@%t9NoD>|DNHM;^=2^Xwf3d)b0THDxBl6EDqFpe{6M>w`M zb}GuM5)yC018~7Bz!UHQTyu$d3dVMvzow|Py-Gc2zVn@LzB6+^|I$16U>i4xLzo$m zKJH!O;GAHOxq)lBHtvlE1H!Q74n1lUCSqLIu&Q;jTvxi!_*UN?F^fp}%yrLfvS-=u zsK4jAHnlDT=8k$c@y}g1AZ+iVv`4=8Y|}9V>N>s{59W^bWB^X6W?Og3tZOXp^|h) zf{DE0m*Vqr+7ONoa53g6N!Lgo;DC+DY<7$p2}aD>k9dawSCe1*68S0~)ekAL`&Dvo zUQm}w(zL26$g-`9Iph+LrN8~Q?xja`ejYbuisbv`3py67((g~SIpqE-PO1rO+l9Z^ z;j=p$3+==k#mJH3GDnIRrF?!2Pt9Ry&^Ro%W`1M57Vw%v>$3QJ!GLVVvWV|@N1jd4 z2CRCFIu`XzJ11bFxLQsBRY{>OK!cHO8;ry~VuVi5rKSO!03KmO>igVox%6bA@Oug# zMV_V(>Br_r6<9H&q*02sa!I^RePT?s!`pzM{LO^WN3ast9`VSQ-%sGVFkB~b%;FT@ z>rtmqoil?AGU?@92B(YJ^2=n?e`+pPV}z)}_%cARV3iS@T$sGyau2u?YqteEA|pn9 z-sJ6Mf8nQ9KudBQ-dn-=T;G8VbM5g-qHp0*_@A+Gl56G0UBwXF9IrJo2KpL4SjfOF zm1vc@pH}D_$PUS{N0@(3J)cV-o}+SS>dh&Z>;&v`{$N+`Np=TTEtk75yqsWCHc+R|Gf8WEr`5y&XpJMy5 zidjg1M=s;bh5O;bg=vps17^#|cP?RxNK)#hQ21GZwFM7u!IQRjEE_Gk-BdaqMN^Fv zwbPPo%Aq3H*WW@Nj3pJfz6qP1u6yjaAt8S3A8+hOLEd` zY3(j2ntAaic_!l9mn&4M)#Ogc=yWSxd4Xyc9yZz)HQXtnN01FUB_C3V7n1O(X)2$* z_yJUo*VD5Lvnpj?Xn?NYjA$FSj^vZJ(&;KSqb(oHrxmrfNCjX;)!I#tFQB&}bEGtm z)>G9#g|Boy?vmu;aff?n?($jB^yuU@ogV|e-hTYhEPnnqwbO`(KCu=Ked8CWJ2yj$ zr=>rVFnv56jz^UFK%LJn|D^QY7*UcUNJ)xcvH4I*IxY29qG9yY-O2p%aXfp?jA}QI NX;EZ6OkKehz`xaKuTKB~ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php new file mode 100644 index 00000000000..38a94c21d6a --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php @@ -0,0 +1,77 @@ +google.cloud.policytroubleshooter.v1.AccessState + */ +class AccessState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_STATE_UNSPECIFIED = 0; + */ + const ACCESS_STATE_UNSPECIFIED = 0; + /** + * The principal has the permission. + * + * Generated from protobuf enum GRANTED = 1; + */ + const GRANTED = 1; + /** + * The principal does not have the permission. + * + * Generated from protobuf enum NOT_GRANTED = 2; + */ + const NOT_GRANTED = 2; + /** + * The principal has the permission only if a condition expression evaluates + * to `true`. + * + * Generated from protobuf enum UNKNOWN_CONDITIONAL = 3; + */ + const UNKNOWN_CONDITIONAL = 3; + /** + * The sender of the request does not have access to all of the policies that + * Policy Troubleshooter needs to evaluate. + * + * Generated from protobuf enum UNKNOWN_INFO_DENIED = 4; + */ + const UNKNOWN_INFO_DENIED = 4; + + private static $valueToName = [ + self::ACCESS_STATE_UNSPECIFIED => 'ACCESS_STATE_UNSPECIFIED', + self::GRANTED => 'GRANTED', + self::NOT_GRANTED => 'NOT_GRANTED', + self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', + self::UNKNOWN_INFO_DENIED => 'UNKNOWN_INFO_DENIED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php new file mode 100644 index 00000000000..6a94ba29e53 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php @@ -0,0 +1,187 @@ +google.cloud.policytroubleshooter.v1.AccessTuple + */ +class AccessTuple extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $principal = ''; + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $full_resource_name = ''; + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $permission = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $principal + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * @type string $full_resource_name + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type string $permission + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPrincipal() + { + return $this->principal; + } + + /** + * Required. The principal whose access you want to check, in the form of + * the email address that represents that principal. For example, + * `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->principal = $var; + + return $this; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPermission() + { + return $this->permission; + } + + /** + * Required. The IAM permission to check for the specified principal and + * resource. + * For a complete list of IAM permissions, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPermission($var) + { + GPBUtil::checkString($var, True); + $this->permission = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php new file mode 100644 index 00000000000..0ed308060ee --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php @@ -0,0 +1,398 @@ +google.cloud.policytroubleshooter.v1.BindingExplanation + */ +class BindingExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access = 0; + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + */ + protected $role = ''; + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; + */ + protected $role_permission = 0; + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; + */ + protected $role_permission_relevance = 0; + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + */ + private $memberships; + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; + */ + protected $relevance = 0; + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + */ + protected $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * @type string $role + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * @type int $role_permission + * Indicates whether the role granted by this binding contains the specified + * permission. + * @type int $role_permission_relevance + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * @type array|\Google\Protobuf\Internal\MapField $memberships + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * @type int $relevance + * The relevance of this binding to the overall determination for the entire + * policy. + * @type \Google\Type\Expr $condition + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAccess() + { + return $this->access; + } + + /** + * Required. Indicates whether _this binding_ provides the specified + * permission to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another binding that overrides + * this binding. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); + $this->access = $var; + + return $this; + } + + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * The role that this binding grants. For example, + * `roles/compute.serviceAgent`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; + * @return int + */ + public function getRolePermission() + { + return $this->role_permission; + } + + /** + * Indicates whether the role granted by this binding contains the specified + * permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; + * @param int $var + * @return $this + */ + public function setRolePermission($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\RolePermission::class); + $this->role_permission = $var; + + return $this; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; + * @return int + */ + public function getRolePermissionRelevance() + { + return $this->role_permission_relevance; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; + * @param int $var + * @return $this + */ + public function setRolePermissionRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); + $this->role_permission_relevance = $var; + + return $this; + } + + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * Indicates whether each principal in the binding includes the principal + * specified in the request, either directly or indirectly. Each key + * identifies a principal in the binding, and each value indicates whether the + * principal in the binding includes the principal in the request. + * For example, suppose that a binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * principal of the group `group:product-eng@example.com`. + * For the first principal in the binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `MEMBERSHIP_NOT_INCLUDED`. + * For the second principal in the binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `MEMBERSHIP_INCLUDED`. + * + * Generated from protobuf field map memberships = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\AnnotatedMembership::class); + $this->memberships = $arr; + + return $this; + } + + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this binding to the overall determination for the entire + * policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * A condition expression that prevents this binding from granting access + * unless the expression evaluates to `true`. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php new file mode 100644 index 00000000000..fa404ca0589 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php @@ -0,0 +1,108 @@ +google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + */ +class AnnotatedMembership extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; + */ + protected $membership = 0; + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $membership + * Indicates whether the binding includes the principal. + * @type int $relevance + * The relevance of the principal's status to the overall determination for + * the binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; + * @return int + */ + public function getMembership() + { + return $this->membership; + } + + /** + * Indicates whether the binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; + * @param int $var + * @return $this + */ + public function setMembership($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\Membership::class); + $this->membership = $var; + + return $this; + } + + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the principal's status to the overall determination for + * the binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnnotatedMembership::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_AnnotatedMembership::class); + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php new file mode 100644 index 00000000000..ce26c1c2722 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php @@ -0,0 +1,84 @@ +google.cloud.policytroubleshooter.v1.BindingExplanation.Membership + */ +class Membership +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum MEMBERSHIP_UNSPECIFIED = 0; + */ + const MEMBERSHIP_UNSPECIFIED = 0; + /** + * The binding includes the principal. The principal can be included + * directly or indirectly. For example: + * * A principal is included directly if that principal is listed in the + * binding. + * * A principal is included indirectly if that principal is in a Google + * group or Google Workspace domain that is listed in the binding. + * + * Generated from protobuf enum MEMBERSHIP_INCLUDED = 1; + */ + const MEMBERSHIP_INCLUDED = 1; + /** + * The binding does not include the principal. + * + * Generated from protobuf enum MEMBERSHIP_NOT_INCLUDED = 2; + */ + const MEMBERSHIP_NOT_INCLUDED = 2; + /** + * The sender of the request is not allowed to access the binding. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + */ + const MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + /** + * The principal is an unsupported type. Only Google Accounts and service + * accounts are supported. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + */ + const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + + private static $valueToName = [ + self::MEMBERSHIP_UNSPECIFIED => 'MEMBERSHIP_UNSPECIFIED', + self::MEMBERSHIP_INCLUDED => 'MEMBERSHIP_INCLUDED', + self::MEMBERSHIP_NOT_INCLUDED => 'MEMBERSHIP_NOT_INCLUDED', + self::MEMBERSHIP_UNKNOWN_INFO_DENIED => 'MEMBERSHIP_UNKNOWN_INFO_DENIED', + self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', + ]; + + 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(Membership::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_Membership::class); + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php new file mode 100644 index 00000000000..12606d1e011 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php @@ -0,0 +1,71 @@ +google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission + */ +class RolePermission +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ROLE_PERMISSION_UNSPECIFIED = 0; + */ + const ROLE_PERMISSION_UNSPECIFIED = 0; + /** + * The permission is included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; + */ + const ROLE_PERMISSION_INCLUDED = 1; + /** + * The permission is not included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; + */ + const ROLE_PERMISSION_NOT_INCLUDED = 2; + /** + * The sender of the request is not allowed to access the binding. + * + * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + */ + const ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + + private static $valueToName = [ + self::ROLE_PERMISSION_UNSPECIFIED => 'ROLE_PERMISSION_UNSPECIFIED', + self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', + self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', + self::ROLE_PERMISSION_UNKNOWN_INFO_DENIED => 'ROLE_PERMISSION_UNKNOWN_INFO_DENIED', + ]; + + 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(RolePermission::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_RolePermission::class); + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php new file mode 100644 index 00000000000..825e85a27a2 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php @@ -0,0 +1,290 @@ +google.cloud.policytroubleshooter.v1.ExplainedPolicy + */ +class ExplainedPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + */ + protected $access = 0; + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + */ + protected $full_resource_name = ''; + /** + * The IAM policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + */ + protected $policy = null; + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; + */ + private $binding_explanations; + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * @type string $full_resource_name + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * @type array<\Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * @type int $relevance + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + * @return int + */ + public function getAccess() + { + return $this->access; + } + + /** + * Indicates whether _this policy_ provides the specified permission to the + * specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `access` field in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + * @param int $var + * @return $this + */ + public function setAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); + $this->access = $var; + + return $this; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The IAM policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindingExplanations() + { + return $this->binding_explanations; + } + + /** + * Details about how each binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; + * @param array<\Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindingExplanations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation::class); + $this->binding_explanations = $arr; + + return $this; + } + + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this policy to the overall determination in the + * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php new file mode 100644 index 00000000000..f41f00cfa6b --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php @@ -0,0 +1,65 @@ +google.cloud.policytroubleshooter.v1.HeuristicRelevance + */ +class HeuristicRelevance +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + */ + const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + /** + * The data point has a limited effect on the result. Changing the data point + * is unlikely to affect the overall determination. + * + * Generated from protobuf enum NORMAL = 1; + */ + const NORMAL = 1; + /** + * The data point has a strong effect on the result. Changing the data point + * is likely to affect the overall determination. + * + * Generated from protobuf enum HIGH = 2; + */ + const HIGH = 2; + + private static $valueToName = [ + self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', + self::NORMAL => 'NORMAL', + self::HIGH => 'HIGH', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php new file mode 100644 index 00000000000..c850ac29fac --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php @@ -0,0 +1,82 @@ +google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + */ +class TroubleshootIamPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; + */ + protected $access_tuple = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple $access_tuple + * The information to use for checking whether a principal has a permission + * for a resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Checker::initOnce(); + parent::__construct($data); + } + + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; + * @return \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple|null + */ + public function getAccessTuple() + { + return $this->access_tuple; + } + + public function hasAccessTuple() + { + return isset($this->access_tuple); + } + + public function clearAccessTuple() + { + unset($this->access_tuple); + } + + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; + * @param \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple $var + * @return $this + */ + public function setAccessTuple($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple::class); + $this->access_tuple = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php new file mode 100644 index 00000000000..a183021d594 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php @@ -0,0 +1,168 @@ +google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + */ +class TroubleshootIamPolicyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all of the applicable IAM policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + */ + protected $access = 0; + /** + * List of IAM policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies can include the policy for the resource itself. It can + * also include policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; + */ + private $explained_policies; + /** + * The general errors contained in the troubleshooting response. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $access + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all of the applicable IAM policies. + * @type array<\Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies + * List of IAM policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies can include the policy for the resource itself. It can + * also include policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * The general errors contained in the troubleshooting response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Checker::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all of the applicable IAM policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + * @return int + */ + public function getAccess() + { + return $this->access; + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all of the applicable IAM policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; + * @param int $var + * @return $this + */ + public function setAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); + $this->access = $var; + + return $this; + } + + /** + * List of IAM policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies can include the policy for the resource itself. It can + * also include policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplainedPolicies() + { + return $this->explained_policies; + } + + /** + * List of IAM policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies can include the policy for the resource itself. It can + * also include policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; + * @param array<\Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplainedPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy::class); + $this->explained_policies = $arr; + + return $this; + } + + /** + * The general errors contained in the troubleshooting response. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * The general errors contained in the troubleshooting response. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php b/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php new file mode 100644 index 00000000000..250637b13d0 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php @@ -0,0 +1,59 @@ +troubleshootIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php new file mode 100644 index 00000000000..3facc74ba68 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php @@ -0,0 +1,197 @@ + troubleshootIamPolicyAsync(TroubleshootIamPolicyRequest $request, array $optionalArgs = []) + */ +final class IamCheckerClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.policytroubleshooter.v1.IamChecker'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'policytroubleshooter.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'policytroubleshooter.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/iam_checker_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/iam_checker_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/iam_checker_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/iam_checker_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'policytroubleshooter.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Checks whether a principal has a specific permission for a specific + * resource, and explains why the principal does or does not have that + * permission. + * + * The async variant is {@see IamCheckerClient::troubleshootIamPolicyAsync()} . + * + * @example samples/V1/IamCheckerClient/troubleshoot_iam_policy.php + * + * @param TroubleshootIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TroubleshootIamPolicyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function troubleshootIamPolicy(TroubleshootIamPolicyRequest $request, array $callOptions = []): TroubleshootIamPolicyResponse + { + return $this->startApiCall('TroubleshootIamPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..edff7df0b55 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.policytroubleshooter.v1", + "libraryPackage": "Google\\Cloud\\PolicyTroubleshooter\\V1", + "services": { + "IamChecker": { + "clients": { + "grpc": { + "libraryClient": "IamCheckerGapicClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ + "troubleshootIamPolicy" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json new file mode 100644 index 00000000000..ab57e45de76 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.policytroubleshooter.v1.IamChecker": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "UNKNOWN" + ], + "no_retry_1_codes": [] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "TroubleshootIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php new file mode 100644 index 00000000000..b1fe76c28bb --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php @@ -0,0 +1,32 @@ + [ + 'google.cloud.policytroubleshooter.v1.IamChecker' => [ + 'TroubleshootIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PolicyTroubleshooter\V1\TroubleshootIamPolicyResponse', + ], + ], + ], +]; diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php new file mode 100644 index 00000000000..35b80f85afd --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.policytroubleshooter.v1.IamChecker' => [ + 'TroubleshootIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/iam:troubleshoot', + 'body' => '*', + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php b/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php new file mode 100644 index 00000000000..3b5a17a698b --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php @@ -0,0 +1,138 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return IamCheckerClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new IamCheckerClient($options); + } + + /** @test */ + public function troubleshootIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TroubleshootIamPolicyResponse(); + $transport->addResponse($expectedResponse); + $request = new TroubleshootIamPolicyRequest(); + $response = $gapicClient->troubleshootIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policytroubleshooter.v1.IamChecker/TroubleshootIamPolicy', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function troubleshootIamPolicyExceptionTest() + { + $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); + $request = new TroubleshootIamPolicyRequest(); + try { + $gapicClient->troubleshootIamPolicy($request); + // 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 troubleshootIamPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TroubleshootIamPolicyResponse(); + $transport->addResponse($expectedResponse); + $request = new TroubleshootIamPolicyRequest(); + $response = $gapicClient->troubleshootIamPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policytroubleshooter.v1.IamChecker/TroubleshootIamPolicy', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php new file mode 100644 index 0000000000000000000000000000000000000000..4bae7bc3f6cf162413e3ec5fd29cb0d35bb47860 GIT binary patch literal 10091 zcmdTK&u<%9nQ@XP`I2puNt(Fcb~|;uY#LfyO|$~sZFe2VNvut5%XU&)jE2ehB^lM3 znVlIY4X6U`i3?m-uw1xsgBu5g7H*4#U^yTG7sQ1F2gF~%k?*}XzwC??8#mI@OPzV& z`+om=?|bjOYaWzAIUtg08IGYEO=-8aw?`~VH4aU!NvxD4t(K%> zsV3!D3$;uDah?Ulq!}QT|y8Ua4 zQ3BAFLt>kXN~HDj$`)~yhTSK>G+>>blU z4Ly=PHp^6LsIYoLM|pLnSzjf#YH6lpSY-swWcG>UtD1gUxa*Ro=(Ig)f%BNjoMQ5k z>PYZ_@b zR>*;Jq#0K4TbV^4xYq7-+fv`#e4ABKziJ;6`WtH+dak1!n!WQ{G1Yn%?a=DO3bhlH z)blUQE}CS%c>l5HdS15C@EvUp19!o94eBUw!B5xV(LfO^F7WLs7VxR4fKOq-r;e5r z^DZI9)G$3zKjJ~3xEWg5qs}7ly58afBwPTNIUcxKC2DP{eeJrtkL4B&$h6Ij+dE@r59Yb5LOy7rZ;0>1q@t?Cwq>Vf zHc4ENgoTNvw^JP5`6^6h+3p(Mocz@=+~`8hHZib?_yT5)Bh2T`rtFfXQgE`Dm!9=b z_DnLV5~sm=qwY*j2^t$fP;nRHD1vb;bLWy#;Y~$n*(*N85Wm;EC|Qb$TLpv2!y|qZ z<{Lymi6Sw~NW9xSiB&{&ibC>x0*Dcsx&u;aCtt~KZpztQE?=$6)mpZem$!@6az0mB zE96(Fz93!($YqNz#FQXT!)y3AmS68vOq_zr?c)2z(vzZGD6W;JhQxW8@xJ6rMJ&^W zQZc(ZHJtpL023ik66avtv@~7SOr^HA@LbZtA^gd(rf54{&L6*CqBZ|oatT7IS&Q? zpcp96Lh?@|Fx9ytZo`--gBx?X|D8^%;;KWe!9)YYT62AoJ9!_D(#dD4Oo$~`VbtRJ z!u9Tzfq3ParvaAPWf=37a|K3iVjXEJ z&o|@ZBn$`sL;s@LlRHg9f?*~*Kuj~a3sMNvupH)ZLy7lb)XSo8!=y!2!X&|r?OHV9 zN#dpRlwXjUXC!_pz+{+Z>h`D!`ABKDTppPe;w_ldKr9X0Zx#(>jGg39VldYwYwdu@Gh;-0 z?<0~J_Hg=s1|mzcnob%#C2GV*Lr{--?CJU3f}dgumf{GpFP323B299nU>D7lcX{cZ z-cfFlmZf3HsTB`L@?SBSjimJTi_s3XN=!_2&yAuCv%4DRH+?@`t8A2(Dlpr-v`lX+ z996hlwds)h*MK?{--JuNxVmZhs>dU1-5#WPIZOU^4CcG>bfMbDTwod4FtHFs{a&Ge z$w7&69cj&D`+VQ5AcC@Ay9&D6Y|$dd+ZP$Gbr8TB==toc(DyOS;7J;t1mo+F9PSd! zKETAsYhWLZSr=oZ-1D6qd0RdOaUUiEdUpI0^T9^bT*&}?Ig-+-$=R5H%gC?u>20P6J@TU{Cx&fT@6(Yp)3yqQ#1yNXA7CMtD`^EzJcwWG40%A^AxR zu0}S^*kMhxwmhP~ebqDm`LRxMhs#^N4l{%{|1AEz&d@7xeKc^)H7F8F!S8(93`P$q z0~$=kwjoG$GAcw<@H&k(7Gud@qw=EpczO}aJHPrpjcgux?R(U_(b{C<^`||lyn;NO z{4@qLQG_l~bwR1+!PQ=Bm)ue-ehsFr7S=ct98$doq7Nl9zeF@lMt)3r^-BDi2s2TH zE>MXtA>r3g8V|Hh^@};{5+;_O_U>yD+y^Bz=n}lVESeymqUu?vHW*oC1*HjSy6O45 z0^IN=CNETCvcq#oXc`U|D)bRtjUsGg*FxLcCxgkI_hdRH`gh=(FS)06|F(i2ohFv* z^}&eyC7n7#*+cG|TW5)sIhnU+$48me)xik6*7mXT-swXDuKOZ~bnbzWNmhdqaDK`6_I zZvQ9Sq3ha>-W47YC@T(~KzVd7sGBLLq2HlkT0&* z&;~j2BLS`j5%W1>?1uvD+-b$?h~u{N#PfD-U2NiF8v8LG)B=rtu6RrS4lk^tPM3HK z;~u;CTxiaVc>hLohh9~RNw`ET%dotTL-gQqPL-k|-m>uoH;q?p%@&)I@I2z3Z;BrH z`3I*cE>n3QFH0wh7jUKHllU5pVCurVTPnzih`vDd25ZYk0wMY6=6oUfMRkObi+{v} zEW3~hAMTQvi#9h)PtF>rya9;_nDt7wSi^CPfEtd%LB}l~OiWyaFGk>q8n_IJx8dd) zuxwm2y!cxIuF&Ke7UmY*Sj`uoo+Zn5h@S?*FLZDuh!R{sy-EdfA!6cPc=I$wv>2$C z?x3y|zrfz*%)7NTe5q2}%**9`WvfuF;!FzXRk_V=_A6@kg#t!ySoH+#T&3bMloTRH zRnQ6HiN^npa8=V@#?f$F`K^_FrMgilpUuh~h@GH}g#^rnzPFLaONaT;TD!(*fJ7|f%yPS2 zE>&m{4KE&pc>1=UhQdaEyHcpu3OTuw-^}l1i@DBmC#o(As936O;Q&(*(IukRHwx<; zQ?aGrV1DHn2I09iPS*Z_)hhhSpU;bZTpULta7R;#KE`QX@bJ-n^5%zs`R7NmYsp#q zQVK8OGfwD1Q$|=!Jozkpn_t<7SMXsLe@lRGEbJ7XA^x0A9XO6@XVU583zd}ozc!Qdk=>E zazV}AhbXSO`yWC0d2C^wz57b#=({iXW~7~33T>F$S^mret-Ei;-1k52z;*UY44;Yp zJ9dv_&SV(sOeV@-G8sgk$?PoeUSbt^`7QtP%su`JEA(g!>m5#|A|7lpNdBgoogle.cloud.policytroubleshooter.iam.v3.AccessTuple + */ +class AccessTuple extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The email address of the principal whose access you want to + * check. For example, `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $principal = ''; + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $full_resource_name = ''; + /** + * Required. The IAM permission to check for, either in the `v1` permission + * format or the `v2` permission format. + * For a complete list of IAM permissions in the `v1` format, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a list of IAM permissions in the `v2` format, see + * https://cloud.google.com/iam/help/deny/supported-permissions. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $permission = ''; + /** + * Output only. The permission that Policy Troubleshooter checked for, in + * the `v2` format. + * + * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $permission_fqdn = ''; + /** + * Optional. Additional context for the request, such as the request time or + * IP address. This context allows Policy Troubleshooter to troubleshoot + * conditional role bindings and deny rules. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $principal + * Required. The email address of the principal whose access you want to + * check. For example, `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * @type string $full_resource_name + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type string $permission + * Required. The IAM permission to check for, either in the `v1` permission + * format or the `v2` permission format. + * For a complete list of IAM permissions in the `v1` format, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a list of IAM permissions in the `v2` format, see + * https://cloud.google.com/iam/help/deny/supported-permissions. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * @type string $permission_fqdn + * Output only. The permission that Policy Troubleshooter checked for, in + * the `v2` format. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $condition_context + * Optional. Additional context for the request, such as the request time or + * IP address. This context allows Policy Troubleshooter to troubleshoot + * conditional role bindings and deny rules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. The email address of the principal whose access you want to + * check. For example, `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPrincipal() + { + return $this->principal; + } + + /** + * Required. The email address of the principal whose access you want to + * check. For example, `alice@example.com` or + * `my-service-account@my-project.iam.gserviceaccount.com`. + * The principal must be a Google Account or a service account. Other types of + * principals are not supported. + * + * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->principal = $var; + + return $this; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * Required. The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * Required. The IAM permission to check for, either in the `v1` permission + * format or the `v2` permission format. + * For a complete list of IAM permissions in the `v1` format, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a list of IAM permissions in the `v2` format, see + * https://cloud.google.com/iam/help/deny/supported-permissions. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPermission() + { + return $this->permission; + } + + /** + * Required. The IAM permission to check for, either in the `v1` permission + * format or the `v2` permission format. + * For a complete list of IAM permissions in the `v1` format, see + * https://cloud.google.com/iam/help/permissions/reference. + * For a list of IAM permissions in the `v2` format, see + * https://cloud.google.com/iam/help/deny/supported-permissions. + * For a complete list of predefined IAM roles and the permissions in each + * role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPermission($var) + { + GPBUtil::checkString($var, True); + $this->permission = $var; + + return $this; + } + + /** + * Output only. The permission that Policy Troubleshooter checked for, in + * the `v2` format. + * + * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPermissionFqdn() + { + return $this->permission_fqdn; + } + + /** + * Output only. The permission that Policy Troubleshooter checked for, in + * the `v2` format. + * + * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPermissionFqdn($var) + { + GPBUtil::checkString($var, True); + $this->permission_fqdn = $var; + + return $this; + } + + /** + * Optional. Additional context for the request, such as the request time or + * IP address. This context allows Policy Troubleshooter to troubleshoot + * conditional role bindings and deny rules. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext|null + */ + public function getConditionContext() + { + return $this->condition_context; + } + + public function hasConditionContext() + { + return isset($this->condition_context); + } + + public function clearConditionContext() + { + unset($this->condition_context); + } + + /** + * Optional. Additional context for the request, such as the request time or + * IP address. This context allows Policy Troubleshooter to troubleshoot + * conditional role bindings and deny rules. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $var + * @return $this + */ + public function setConditionContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext::class); + $this->condition_context = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php new file mode 100644 index 00000000000..1ecec32c116 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php @@ -0,0 +1,79 @@ +google.cloud.policytroubleshooter.iam.v3.AllowAccessState + */ +class AllowAccessState +{ + /** + * Not specified. + * + * Generated from protobuf enum ALLOW_ACCESS_STATE_UNSPECIFIED = 0; + */ + const ALLOW_ACCESS_STATE_UNSPECIFIED = 0; + /** + * The allow policy gives the principal the permission. + * + * Generated from protobuf enum ALLOW_ACCESS_STATE_GRANTED = 1; + */ + const ALLOW_ACCESS_STATE_GRANTED = 1; + /** + * The allow policy doesn't give the principal the permission. + * + * Generated from protobuf enum ALLOW_ACCESS_STATE_NOT_GRANTED = 2; + */ + const ALLOW_ACCESS_STATE_NOT_GRANTED = 2; + /** + * The allow policy gives the principal the permission if a condition + * expression evaluate to `true`. However, the sender of the request didn't + * provide enough context for Policy Troubleshooter to evaluate the condition + * expression. + * + * Generated from protobuf enum ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; + */ + const ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; + /** + * The sender of the request doesn't have access to all of the allow policies + * that Policy Troubleshooter needs to evaluate the principal's access. + * + * Generated from protobuf enum ALLOW_ACCESS_STATE_UNKNOWN_INFO = 4; + */ + const ALLOW_ACCESS_STATE_UNKNOWN_INFO = 4; + + private static $valueToName = [ + self::ALLOW_ACCESS_STATE_UNSPECIFIED => 'ALLOW_ACCESS_STATE_UNSPECIFIED', + self::ALLOW_ACCESS_STATE_GRANTED => 'ALLOW_ACCESS_STATE_GRANTED', + self::ALLOW_ACCESS_STATE_NOT_GRANTED => 'ALLOW_ACCESS_STATE_NOT_GRANTED', + self::ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL => 'ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL', + self::ALLOW_ACCESS_STATE_UNKNOWN_INFO => 'ALLOW_ACCESS_STATE_UNKNOWN_INFO', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php new file mode 100644 index 00000000000..f3101897bd5 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php @@ -0,0 +1,486 @@ +google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation + */ +class AllowBindingExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this role binding_ gives the specified + * permission to the specified principal on the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission on the resource. There might be another role binding that + * overrides this role binding. To determine whether the principal actually + * has the permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $allow_access_state = 0; + /** + * The role that this role binding grants. For example, + * `roles/compute.admin`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + */ + protected $role = ''; + /** + * Indicates whether the role granted by this role binding contains the + * specified permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; + */ + protected $role_permission = 0; + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; + */ + protected $role_permission_relevance = 0; + /** + * The combined result of all memberships. Indicates if the principal is + * included in any role binding, either directly or indirectly. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; + */ + protected $combined_membership = null; + /** + * Indicates whether each role binding includes the principal specified in the + * request, either directly or indirectly. Each key identifies a principal in + * the role binding, and each value indicates whether the principal in the + * role binding includes the principal in the request. + * For example, suppose that a role binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * member of the group `group:product-eng@example.com`. + * For the first principal in the role binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `NOT_INCLUDED`. + * For the second principal in the role binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `INCLUDED`. + * + * Generated from protobuf field map memberships = 6; + */ + private $memberships; + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; + */ + protected $relevance = 0; + /** + * A condition expression that specifies when the role binding grants access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 8; + */ + protected $condition = null; + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; + */ + protected $condition_explanation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $allow_access_state + * Required. Indicates whether _this role binding_ gives the specified + * permission to the specified principal on the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission on the resource. There might be another role binding that + * overrides this role binding. To determine whether the principal actually + * has the permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * @type string $role + * The role that this role binding grants. For example, + * `roles/compute.admin`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * @type int $role_permission + * Indicates whether the role granted by this role binding contains the + * specified permission. + * @type int $role_permission_relevance + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership $combined_membership + * The combined result of all memberships. Indicates if the principal is + * included in any role binding, either directly or indirectly. + * @type array|\Google\Protobuf\Internal\MapField $memberships + * Indicates whether each role binding includes the principal specified in the + * request, either directly or indirectly. Each key identifies a principal in + * the role binding, and each value indicates whether the principal in the + * role binding includes the principal in the request. + * For example, suppose that a role binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * member of the group `group:product-eng@example.com`. + * For the first principal in the role binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `NOT_INCLUDED`. + * For the second principal in the role binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `INCLUDED`. + * @type int $relevance + * The relevance of this role binding to the overall determination for the + * entire policy. + * @type \Google\Type\Expr $condition + * A condition expression that specifies when the role binding grants access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $condition_explanation + * Condition evaluation state for this role binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this role binding_ gives the specified + * permission to the specified principal on the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission on the resource. There might be another role binding that + * overrides this role binding. To determine whether the principal actually + * has the permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAllowAccessState() + { + return $this->allow_access_state; + } + + /** + * Required. Indicates whether _this role binding_ gives the specified + * permission to the specified principal on the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission on the resource. There might be another role binding that + * overrides this role binding. To determine whether the principal actually + * has the permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAllowAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); + $this->allow_access_state = $var; + + return $this; + } + + /** + * The role that this role binding grants. For example, + * `roles/compute.admin`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * The role that this role binding grants. For example, + * `roles/compute.admin`. + * For a complete list of predefined IAM roles, as well as the permissions in + * each role, see https://cloud.google.com/iam/help/roles/reference. + * + * Generated from protobuf field string role = 2; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Indicates whether the role granted by this role binding contains the + * specified permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; + * @return int + */ + public function getRolePermission() + { + return $this->role_permission; + } + + /** + * Indicates whether the role granted by this role binding contains the + * specified permission. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; + * @param int $var + * @return $this + */ + public function setRolePermission($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\RolePermissionInclusionState::class); + $this->role_permission = $var; + + return $this; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; + * @return int + */ + public function getRolePermissionRelevance() + { + return $this->role_permission_relevance; + } + + /** + * The relevance of the permission's existence, or nonexistence, in the role + * to the overall determination for the entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; + * @param int $var + * @return $this + */ + public function setRolePermissionRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->role_permission_relevance = $var; + + return $this; + } + + /** + * The combined result of all memberships. Indicates if the principal is + * included in any role binding, either directly or indirectly. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership|null + */ + public function getCombinedMembership() + { + return $this->combined_membership; + } + + public function hasCombinedMembership() + { + return isset($this->combined_membership); + } + + public function clearCombinedMembership() + { + unset($this->combined_membership); + } + + /** + * The combined result of all memberships. Indicates if the principal is + * included in any role binding, either directly or indirectly. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership $var + * @return $this + */ + public function setCombinedMembership($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership::class); + $this->combined_membership = $var; + + return $this; + } + + /** + * Indicates whether each role binding includes the principal specified in the + * request, either directly or indirectly. Each key identifies a principal in + * the role binding, and each value indicates whether the principal in the + * role binding includes the principal in the request. + * For example, suppose that a role binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * member of the group `group:product-eng@example.com`. + * For the first principal in the role binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `NOT_INCLUDED`. + * For the second principal in the role binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `INCLUDED`. + * + * Generated from protobuf field map memberships = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * Indicates whether each role binding includes the principal specified in the + * request, either directly or indirectly. Each key identifies a principal in + * the role binding, and each value indicates whether the principal in the + * role binding includes the principal in the request. + * For example, suppose that a role binding includes the following principals: + * * `user:alice@example.com` + * * `group:product-eng@example.com` + * You want to troubleshoot access for `user:bob@example.com`. This user is a + * member of the group `group:product-eng@example.com`. + * For the first principal in the role binding, the key is + * `user:alice@example.com`, and the `membership` field in the value is set to + * `NOT_INCLUDED`. + * For the second principal in the role binding, the key is + * `group:product-eng@example.com`, and the `membership` field in the value is + * set to `INCLUDED`. + * + * Generated from protobuf field map memberships = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership::class); + $this->memberships = $arr; + + return $this; + } + + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * A condition expression that specifies when the role binding grants access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 8; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * A condition expression that specifies when the role binding grants access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 8; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation|null + */ + public function getConditionExplanation() + { + return $this->condition_explanation; + } + + public function hasConditionExplanation() + { + return isset($this->condition_explanation); + } + + public function clearConditionExplanation() + { + unset($this->condition_explanation); + } + + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $var + * @return $this + */ + public function setConditionExplanation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation::class); + $this->condition_explanation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php new file mode 100644 index 00000000000..9257e5bd13a --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php @@ -0,0 +1,108 @@ +google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership + */ +class AnnotatedAllowMembership extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the role binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + */ + protected $membership = 0; + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $membership + * Indicates whether the role binding includes the principal. + * @type int $relevance + * The relevance of the principal's status to the overall determination for + * the role binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the role binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + * @return int + */ + public function getMembership() + { + return $this->membership; + } + + /** + * Indicates whether the role binding includes the principal. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + * @param int $var + * @return $this + */ + public function setMembership($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\MembershipMatchingState::class); + $this->membership = $var; + + return $this; + } + + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnnotatedAllowMembership::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation_AnnotatedAllowMembership::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php new file mode 100644 index 00000000000..0071db315e9 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php @@ -0,0 +1,168 @@ +google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation + */ +class AllowPolicyExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all applicable IAM allow policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; + */ + protected $allow_access_state = 0; + /** + * List of IAM allow policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies includes the policy for the resource itself, as well + * as allow policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; + */ + private $explained_policies; + /** + * The relevance of the allow policy type to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $allow_access_state + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all applicable IAM allow policies. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies + * List of IAM allow policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies includes the policy for the resource itself, as well + * as allow policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * @type int $relevance + * The relevance of the allow policy type to the overall access state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all applicable IAM allow policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; + * @return int + */ + public function getAllowAccessState() + { + return $this->allow_access_state; + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all applicable IAM allow policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; + * @param int $var + * @return $this + */ + public function setAllowAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); + $this->allow_access_state = $var; + + return $this; + } + + /** + * List of IAM allow policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies includes the policy for the resource itself, as well + * as allow policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplainedPolicies() + { + return $this->explained_policies; + } + + /** + * List of IAM allow policies that were evaluated to check the principal's + * permissions, with annotations to indicate how each policy contributed to + * the final result. + * The list of policies includes the policy for the resource itself, as well + * as allow policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplainedPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy::class); + $this->explained_policies = $arr; + + return $this; + } + + /** + * The relevance of the allow policy type to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the allow policy type to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php new file mode 100644 index 00000000000..0f7a4da01cd --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php @@ -0,0 +1,220 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionContext + */ +class ConditionContext extends \Google\Protobuf\Internal\Message +{ + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; + */ + protected $resource = null; + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi-hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; + */ + protected $destination = null; + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; + */ + protected $request = null; + /** + * Output only. The effective tags on the resource. The effective tags are + * fetched during troubleshooting. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $effective_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource $resource + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer $destination + * The destination of a network activity, such as accepting a TCP connection. + * In a multi-hop network activity, the destination represents the receiver of + * the last hop. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request $request + * Represents a network request, such as an HTTP request. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * Output only. The effective tags on the resource. The effective tags are + * fetched during troubleshooting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi-hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer|null + */ + public function getDestination() + { + return $this->destination; + } + + public function hasDestination() + { + return isset($this->destination); + } + + public function clearDestination() + { + unset($this->destination); + } + + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi-hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer::class); + $this->destination = $var; + + return $this; + } + + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request::class); + $this->request = $var; + + return $this; + } + + /** + * Output only. The effective tags on the resource. The effective tags are + * fetched during troubleshooting. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * Output only. The effective tags on the resource. The effective tags are + * fetched during troubleshooting. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag::class); + $this->effective_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php new file mode 100644 index 00000000000..95c87757bff --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php @@ -0,0 +1,292 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag + */ +class EffectiveTag extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tag_value = ''; + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $namespaced_tag_value = ''; + /** + * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such + * as `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tag_key = ''; + /** + * Output only. The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $namespaced_tag_key = ''; + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + */ + protected $tag_key_parent_name = ''; + /** + * Output only. Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $inherited = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag_value + * Output only. Resource name for TagValue in the format `tagValues/456`. + * @type string $namespaced_tag_value + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * @type string $tag_key + * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such + * as `tagKeys/123`. + * @type string $namespaced_tag_key + * Output only. The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * @type string $tag_key_parent_name + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * @type bool $inherited + * Output only. Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTagValue() + { + return $this->tag_value; + } + + /** + * Output only. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNamespacedTagValue() + { + return $this->namespaced_tag_value; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNamespacedTagValue($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_value = $var; + + return $this; + } + + /** + * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such + * as `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTagKey() + { + return $this->tag_key; + } + + /** + * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such + * as `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkString($var, True); + $this->tag_key = $var; + + return $this; + } + + /** + * Output only. The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNamespacedTagKey() + { + return $this->namespaced_tag_key; + } + + /** + * Output only. The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNamespacedTagKey($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_key = $var; + + return $this; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @return string + */ + public function getTagKeyParentName() + { + return $this->tag_key_parent_name; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @param string $var + * @return $this + */ + public function setTagKeyParentName($var) + { + GPBUtil::checkString($var, True); + $this->tag_key_parent_name = $var; + + return $this; + } + + /** + * Output only. Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getInherited() + { + return $this->inherited; + } + + /** + * Output only. Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setInherited($var) + { + GPBUtil::checkBool($var); + $this->inherited = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EffectiveTag::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_EffectiveTag::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php new file mode 100644 index 00000000000..82626fa22e6 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php @@ -0,0 +1,107 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer + */ +class Peer extends \Google\Protobuf\Internal\Message +{ + /** + * The IPv4 or IPv6 address of the peer. + * + * Generated from protobuf field string ip = 1; + */ + protected $ip = ''; + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip + * The IPv4 or IPv6 address of the peer. + * @type int|string $port + * The network port of the peer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * The IPv4 or IPv6 address of the peer. + * + * Generated from protobuf field string ip = 1; + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * The IPv4 or IPv6 address of the peer. + * + * Generated from protobuf field string ip = 1; + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + * @return int|string + */ + public function getPort() + { + return $this->port; + } + + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + * @param int|string $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt64($var); + $this->port = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Peer::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Peer::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php new file mode 100644 index 00000000000..5d019fa1ffa --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php @@ -0,0 +1,86 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request + */ +class Request extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The timestamp when the destination service receives the first + * byte of the request. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $receive_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $receive_time + * Optional. The timestamp when the destination service receives the first + * byte of the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The timestamp when the destination service receives the first + * byte of the request. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReceiveTime() + { + return $this->receive_time; + } + + public function hasReceiveTime() + { + return isset($this->receive_time); + } + + public function clearReceiveTime() + { + unset($this->receive_time); + } + + /** + * Optional. The timestamp when the destination service receives the first + * byte of the request. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReceiveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->receive_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Request::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Request::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php new file mode 100644 index 00000000000..e2632d6849f --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php @@ -0,0 +1,184 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource + */ +class Resource extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the service that this resource belongs to, such as + * `compute.googleapis.com`. The service name might not match the DNS + * hostname that actually serves the request. + * For a full list of resource service values, see + * https://cloud.google.com/iam/help/conditions/resource-services + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as `//{resource.service}/{resource.name}`. + * Unlike the resource URI, the resource name doesn't contain any protocol + * and version information. + * For a list of full resource name formats, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The type of the resource, in the format `{service}/{kind}`. + * For a full list of resource type values, see + * https://cloud.google.com/iam/help/conditions/resource-types + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The name of the service that this resource belongs to, such as + * `compute.googleapis.com`. The service name might not match the DNS + * hostname that actually serves the request. + * For a full list of resource service values, see + * https://cloud.google.com/iam/help/conditions/resource-services + * @type string $name + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as `//{resource.service}/{resource.name}`. + * Unlike the resource URI, the resource name doesn't contain any protocol + * and version information. + * For a list of full resource name formats, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names + * @type string $type + * The type of the resource, in the format `{service}/{kind}`. + * For a full list of resource type values, see + * https://cloud.google.com/iam/help/conditions/resource-types + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * The name of the service that this resource belongs to, such as + * `compute.googleapis.com`. The service name might not match the DNS + * hostname that actually serves the request. + * For a full list of resource service values, see + * https://cloud.google.com/iam/help/conditions/resource-services + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * The name of the service that this resource belongs to, such as + * `compute.googleapis.com`. The service name might not match the DNS + * hostname that actually serves the request. + * For a full list of resource service values, see + * https://cloud.google.com/iam/help/conditions/resource-services + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as `//{resource.service}/{resource.name}`. + * Unlike the resource URI, the resource name doesn't contain any protocol + * and version information. + * For a list of full resource name formats, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as `//{resource.service}/{resource.name}`. + * Unlike the resource URI, the resource name doesn't contain any protocol + * and version information. + * For a list of full resource name formats, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the resource, in the format `{service}/{kind}`. + * For a full list of resource type values, see + * https://cloud.google.com/iam/help/conditions/resource-types + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the resource, in the format `{service}/{kind}`. + * For a full list of resource type values, see + * https://cloud.google.com/iam/help/conditions/resource-types + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Resource::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Resource::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php new file mode 100644 index 00000000000..2d0da74c81e --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php @@ -0,0 +1,153 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionExplanation + */ +class ConditionExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Value of the condition. + * + * Generated from protobuf field .google.protobuf.Value value = 1; + */ + protected $value = null; + /** + * Any errors that prevented complete evaluation of the condition expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + */ + private $errors; + /** + * The value of each statement of the condition expression. The value can be + * `true`, `false`, or `null`. The value is `null` if the statement can't be + * evaluated. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; + */ + private $evaluation_states; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Value $value + * Value of the condition. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * Any errors that prevented complete evaluation of the condition expression. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $evaluation_states + * The value of each statement of the condition expression. The value can be + * `true`, `false`, or `null`. The value is `null` if the statement can't be + * evaluated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Value of the condition. + * + * Generated from protobuf field .google.protobuf.Value value = 1; + * @return \Google\Protobuf\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Value of the condition. + * + * Generated from protobuf field .google.protobuf.Value value = 1; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->value = $var; + + return $this; + } + + /** + * Any errors that prevented complete evaluation of the condition expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Any errors that prevented complete evaluation of the condition expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 3; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + + /** + * The value of each statement of the condition expression. The value can be + * `true`, `false`, or `null`. The value is `null` if the statement can't be + * evaluated. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEvaluationStates() + { + return $this->evaluation_states; + } + + /** + * The value of each statement of the condition expression. The value can be + * `true`, `false`, or `null`. The value is `null` if the statement can't be + * evaluated. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEvaluationStates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState::class); + $this->evaluation_states = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php new file mode 100644 index 00000000000..c6942a296a5 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php @@ -0,0 +1,194 @@ +google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState + */ +class EvaluationState extends \Google\Protobuf\Internal\Message +{ + /** + * Start position of an expression in the condition, by character. + * + * Generated from protobuf field int32 start = 1; + */ + protected $start = 0; + /** + * End position of an expression in the condition, by character, + * end included, for example: the end position of the first part of + * `a==b || c==d` would be 4. + * + * Generated from protobuf field int32 end = 2; + */ + protected $end = 0; + /** + * Value of this expression. + * + * Generated from protobuf field .google.protobuf.Value value = 3; + */ + protected $value = null; + /** + * Any errors that prevented complete evaluation of the condition + * expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 4; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Start position of an expression in the condition, by character. + * @type int $end + * End position of an expression in the condition, by character, + * end included, for example: the end position of the first part of + * `a==b || c==d` would be 4. + * @type \Google\Protobuf\Value $value + * Value of this expression. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * Any errors that prevented complete evaluation of the condition + * expression. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Start position of an expression in the condition, by character. + * + * Generated from protobuf field int32 start = 1; + * @return int + */ + public function getStart() + { + return $this->start; + } + + /** + * Start position of an expression in the condition, by character. + * + * Generated from protobuf field int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * End position of an expression in the condition, by character, + * end included, for example: the end position of the first part of + * `a==b || c==d` would be 4. + * + * Generated from protobuf field int32 end = 2; + * @return int + */ + public function getEnd() + { + return $this->end; + } + + /** + * End position of an expression in the condition, by character, + * end included, for example: the end position of the first part of + * `a==b || c==d` would be 4. + * + * Generated from protobuf field int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + + /** + * Value of this expression. + * + * Generated from protobuf field .google.protobuf.Value value = 3; + * @return \Google\Protobuf\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Value of this expression. + * + * Generated from protobuf field .google.protobuf.Value value = 3; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->value = $var; + + return $this; + } + + /** + * Any errors that prevented complete evaluation of the condition + * expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Any errors that prevented complete evaluation of the condition + * expression. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 4; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EvaluationState::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation_EvaluationState::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php new file mode 100644 index 00000000000..be6bbbf58e4 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php @@ -0,0 +1,79 @@ +google.cloud.policytroubleshooter.iam.v3.DenyAccessState + */ +class DenyAccessState +{ + /** + * Not specified. + * + * Generated from protobuf enum DENY_ACCESS_STATE_UNSPECIFIED = 0; + */ + const DENY_ACCESS_STATE_UNSPECIFIED = 0; + /** + * The deny policy denies the principal the permission. + * + * Generated from protobuf enum DENY_ACCESS_STATE_DENIED = 1; + */ + const DENY_ACCESS_STATE_DENIED = 1; + /** + * The deny policy doesn't deny the principal the permission. + * + * Generated from protobuf enum DENY_ACCESS_STATE_NOT_DENIED = 2; + */ + const DENY_ACCESS_STATE_NOT_DENIED = 2; + /** + * The deny policy denies the principal the permission if a condition + * expression evaluates to `true`. However, the sender of the request didn't + * provide enough context for Policy Troubleshooter to evaluate the condition + * expression. + * + * Generated from protobuf enum DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; + */ + const DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; + /** + * The sender of the request does not have access to all of the deny policies + * that Policy Troubleshooter needs to evaluate the principal's access. + * + * Generated from protobuf enum DENY_ACCESS_STATE_UNKNOWN_INFO = 4; + */ + const DENY_ACCESS_STATE_UNKNOWN_INFO = 4; + + private static $valueToName = [ + self::DENY_ACCESS_STATE_UNSPECIFIED => 'DENY_ACCESS_STATE_UNSPECIFIED', + self::DENY_ACCESS_STATE_DENIED => 'DENY_ACCESS_STATE_DENIED', + self::DENY_ACCESS_STATE_NOT_DENIED => 'DENY_ACCESS_STATE_NOT_DENIED', + self::DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL => 'DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL', + self::DENY_ACCESS_STATE_UNKNOWN_INFO => 'DENY_ACCESS_STATE_UNKNOWN_INFO', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php new file mode 100644 index 00000000000..038fa209141 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php @@ -0,0 +1,218 @@ +google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation + */ +class DenyPolicyExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the principal is denied the specified permission for + * the specified resource, based on evaluating all applicable IAM deny + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; + */ + protected $deny_access_state = 0; + /** + * List of resources with IAM deny policies that were evaluated to check the + * principal's denied permissions, with annotations to indicate how each + * policy contributed to the final result. + * The list of resources includes the policy for the resource itself, as well + * as policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. The + * order of the resources starts from the resource and climbs up the resource + * hierarchy. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; + */ + private $explained_resources; + /** + * The relevance of the deny policy result to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + */ + protected $relevance = 0; + /** + * Indicates whether the permission to troubleshoot is supported in deny + * policies. + * + * Generated from protobuf field bool permission_deniable = 4; + */ + protected $permission_deniable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $deny_access_state + * Indicates whether the principal is denied the specified permission for + * the specified resource, based on evaluating all applicable IAM deny + * policies. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource>|\Google\Protobuf\Internal\RepeatedField $explained_resources + * List of resources with IAM deny policies that were evaluated to check the + * principal's denied permissions, with annotations to indicate how each + * policy contributed to the final result. + * The list of resources includes the policy for the resource itself, as well + * as policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. The + * order of the resources starts from the resource and climbs up the resource + * hierarchy. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * @type int $relevance + * The relevance of the deny policy result to the overall access state. + * @type bool $permission_deniable + * Indicates whether the permission to troubleshoot is supported in deny + * policies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the principal is denied the specified permission for + * the specified resource, based on evaluating all applicable IAM deny + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; + * @return int + */ + public function getDenyAccessState() + { + return $this->deny_access_state; + } + + /** + * Indicates whether the principal is denied the specified permission for + * the specified resource, based on evaluating all applicable IAM deny + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; + * @param int $var + * @return $this + */ + public function setDenyAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); + $this->deny_access_state = $var; + + return $this; + } + + /** + * List of resources with IAM deny policies that were evaluated to check the + * principal's denied permissions, with annotations to indicate how each + * policy contributed to the final result. + * The list of resources includes the policy for the resource itself, as well + * as policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. The + * order of the resources starts from the resource and climbs up the resource + * hierarchy. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplainedResources() + { + return $this->explained_resources; + } + + /** + * List of resources with IAM deny policies that were evaluated to check the + * principal's denied permissions, with annotations to indicate how each + * policy contributed to the final result. + * The list of resources includes the policy for the resource itself, as well + * as policies that are inherited from higher levels of the resource + * hierarchy, including the organization, the folder, and the project. The + * order of the resources starts from the resource and climbs up the resource + * hierarchy. + * To learn more about the resource hierarchy, see + * https://cloud.google.com/iam/help/resource-hierarchy. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplainedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource::class); + $this->explained_resources = $arr; + + return $this; + } + + /** + * The relevance of the deny policy result to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the deny policy result to the overall access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * Indicates whether the permission to troubleshoot is supported in deny + * policies. + * + * Generated from protobuf field bool permission_deniable = 4; + * @return bool + */ + public function getPermissionDeniable() + { + return $this->permission_deniable; + } + + /** + * Indicates whether the permission to troubleshoot is supported in deny + * policies. + * + * Generated from protobuf field bool permission_deniable = 4; + * @param bool $var + * @return $this + */ + public function setPermissionDeniable($var) + { + GPBUtil::checkBool($var); + $this->permission_deniable = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php new file mode 100644 index 00000000000..f196aa83e8d --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php @@ -0,0 +1,630 @@ +google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation + */ +class DenyRuleExplanation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this rule_ denies the specified permission to + * the specified principal for the specified resource. + * This field does _not_ indicate whether the principal is actually denied on + * the permission for the resource. There might be another rule that overrides + * this rule. To determine whether the principal actually has the permission, + * use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deny_access_state = 0; + /** + * Indicates whether the permission in the request is listed as a denied + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; + */ + protected $combined_denied_permission = null; + /** + * Lists all denied permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a denied permission in the rule, and each value + * indicates whether the denied permission matches the permission in the + * request. + * + * Generated from protobuf field map denied_permissions = 3; + */ + private $denied_permissions; + /** + * Indicates whether the permission in the request is listed as an exception + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; + */ + protected $combined_exception_permission = null; + /** + * Lists all exception permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a exception permission in the rule, and each value + * indicates whether the exception permission matches the permission in the + * request. + * + * Generated from protobuf field map exception_permissions = 5; + */ + private $exception_permissions; + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; + */ + protected $combined_denied_principal = null; + /** + * Lists all denied principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a denied principal in the rule, and each value + * indicates whether the denied principal matches the principal in the + * request. + * + * Generated from protobuf field map denied_principals = 7; + */ + private $denied_principals; + /** + * Indicates whether the principal is listed as an exception principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; + */ + protected $combined_exception_principal = null; + /** + * Lists all exception principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a exception principal in the rule, and each value + * indicates whether the exception principal matches the principal in the + * request. + * + * Generated from protobuf field map exception_principals = 9; + */ + private $exception_principals; + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; + */ + protected $relevance = 0; + /** + * A condition expression that specifies when the deny rule denies the + * principal access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 11; + */ + protected $condition = null; + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; + */ + protected $condition_explanation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $deny_access_state + * Required. Indicates whether _this rule_ denies the specified permission to + * the specified principal for the specified resource. + * This field does _not_ indicate whether the principal is actually denied on + * the permission for the resource. There might be another rule that overrides + * this rule. To determine whether the principal actually has the permission, + * use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $combined_denied_permission + * Indicates whether the permission in the request is listed as a denied + * permission in the deny rule. + * @type array|\Google\Protobuf\Internal\MapField $denied_permissions + * Lists all denied permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a denied permission in the rule, and each value + * indicates whether the denied permission matches the permission in the + * request. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $combined_exception_permission + * Indicates whether the permission in the request is listed as an exception + * permission in the deny rule. + * @type array|\Google\Protobuf\Internal\MapField $exception_permissions + * Lists all exception permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a exception permission in the rule, and each value + * indicates whether the exception permission matches the permission in the + * request. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $combined_denied_principal + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * @type array|\Google\Protobuf\Internal\MapField $denied_principals + * Lists all denied principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a denied principal in the rule, and each value + * indicates whether the denied principal matches the principal in the + * request. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $combined_exception_principal + * Indicates whether the principal is listed as an exception principal in the + * deny rule, either directly or through membership in a principal set. + * @type array|\Google\Protobuf\Internal\MapField $exception_principals + * Lists all exception principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a exception principal in the rule, and each value + * indicates whether the exception principal matches the principal in the + * request. + * @type int $relevance + * The relevance of this role binding to the overall determination for the + * entire policy. + * @type \Google\Type\Expr $condition + * A condition expression that specifies when the deny rule denies the + * principal access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $condition_explanation + * Condition evaluation state for this role binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this rule_ denies the specified permission to + * the specified principal for the specified resource. + * This field does _not_ indicate whether the principal is actually denied on + * the permission for the resource. There might be another rule that overrides + * this rule. To determine whether the principal actually has the permission, + * use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDenyAccessState() + { + return $this->deny_access_state; + } + + /** + * Required. Indicates whether _this rule_ denies the specified permission to + * the specified principal for the specified resource. + * This field does _not_ indicate whether the principal is actually denied on + * the permission for the resource. There might be another rule that overrides + * this rule. To determine whether the principal actually has the permission, + * use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDenyAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); + $this->deny_access_state = $var; + + return $this; + } + + /** + * Indicates whether the permission in the request is listed as a denied + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching|null + */ + public function getCombinedDeniedPermission() + { + return $this->combined_denied_permission; + } + + public function hasCombinedDeniedPermission() + { + return isset($this->combined_denied_permission); + } + + public function clearCombinedDeniedPermission() + { + unset($this->combined_denied_permission); + } + + /** + * Indicates whether the permission in the request is listed as a denied + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $var + * @return $this + */ + public function setCombinedDeniedPermission($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); + $this->combined_denied_permission = $var; + + return $this; + } + + /** + * Lists all denied permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a denied permission in the rule, and each value + * indicates whether the denied permission matches the permission in the + * request. + * + * Generated from protobuf field map denied_permissions = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDeniedPermissions() + { + return $this->denied_permissions; + } + + /** + * Lists all denied permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a denied permission in the rule, and each value + * indicates whether the denied permission matches the permission in the + * request. + * + * Generated from protobuf field map denied_permissions = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDeniedPermissions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); + $this->denied_permissions = $arr; + + return $this; + } + + /** + * Indicates whether the permission in the request is listed as an exception + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching|null + */ + public function getCombinedExceptionPermission() + { + return $this->combined_exception_permission; + } + + public function hasCombinedExceptionPermission() + { + return isset($this->combined_exception_permission); + } + + public function clearCombinedExceptionPermission() + { + unset($this->combined_exception_permission); + } + + /** + * Indicates whether the permission in the request is listed as an exception + * permission in the deny rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $var + * @return $this + */ + public function setCombinedExceptionPermission($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); + $this->combined_exception_permission = $var; + + return $this; + } + + /** + * Lists all exception permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a exception permission in the rule, and each value + * indicates whether the exception permission matches the permission in the + * request. + * + * Generated from protobuf field map exception_permissions = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExceptionPermissions() + { + return $this->exception_permissions; + } + + /** + * Lists all exception permissions in the deny rule and indicates whether each + * permission matches the permission in the request. + * Each key identifies a exception permission in the rule, and each value + * indicates whether the exception permission matches the permission in the + * request. + * + * Generated from protobuf field map exception_permissions = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExceptionPermissions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); + $this->exception_permissions = $arr; + + return $this; + } + + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching|null + */ + public function getCombinedDeniedPrincipal() + { + return $this->combined_denied_principal; + } + + public function hasCombinedDeniedPrincipal() + { + return isset($this->combined_denied_principal); + } + + public function clearCombinedDeniedPrincipal() + { + unset($this->combined_denied_principal); + } + + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $var + * @return $this + */ + public function setCombinedDeniedPrincipal($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); + $this->combined_denied_principal = $var; + + return $this; + } + + /** + * Lists all denied principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a denied principal in the rule, and each value + * indicates whether the denied principal matches the principal in the + * request. + * + * Generated from protobuf field map denied_principals = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDeniedPrincipals() + { + return $this->denied_principals; + } + + /** + * Lists all denied principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a denied principal in the rule, and each value + * indicates whether the denied principal matches the principal in the + * request. + * + * Generated from protobuf field map denied_principals = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDeniedPrincipals($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); + $this->denied_principals = $arr; + + return $this; + } + + /** + * Indicates whether the principal is listed as an exception principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching|null + */ + public function getCombinedExceptionPrincipal() + { + return $this->combined_exception_principal; + } + + public function hasCombinedExceptionPrincipal() + { + return isset($this->combined_exception_principal); + } + + public function clearCombinedExceptionPrincipal() + { + unset($this->combined_exception_principal); + } + + /** + * Indicates whether the principal is listed as an exception principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $var + * @return $this + */ + public function setCombinedExceptionPrincipal($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); + $this->combined_exception_principal = $var; + + return $this; + } + + /** + * Lists all exception principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a exception principal in the rule, and each value + * indicates whether the exception principal matches the principal in the + * request. + * + * Generated from protobuf field map exception_principals = 9; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExceptionPrincipals() + { + return $this->exception_principals; + } + + /** + * Lists all exception principals in the deny rule and indicates whether each + * principal matches the principal in the request, either directly or through + * membership in a principal set. + * Each key identifies a exception principal in the rule, and each value + * indicates whether the exception principal matches the principal in the + * request. + * + * Generated from protobuf field map exception_principals = 9; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExceptionPrincipals($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); + $this->exception_principals = $arr; + + return $this; + } + + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this role binding to the overall determination for the + * entire policy. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * A condition expression that specifies when the deny rule denies the + * principal access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 11; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * A condition expression that specifies when the deny rule denies the + * principal access. + * To learn about IAM Conditions, see + * https://cloud.google.com/iam/help/conditions/overview. + * + * Generated from protobuf field .google.type.Expr condition = 11; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation|null + */ + public function getConditionExplanation() + { + return $this->condition_explanation; + } + + public function hasConditionExplanation() + { + return isset($this->condition_explanation); + } + + public function clearConditionExplanation() + { + unset($this->condition_explanation); + } + + /** + * Condition evaluation state for this role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $var + * @return $this + */ + public function setConditionExplanation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation::class); + $this->condition_explanation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php new file mode 100644 index 00000000000..4e2dc255f07 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php @@ -0,0 +1,114 @@ +google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching + */ +class AnnotatedDenyPrincipalMatching extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + */ + protected $membership = 0; + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $membership + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * @type int $relevance + * The relevance of the principal's status to the overall determination for + * the role binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + * @return int + */ + public function getMembership() + { + return $this->membership; + } + + /** + * Indicates whether the principal is listed as a denied principal in the + * deny rule, either directly or through membership in a principal set. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; + * @param int $var + * @return $this + */ + public function setMembership($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\MembershipMatchingState::class); + $this->membership = $var; + + return $this; + } + + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the principal's status to the overall determination for + * the role binding. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnnotatedDenyPrincipalMatching::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation_AnnotatedDenyPrincipalMatching::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php new file mode 100644 index 00000000000..3c4a4e7e512 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php @@ -0,0 +1,113 @@ +google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching + */ +class AnnotatedPermissionMatching extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the permission in the request is denied by the deny + * rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; + */ + protected $permission_matching_state = 0; + /** + * The relevance of the permission status to the overall determination for + * the rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $permission_matching_state + * Indicates whether the permission in the request is denied by the deny + * rule. + * @type int $relevance + * The relevance of the permission status to the overall determination for + * the rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the permission in the request is denied by the deny + * rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; + * @return int + */ + public function getPermissionMatchingState() + { + return $this->permission_matching_state; + } + + /** + * Indicates whether the permission in the request is denied by the deny + * rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; + * @param int $var + * @return $this + */ + public function setPermissionMatchingState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\PermissionPatternMatchingState::class); + $this->permission_matching_state = $var; + + return $this; + } + + /** + * The relevance of the permission status to the overall determination for + * the rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of the permission status to the overall determination for + * the rule. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnnotatedPermissionMatching::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation_AnnotatedPermissionMatching::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php new file mode 100644 index 00000000000..2f8d26ce38c --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php @@ -0,0 +1,294 @@ +google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy + */ +class ExplainedAllowPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this policy_ provides the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $allow_access_state = 0; + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + */ + protected $full_resource_name = ''; + /** + * Details about how each role binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. The order of + * the role bindings matches the role binding order in the policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; + */ + private $binding_explanations; + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + */ + protected $relevance = 0; + /** + * The IAM allow policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 5; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $allow_access_state + * Required. Indicates whether _this policy_ provides the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * @type string $full_resource_name + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations + * Details about how each role binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. The order of + * the role bindings matches the role binding order in the policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * @type int $relevance + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM allow policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this policy_ provides the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAllowAccessState() + { + return $this->allow_access_state; + } + + /** + * Required. Indicates whether _this policy_ provides the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAllowAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); + $this->allow_access_state = $var; + + return $this; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * Details about how each role binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. The order of + * the role bindings matches the role binding order in the policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindingExplanations() + { + return $this->binding_explanations; + } + + /** + * Details about how each role binding in the policy affects the principal's + * ability, or inability, to use the permission for the resource. The order of + * the role bindings matches the role binding order in the policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindingExplanations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation::class); + $this->binding_explanations = $arr; + + return $this; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + + /** + * The IAM allow policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 5; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM allow policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is empty. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 5; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php new file mode 100644 index 00000000000..a4ffb91ca30 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php @@ -0,0 +1,240 @@ +google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy + */ +class ExplainedDenyPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether _this policy_ denies the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deny_access_state = 0; + /** + * The IAM deny policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.iam.v2.Policy policy = 2; + */ + protected $policy = null; + /** + * Details about how each rule in the policy affects the principal's inability + * to use the permission for the resource. The order of the deny rule matches + * the order of the rules in the deny policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; + */ + private $rule_explanations; + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $deny_access_state + * Required. Indicates whether _this policy_ denies the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * @type \Google\Cloud\Iam\V2\Policy $policy + * The IAM deny policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation>|\Google\Protobuf\Internal\RepeatedField $rule_explanations + * Details about how each rule in the policy affects the principal's inability + * to use the permission for the resource. The order of the deny rule matches + * the order of the rules in the deny policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * @type int $relevance + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether _this policy_ denies the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDenyAccessState() + { + return $this->deny_access_state; + } + + /** + * Required. Indicates whether _this policy_ denies the specified permission + * to the specified principal for the specified resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDenyAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); + $this->deny_access_state = $var; + + return $this; + } + + /** + * The IAM deny policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.iam.v2.Policy policy = 2; + * @return \Google\Cloud\Iam\V2\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM deny policy attached to the resource. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.iam.v2.Policy policy = 2; + * @param \Google\Cloud\Iam\V2\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V2\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * Details about how each rule in the policy affects the principal's inability + * to use the permission for the resource. The order of the deny rule matches + * the order of the rules in the deny policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuleExplanations() + { + return $this->rule_explanations; + } + + /** + * Details about how each rule in the policy affects the principal's inability + * to use the permission for the resource. The order of the deny rule matches + * the order of the rules in the deny policy. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuleExplanations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation::class); + $this->rule_explanations = $arr; + + return $this; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php new file mode 100644 index 00000000000..dc4b7ad16d1 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php @@ -0,0 +1,238 @@ +google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource + */ +class ExplainedDenyResource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Indicates whether any policies attached to _this resource_ deny + * the specific permission to the specified principal for the specified + * resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deny_access_state = 0; + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + */ + protected $full_resource_name = ''; + /** + * List of IAM deny policies that were evaluated to check the principal's + * denied permissions, with annotations to indicate how each policy + * contributed to the final result. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; + */ + private $explained_policies; + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + */ + protected $relevance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $deny_access_state + * Required. Indicates whether any policies attached to _this resource_ deny + * the specific permission to the specified principal for the specified + * resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * @type string $full_resource_name + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies + * List of IAM deny policies that were evaluated to check the principal's + * denied permissions, with annotations to indicate how each policy + * contributed to the final result. + * @type int $relevance + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Required. Indicates whether any policies attached to _this resource_ deny + * the specific permission to the specified principal for the specified + * resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDenyAccessState() + { + return $this->deny_access_state; + } + + /** + * Required. Indicates whether any policies attached to _this resource_ deny + * the specific permission to the specified principal for the specified + * resource. + * This field does _not_ indicate whether the principal actually has the + * permission for the resource. There might be another policy that overrides + * this policy. To determine whether the principal actually has the + * permission, use the `overall_access_state` field in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDenyAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); + $this->deny_access_state = $var; + + return $this; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The full resource name that identifies the resource. For example, + * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * For examples of full resource names for Google Cloud services, see + * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + * + * Generated from protobuf field string full_resource_name = 2; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * List of IAM deny policies that were evaluated to check the principal's + * denied permissions, with annotations to indicate how each policy + * contributed to the final result. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplainedPolicies() + { + return $this->explained_policies; + } + + /** + * List of IAM deny policies that were evaluated to check the principal's + * denied permissions, with annotations to indicate how each policy + * contributed to the final result. + * + * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; + * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplainedPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy::class); + $this->explained_policies = $arr; + + return $this; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @return int + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * The relevance of this policy to the overall access state in the + * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. + * If the sender of the request does not have access to the policy, this field + * is omitted. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; + * @param int $var + * @return $this + */ + public function setRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); + $this->relevance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php new file mode 100644 index 00000000000..f83209056a6 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php @@ -0,0 +1,64 @@ +google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance + */ +class HeuristicRelevance +{ + /** + * Not specified. + * + * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + */ + const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + /** + * The data point has a limited effect on the result. Changing the data point + * is unlikely to affect the overall determination. + * + * Generated from protobuf enum HEURISTIC_RELEVANCE_NORMAL = 1; + */ + const HEURISTIC_RELEVANCE_NORMAL = 1; + /** + * The data point has a strong effect on the result. Changing the data point + * is likely to affect the overall determination. + * + * Generated from protobuf enum HEURISTIC_RELEVANCE_HIGH = 2; + */ + const HEURISTIC_RELEVANCE_HIGH = 2; + + private static $valueToName = [ + self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', + self::HEURISTIC_RELEVANCE_NORMAL => 'HEURISTIC_RELEVANCE_NORMAL', + self::HEURISTIC_RELEVANCE_HIGH => 'HEURISTIC_RELEVANCE_HIGH', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php new file mode 100644 index 00000000000..a2c6c2e2987 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php @@ -0,0 +1,83 @@ +google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState + */ +class MembershipMatchingState +{ + /** + * Not specified. + * + * Generated from protobuf enum MEMBERSHIP_MATCHING_STATE_UNSPECIFIED = 0; + */ + const MEMBERSHIP_MATCHING_STATE_UNSPECIFIED = 0; + /** + * The principal in the request matches the principal in the policy. The + * principal can be included directly or indirectly: + * * A principal is included directly if that principal is listed in the + * role binding. + * * A principal is included indirectly if that principal is in a Google + * group, Google Workspace account, or Cloud Identity domain that is listed + * in the policy. + * + * Generated from protobuf enum MEMBERSHIP_MATCHED = 1; + */ + const MEMBERSHIP_MATCHED = 1; + /** + * The principal in the request doesn't match the principal in the policy. + * + * Generated from protobuf enum MEMBERSHIP_NOT_MATCHED = 2; + */ + const MEMBERSHIP_NOT_MATCHED = 2; + /** + * The principal in the policy is a group or domain, and the sender of the + * request doesn't have permission to view whether the principal in the + * request is a member of the group or domain. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO = 3; + */ + const MEMBERSHIP_UNKNOWN_INFO = 3; + /** + * The principal is an unsupported type. + * + * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + */ + const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + + private static $valueToName = [ + self::MEMBERSHIP_MATCHING_STATE_UNSPECIFIED => 'MEMBERSHIP_MATCHING_STATE_UNSPECIFIED', + self::MEMBERSHIP_MATCHED => 'MEMBERSHIP_MATCHED', + self::MEMBERSHIP_NOT_MATCHED => 'MEMBERSHIP_NOT_MATCHED', + self::MEMBERSHIP_UNKNOWN_INFO => 'MEMBERSHIP_UNKNOWN_INFO', + self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php new file mode 100644 index 00000000000..532ba20b750 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php @@ -0,0 +1,61 @@ +google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState + */ +class PermissionPatternMatchingState +{ + /** + * Not specified. + * + * Generated from protobuf enum PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED = 0; + */ + const PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED = 0; + /** + * The permission in the request matches the permission in the policy. + * + * Generated from protobuf enum PERMISSION_PATTERN_MATCHED = 1; + */ + const PERMISSION_PATTERN_MATCHED = 1; + /** + * The permission in the request matches the permission in the policy. + * + * Generated from protobuf enum PERMISSION_PATTERN_NOT_MATCHED = 2; + */ + const PERMISSION_PATTERN_NOT_MATCHED = 2; + + private static $valueToName = [ + self::PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED => 'PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED', + self::PERMISSION_PATTERN_MATCHED => 'PERMISSION_PATTERN_MATCHED', + self::PERMISSION_PATTERN_NOT_MATCHED => 'PERMISSION_PATTERN_NOT_MATCHED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php new file mode 100644 index 00000000000..86df4310ca3 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php @@ -0,0 +1,68 @@ +google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState + */ +class RolePermissionInclusionState +{ + /** + * Not specified. + * + * Generated from protobuf enum ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED = 0; + */ + const ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED = 0; + /** + * The permission is included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; + */ + const ROLE_PERMISSION_INCLUDED = 1; + /** + * The permission is not included in the role. + * + * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; + */ + const ROLE_PERMISSION_NOT_INCLUDED = 2; + /** + * The sender of the request is not allowed to access the role definition. + * + * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO = 3; + */ + const ROLE_PERMISSION_UNKNOWN_INFO = 3; + + private static $valueToName = [ + self::ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED => 'ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED', + self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', + self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', + self::ROLE_PERMISSION_UNKNOWN_INFO => 'ROLE_PERMISSION_UNKNOWN_INFO', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php new file mode 100644 index 00000000000..01b85d1f95e --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php @@ -0,0 +1,82 @@ +google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyRequest + */ +class TroubleshootIamPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; + */ + protected $access_tuple = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $access_tuple + * The information to use for checking whether a principal has a permission + * for a resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple|null + */ + public function getAccessTuple() + { + return $this->access_tuple; + } + + public function hasAccessTuple() + { + return isset($this->access_tuple); + } + + public function clearAccessTuple() + { + unset($this->access_tuple); + } + + /** + * The information to use for checking whether a principal has a permission + * for a resource. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $var + * @return $this + */ + public function setAccessTuple($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple::class); + $this->access_tuple = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php new file mode 100644 index 00000000000..230d00f1469 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php @@ -0,0 +1,220 @@ +google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse + */ +class TroubleshootIamPolicyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all types of the applicable IAM + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; + */ + protected $overall_access_state = 0; + /** + * The access tuple from the request, including any provided context used to + * evaluate the condition. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; + */ + protected $access_tuple = null; + /** + * An explanation of how the applicable IAM allow policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; + */ + protected $allow_policy_explanation = null; + /** + * An explanation of how the applicable IAM deny policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; + */ + protected $deny_policy_explanation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $overall_access_state + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all types of the applicable IAM + * policies. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $access_tuple + * The access tuple from the request, including any provided context used to + * evaluate the condition. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation $allow_policy_explanation + * An explanation of how the applicable IAM allow policies affect the final + * access state. + * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation $deny_policy_explanation + * An explanation of how the applicable IAM deny policies affect the final + * access state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all types of the applicable IAM + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; + * @return int + */ + public function getOverallAccessState() + { + return $this->overall_access_state; + } + + /** + * Indicates whether the principal has the specified permission for the + * specified resource, based on evaluating all types of the applicable IAM + * policies. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; + * @param int $var + * @return $this + */ + public function setOverallAccessState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse\OverallAccessState::class); + $this->overall_access_state = $var; + + return $this; + } + + /** + * The access tuple from the request, including any provided context used to + * evaluate the condition. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple|null + */ + public function getAccessTuple() + { + return $this->access_tuple; + } + + public function hasAccessTuple() + { + return isset($this->access_tuple); + } + + public function clearAccessTuple() + { + unset($this->access_tuple); + } + + /** + * The access tuple from the request, including any provided context used to + * evaluate the condition. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $var + * @return $this + */ + public function setAccessTuple($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple::class); + $this->access_tuple = $var; + + return $this; + } + + /** + * An explanation of how the applicable IAM allow policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation|null + */ + public function getAllowPolicyExplanation() + { + return $this->allow_policy_explanation; + } + + public function hasAllowPolicyExplanation() + { + return isset($this->allow_policy_explanation); + } + + public function clearAllowPolicyExplanation() + { + unset($this->allow_policy_explanation); + } + + /** + * An explanation of how the applicable IAM allow policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation $var + * @return $this + */ + public function setAllowPolicyExplanation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation::class); + $this->allow_policy_explanation = $var; + + return $this; + } + + /** + * An explanation of how the applicable IAM deny policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; + * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation|null + */ + public function getDenyPolicyExplanation() + { + return $this->deny_policy_explanation; + } + + public function hasDenyPolicyExplanation() + { + return isset($this->deny_policy_explanation); + } + + public function clearDenyPolicyExplanation() + { + unset($this->deny_policy_explanation); + } + + /** + * An explanation of how the applicable IAM deny policies affect the final + * access state. + * + * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; + * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation $var + * @return $this + */ + public function setDenyPolicyExplanation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation::class); + $this->deny_policy_explanation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php new file mode 100644 index 00000000000..636bfee1907 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php @@ -0,0 +1,81 @@ +google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState + */ +class OverallAccessState +{ + /** + * Not specified. + * + * Generated from protobuf enum OVERALL_ACCESS_STATE_UNSPECIFIED = 0; + */ + const OVERALL_ACCESS_STATE_UNSPECIFIED = 0; + /** + * The principal has the permission. + * + * Generated from protobuf enum CAN_ACCESS = 1; + */ + const CAN_ACCESS = 1; + /** + * The principal doesn't have the permission. + * + * Generated from protobuf enum CANNOT_ACCESS = 2; + */ + const CANNOT_ACCESS = 2; + /** + * The principal might have the permission, but the sender can't access all + * of the information needed to fully evaluate the principal's access. + * + * Generated from protobuf enum UNKNOWN_INFO = 3; + */ + const UNKNOWN_INFO = 3; + /** + * The principal might have the permission, but Policy Troubleshooter can't + * fully evaluate the principal's access because the sender didn't provide + * the required context to evaluate the condition. + * + * Generated from protobuf enum UNKNOWN_CONDITIONAL = 4; + */ + const UNKNOWN_CONDITIONAL = 4; + + private static $valueToName = [ + self::OVERALL_ACCESS_STATE_UNSPECIFIED => 'OVERALL_ACCESS_STATE_UNSPECIFIED', + self::CAN_ACCESS => 'CAN_ACCESS', + self::CANNOT_ACCESS => 'CANNOT_ACCESS', + self::UNKNOWN_INFO => 'UNKNOWN_INFO', + self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', + ]; + + 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(OverallAccessState::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse_OverallAccessState::class); + diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php new file mode 100644 index 00000000000..091ecf5fcfd --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php @@ -0,0 +1,59 @@ +troubleshootIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END policytroubleshooter_v3_generated_PolicyTroubleshooter_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php new file mode 100644 index 00000000000..9fb2b8e74d9 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php @@ -0,0 +1,198 @@ + troubleshootIamPolicyAsync(TroubleshootIamPolicyRequest $request, array $optionalArgs = []) + */ +final class PolicyTroubleshooterClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'policytroubleshooter.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'policytroubleshooter.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/policy_troubleshooter_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'policytroubleshooter.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Checks whether a principal has a specific permission for a specific + * resource, and explains why the principal does or doesn't have that + * permission. + * + * The async variant is + * {@see PolicyTroubleshooterClient::troubleshootIamPolicyAsync()} . + * + * @example samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php + * + * @param TroubleshootIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TroubleshootIamPolicyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function troubleshootIamPolicy(TroubleshootIamPolicyRequest $request, array $callOptions = []): TroubleshootIamPolicyResponse + { + return $this->startApiCall('TroubleshootIamPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json new file mode 100644 index 00000000000..17bca5927d5 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.policytroubleshooter.iam.v3", + "libraryPackage": "Google\\Cloud\\PolicyTroubleshooter\\Iam\\V3", + "services": { + "PolicyTroubleshooter": { + "clients": { + "grpc": { + "libraryClient": "PolicyTroubleshooterGapicClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ + "troubleshootIamPolicy" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json new file mode 100644 index 00000000000..8852fe92d97 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "TroubleshootIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php new file mode 100644 index 00000000000..b6365012b5d --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php @@ -0,0 +1,32 @@ + [ + 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter' => [ + 'TroubleshootIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse', + ], + ], + ], +]; diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php new file mode 100644 index 00000000000..1fa971fc5cf --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter' => [ + 'TroubleshootIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/iam:troubleshoot', + 'body' => '*', + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php new file mode 100644 index 00000000000..1c6bcea3301 --- /dev/null +++ b/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php @@ -0,0 +1,138 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PolicyTroubleshooterClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PolicyTroubleshooterClient($options); + } + + /** @test */ + public function troubleshootIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TroubleshootIamPolicyResponse(); + $transport->addResponse($expectedResponse); + $request = new TroubleshootIamPolicyRequest(); + $response = $gapicClient->troubleshootIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter/TroubleshootIamPolicy', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function troubleshootIamPolicyExceptionTest() + { + $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); + $request = new TroubleshootIamPolicyRequest(); + try { + $gapicClient->troubleshootIamPolicy($request); + // 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 troubleshootIamPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TroubleshootIamPolicyResponse(); + $transport->addResponse($expectedResponse); + $request = new TroubleshootIamPolicyRequest(); + $response = $gapicClient->troubleshootIamPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter/TroubleshootIamPolicy', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php new file mode 100644 index 0000000000000000000000000000000000000000..d7336ea94188e456da8400f0bf46f85e86b854f3 GIT binary patch literal 5198 zcmcIo&2!U66vsBs#|AO$|WE13S zWv;Nc%oNr(`V`i-@0XauMTBg}3PVk9FAIBUA8GKb3AEQh=T zN0+pg<%Aei96sCXx;7=At1*Ff*T(a=G@+B7z3zJe%#s$}aD!n5IMpgH#er)%wG|xN z0r9C9Y`{^|Y-1WD%vR=aNwZ8HX=(G~j;49&l1my5x;SZF(*jJpfxF1>%@iEOziLD9 zEBd5XbX||3;JKk`_I&E8I7)EYA=stqWS$W0G)uT+?Gi6YC%TCxn?}CmGtX@YUDqXU zySDB#4ySW6j$IXSwo`Z-3vLl0FSU03;jVJB+P%9u2~nLVA!JuF33Zu-bF)&v96KsDX%C9@g?egk6raFJ63psJ{YtT`j9wS zd4wip;R?Y_ZhmUvt}Z+}7I0l&SD8f@T>JyACrt92^&A6IHGzfi*|DCLo?`$yx17o` zspx3ONEESc9E2<}Pl%Y(7cmjVv|;O+>Up;-&8PBCDmvP`*I6_k#r7gP%eq*PemUhT zI@ctj?^t_vzQtqBe99>*nrg}x0jO{?a?a+I&(M?|U}&9n#(qx8sfD?SW)LObY4o`0 z2z?;c^`U7>sXP$*WGQp`ZSgU>&1=O#sSvD&0uk!a_>IU(C8EEvFMk~re#)WohzCPJ zm_-QsGp2RA=VOtG;>r)vOoYyk?D!mqsfF1?-iq2>8iS-}=s~&@+jHyPfQXzG8aL65 zFcn~!STJ<$P(?gVA4D3DtBZP(-E%XNje$*uV>Dn{5R>5;`=7%R!L0xtc+wjC^4CG( z?>w6BcSN~>vZR?L<^cN=ynKwti0gN0sERw^840)w7ZHGU(8XOCuz-s|>^d83x}iD_ z08B4D9Z6aLej-t$(vt-B?|&JgKa%%$!lCpnj~btyI>^GZ|$P<@xcMEL*Rvi9d3s2{b04 zDwt?Y@J;!YHSYk5E)3nQA+wryWbI&O7h3ydIYN(BkvPur(2#>_kJ{p6h*f5m8#%$2 zfuv>w#K|?b@GY2(Vy~P-X9MheA{W8IT$2QHIGI6XP-%Av70mz`0xONca_x?&ajCVrK*by>$NPokq%*g8Dp@hQ6n@RT{_EeL zv%h2%J^qH?k4D`kaPd0~)1qBmz*C_W37rP5o@{Eg06E?`Q=&B}b|P8>0tvJvb;DF>MM9@Rt0$WpEtxH0 zO0)*WPDE=!U~c{Y@5pPoWU=pV-FW4#lm_@al zP;E!a%+jU)@&Kfx-bUv6x@h;&=N}BoZ7+J>lDTNWB?cb8>s%O#&6kcW&Yl! zFSGY9z2B-X-@D#Kr)u(9EP5AP77t%Fco^d^ZEv$TggVpY`b@K5p=rv4jWOUT^&Z@e Z-y!ab7pKGn)sc@={G@n9IzR^q{Rblvs-yq_ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php new file mode 100644 index 00000000000..28de295119b --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php @@ -0,0 +1,511 @@ +google.cloud.privatecatalog.v1beta1.AssetReference + */ +class AssetReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $inputs = null; + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $validation_status = 0; + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $validation_operation = null; + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcs_source = null; + /** + * Output only. The creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @deprecated + */ + protected $version = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Output only. A unique identifier among asset references in a product. + * @type string $description + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * @type \Google\Cloud\PrivateCatalog\V1beta1\Inputs $inputs + * Output only. The definition of input parameters to hydrate the asset template. + * @type int $validation_status + * Output only. The current state of the asset reference. + * @type \Google\LongRunning\Operation $validation_operation + * Output only. The validation process metadata. + * @type string $asset + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * @type string $gcs_path + * Output only. The cloud storage object path. + * @type \Google\Cloud\PrivateCatalog\V1beta1\GitSource $git_source + * Output only. The git source. + * @type \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $gcs_source + * Output only. The cloud storage source. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the asset reference. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the asset reference. + * @type string $version + * The version of the source used for this asset reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\Inputs|null + */ + public function getInputs() + { + return $this->inputs; + } + + public function hasInputs() + { + return isset($this->inputs); + } + + public function clearInputs() + { + unset($this->inputs); + } + + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\Inputs $var + * @return $this + */ + public function setInputs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\Inputs::class); + $this->inputs = $var; + + return $this; + } + + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getValidationStatus() + { + return $this->validation_status; + } + + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setValidationStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference\AssetValidationState::class); + $this->validation_status = $var; + + return $this; + } + + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\LongRunning\Operation|null + */ + public function getValidationOperation() + { + return $this->validation_operation; + } + + public function hasValidationOperation() + { + return isset($this->validation_operation); + } + + public function clearValidationOperation() + { + unset($this->validation_operation); + } + + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setValidationOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->validation_operation = $var; + + return $this; + } + + /** + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * + * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAsset() + { + return $this->readOneof(10); + } + + public function hasAsset() + { + return $this->hasOneof(10); + } + + /** + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * + * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. The cloud storage object path. + * + * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + * @deprecated + */ + public function getGcsPath() + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(11); + } + + public function hasGcsPath() + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(11); + } + + /** + * Output only. The cloud storage object path. + * + * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + * @deprecated + */ + public function setGcsPath($var) + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Output only. The git source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\GitSource|null + */ + public function getGitSource() + { + return $this->readOneof(15); + } + + public function hasGitSource() + { + return $this->hasOneof(15); + } + + /** + * Output only. The git source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\GitSource $var + * @return $this + */ + public function setGitSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GitSource::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\GcsSource|null + */ + public function getGcsSource() + { + return $this->gcs_source; + } + + public function hasGcsSource() + { + return isset($this->gcs_source); + } + + public function clearGcsSource() + { + unset($this->gcs_source); + } + + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GcsSource::class); + $this->gcs_source = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @return string + * @deprecated + */ + public function getVersion() + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + return $this->version; + } + + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setVersion($var) + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php new file mode 100644 index 00000000000..b7a471cf660 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php @@ -0,0 +1,71 @@ +google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + */ +class AssetValidationState +{ + /** + * Unknown state. + * + * Generated from protobuf enum ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + */ + const ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + /** + * The validation is still in process. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The validation is done and the asset reference is valid. + * + * Generated from protobuf enum VALID = 2; + */ + const VALID = 2; + /** + * The validation is done and the asset reference is invalid. + * + * Generated from protobuf enum INVALID = 3; + */ + const INVALID = 3; + + private static $valueToName = [ + self::ASSET_VALIDATION_STATE_UNSPECIFIED => 'ASSET_VALIDATION_STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::VALID => 'VALID', + self::INVALID => 'INVALID', + ]; + + 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(AssetValidationState::class, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference_AssetValidationState::class); + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php new file mode 100644 index 00000000000..89c4e77f2ba --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php @@ -0,0 +1,228 @@ +google.cloud.privatecatalog.v1beta1.Catalog + */ +class Catalog extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The time when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}'. + * @type string $display_name + * Output only. The descriptive name of the catalog as it appears in UIs. + * @type string $description + * Output only. The description of the catalog. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the catalog was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the catalog was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The time when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php new file mode 100644 index 00000000000..9439240968d --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php @@ -0,0 +1,149 @@ +google.cloud.privatecatalog.v1beta1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcs_path = ''; + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_path + * Output only. the cloud storage object path. + * @type int|string $generation + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the object metadata was last changed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGcsPath() + { + return $this->gcs_path; + } + + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGcsPath($var) + { + GPBUtil::checkString($var, True); + $this->gcs_path = $var; + + return $this; + } + + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php new file mode 100644 index 00000000000..13cdd80dd4a --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php @@ -0,0 +1,217 @@ +google.cloud.privatecatalog.v1beta1.GitSource + */ +class GitSource extends \Google\Protobuf\Internal\Message +{ + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + */ + protected $repo = ''; + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + */ + protected $dir = ''; + protected $ref; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $repo + * Location of the Git repo to build. + * @type string $dir + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * @type string $commit + * The revision commit to use. + * @type string $branch + * The revision branch to use. + * @type string $tag + * The revision tag to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + * @return string + */ + public function getRepo() + { + return $this->repo; + } + + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + * @param string $var + * @return $this + */ + public function setRepo($var) + { + GPBUtil::checkString($var, True); + $this->repo = $var; + + return $this; + } + + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + * @return string + */ + public function getDir() + { + return $this->dir; + } + + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + * @param string $var + * @return $this + */ + public function setDir($var) + { + GPBUtil::checkString($var, True); + $this->dir = $var; + + return $this; + } + + /** + * The revision commit to use. + * + * Generated from protobuf field string commit = 3; + * @return string + */ + public function getCommit() + { + return $this->readOneof(3); + } + + public function hasCommit() + { + return $this->hasOneof(3); + } + + /** + * The revision commit to use. + * + * Generated from protobuf field string commit = 3; + * @param string $var + * @return $this + */ + public function setCommit($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The revision branch to use. + * + * Generated from protobuf field string branch = 4; + * @return string + */ + public function getBranch() + { + return $this->readOneof(4); + } + + public function hasBranch() + { + return $this->hasOneof(4); + } + + /** + * The revision branch to use. + * + * Generated from protobuf field string branch = 4; + * @param string $var + * @return $this + */ + public function setBranch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The revision tag to use. + * + * Generated from protobuf field string tag = 5; + * @return string + */ + public function getTag() + { + return $this->readOneof(5); + } + + public function hasTag() + { + return $this->hasOneof(5); + } + + /** + * The revision tag to use. + * + * Generated from protobuf field string tag = 5; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getRef() + { + return $this->whichOneof("ref"); + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php new file mode 100644 index 00000000000..7fef7240488 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php @@ -0,0 +1,77 @@ +google.cloud.privatecatalog.v1beta1.Inputs + */ +class Inputs extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $parameters + * Output only. The JSON schema defining the inputs and their formats. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php new file mode 100644 index 00000000000..d22f0ed59e7 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php @@ -0,0 +1,922 @@ +google.cloud.privatecatalog.v1beta1.Product + */ +class Product extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $asset_type = ''; + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_metadata = null; + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $icon_uri = ''; + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $asset_references; + /** + * Output only. The time when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * @type string $asset_type + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * @type \Google\Protobuf\Struct $display_metadata + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * @type string $icon_uri + * Output only. The icon URI of the product. + * @type array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $asset_references + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the product was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the product was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getDisplayMetadata() + { + return $this->display_metadata; + } + + public function hasDisplayMetadata() + { + return isset($this->display_metadata); + } + + public function clearDisplayMetadata() + { + unset($this->display_metadata); + } + + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDisplayMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->display_metadata = $var; + + return $this; + } + + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIconUri() + { + return $this->icon_uri; + } + + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIconUri($var) + { + GPBUtil::checkString($var, True); + $this->icon_uri = $var; + + return $this; + } + + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetReferences() + { + return $this->asset_references; + } + + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference::class); + $this->asset_references = $arr; + + return $this; + } + + /** + * Output only. The time when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php new file mode 100644 index 00000000000..46c48ae71b1 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php @@ -0,0 +1,189 @@ +google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest + */ +class SearchCatalogsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * @type string $query + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php new file mode 100644 index 00000000000..073d9cfa206 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + */ +class SearchCatalogsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + private $catalogs; + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * 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\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $catalogs + * The `Catalog`s computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCatalogs() + { + return $this->catalogs; + } + + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCatalogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Catalog::class); + $this->catalogs = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php new file mode 100644 index 00000000000..38693b585c3 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php @@ -0,0 +1,197 @@ +google.cloud.privatecatalog.v1beta1.SearchProductsRequest + */ +class SearchProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @type string $query + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php new file mode 100644 index 00000000000..8e3c9015929 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchProductsResponse + */ +class SearchProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + private $products; + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * 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\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $products + * The `Product` resources computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducts() + { + return $this->products; + } + + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Product::class); + $this->products = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php new file mode 100644 index 00000000000..2a177f28643 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php @@ -0,0 +1,197 @@ +google.cloud.privatecatalog.v1beta1.SearchVersionsRequest + */ +class SearchVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @type string $query + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php new file mode 100644 index 00000000000..da4bb06dd2a --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + */ +class SearchVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + private $versions; + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * 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\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $versions + * The `Version` resources computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersions() + { + return $this->versions; + } + + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Version::class); + $this->versions = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php new file mode 100644 index 00000000000..8d1ed9bcf83 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php @@ -0,0 +1,254 @@ +google.cloud.privatecatalog.v1beta1.Version + */ +class Version extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $asset = null; + /** + * Output only. The time when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the version under a product. + * @type string $description + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * @type \Google\Protobuf\Struct $asset + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the version was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the version was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getAsset() + { + return $this->asset; + } + + public function hasAsset() + { + return isset($this->asset); + } + + public function clearAsset() + { + unset($this->asset); + } + + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->asset = $var; + + return $this; + } + + /** + * Output only. The time when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php new file mode 100644 index 00000000000..495a69102f5 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php @@ -0,0 +1,80 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchCatalogs($request); + + /** @var Catalog $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + search_catalogs_sample($resource); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php new file mode 100644 index 00000000000..d60e004977f --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php @@ -0,0 +1,77 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchProducts($request); + + /** @var Product $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + search_products_sample($resource); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php new file mode 100644 index 00000000000..1177256e7aa --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php @@ -0,0 +1,86 @@ +setResource($resource) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchVersions($request); + + /** @var Version $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $query = '[QUERY]'; + + search_versions_sample($resource, $query); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php new file mode 100644 index 00000000000..5667d9a1c8e --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php @@ -0,0 +1,284 @@ + searchCatalogsAsync(SearchCatalogsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchProductsAsync(SearchProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchVersionsAsync(SearchVersionsRequest $request, array $optionalArgs = []) + */ +final class PrivateCatalogClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudprivatecatalog.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchCatalogsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_catalogs.php + * + * @param SearchCatalogsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function searchCatalogs(SearchCatalogsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchCatalogs', $request, $callOptions); + } + + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchProductsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_products.php + * + * @param SearchProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function searchProducts(SearchProductsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchProducts', $request, $callOptions); + } + + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchVersionsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_versions.php + * + * @param SearchVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function searchVersions(SearchVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchVersions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php new file mode 100644 index 00000000000..971af4c4ea1 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php @@ -0,0 +1,452 @@ +searchCatalogs($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @experimental + * + * @deprecated Please use the new service client {@see \Google\Cloud\PrivateCatalog\V1beta1\Client\PrivateCatalogClient}. + */ +class PrivateCatalogGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; + + /** 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 function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudprivatecatalog.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 + * $apiEndpoint 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); + } + + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. It can be in following formats: + * + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * @param array $optionalArgs { + * Optional. + * + * @type string $query + * The query to filter the catalogs. The supported queries are: + * + * * Get a single catalog: `name=catalogs/{catalog}` + * @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 searchCatalogs($resource, array $optionalArgs = []) + { + $request = new SearchCatalogsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + 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('SearchCatalogs', $optionalArgs, SearchCatalogsResponse::class, $request); + } + + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchProducts($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchProducts($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @param array $optionalArgs { + * Optional. + * + * @type string $query + * The query to filter the products. + * + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * @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 searchProducts($resource, array $optionalArgs = []) + { + $request = new SearchProductsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + 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('SearchProducts', $optionalArgs, SearchProductsResponse::class, $request); + } + + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * $query = 'query'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @param string $query Required. The query to filter the versions. + * + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * @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 searchVersions($resource, $query, array $optionalArgs = []) + { + $request = new SearchVersionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setQuery($query); + $requestParamHeaders['resource'] = $resource; + 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('SearchVersions', $optionalArgs, SearchVersionsResponse::class, $request); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php new file mode 100644 index 00000000000..cee80c95343 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ + 'SearchCatalogs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCatalogs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchCatalogsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SearchProducts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProducts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchProductsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SearchVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php new file mode 100644 index 00000000000..af11787e28b --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php @@ -0,0 +1,92 @@ + [ + 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ + 'SearchCatalogs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/catalogs:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/catalogs:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/catalogs:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SearchProducts' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/products:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/products:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/products:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SearchVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/versions:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/versions:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/versions:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php new file mode 100644 index 00000000000..ff2d34f19a2 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php @@ -0,0 +1,328 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PrivateCatalogClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PrivateCatalogClient($options); + } + + /** @test */ + public function searchCatalogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + $response = $gapicClient->searchCatalogs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchCatalogsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + try { + $gapicClient->searchCatalogs($request); + // 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 searchProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [ + $productsElement, + ]; + $expectedResponse = new SearchProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchProductsRequest()) + ->setResource($resource); + $response = $gapicClient->searchProducts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProductsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new SearchProductsRequest()) + ->setResource($resource); + try { + $gapicClient->searchProducts($request); + // 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 searchVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $versionsElement = new Version(); + $versions = [ + $versionsElement, + ]; + $expectedResponse = new SearchVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVersions($versions); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $query = 'query107944136'; + $request = (new SearchVersionsRequest()) + ->setResource($resource) + ->setQuery($query); + $response = $gapicClient->searchVersions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVersionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $query = 'query107944136'; + $request = (new SearchVersionsRequest()) + ->setResource($resource) + ->setQuery($query); + try { + $gapicClient->searchVersions($request); + // 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 searchCatalogsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + $response = $gapicClient->searchCatalogsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php new file mode 100644 index 00000000000..16936fb6b15 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php @@ -0,0 +1,274 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PrivateCatalogClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PrivateCatalogClient($options); + } + + /** @test */ + public function searchCatalogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->searchCatalogs($resource); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchCatalogsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + try { + $gapicClient->searchCatalogs($resource); + // 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 searchProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [ + $productsElement, + ]; + $expectedResponse = new SearchProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->searchProducts($resource); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProductsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + try { + $gapicClient->searchProducts($resource); + // 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 searchVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $versionsElement = new Version(); + $versions = [ + $versionsElement, + ]; + $expectedResponse = new SearchVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVersions($versions); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $query = 'query107944136'; + $response = $gapicClient->searchVersions($resource, $query); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVersionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $query = 'query107944136'; + try { + $gapicClient->searchVersions($resource, $query); + // 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/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php new file mode 100644 index 0000000000000000000000000000000000000000..f77582a051a69d42ce8def96ff1d24ad08bd978f GIT binary patch literal 16268 zcmc&*U2G%Qb@q@et#ql?YVWSSTE=$hv76l}Hrb_}*x`CN9#YiLS}VyEcjKr;CL{7n z8ZS9BnHg%mStv+?96+xO7ZnPuV--wH`1vvWTa?vsq?yP;cmo0*;V z?k@2&b+_f&P2y)WnZ=FF`bITVURl~!Cdt*CZo855eER@i-y;pH zUME4&vK(uV__>3t!yaYXhzL1Wiv*rkCz<8V;w=(d4J)*2%Zz!gM48t%2Q#nTxq1zu zdeaJm%#c^m1C)V3uf5Z>>zN?5LiqQL9hkObhql$UzXTe%p4qjU0Rdk9@9wspdT6^& zh7xQzb#mq78P1cw`;6y;#;#|ixSLdopupOy6B6ICnzcm|)P36vU4Ii^Efn@h7^$A# zx$!0Fvb`m6)+>>< zP}{kT-a0_#hvL+@cA4|Zvfu!oJ}@|B53Z&!iUBRphDbt9jK_uaN0kS=)Q-#@VMyYI zOUetruom&?Y4NDpF^QZTnS^-hN%0a3L*TQyhFEv;T*kNPIhUdZt1I4+B1Uh7atXx? za&o>`&r!c_2mFEl270`-PwIC!oE_Kl8(^}087t(AZ7>3S6HR)S56YO=GTN2tV&Od_ z@mu2soFAr1J{M48kcGgVD?6bbHc1OO=>L^KPYf9>@E{Bjd=Z@uh<{+$i3!2mZOdWt z7tqwM?NIT8`9vmpC6!;#@{x{R*zA!*W|uhI^gn6nwD^r5pmVm>q9Q>4FdM|NNrTNl zmH+(19X7ja+%niOi)@sYN77kzw&y1P2s+=gg8*i4g6*)Mpe~Ro2`e&-W`t_Y@V-a% z|D8c8MeFz+Izqc zx&GbVrh9LGl1cUH_{;@|&k6>dbrqfK*tf8Q`O_n^?i2!i2KZ%kp=G^k`rNfl>E-iN zjPWHYbEJP6{;5m}ypATQ=aTtpczrfskgp%BKgAfb)VT>?&M%`Ug(So`-)IM+y=&K5 zsxs@Yvup3oBPQ2tV+|zY2k~#JoM91xF`v&@H1tuc(SYK|h4RFNVxS{HX!%f{1oJ5- zL1ionAjb&a>k8{C=ggOR2AzT`Z*P7EhM7+PD1jb7N^E=&odGFLC@8@TT>t*aAwgY< zqejYt#JA)qE05pH%Iskh zr_gD31$3wAquZN{oNl7<-NgIGUnI~Nc@G!Cqu(I)FvvX+zYcRvm-`yrlRpo0paYpK z;l6Tph+o-tn+=Gbxd;5m=p5Euf6sF4FY#(L_dvZIncKpQB3+PADOdV)2=|9!a`%s23(Rw2!6K0ABk=JNkCZ4QIu8%7q#Af0#mgzs&&?$O_x6rf{fa@%k zKY8AK0?kEQH6214BBD&t!4vpn=#m_>-$9cdxBH(2n(Iq(UqG{abx@+5*O-`9a&PIVkJrZ zJaeRw*$VJ3a@I_x=@LpQ_h>~%hgSuC3SEGt%M+GK-t<7~0P& z4P9KbgRrc`43SeFX3>rxL(?AMCuRTu1rvvviN^ey-Vfco#F?kXAP>j*Jeu6Kn*ch@ zpX%I%g>Zd{U*^tzsQ=`<`nNPR-#-b_4BSLrK?c-C>;4yFTauy~+E_T`&Cq01;Ud!{ zIt|jM+78sh^?eH}RG0^(75(c;bZLuNetloz5quEZ4H2$eO#ruKvq9IEsd+ZP6?>*b zWzCitbM8DaE6fwYX#EWc@NZdNw#z`cb2RSl&FP3=Rp58XnKE)&(sq!p}m zwN;`m9;ZCee+^DhV(pk>ZE~20*ndMCIZHax!nAoIDPrO}Qj<7y=rNs*+Zg0~Uo<)} zP$v}Ve+JWCBux^M0n>eGTBY$x8J{^j6^vTi#I6glF`FXK;rh2hrrWHy9UxPWW_TSk zRv6-%>GaVQ!C}rmsQZo(JVvGe>tkqQ*|(hV_ubG#oDhmtLwph!5SI5Fo!*wli&Xx& z-nN3ybTty9jsH~a2-wwS@^xO3{W9&_XGh2zOv`GgypEnr*#0^I_^Kh0xD&EBBs*Y#7dk_J2}QTL3ziR~a9A!r&OCTgBeqM7D+~sU02Mwo zmkr^cCtQRwX9k?BXo5Jjo#VJ!>12yrrmTRgJKU*L`OOoK5k-qzB3QtH&m+Xb0!OEL zzC8||P8(=C@=gj>a}|%o;(0VBeUNrBP?81Eg7JM17Pz5w05fs@PFt2tUqzGLz2cMP z(P`m0@o6^DbmR}Xh%QCG2Kj@z1vOlnrI@^f>IoWk0YGjsj3Jp$0S+cTAYA|qCSt=4 z6>xwF;`=aJz5rM*G;ATUo9T~#A~2BlS$y?alD zhXDW)&-Rq6`u8<-j$#9H7TIzS27gzJi_+C`+Zh2BBtSeQRZPa}d^Y7Nu517r@(&^N>l2x+>DE_AQR2W%MnZ2*MeFcS42k-{Ovshifqc}5F(x`WP( zbpEheD`~p}Ea-R998?1LKb*l@2=f}^!x`@HAXadUs%yN56XlAChhzbTj2Lie6_V(I zdpZ$O|4IU#iwc+n zFZE(CUI2Suv{t~sN}xvvo{+)u+meCw!j;qUyW$~ic=*wOsD16(HlQOfNmyoz%w;b5J1k>Ga| z2>0&|;9_i5^b<>U#&4Sk@em6A2X3u@tKk>bsm0M_Az)ii+c)sbDrszWO8S@Zr&RhF zS{0P|dkNT$>Du+cH)1Qcn@}osEWBL*D=h~E<@J)_KS`orA*SXZY5K^%Ur;xXwiosB0zo&I8~UhGp^F~>7&3p~M$-tZ(MKC|HGZna zS`F2%7r4Slvg-w|H^b2%7Apjj74Mj%U{wRf85sRO!|lv*urE zc^*cUm$D-$y33}vH}eLIseQ~wh%DV4Z|1KJ<`^sFbn(JJOCZ$g=yCibq8%c+GVzZY zsk9>b{Yy_Z5wB+J4W|OX8KGty#vxA4HiQ<#q4gP_=UL|y;Fo1AJ{AvA$)sN6Z*g@~ z3(fvJFDrhc;aAk$KDewHG9_6bEaS4uV+0EpDkB{2XT|BRm` zk=h-xb<}^{RbNDA8b3Tpj1dYA*; zC8%*m6c>9G#$l27Cz>9kQyXTa91_@G*5fv8$1pPVX2|6sU;O2%$hF8&}J} z;J*K^rt=&$j+GWHzR6tB7Pep2mzdj*ZLlh{vd#n27`Cghp&4vC0?}~%g9{POxXS%c zuH2t#!rsPGZUf*ys@WC2bVAKaPDTBChf|!u+6f5-!2|y{ga!pG93eC)R8p_UbRxfl z+BY2?RO;(NSX}rIO|_L+sY{ua&yE~WE#K66{uTkp2Eg4--t_k`yJzB@%H3? zZe;hv&V8A{N@7iXq=Bz?7e_Jn zCEqtbk3Km>Exki7u}?dq!Tvz{`H`P`>`a2^gzoc~qfcj_<)39MUvX1J*{%=xf}6d` LzqCF?hY0;YpF!iu literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php new file mode 100644 index 00000000000..cab2cd15588 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php @@ -0,0 +1,75 @@ +google.cloud.privilegedaccessmanager.v1.AccessControlEntry + */ +class AccessControlEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Users who are allowed for the operation. Each entry should be a + * valid v1 IAM principal identifier. The format for these is documented at: + * https://cloud.google.com/iam/docs/principal-identifiers#v1 + * + * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $principals; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $principals + * Optional. Users who are allowed for the operation. Each entry should be a + * valid v1 IAM principal identifier. The format for these is documented at: + * https://cloud.google.com/iam/docs/principal-identifiers#v1 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Users who are allowed for the operation. Each entry should be a + * valid v1 IAM principal identifier. The format for these is documented at: + * https://cloud.google.com/iam/docs/principal-identifiers#v1 + * + * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrincipals() + { + return $this->principals; + } + + /** + * Optional. Users who are allowed for the operation. Each entry should be a + * valid v1 IAM principal identifier. The format for these is documented at: + * https://cloud.google.com/iam/docs/principal-identifiers#v1 + * + * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrincipals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->principals = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php new file mode 100644 index 00000000000..e6c0ad9942d --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php @@ -0,0 +1,79 @@ +google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow + */ +class ApprovalWorkflow extends \Google\Protobuf\Internal\Message +{ + protected $approval_workflow; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals $manual_approvals + * An approval workflow where users designated as approvers review and act + * on the grants. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * An approval workflow where users designated as approvers review and act + * on the grants. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ManualApprovals manual_approvals = 1; + * @return \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals|null + */ + public function getManualApprovals() + { + return $this->readOneof(1); + } + + public function hasManualApprovals() + { + return $this->hasOneof(1); + } + + /** + * An approval workflow where users designated as approvers review and act + * on the grants. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ManualApprovals manual_approvals = 1; + * @param \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals $var + * @return $this + */ + public function setManualApprovals($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getApprovalWorkflow() + { + return $this->whichOneof("approval_workflow"); + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php new file mode 100644 index 00000000000..4a05d756293 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php @@ -0,0 +1,109 @@ +google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest + */ +class ApproveGrantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the grant resource which is being approved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The reason for approving this grant. This is required if the + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the grant resource which is being approved. + * @type string $reason + * Optional. The reason for approving this grant. This is required if the + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the grant resource which is being approved. + * + * 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. Name of the grant resource which is being approved. + * + * 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; + } + + /** + * Optional. The reason for approving this grant. This is required if the + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. The reason for approving this grant. This is required if the + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php new file mode 100644 index 00000000000..3d0a9d42614 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php @@ -0,0 +1,83 @@ +google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest + */ +class CheckOnboardingStatusRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource for which the onboarding status should be checked. + * Should be in one of the following formats: + * * `projects/{project-number|project-id}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `organizations/{organization-number}/locations/{region}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource for which the onboarding status should be checked. + * Should be in one of the following formats: + * * `projects/{project-number|project-id}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `organizations/{organization-number}/locations/{region}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource for which the onboarding status should be checked. + * Should be in one of the following formats: + * * `projects/{project-number|project-id}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `organizations/{organization-number}/locations/{region}` + * + * 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 for which the onboarding status should be checked. + * Should be in one of the following formats: + * * `projects/{project-number|project-id}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `organizations/{organization-number}/locations/{region}` + * + * 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; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php new file mode 100644 index 00000000000..cbfa7d281b6 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php @@ -0,0 +1,109 @@ +google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse + */ +class CheckOnboardingStatusResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The service account that PAM uses to act on this resource. + * + * Generated from protobuf field string service_account = 1; + */ + protected $service_account = ''; + /** + * List of issues that are preventing PAM from functioning for this resource + * and need to be fixed to complete onboarding. Some issues might not be + * detected or reported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; + */ + private $findings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account + * The service account that PAM uses to act on this resource. + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding>|\Google\Protobuf\Internal\RepeatedField $findings + * List of issues that are preventing PAM from functioning for this resource + * and need to be fixed to complete onboarding. Some issues might not be + * detected or reported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The service account that PAM uses to act on this resource. + * + * Generated from protobuf field string service_account = 1; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * The service account that PAM uses to act on this resource. + * + * Generated from protobuf field string service_account = 1; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * List of issues that are preventing PAM from functioning for this resource + * and need to be fixed to complete onboarding. Some issues might not be + * detected or reported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFindings() + { + return $this->findings; + } + + /** + * List of issues that are preventing PAM from functioning for this resource + * and need to be fixed to complete onboarding. Some issues might not be + * detected or reported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding::class); + $this->findings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php new file mode 100644 index 00000000000..f492c7e0f48 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php @@ -0,0 +1,79 @@ +google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding + */ +class Finding extends \Google\Protobuf\Internal\Message +{ + protected $finding_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied $iam_access_denied + * PAM's service account is being denied access by Cloud IAM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * PAM's service account is being denied access by Cloud IAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied iam_access_denied = 1; + * @return \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied|null + */ + public function getIamAccessDenied() + { + return $this->readOneof(1); + } + + public function hasIamAccessDenied() + { + return $this->hasOneof(1); + } + + /** + * PAM's service account is being denied access by Cloud IAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied iam_access_denied = 1; + * @param \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied $var + * @return $this + */ + public function setIamAccessDenied($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getFindingType() + { + return $this->whichOneof("finding_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Finding::class, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse_Finding::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php new file mode 100644 index 00000000000..ae3ada03a9e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php @@ -0,0 +1,73 @@ +google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied + */ +class IAMAccessDenied extends \Google\Protobuf\Internal\Message +{ + /** + * List of permissions that are being denied. + * + * Generated from protobuf field repeated string missing_permissions = 1; + */ + private $missing_permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $missing_permissions + * List of permissions that are being denied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * List of permissions that are being denied. + * + * Generated from protobuf field repeated string missing_permissions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMissingPermissions() + { + return $this->missing_permissions; + } + + /** + * List of permissions that are being denied. + * + * Generated from protobuf field repeated string missing_permissions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMissingPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->missing_permissions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IAMAccessDenied::class, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse_Finding_IAMAccessDenied::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php new file mode 100644 index 00000000000..0fdeca61930 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php @@ -0,0 +1,289 @@ +google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest + */ +class CreateEntitlementRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the parent resource for the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `projects/{project-id|project-number}/locations/{region}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to use for this entitlement. This becomes the last part of + * the resource name. + * This value should be 4-63 characters in length, and valid characters are + * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + * This value should be unique among all other entitlements under the + * specified `parent`. + * + * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entitlement_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entitlement = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request and returns the + * previous operation's response. This prevents clients from accidentally + * creating duplicate entitlements. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Name of the parent resource for the entitlement. + * Possible formats: + * + * * `organizations/{organization-number}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `projects/{project-id|project-number}/locations/{region}` + * Please see {@see PrivilegedAccessManagerClient::organizationLocationName()} for help formatting this field. + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement Required. The resource being created + * @param string $entitlementId Required. The ID to use for this entitlement. This becomes the last part of + * the resource name. + * + * This value should be 4-63 characters in length, and valid characters are + * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + * + * This value should be unique among all other entitlements under the + * specified `parent`. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\CreateEntitlementRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement, string $entitlementId): self + { + return (new self()) + ->setParent($parent) + ->setEntitlement($entitlement) + ->setEntitlementId($entitlementId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the parent resource for the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `projects/{project-id|project-number}/locations/{region}` + * @type string $entitlement_id + * Required. The ID to use for this entitlement. This becomes the last part of + * the resource name. + * This value should be 4-63 characters in length, and valid characters are + * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + * This value should be unique among all other entitlements under the + * specified `parent`. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request and returns the + * previous operation's response. This prevents clients from accidentally + * creating duplicate entitlements. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the parent resource for the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `projects/{project-id|project-number}/locations/{region}` + * + * 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. Name of the parent resource for the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}` + * * `folders/{folder-number}/locations/{region}` + * * `projects/{project-id|project-number}/locations/{region}` + * + * 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 ID to use for this entitlement. This becomes the last part of + * the resource name. + * This value should be 4-63 characters in length, and valid characters are + * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + * This value should be unique among all other entitlements under the + * specified `parent`. + * + * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEntitlementId() + { + return $this->entitlement_id; + } + + /** + * Required. The ID to use for this entitlement. This becomes the last part of + * the resource name. + * This value should be 4-63 characters in length, and valid characters are + * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + * This value should be unique among all other entitlements under the + * specified `parent`. + * + * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEntitlementId($var) + { + GPBUtil::checkString($var, True); + $this->entitlement_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement|null + */ + public function getEntitlement() + { + return $this->entitlement; + } + + public function hasEntitlement() + { + return isset($this->entitlement); + } + + public function clearEntitlement() + { + unset($this->entitlement); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $var + * @return $this + */ + public function setEntitlement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); + $this->entitlement = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request and returns the + * previous operation's response. This prevents clients from accidentally + * creating duplicate entitlements. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request and returns the + * previous operation's response. This prevents clients from accidentally + * creating duplicate entitlements. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php new file mode 100644 index 00000000000..6f5feadca9b --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php @@ -0,0 +1,206 @@ +google.cloud.privilegedaccessmanager.v1.CreateGrantRequest + */ +class CreateGrantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the parent entitlement for which this grant is being + * requested. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grant = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate grants. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Name of the parent entitlement for which this grant is being + * requested. Please see + * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant Required. The resource being created. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\CreateGrantRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant): self + { + return (new self()) + ->setParent($parent) + ->setGrant($grant); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the parent entitlement for which this grant is being + * requested. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate grants. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the parent entitlement for which this grant is being + * requested. + * + * 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. Name of the parent entitlement for which this grant is being + * requested. + * + * 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 resource being created. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant|null + */ + public function getGrant() + { + return $this->grant; + } + + public function hasGrant() + { + return isset($this->grant); + } + + public function clearGrant() + { + unset($this->grant); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant $var + * @return $this + */ + public function setGrant($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); + $this->grant = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate grants. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate grants. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php new file mode 100644 index 00000000000..bc1fd4bf826 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php @@ -0,0 +1,193 @@ +google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest + */ +class DeleteEntitlementRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set to true, any child grant under this entitlement is also + * deleted. (Otherwise, the request only works if the entitlement has no child + * grant.) + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\DeleteEntitlementRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $force + * Optional. If set to true, any child grant under this entitlement is also + * deleted. (Otherwise, the request only works if the entitlement has no child + * grant.) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server knows to + * ignore the request if it has already been completed. The server guarantees + * this for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + + /** + * Optional. If set to true, any child grant under this entitlement is also + * deleted. (Otherwise, the request only works if the entitlement has no child + * grant.) + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, any child grant under this entitlement is also + * deleted. (Otherwise, the request only works if the entitlement has no child + * grant.) + * + * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php new file mode 100644 index 00000000000..7167f8ccf2e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php @@ -0,0 +1,109 @@ +google.cloud.privilegedaccessmanager.v1.DenyGrantRequest + */ +class DenyGrantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the grant resource which is being denied. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The reason for denying this grant. This is required if + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the grant resource which is being denied. + * @type string $reason + * Optional. The reason for denying this grant. This is required if + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the grant resource which is being denied. + * + * 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. Name of the grant resource which is being denied. + * + * 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; + } + + /** + * Optional. The reason for denying this grant. This is required if + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. The reason for denying this grant. This is required if + * `require_approver_justification` field of the `ManualApprovals` workflow + * used in this grant is true. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php new file mode 100644 index 00000000000..aa33c4d4f69 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php @@ -0,0 +1,531 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement + */ +class Entitlement extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Who can create grants using this entitlement. This list should + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $eligible_users; + /** + * Optional. The approvals needed before access are granted to a requester. No + * approvals are needed if this field is null. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $approval_workflow = null; + /** + * The access granted to a requester on successful approval. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; + */ + protected $privileged_access = null; + /** + * Required. The maximum amount of time that access is granted for a request. + * A requester can ask for a duration less than this, but never more. + * + * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_request_duration = null; + /** + * Output only. Current state of this entitlement. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The manner in which the requester should provide a justification + * for requesting access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $requester_justification_config = null; + /** + * Optional. Additional email addresses to be notified based on actions taken. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_notification_targets = null; + /** + * An `etag` is used for optimistic concurrency control as a way to prevent + * simultaneous updates to the same entitlement. An `etag` is returned in the + * response to `GetEntitlement` and the caller should put the `etag` in the + * request to `UpdateEntitlement` so that their change is applied on + * the same version. If this field is omitted or if there is a mismatch while + * updating an entitlement, then the server rejects the request. + * + * Generated from protobuf field string etag = 12; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp. + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $eligible_users + * Optional. Who can create grants using this entitlement. This list should + * contain at most one entry. + * @type \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow $approval_workflow + * Optional. The approvals needed before access are granted to a requester. No + * approvals are needed if this field is null. + * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $privileged_access + * The access granted to a requester on successful approval. + * @type \Google\Protobuf\Duration $max_request_duration + * Required. The maximum amount of time that access is granted for a request. + * A requester can ask for a duration less than this, but never more. + * @type int $state + * Output only. Current state of this entitlement. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig $requester_justification_config + * Required. The manner in which the requester should provide a justification + * for requesting access. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets $additional_notification_targets + * Optional. Additional email addresses to be notified based on actions taken. + * @type string $etag + * An `etag` is used for optimistic concurrency control as a way to prevent + * simultaneous updates to the same entitlement. An `etag` is returned in the + * response to `GetEntitlement` and the caller should put the `etag` in the + * request to `UpdateEntitlement` so that their change is applied on + * the same version. If this field is omitted or if there is a mismatch while + * updating an entitlement, then the server rejects the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of the entitlement. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Who can create grants using this entitlement. This list should + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEligibleUsers() + { + return $this->eligible_users; + } + + /** + * Optional. Who can create grants using this entitlement. This list should + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEligibleUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry::class); + $this->eligible_users = $arr; + + return $this; + } + + /** + * Optional. The approvals needed before access are granted to a requester. No + * approvals are needed if this field is null. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow|null + */ + public function getApprovalWorkflow() + { + return $this->approval_workflow; + } + + public function hasApprovalWorkflow() + { + return isset($this->approval_workflow); + } + + public function clearApprovalWorkflow() + { + unset($this->approval_workflow); + } + + /** + * Optional. The approvals needed before access are granted to a requester. No + * approvals are needed if this field is null. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow $var + * @return $this + */ + public function setApprovalWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow::class); + $this->approval_workflow = $var; + + return $this; + } + + /** + * The access granted to a requester on successful approval. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; + * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess|null + */ + public function getPrivilegedAccess() + { + return $this->privileged_access; + } + + public function hasPrivilegedAccess() + { + return isset($this->privileged_access); + } + + public function clearPrivilegedAccess() + { + unset($this->privileged_access); + } + + /** + * The access granted to a requester on successful approval. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; + * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $var + * @return $this + */ + public function setPrivilegedAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess::class); + $this->privileged_access = $var; + + return $this; + } + + /** + * Required. The maximum amount of time that access is granted for a request. + * A requester can ask for a duration less than this, but never more. + * + * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRequestDuration() + { + return $this->max_request_duration; + } + + public function hasMaxRequestDuration() + { + return isset($this->max_request_duration); + } + + public function clearMaxRequestDuration() + { + unset($this->max_request_duration); + } + + /** + * Required. The maximum amount of time that access is granted for a request. + * A requester can ask for a duration less than this, but never more. + * + * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRequestDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_request_duration = $var; + + return $this; + } + + /** + * Output only. Current state of this entitlement. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of this entitlement. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The manner in which the requester should provide a justification + * for requesting access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig|null + */ + public function getRequesterJustificationConfig() + { + return $this->requester_justification_config; + } + + public function hasRequesterJustificationConfig() + { + return isset($this->requester_justification_config); + } + + public function clearRequesterJustificationConfig() + { + unset($this->requester_justification_config); + } + + /** + * Required. The manner in which the requester should provide a justification + * for requesting access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig $var + * @return $this + */ + public function setRequesterJustificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig::class); + $this->requester_justification_config = $var; + + return $this; + } + + /** + * Optional. Additional email addresses to be notified based on actions taken. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets|null + */ + public function getAdditionalNotificationTargets() + { + return $this->additional_notification_targets; + } + + public function hasAdditionalNotificationTargets() + { + return isset($this->additional_notification_targets); + } + + public function clearAdditionalNotificationTargets() + { + unset($this->additional_notification_targets); + } + + /** + * Optional. Additional email addresses to be notified based on actions taken. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets $var + * @return $this + */ + public function setAdditionalNotificationTargets($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets::class); + $this->additional_notification_targets = $var; + + return $this; + } + + /** + * An `etag` is used for optimistic concurrency control as a way to prevent + * simultaneous updates to the same entitlement. An `etag` is returned in the + * response to `GetEntitlement` and the caller should put the `etag` in the + * request to `UpdateEntitlement` so that their change is applied on + * the same version. If this field is omitted or if there is a mismatch while + * updating an entitlement, then the server rejects the request. + * + * Generated from protobuf field string etag = 12; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * An `etag` is used for optimistic concurrency control as a way to prevent + * simultaneous updates to the same entitlement. An `etag` is returned in the + * response to `GetEntitlement` and the caller should put the `etag` in the + * request to `UpdateEntitlement` so that their change is applied on + * the same version. If this field is omitted or if there is a mismatch while + * updating an entitlement, then the server rejects the request. + * + * Generated from protobuf field string etag = 12; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php new file mode 100644 index 00000000000..becc9a4668e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php @@ -0,0 +1,112 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets + */ +class AdditionalNotificationTargets extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Additional email addresses to be notified when a principal + * (requester) is granted access. + * + * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $admin_email_recipients; + /** + * Optional. Additional email address to be notified about an eligible + * entitlement. + * + * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $requester_email_recipients; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $admin_email_recipients + * Optional. Additional email addresses to be notified when a principal + * (requester) is granted access. + * @type array|\Google\Protobuf\Internal\RepeatedField $requester_email_recipients + * Optional. Additional email address to be notified about an eligible + * entitlement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Additional email addresses to be notified when a principal + * (requester) is granted access. + * + * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdminEmailRecipients() + { + return $this->admin_email_recipients; + } + + /** + * Optional. Additional email addresses to be notified when a principal + * (requester) is granted access. + * + * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdminEmailRecipients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->admin_email_recipients = $arr; + + return $this; + } + + /** + * Optional. Additional email address to be notified about an eligible + * entitlement. + * + * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequesterEmailRecipients() + { + return $this->requester_email_recipients; + } + + /** + * Optional. Additional email address to be notified about an eligible + * entitlement. + * + * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequesterEmailRecipients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->requester_email_recipients = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdditionalNotificationTargets::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_AdditionalNotificationTargets::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php new file mode 100644 index 00000000000..41229f2d65e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php @@ -0,0 +1,121 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig + */ +class RequesterJustificationConfig extends \Google\Protobuf\Internal\Message +{ + protected $justification_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory $not_mandatory + * This option means the requester isn't required to provide a + * justification. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured $unstructured + * This option means the requester must provide a string as + * justification. If this is selected, the server allows the requester + * to provide a justification but doesn't validate it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * This option means the requester isn't required to provide a + * justification. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory not_mandatory = 1; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory|null + */ + public function getNotMandatory() + { + return $this->readOneof(1); + } + + public function hasNotMandatory() + { + return $this->hasOneof(1); + } + + /** + * This option means the requester isn't required to provide a + * justification. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory not_mandatory = 1; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory $var + * @return $this + */ + public function setNotMandatory($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This option means the requester must provide a string as + * justification. If this is selected, the server allows the requester + * to provide a justification but doesn't validate it. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured unstructured = 2; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured|null + */ + public function getUnstructured() + { + return $this->readOneof(2); + } + + public function hasUnstructured() + { + return $this->hasOneof(2); + } + + /** + * This option means the requester must provide a string as + * justification. If this is selected, the server allows the requester + * to provide a justification but doesn't validate it. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured unstructured = 2; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured $var + * @return $this + */ + public function setUnstructured($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getJustificationType() + { + return $this->whichOneof("justification_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RequesterJustificationConfig::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php new file mode 100644 index 00000000000..d129ccbacbe --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php @@ -0,0 +1,37 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory + */ +class NotMandatory extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NotMandatory::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig_NotMandatory::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php new file mode 100644 index 00000000000..4c98497f240 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php @@ -0,0 +1,36 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured + */ +class Unstructured extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Unstructured::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig_Unstructured::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php new file mode 100644 index 00000000000..5a21d5c2b65 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php @@ -0,0 +1,85 @@ +google.cloud.privilegedaccessmanager.v1.Entitlement.State + */ +class State +{ + /** + * Unspecified state. This value is never returned by the server. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The entitlement is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The entitlement is available for requesting access. + * + * Generated from protobuf enum AVAILABLE = 2; + */ + const AVAILABLE = 2; + /** + * The entitlement is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The entitlement has been deleted. + * + * Generated from protobuf enum DELETED = 4; + */ + const DELETED = 4; + /** + * The entitlement is being updated. + * + * Generated from protobuf enum UPDATING = 5; + */ + const UPDATING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::AVAILABLE => 'AVAILABLE', + self::DELETING => 'DELETING', + self::DELETED => 'DELETED', + self::UPDATING => 'UPDATING', + ]; + + 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(State::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_State::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php new file mode 100644 index 00000000000..0d9c167a152 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php @@ -0,0 +1,81 @@ +google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest + */ +class GetEntitlementRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\GetEntitlementRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php new file mode 100644 index 00000000000..0ae620397b2 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php @@ -0,0 +1,81 @@ +google.cloud.privilegedaccessmanager.v1.GetGrantRequest + */ +class GetGrantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see PrivilegedAccessManagerClient::grantName()} for help formatting this field. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\GetGrantRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php new file mode 100644 index 00000000000..a0a8bec2887 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php @@ -0,0 +1,560 @@ +google.cloud.privilegedaccessmanager.v1.Grant + */ +class Grant extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this grant. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * The last segment of this name (`{grant-id}`) is autogenerated. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Username of the user who created this grant. + * + * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requester = ''; + /** + * Required. The amount of time access is needed for. This value should be + * less than the `max_request_duration` value of the entitlement. + * + * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $requested_duration = null; + /** + * Optional. Justification of why this access is needed. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $justification = null; + /** + * Output only. Current state of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Timeline of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $timeline = null; + /** + * Output only. The access that would be granted by this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $privileged_access = null; + /** + * Output only. Audit trail of access provided by this grant. If unspecified + * then access was never granted. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $audit_trail = null; + /** + * Optional. Additional email addresses to notify for all the actions + * performed on the grant. + * + * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additional_email_recipients; + /** + * Output only. Flag set by the PAM system to indicate that policy bindings + * made by this grant have been modified from outside PAM. + * After it is set, this flag remains set forever irrespective of the grant + * state. A `true` value here indicates that PAM no longer has any certainty + * on the access a user has because of this grant. + * + * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $externally_modified = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this grant. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * The last segment of this name (`{grant-id}`) is autogenerated. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp. + * @type string $requester + * Output only. Username of the user who created this grant. + * @type \Google\Protobuf\Duration $requested_duration + * Required. The amount of time access is needed for. This value should be + * less than the `max_request_duration` value of the entitlement. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Justification $justification + * Optional. Justification of why this access is needed. + * @type int $state + * Output only. Current state of this grant. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline $timeline + * Output only. Timeline of this grant. + * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $privileged_access + * Output only. The access that would be granted by this grant. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail $audit_trail + * Output only. Audit trail of access provided by this grant. If unspecified + * then access was never granted. + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_email_recipients + * Optional. Additional email addresses to notify for all the actions + * performed on the grant. + * @type bool $externally_modified + * Output only. Flag set by the PAM system to indicate that policy bindings + * made by this grant have been modified from outside PAM. + * After it is set, this flag remains set forever irrespective of the grant + * state. A `true` value here indicates that PAM no longer has any certainty + * on the access a user has because of this grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this grant. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * The last segment of this name (`{grant-id}`) is autogenerated. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this grant. + * Possible formats: + * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + * The last segment of this name (`{grant-id}`) is autogenerated. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Username of the user who created this grant. + * + * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRequester() + { + return $this->requester; + } + + /** + * Output only. Username of the user who created this grant. + * + * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRequester($var) + { + GPBUtil::checkString($var, True); + $this->requester = $var; + + return $this; + } + + /** + * Required. The amount of time access is needed for. This value should be + * less than the `max_request_duration` value of the entitlement. + * + * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getRequestedDuration() + { + return $this->requested_duration; + } + + public function hasRequestedDuration() + { + return isset($this->requested_duration); + } + + public function clearRequestedDuration() + { + unset($this->requested_duration); + } + + /** + * Required. The amount of time access is needed for. This value should be + * less than the `max_request_duration` value of the entitlement. + * + * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRequestedDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->requested_duration = $var; + + return $this; + } + + /** + * Optional. Justification of why this access is needed. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Justification|null + */ + public function getJustification() + { + return $this->justification; + } + + public function hasJustification() + { + return isset($this->justification); + } + + public function clearJustification() + { + unset($this->justification); + } + + /** + * Optional. Justification of why this access is needed. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Justification $var + * @return $this + */ + public function setJustification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Justification::class); + $this->justification = $var; + + return $this; + } + + /** + * Output only. Current state of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Timeline of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline|null + */ + public function getTimeline() + { + return $this->timeline; + } + + public function hasTimeline() + { + return isset($this->timeline); + } + + public function clearTimeline() + { + unset($this->timeline); + } + + /** + * Output only. Timeline of this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline $var + * @return $this + */ + public function setTimeline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline::class); + $this->timeline = $var; + + return $this; + } + + /** + * Output only. The access that would be granted by this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess|null + */ + public function getPrivilegedAccess() + { + return $this->privileged_access; + } + + public function hasPrivilegedAccess() + { + return isset($this->privileged_access); + } + + public function clearPrivilegedAccess() + { + unset($this->privileged_access); + } + + /** + * Output only. The access that would be granted by this grant. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $var + * @return $this + */ + public function setPrivilegedAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess::class); + $this->privileged_access = $var; + + return $this; + } + + /** + * Output only. Audit trail of access provided by this grant. If unspecified + * then access was never granted. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail|null + */ + public function getAuditTrail() + { + return $this->audit_trail; + } + + public function hasAuditTrail() + { + return isset($this->audit_trail); + } + + public function clearAuditTrail() + { + unset($this->audit_trail); + } + + /** + * Output only. Audit trail of access provided by this grant. If unspecified + * then access was never granted. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail $var + * @return $this + */ + public function setAuditTrail($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail::class); + $this->audit_trail = $var; + + return $this; + } + + /** + * Optional. Additional email addresses to notify for all the actions + * performed on the grant. + * + * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalEmailRecipients() + { + return $this->additional_email_recipients; + } + + /** + * Optional. Additional email addresses to notify for all the actions + * performed on the grant. + * + * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalEmailRecipients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_email_recipients = $arr; + + return $this; + } + + /** + * Output only. Flag set by the PAM system to indicate that policy bindings + * made by this grant have been modified from outside PAM. + * After it is set, this flag remains set forever irrespective of the grant + * state. A `true` value here indicates that PAM no longer has any certainty + * on the access a user has because of this grant. + * + * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getExternallyModified() + { + return $this->externally_modified; + } + + /** + * Output only. Flag set by the PAM system to indicate that policy bindings + * made by this grant have been modified from outside PAM. + * After it is set, this flag remains set forever irrespective of the grant + * state. A `true` value here indicates that PAM no longer has any certainty + * on the access a user has because of this grant. + * + * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setExternallyModified($var) + { + GPBUtil::checkBool($var); + $this->externally_modified = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php new file mode 100644 index 00000000000..b4b424134c6 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php @@ -0,0 +1,132 @@ +google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail + */ +class AuditTrail extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time at which access was given. + * + * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $access_grant_time = null; + /** + * Output only. The time at which the system removed access. This could be + * because of an automatic expiry or because of a revocation. + * If unspecified, then access hasn't been removed yet. + * + * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $access_remove_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $access_grant_time + * Output only. The time at which access was given. + * @type \Google\Protobuf\Timestamp $access_remove_time + * Output only. The time at which the system removed access. This could be + * because of an automatic expiry or because of a revocation. + * If unspecified, then access hasn't been removed yet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time at which access was given. + * + * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAccessGrantTime() + { + return $this->access_grant_time; + } + + public function hasAccessGrantTime() + { + return isset($this->access_grant_time); + } + + public function clearAccessGrantTime() + { + unset($this->access_grant_time); + } + + /** + * Output only. The time at which access was given. + * + * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAccessGrantTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->access_grant_time = $var; + + return $this; + } + + /** + * Output only. The time at which the system removed access. This could be + * because of an automatic expiry or because of a revocation. + * If unspecified, then access hasn't been removed yet. + * + * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAccessRemoveTime() + { + return $this->access_remove_time; + } + + public function hasAccessRemoveTime() + { + return isset($this->access_remove_time); + } + + public function clearAccessRemoveTime() + { + unset($this->access_remove_time); + } + + /** + * Output only. The time at which the system removed access. This could be + * because of an automatic expiry or because of a revocation. + * If unspecified, then access hasn't been removed yet. + * + * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAccessRemoveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->access_remove_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AuditTrail::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_AuditTrail::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php new file mode 100644 index 00000000000..11c611d4a05 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php @@ -0,0 +1,126 @@ +google.cloud.privilegedaccessmanager.v1.Grant.State + */ +class State +{ + /** + * Unspecified state. This value is never returned by the server. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The entitlement had an approval workflow configured and this grant is + * waiting for the workflow to complete. + * + * Generated from protobuf enum APPROVAL_AWAITED = 1; + */ + const APPROVAL_AWAITED = 1; + /** + * The approval workflow completed with a denied result. No access is + * granted for this grant. This is a terminal state. + * + * Generated from protobuf enum DENIED = 3; + */ + const DENIED = 3; + /** + * The approval workflow completed successfully with an approved result or + * none was configured. Access is provided at an appropriate time. + * + * Generated from protobuf enum SCHEDULED = 4; + */ + const SCHEDULED = 4; + /** + * Access is being given. + * + * Generated from protobuf enum ACTIVATING = 5; + */ + const ACTIVATING = 5; + /** + * Access was successfully given and is currently active. + * + * Generated from protobuf enum ACTIVE = 6; + */ + const ACTIVE = 6; + /** + * The system could not give access due to a non-retriable error. This is a + * terminal state. + * + * Generated from protobuf enum ACTIVATION_FAILED = 7; + */ + const ACTIVATION_FAILED = 7; + /** + * Expired after waiting for the approval workflow to complete. This is a + * terminal state. + * + * Generated from protobuf enum EXPIRED = 8; + */ + const EXPIRED = 8; + /** + * Access is being revoked. + * + * Generated from protobuf enum REVOKING = 9; + */ + const REVOKING = 9; + /** + * Access was revoked by a user. This is a terminal state. + * + * Generated from protobuf enum REVOKED = 10; + */ + const REVOKED = 10; + /** + * System took back access as the requested duration was over. This is a + * terminal state. + * + * Generated from protobuf enum ENDED = 11; + */ + const ENDED = 11; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::APPROVAL_AWAITED => 'APPROVAL_AWAITED', + self::DENIED => 'DENIED', + self::SCHEDULED => 'SCHEDULED', + self::ACTIVATING => 'ACTIVATING', + self::ACTIVE => 'ACTIVE', + self::ACTIVATION_FAILED => 'ACTIVATION_FAILED', + self::EXPIRED => 'EXPIRED', + self::REVOKING => 'REVOKING', + self::REVOKED => 'REVOKED', + self::ENDED => 'ENDED', + ]; + + 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(State::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_State::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php new file mode 100644 index 00000000000..3ce375e8dd8 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php @@ -0,0 +1,82 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline + */ +class Timeline extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The events that have occurred on this grant. This list + * contains entries in the same order as they occurred. The first entry is + * always be of type `Requested` and there is always at least one entry in + * this array. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event>|\Google\Protobuf\Internal\RepeatedField $events + * Output only. The events that have occurred on this grant. This list + * contains entries in the same order as they occurred. The first entry is + * always be of type `Requested` and there is always at least one entry in + * this array. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The events that have occurred on this grant. This list + * contains entries in the same order as they occurred. The first entry is + * always be of type `Requested` and there is always at least one entry in + * this array. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEvents() + { + return $this->events; + } + + /** + * Output only. The events that have occurred on this grant. This list + * contains entries in the same order as they occurred. The first entry is + * always be of type `Requested` and there is always at least one entry in + * this array. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event::class); + $this->events = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Timeline::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php new file mode 100644 index 00000000000..c1dfe5b7add --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php @@ -0,0 +1,425 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event + */ +class Event extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time (as recorded at server) when this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $event_time = null; + protected $event; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested $requested + * The grant was requested. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved $approved + * The grant was approved. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied $denied + * The grant was denied. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked $revoked + * The grant was revoked. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled $scheduled + * The grant has been scheduled to give access. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated $activated + * The grant was successfully activated to give access. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed $activation_failed + * There was a non-retriable error while trying to give access. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired $expired + * The approval workflow did not complete in the necessary duration, + * and so the grant is expired. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended $ended + * Access given by the grant ended automatically as the approved + * duration was over. + * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified $externally_modified + * The policy bindings made by grant have been modified outside of PAM. + * @type \Google\Protobuf\Timestamp $event_time + * Output only. The time (as recorded at server) when this event occurred. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The grant was requested. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested requested = 2; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested|null + */ + public function getRequested() + { + return $this->readOneof(2); + } + + public function hasRequested() + { + return $this->hasOneof(2); + } + + /** + * The grant was requested. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested requested = 2; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested $var + * @return $this + */ + public function setRequested($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The grant was approved. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved approved = 3; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved|null + */ + public function getApproved() + { + return $this->readOneof(3); + } + + public function hasApproved() + { + return $this->hasOneof(3); + } + + /** + * The grant was approved. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved approved = 3; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved $var + * @return $this + */ + public function setApproved($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The grant was denied. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied denied = 4; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied|null + */ + public function getDenied() + { + return $this->readOneof(4); + } + + public function hasDenied() + { + return $this->hasOneof(4); + } + + /** + * The grant was denied. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied denied = 4; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied $var + * @return $this + */ + public function setDenied($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The grant was revoked. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked revoked = 5; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked|null + */ + public function getRevoked() + { + return $this->readOneof(5); + } + + public function hasRevoked() + { + return $this->hasOneof(5); + } + + /** + * The grant was revoked. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked revoked = 5; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked $var + * @return $this + */ + public function setRevoked($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The grant has been scheduled to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled scheduled = 6; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled|null + */ + public function getScheduled() + { + return $this->readOneof(6); + } + + public function hasScheduled() + { + return $this->hasOneof(6); + } + + /** + * The grant has been scheduled to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled scheduled = 6; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled $var + * @return $this + */ + public function setScheduled($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The grant was successfully activated to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated activated = 7; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated|null + */ + public function getActivated() + { + return $this->readOneof(7); + } + + public function hasActivated() + { + return $this->hasOneof(7); + } + + /** + * The grant was successfully activated to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated activated = 7; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated $var + * @return $this + */ + public function setActivated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * There was a non-retriable error while trying to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed activation_failed = 8; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed|null + */ + public function getActivationFailed() + { + return $this->readOneof(8); + } + + public function hasActivationFailed() + { + return $this->hasOneof(8); + } + + /** + * There was a non-retriable error while trying to give access. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed activation_failed = 8; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed $var + * @return $this + */ + public function setActivationFailed($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The approval workflow did not complete in the necessary duration, + * and so the grant is expired. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired expired = 10; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired|null + */ + public function getExpired() + { + return $this->readOneof(10); + } + + public function hasExpired() + { + return $this->hasOneof(10); + } + + /** + * The approval workflow did not complete in the necessary duration, + * and so the grant is expired. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired expired = 10; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired $var + * @return $this + */ + public function setExpired($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Access given by the grant ended automatically as the approved + * duration was over. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended ended = 11; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended|null + */ + public function getEnded() + { + return $this->readOneof(11); + } + + public function hasEnded() + { + return $this->hasOneof(11); + } + + /** + * Access given by the grant ended automatically as the approved + * duration was over. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended ended = 11; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended $var + * @return $this + */ + public function setEnded($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The policy bindings made by grant have been modified outside of PAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified externally_modified = 12; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified|null + */ + public function getExternallyModified() + { + return $this->readOneof(12); + } + + public function hasExternallyModified() + { + return $this->hasOneof(12); + } + + /** + * The policy bindings made by grant have been modified outside of PAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified externally_modified = 12; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified $var + * @return $this + */ + public function setExternallyModified($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Output only. The time (as recorded at server) when this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time (as recorded at server) when this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getEvent() + { + return $this->whichOneof("event"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Event::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php new file mode 100644 index 00000000000..e79a539e178 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php @@ -0,0 +1,37 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated + */ +class Activated extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Activated::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Activated::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php new file mode 100644 index 00000000000..2b32abb57ea --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php @@ -0,0 +1,80 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed + */ +class ActivationFailed extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The error that occurred while activating the grant. + * + * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $error + * Output only. The error that occurred while activating the grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The error that occurred while activating the grant. + * + * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. The error that occurred while activating the grant. + * + * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ActivationFailed::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_ActivationFailed::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php new file mode 100644 index 00000000000..a3812c8643e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php @@ -0,0 +1,108 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved + */ +class Approved extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The reason provided by the approver for approving the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reason = ''; + /** + * Output only. Username of the user who approved the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $actor = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reason + * Output only. The reason provided by the approver for approving the + * grant. + * @type string $actor + * Output only. Username of the user who approved the grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The reason provided by the approver for approving the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Output only. The reason provided by the approver for approving the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Output only. Username of the user who approved the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getActor() + { + return $this->actor; + } + + /** + * Output only. Username of the user who approved the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActor($var) + { + GPBUtil::checkString($var, True); + $this->actor = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Approved::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Approved::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php new file mode 100644 index 00000000000..4d47a1fc4ec --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php @@ -0,0 +1,108 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied + */ +class Denied extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The reason provided by the approver for denying the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reason = ''; + /** + * Output only. Username of the user who denied the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $actor = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reason + * Output only. The reason provided by the approver for denying the + * grant. + * @type string $actor + * Output only. Username of the user who denied the grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The reason provided by the approver for denying the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Output only. The reason provided by the approver for denying the + * grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Output only. Username of the user who denied the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getActor() + { + return $this->actor; + } + + /** + * Output only. Username of the user who denied the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActor($var) + { + GPBUtil::checkString($var, True); + $this->actor = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Denied::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Denied::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php new file mode 100644 index 00000000000..12539fa8b28 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php @@ -0,0 +1,36 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended + */ +class Ended extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ended::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Ended::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php new file mode 100644 index 00000000000..cfe04ff1100 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php @@ -0,0 +1,36 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired + */ +class Expired extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Expired::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Expired::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php new file mode 100644 index 00000000000..9a95db356b5 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php @@ -0,0 +1,37 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified + */ +class ExternallyModified extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExternallyModified::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_ExternallyModified::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php new file mode 100644 index 00000000000..e0e0b948ea4 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php @@ -0,0 +1,84 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested + */ +class Requested extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time at which this grant expires unless the approval + * workflow completes. If omitted, then the request never expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. The time at which this grant expires unless the approval + * workflow completes. If omitted, then the request never expires. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time at which this grant expires unless the approval + * workflow completes. If omitted, then the request never expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. The time at which this grant expires unless the approval + * workflow completes. If omitted, then the request never expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Requested::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Requested::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php new file mode 100644 index 00000000000..857829bdf5c --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php @@ -0,0 +1,104 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked + */ +class Revoked extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The reason provided by the user for revoking the grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reason = ''; + /** + * Output only. Username of the user who revoked the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $actor = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reason + * Output only. The reason provided by the user for revoking the grant. + * @type string $actor + * Output only. Username of the user who revoked the grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The reason provided by the user for revoking the grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Output only. The reason provided by the user for revoking the grant. + * + * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Output only. Username of the user who revoked the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getActor() + { + return $this->actor; + } + + /** + * Output only. Username of the user who revoked the grant. + * + * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActor($var) + { + GPBUtil::checkString($var, True); + $this->actor = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Revoked::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Revoked::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php new file mode 100644 index 00000000000..1105621b35b --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php @@ -0,0 +1,81 @@ +google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled + */ +class Scheduled extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time at which the access is granted. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $scheduled_activation_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $scheduled_activation_time + * Output only. The time at which the access is granted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time at which the access is granted. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduledActivationTime() + { + return $this->scheduled_activation_time; + } + + public function hasScheduledActivationTime() + { + return isset($this->scheduled_activation_time); + } + + public function clearScheduledActivationTime() + { + unset($this->scheduled_activation_time); + } + + /** + * Output only. The time at which the access is granted. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduledActivationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->scheduled_activation_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Scheduled::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Scheduled::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php new file mode 100644 index 00000000000..1b5d05d4218 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php @@ -0,0 +1,78 @@ +google.cloud.privilegedaccessmanager.v1.Justification + */ +class Justification extends \Google\Protobuf\Internal\Message +{ + protected $justification; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $unstructured_justification + * A free form textual justification. The system only ensures that this + * is not empty. No other kind of validation is performed on the string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * A free form textual justification. The system only ensures that this + * is not empty. No other kind of validation is performed on the string. + * + * Generated from protobuf field string unstructured_justification = 1; + * @return string + */ + public function getUnstructuredJustification() + { + return $this->readOneof(1); + } + + public function hasUnstructuredJustification() + { + return $this->hasOneof(1); + } + + /** + * A free form textual justification. The system only ensures that this + * is not empty. No other kind of validation is performed on the string. + * + * Generated from protobuf field string unstructured_justification = 1; + * @param string $var + * @return $this + */ + public function setUnstructuredJustification($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getJustification() + { + return $this->whichOneof("justification"); + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php new file mode 100644 index 00000000000..73ed3cea30e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php @@ -0,0 +1,221 @@ +google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest + */ +class ListEntitlementsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent which owns the entitlement resources. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent which owns the entitlement resources. Please see + * {@see PrivilegedAccessManagerClient::organizationLocationName()} for help formatting this field. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\ListEntitlementsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent which owns the entitlement resources. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent which owns the entitlement resources. + * + * 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 which owns the entitlement resources. + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server picks an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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 results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering 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; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php new file mode 100644 index 00000000000..6bd0e6f6811 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php @@ -0,0 +1,135 @@ +google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse + */ +class ListEntitlementsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + */ + private $entitlements; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $entitlements + * The list of entitlements. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntitlements() + { + return $this->entitlements; + } + + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntitlements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); + $this->entitlements = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php new file mode 100644 index 00000000000..7d6f0c928b2 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php @@ -0,0 +1,221 @@ +google.cloud.privilegedaccessmanager.v1.ListGrantsRequest + */ +class ListGrantsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource which owns the grants. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent resource which owns the grants. Please see + * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\ListGrantsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource which owns the grants. + * @type int $page_size + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource which owns the grants. + * + * 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 which owns the grants. + * + * 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. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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 results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering 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; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php new file mode 100644 index 00000000000..607290c3055 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php @@ -0,0 +1,135 @@ +google.cloud.privilegedaccessmanager.v1.ListGrantsResponse + */ +class ListGrantsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + */ + private $grants; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $grants + * The list of grants. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGrants() + { + return $this->grants; + } + + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGrants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); + $this->grants = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php new file mode 100644 index 00000000000..cb35f1ca66d --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php @@ -0,0 +1,120 @@ +google.cloud.privilegedaccessmanager.v1.ManualApprovals + */ +class ManualApprovals extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Do the approvers need to provide a justification for their + * actions? + * + * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_approver_justification = false; + /** + * Optional. List of approval steps in this workflow. These steps are followed + * in the specified order sequentially. Only 1 step is supported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $steps; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $require_approver_justification + * Optional. Do the approvers need to provide a justification for their + * actions? + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step>|\Google\Protobuf\Internal\RepeatedField $steps + * Optional. List of approval steps in this workflow. These steps are followed + * in the specified order sequentially. Only 1 step is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Do the approvers need to provide a justification for their + * actions? + * + * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireApproverJustification() + { + return $this->require_approver_justification; + } + + /** + * Optional. Do the approvers need to provide a justification for their + * actions? + * + * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireApproverJustification($var) + { + GPBUtil::checkBool($var); + $this->require_approver_justification = $var; + + return $this; + } + + /** + * Optional. List of approval steps in this workflow. These steps are followed + * in the specified order sequentially. Only 1 step is supported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Optional. List of approval steps in this workflow. These steps are followed + * in the specified order sequentially. Only 1 step is supported. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step::class); + $this->steps = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php new file mode 100644 index 00000000000..db5f51076a5 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php @@ -0,0 +1,154 @@ +google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step + */ +class Step extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The potential set of approvers in this step. This list must + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $approvers; + /** + * Required. How many users from the above list need to approve. If there + * aren't enough distinct users in the list, then the workflow indefinitely + * blocks. Should always be greater than 0. 1 is the only supported value. + * + * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $approvals_needed = 0; + /** + * Optional. Additional email addresses to be notified when a grant is + * pending approval. + * + * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $approver_email_recipients; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $approvers + * Optional. The potential set of approvers in this step. This list must + * contain at most one entry. + * @type int $approvals_needed + * Required. How many users from the above list need to approve. If there + * aren't enough distinct users in the list, then the workflow indefinitely + * blocks. Should always be greater than 0. 1 is the only supported value. + * @type array|\Google\Protobuf\Internal\RepeatedField $approver_email_recipients + * Optional. Additional email addresses to be notified when a grant is + * pending approval. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The potential set of approvers in this step. This list must + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApprovers() + { + return $this->approvers; + } + + /** + * Optional. The potential set of approvers in this step. This list must + * contain at most one entry. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApprovers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry::class); + $this->approvers = $arr; + + return $this; + } + + /** + * Required. How many users from the above list need to approve. If there + * aren't enough distinct users in the list, then the workflow indefinitely + * blocks. Should always be greater than 0. 1 is the only supported value. + * + * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getApprovalsNeeded() + { + return $this->approvals_needed; + } + + /** + * Required. How many users from the above list need to approve. If there + * aren't enough distinct users in the list, then the workflow indefinitely + * blocks. Should always be greater than 0. 1 is the only supported value. + * + * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setApprovalsNeeded($var) + { + GPBUtil::checkInt32($var); + $this->approvals_needed = $var; + + return $this; + } + + /** + * Optional. Additional email addresses to be notified when a grant is + * pending approval. + * + * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApproverEmailRecipients() + { + return $this->approver_email_recipients; + } + + /** + * Optional. Additional email addresses to be notified when a grant is + * pending approval. + * + * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApproverEmailRecipients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->approver_email_recipients = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Step::class, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals_Step::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php new file mode 100644 index 00000000000..1bae5490fa1 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.privilegedaccessmanager.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php new file mode 100644 index 00000000000..6c6c444a62b --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php @@ -0,0 +1,75 @@ +google.cloud.privilegedaccessmanager.v1.PrivilegedAccess + */ +class PrivilegedAccess extends \Google\Protobuf\Internal\Message +{ + protected $access_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess $gcp_iam_access + * Access to a Google Cloud resource through IAM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Access to a Google Cloud resource through IAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess gcp_iam_access = 1; + * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess|null + */ + public function getGcpIamAccess() + { + return $this->readOneof(1); + } + + public function hasGcpIamAccess() + { + return $this->hasOneof(1); + } + + /** + * Access to a Google Cloud resource through IAM. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess gcp_iam_access = 1; + * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess $var + * @return $this + */ + public function setGcpIamAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getAccessType() + { + return $this->whichOneof("access_type"); + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php new file mode 100644 index 00000000000..c0bf5e33ec2 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php @@ -0,0 +1,140 @@ +google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess + */ +class GcpIamAccess extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of this resource. + * + * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_type = ''; + /** + * Required. Name of the resource. + * + * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * Required. Role bindings that are created on successful grant. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $role_bindings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_type + * Required. The type of this resource. + * @type string $resource + * Required. Name of the resource. + * @type array<\Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding>|\Google\Protobuf\Internal\RepeatedField $role_bindings + * Required. Role bindings that are created on successful grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of this resource. + * + * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Required. The type of this resource. + * + * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. Role bindings that are created on successful grant. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoleBindings() + { + return $this->role_bindings; + } + + /** + * Required. Role bindings that are created on successful grant. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoleBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding::class); + $this->role_bindings = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GcpIamAccess::class, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess_GcpIamAccess::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php new file mode 100644 index 00000000000..ac25ba237a7 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php @@ -0,0 +1,132 @@ +google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding + */ +class RoleBinding extends \Google\Protobuf\Internal\Message +{ + /** + * Required. IAM role to be granted. + * https://cloud.google.com/iam/docs/roles-overview. + * + * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $role = ''; + /** + * Optional. The expression field of the IAM condition to be associated + * with the role. If specified, a user with an active grant for this + * entitlement is able to access the resource only if this condition + * evaluates to true for their request. + * This field uses the same CEL format as IAM and supports all attributes + * that IAM supports, except tags. + * https://cloud.google.com/iam/docs/conditions-overview#attributes. + * + * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition_expression = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $role + * Required. IAM role to be granted. + * https://cloud.google.com/iam/docs/roles-overview. + * @type string $condition_expression + * Optional. The expression field of the IAM condition to be associated + * with the role. If specified, a user with an active grant for this + * entitlement is able to access the resource only if this condition + * evaluates to true for their request. + * This field uses the same CEL format as IAM and supports all attributes + * that IAM supports, except tags. + * https://cloud.google.com/iam/docs/conditions-overview#attributes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. IAM role to be granted. + * https://cloud.google.com/iam/docs/roles-overview. + * + * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * Required. IAM role to be granted. + * https://cloud.google.com/iam/docs/roles-overview. + * + * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Optional. The expression field of the IAM condition to be associated + * with the role. If specified, a user with an active grant for this + * entitlement is able to access the resource only if this condition + * evaluates to true for their request. + * This field uses the same CEL format as IAM and supports all attributes + * that IAM supports, except tags. + * https://cloud.google.com/iam/docs/conditions-overview#attributes. + * + * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConditionExpression() + { + return $this->condition_expression; + } + + /** + * Optional. The expression field of the IAM condition to be associated + * with the role. If specified, a user with an active grant for this + * entitlement is able to access the resource only if this condition + * evaluates to true for their request. + * This field uses the same CEL format as IAM and supports all attributes + * that IAM supports, except tags. + * https://cloud.google.com/iam/docs/conditions-overview#attributes. + * + * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConditionExpression($var) + { + GPBUtil::checkString($var, True); + $this->condition_expression = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RoleBinding::class, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess_GcpIamAccess_RoleBinding::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php new file mode 100644 index 00000000000..3dfd782de7b --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php @@ -0,0 +1,101 @@ +google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest + */ +class RevokeGrantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the grant resource which is being revoked. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The reason for revoking this grant. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the grant resource which is being revoked. + * @type string $reason + * Optional. The reason for revoking this grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the grant resource which is being revoked. + * + * 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. Name of the grant resource which is being revoked. + * + * 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; + } + + /** + * Optional. The reason for revoking this grant. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. The reason for revoking this grant. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php new file mode 100644 index 00000000000..90961a6c953 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php @@ -0,0 +1,215 @@ +google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest + */ +class SearchEntitlementsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent which owns the entitlement resources. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Only entitlements where the calling user has this access are + * returned. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $caller_access_type = 0; + /** + * Optional. Only entitlements matching this filter are returned in the + * response. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.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 which owns the entitlement resources. + * @type int $caller_access_type + * Required. Only entitlements where the calling user has this access are + * returned. + * @type string $filter + * Optional. Only entitlements matching this filter are returned in the + * response. + * @type int $page_size + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent which owns the entitlement resources. + * + * 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 which owns the entitlement resources. + * + * 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. Only entitlements where the calling user has this access are + * returned. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getCallerAccessType() + { + return $this->caller_access_type; + } + + /** + * Required. Only entitlements where the calling user has this access are + * returned. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setCallerAccessType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsRequest\CallerAccessType::class); + $this->caller_access_type = $var; + + return $this; + } + + /** + * Optional. Only entitlements matching this filter are returned in the + * response. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only entitlements matching this filter are returned in the + * response. + * + * 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. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php new file mode 100644 index 00000000000..2c00d9d5925 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php @@ -0,0 +1,65 @@ +google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType + */ +class CallerAccessType +{ + /** + * Unspecified access type. + * + * Generated from protobuf enum CALLER_ACCESS_TYPE_UNSPECIFIED = 0; + */ + const CALLER_ACCESS_TYPE_UNSPECIFIED = 0; + /** + * The user has access to create grants using this entitlement. + * + * Generated from protobuf enum GRANT_REQUESTER = 1; + */ + const GRANT_REQUESTER = 1; + /** + * The user has access to approve/deny grants created under this + * entitlement. + * + * Generated from protobuf enum GRANT_APPROVER = 2; + */ + const GRANT_APPROVER = 2; + + private static $valueToName = [ + self::CALLER_ACCESS_TYPE_UNSPECIFIED => 'CALLER_ACCESS_TYPE_UNSPECIFIED', + self::GRANT_REQUESTER => 'GRANT_REQUESTER', + self::GRANT_APPROVER => 'GRANT_APPROVER', + ]; + + 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(CallerAccessType::class, \Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsRequest_CallerAccessType::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php new file mode 100644 index 00000000000..d9db5ec0e7b --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php @@ -0,0 +1,101 @@ +google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse + */ +class SearchEntitlementsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + */ + private $entitlements; + /** + * A token identifying a page of results the server should return. + * + * 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\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $entitlements + * The list of entitlements. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntitlements() + { + return $this->entitlements; + } + + /** + * The list of entitlements. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntitlements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); + $this->entitlements = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php new file mode 100644 index 00000000000..23a63d14ac2 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php @@ -0,0 +1,211 @@ +google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest + */ +class SearchGrantsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent which owns the grant resources. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Only grants which the caller is related to by this relationship + * are returned in the response. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $caller_relationship = 0; + /** + * Optional. Only grants matching this filter are returned in the response. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.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 which owns the grant resources. + * @type int $caller_relationship + * Required. Only grants which the caller is related to by this relationship + * are returned in the response. + * @type string $filter + * Optional. Only grants matching this filter are returned in the response. + * @type int $page_size + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent which owns the grant resources. + * + * 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 which owns the grant resources. + * + * 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. Only grants which the caller is related to by this relationship + * are returned in the response. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getCallerRelationship() + { + return $this->caller_relationship; + } + + /** + * Required. Only grants which the caller is related to by this relationship + * are returned in the response. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setCallerRelationship($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsRequest\CallerRelationshipType::class); + $this->caller_relationship = $var; + + return $this; + } + + /** + * Optional. Only grants matching this filter are returned in the response. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only grants matching this filter are returned in the response. + * + * 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. Requested page size. The server may return fewer items than + * requested. If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. The server may return fewer items than + * requested. If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 5 [(.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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php new file mode 100644 index 00000000000..418d3d22d20 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php @@ -0,0 +1,72 @@ +google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType + */ +class CallerRelationshipType +{ + /** + * Unspecified caller relationship type. + * + * Generated from protobuf enum CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0; + */ + const CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0; + /** + * The user created this grant by calling `CreateGrant` earlier. + * + * Generated from protobuf enum HAD_CREATED = 1; + */ + const HAD_CREATED = 1; + /** + * The user is an approver for the entitlement that this grant is parented + * under and can currently approve/deny it. + * + * Generated from protobuf enum CAN_APPROVE = 2; + */ + const CAN_APPROVE = 2; + /** + * The caller had successfully approved/denied this grant earlier. + * + * Generated from protobuf enum HAD_APPROVED = 3; + */ + const HAD_APPROVED = 3; + + private static $valueToName = [ + self::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED => 'CALLER_RELATIONSHIP_TYPE_UNSPECIFIED', + self::HAD_CREATED => 'HAD_CREATED', + self::CAN_APPROVE => 'CAN_APPROVE', + self::HAD_APPROVED => 'HAD_APPROVED', + ]; + + 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(CallerRelationshipType::class, \Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsRequest_CallerRelationshipType::class); + diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php new file mode 100644 index 00000000000..a1ae7f8fcf1 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php @@ -0,0 +1,101 @@ +google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse + */ +class SearchGrantsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + */ + private $grants; + /** + * A token identifying a page of results the server should return. + * + * 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\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $grants + * The list of grants. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGrants() + { + return $this->grants; + } + + /** + * The list of grants. + * + * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; + * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGrants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); + $this->grants = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php new file mode 100644 index 00000000000..00995c2e21d --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php @@ -0,0 +1,176 @@ +google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest + */ +class UpdateEntitlementRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The entitlement resource that is updated. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entitlement = null; + /** + * Required. The list of fields to update. A field is overwritten if, and only + * if, it is in the mask. Any immutable fields set in the mask are ignored by + * the server. Repeated fields and map fields are only allowed in the last + * position of a `paths` string and overwrite the existing values. Hence an + * update to a repeated field or a map should contain the entire list of + * values. The fields specified in the update_mask are relative to the + * resource and not to the request. + * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + * A value of '*' for this field refers to full replacement of the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement Required. The entitlement resource that is updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. A field is overwritten if, and only + * if, it is in the mask. Any immutable fields set in the mask are ignored by + * the server. Repeated fields and map fields are only allowed in the last + * position of a `paths` string and overwrite the existing values. Hence an + * update to a repeated field or a map should contain the entire list of + * values. The fields specified in the update_mask are relative to the + * resource and not to the request. + * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + * A value of '*' for this field refers to full replacement of the resource. + * + * @return \Google\Cloud\PrivilegedAccessManager\V1\UpdateEntitlementRequest + * + * @experimental + */ + public static function build(\Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEntitlement($entitlement) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement + * Required. The entitlement resource that is updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. A field is overwritten if, and only + * if, it is in the mask. Any immutable fields set in the mask are ignored by + * the server. Repeated fields and map fields are only allowed in the last + * position of a `paths` string and overwrite the existing values. Hence an + * update to a repeated field or a map should contain the entire list of + * values. The fields specified in the update_mask are relative to the + * resource and not to the request. + * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + * A value of '*' for this field refers to full replacement of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The entitlement resource that is updated. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement|null + */ + public function getEntitlement() + { + return $this->entitlement; + } + + public function hasEntitlement() + { + return isset($this->entitlement); + } + + public function clearEntitlement() + { + unset($this->entitlement); + } + + /** + * Required. The entitlement resource that is updated. + * + * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $var + * @return $this + */ + public function setEntitlement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); + $this->entitlement = $var; + + return $this; + } + + /** + * Required. The list of fields to update. A field is overwritten if, and only + * if, it is in the mask. Any immutable fields set in the mask are ignored by + * the server. Repeated fields and map fields are only allowed in the last + * position of a `paths` string and overwrite the existing values. Hence an + * update to a repeated field or a map should contain the entire list of + * values. The fields specified in the update_mask are relative to the + * resource and not to the request. + * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + * A value of '*' for this field refers to full replacement of the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. The list of fields to update. A field is overwritten if, and only + * if, it is in the mask. Any immutable fields set in the mask are ignored by + * the server. Repeated fields and map fields are only allowed in the last + * position of a `paths` string and overwrite the existing values. Hence an + * update to a repeated field or a map should contain the entire list of + * values. The fields specified in the update_mask are relative to the + * resource and not to the request. + * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + * A value of '*' for this field refers to full replacement of the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php new file mode 100644 index 00000000000..05834ac27ac --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Grant $response */ + $response = $privilegedAccessManagerClient->approveGrant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::grantName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]', + '[GRANT]' + ); + + approve_grant_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php new file mode 100644 index 00000000000..27397e94e9e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var CheckOnboardingStatusResponse $response */ + $response = $privilegedAccessManagerClient->checkOnboardingStatus($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + check_onboarding_status_sample($formattedParent); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php new file mode 100644 index 00000000000..a0fe55e1571 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php @@ -0,0 +1,110 @@ +setMaxRequestDuration($entitlementMaxRequestDuration) + ->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $request = (new CreateEntitlementRequest()) + ->setParent($formattedParent) + ->setEntitlementId($entitlementId) + ->setEntitlement($entitlement); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $privilegedAccessManagerClient->createEntitlement($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Entitlement $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + $entitlementId = '[ENTITLEMENT_ID]'; + + create_entitlement_sample($formattedParent, $entitlementId); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php new file mode 100644 index 00000000000..17db7704940 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php @@ -0,0 +1,82 @@ +setRequestedDuration($grantRequestedDuration); + $request = (new CreateGrantRequest()) + ->setParent($formattedParent) + ->setGrant($grant); + + // Call the API and handle any network failures. + try { + /** @var Grant $response */ + $response = $privilegedAccessManagerClient->createGrant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::entitlementName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]' + ); + + create_grant_sample($formattedParent); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php new file mode 100644 index 00000000000..cd0537c801a --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php @@ -0,0 +1,89 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $privilegedAccessManagerClient->deleteEntitlement($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Entitlement $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::entitlementName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]' + ); + + delete_entitlement_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php new file mode 100644 index 00000000000..974f96ea468 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Grant $response */ + $response = $privilegedAccessManagerClient->denyGrant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::grantName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]', + '[GRANT]' + ); + + deny_grant_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php new file mode 100644 index 00000000000..c878c1ad474 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Entitlement $response */ + $response = $privilegedAccessManagerClient->getEntitlement($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::entitlementName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]' + ); + + get_entitlement_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php new file mode 100644 index 00000000000..a9e743f430e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Grant $response */ + $response = $privilegedAccessManagerClient->getGrant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::grantName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]', + '[GRANT]' + ); + + get_grant_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php new file mode 100644 index 00000000000..b02af6346a3 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetLocation_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php new file mode 100644 index 00000000000..114740d454e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privilegedAccessManagerClient->listEntitlements($request); + + /** @var Entitlement $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + list_entitlements_sample($formattedParent); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php new file mode 100644 index 00000000000..66ca9108974 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privilegedAccessManagerClient->listGrants($request); + + /** @var Grant $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::entitlementName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]' + ); + + list_grants_sample($formattedParent); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php new file mode 100644 index 00000000000..70df0f2bbf5 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListLocations_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php new file mode 100644 index 00000000000..b1a0fc69e1f --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php @@ -0,0 +1,89 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $privilegedAccessManagerClient->revokeGrant($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Grant $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PrivilegedAccessManagerClient::grantName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]', + '[GRANT]' + ); + + revoke_grant_sample($formattedName); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php new file mode 100644 index 00000000000..cc8638429b2 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setCallerAccessType($callerAccessType); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privilegedAccessManagerClient->searchEntitlements($request); + + /** @var Entitlement $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; + + search_entitlements_sample($formattedParent, $callerAccessType); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php new file mode 100644 index 00000000000..8fe879c7997 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php @@ -0,0 +1,86 @@ +setParent($formattedParent) + ->setCallerRelationship($callerRelationship); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privilegedAccessManagerClient->searchGrants($request); + + /** @var Grant $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PrivilegedAccessManagerClient::entitlementName( + '[PROJECT]', + '[LOCATION]', + '[ENTITLEMENT]' + ); + $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; + + search_grants_sample($formattedParent, $callerRelationship); +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php new file mode 100644 index 00000000000..8fb6bacf144 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php @@ -0,0 +1,99 @@ +setMaxRequestDuration($entitlementMaxRequestDuration) + ->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $updateMask = new FieldMask(); + $request = (new UpdateEntitlementRequest()) + ->setEntitlement($entitlement) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $privilegedAccessManagerClient->updateEntitlement($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Entitlement $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php new file mode 100644 index 00000000000..6ea2e6dafe7 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php @@ -0,0 +1,982 @@ + approveGrantAsync(ApproveGrantRequest $request, array $optionalArgs = []) + * @method PromiseInterface checkOnboardingStatusAsync(CheckOnboardingStatusRequest $request, array $optionalArgs = []) + * @method PromiseInterface createEntitlementAsync(CreateEntitlementRequest $request, array $optionalArgs = []) + * @method PromiseInterface createGrantAsync(CreateGrantRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteEntitlementAsync(DeleteEntitlementRequest $request, array $optionalArgs = []) + * @method PromiseInterface denyGrantAsync(DenyGrantRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEntitlementAsync(GetEntitlementRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGrantAsync(GetGrantRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEntitlementsAsync(ListEntitlementsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGrantsAsync(ListGrantsRequest $request, array $optionalArgs = []) + * @method PromiseInterface revokeGrantAsync(RevokeGrantRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchEntitlementsAsync(SearchEntitlementsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchGrantsAsync(SearchGrantsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateEntitlementAsync(UpdateEntitlementRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class PrivilegedAccessManagerClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'privilegedaccessmanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'privilegedaccessmanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/privileged_access_manager_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/privileged_access_manager_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/privileged_access_manager_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/privileged_access_manager_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a entitlement + * resource. + * + * @param string $project + * @param string $location + * @param string $entitlement + * + * @return string The formatted entitlement resource. + */ + public static function entitlementName(string $project, string $location, string $entitlement): string + { + return self::getPathTemplate('entitlement')->render([ + 'project' => $project, + 'location' => $location, + 'entitlement' => $entitlement, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location resource. + * + * @param string $folder + * @param string $location + * + * @return string The formatted folder_location resource. + */ + public static function folderLocationName(string $folder, string $location): string + { + return self::getPathTemplate('folderLocation')->render([ + 'folder' => $folder, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_entitlement resource. + * + * @param string $folder + * @param string $location + * @param string $entitlement + * + * @return string The formatted folder_location_entitlement resource. + */ + public static function folderLocationEntitlementName(string $folder, string $location, string $entitlement): string + { + return self::getPathTemplate('folderLocationEntitlement')->render([ + 'folder' => $folder, + 'location' => $location, + 'entitlement' => $entitlement, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_entitlement_grant resource. + * + * @param string $folder + * @param string $location + * @param string $entitlement + * @param string $grant + * + * @return string The formatted folder_location_entitlement_grant resource. + */ + public static function folderLocationEntitlementGrantName(string $folder, string $location, string $entitlement, string $grant): string + { + return self::getPathTemplate('folderLocationEntitlementGrant')->render([ + 'folder' => $folder, + 'location' => $location, + 'entitlement' => $entitlement, + 'grant' => $grant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a grant + * resource. + * + * @param string $project + * @param string $location + * @param string $entitlement + * @param string $grant + * + * @return string The formatted grant resource. + */ + public static function grantName(string $project, string $location, string $entitlement, string $grant): string + { + return self::getPathTemplate('grant')->render([ + 'project' => $project, + 'location' => $location, + 'entitlement' => $entitlement, + 'grant' => $grant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted organization_location resource. + */ + public static function organizationLocationName(string $organization, string $location): string + { + return self::getPathTemplate('organizationLocation')->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_entitlement resource. + * + * @param string $organization + * @param string $location + * @param string $entitlement + * + * @return string The formatted organization_location_entitlement resource. + */ + public static function organizationLocationEntitlementName(string $organization, string $location, string $entitlement): string + { + return self::getPathTemplate('organizationLocationEntitlement')->render([ + 'organization' => $organization, + 'location' => $location, + 'entitlement' => $entitlement, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_entitlement_grant resource. + * + * @param string $organization + * @param string $location + * @param string $entitlement + * @param string $grant + * + * @return string The formatted organization_location_entitlement_grant resource. + */ + public static function organizationLocationEntitlementGrantName(string $organization, string $location, string $entitlement, string $grant): string + { + return self::getPathTemplate('organizationLocationEntitlementGrant')->render([ + 'organization' => $organization, + 'location' => $location, + 'entitlement' => $entitlement, + 'grant' => $grant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_entitlement resource. + * + * @param string $project + * @param string $location + * @param string $entitlement + * + * @return string The formatted project_location_entitlement resource. + */ + public static function projectLocationEntitlementName(string $project, string $location, string $entitlement): string + { + return self::getPathTemplate('projectLocationEntitlement')->render([ + 'project' => $project, + 'location' => $location, + 'entitlement' => $entitlement, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_entitlement_grant resource. + * + * @param string $project + * @param string $location + * @param string $entitlement + * @param string $grant + * + * @return string The formatted project_location_entitlement_grant resource. + */ + public static function projectLocationEntitlementGrantName(string $project, string $location, string $entitlement, string $grant): string + { + return self::getPathTemplate('projectLocationEntitlementGrant')->render([ + 'project' => $project, + 'location' => $location, + 'entitlement' => $entitlement, + 'grant' => $grant, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - entitlement: projects/{project}/locations/{location}/entitlements/{entitlement} + * - folderLocation: folders/{folder}/locations/{location} + * - folderLocationEntitlement: folders/{folder}/locations/{location}/entitlements/{entitlement} + * - folderLocationEntitlementGrant: folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant} + * - grant: projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant} + * - location: projects/{project}/locations/{location} + * - organizationLocation: organizations/{organization}/locations/{location} + * - organizationLocationEntitlement: organizations/{organization}/locations/{location}/entitlements/{entitlement} + * - organizationLocationEntitlementGrant: organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant} + * - projectLocationEntitlement: projects/{project}/locations/{location}/entitlements/{entitlement} + * - projectLocationEntitlementGrant: projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'privilegedaccessmanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * `ApproveGrant` is used to approve a grant. This method can only be called + * on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't + * be undone. + * + * The async variant is {@see PrivilegedAccessManagerClient::approveGrantAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/approve_grant.php + * + * @param ApproveGrantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Grant + * + * @throws ApiException Thrown if the API call fails. + */ + public function approveGrant(ApproveGrantRequest $request, array $callOptions = []): Grant + { + return $this->startApiCall('ApproveGrant', $request, $callOptions)->wait(); + } + + /** + * `CheckOnboardingStatus` reports the onboarding status for a + * project/folder/organization. Any findings reported by this API need to be + * fixed before PAM can be used on the resource. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::checkOnboardingStatusAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php + * + * @param CheckOnboardingStatusRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CheckOnboardingStatusResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function checkOnboardingStatus(CheckOnboardingStatusRequest $request, array $callOptions = []): CheckOnboardingStatusResponse + { + return $this->startApiCall('CheckOnboardingStatus', $request, $callOptions)->wait(); + } + + /** + * Creates a new entitlement in a given project/folder/organization and + * location. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::createEntitlementAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/create_entitlement.php + * + * @param CreateEntitlementRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEntitlement(CreateEntitlementRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateEntitlement', $request, $callOptions)->wait(); + } + + /** + * Creates a new grant in a given project/folder/organization and + * location. + * + * The async variant is {@see PrivilegedAccessManagerClient::createGrantAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/create_grant.php + * + * @param CreateGrantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Grant + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGrant(CreateGrantRequest $request, array $callOptions = []): Grant + { + return $this->startApiCall('CreateGrant', $request, $callOptions)->wait(); + } + + /** + * Deletes a single entitlement. This method can only be called when there + * are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the + * entitlement. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::deleteEntitlementAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php + * + * @param DeleteEntitlementRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEntitlement(DeleteEntitlementRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteEntitlement', $request, $callOptions)->wait(); + } + + /** + * `DenyGrant` is used to deny a grant. This method can only be called on a + * grant when it's in the `APPROVAL_AWAITED` state. This operation can't be + * undone. + * + * The async variant is {@see PrivilegedAccessManagerClient::denyGrantAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/deny_grant.php + * + * @param DenyGrantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Grant + * + * @throws ApiException Thrown if the API call fails. + */ + public function denyGrant(DenyGrantRequest $request, array $callOptions = []): Grant + { + return $this->startApiCall('DenyGrant', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single entitlement. + * + * The async variant is {@see PrivilegedAccessManagerClient::getEntitlementAsync()} + * . + * + * @example samples/V1/PrivilegedAccessManagerClient/get_entitlement.php + * + * @param GetEntitlementRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Entitlement + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEntitlement(GetEntitlementRequest $request, array $callOptions = []): Entitlement + { + return $this->startApiCall('GetEntitlement', $request, $callOptions)->wait(); + } + + /** + * Get details of a single grant. + * + * The async variant is {@see PrivilegedAccessManagerClient::getGrantAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/get_grant.php + * + * @param GetGrantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Grant + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGrant(GetGrantRequest $request, array $callOptions = []): Grant + { + return $this->startApiCall('GetGrant', $request, $callOptions)->wait(); + } + + /** + * Lists entitlements in a given project/folder/organization and location. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::listEntitlementsAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/list_entitlements.php + * + * @param ListEntitlementsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEntitlements(ListEntitlementsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEntitlements', $request, $callOptions); + } + + /** + * Lists grants for a given entitlement. + * + * The async variant is {@see PrivilegedAccessManagerClient::listGrantsAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/list_grants.php + * + * @param ListGrantsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGrants(ListGrantsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGrants', $request, $callOptions); + } + + /** + * `RevokeGrant` is used to immediately revoke access for a grant. This method + * can be called when the grant is in a non-terminal state. + * + * The async variant is {@see PrivilegedAccessManagerClient::revokeGrantAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/revoke_grant.php + * + * @param RevokeGrantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function revokeGrant(RevokeGrantRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RevokeGrant', $request, $callOptions)->wait(); + } + + /** + * `SearchEntitlements` returns entitlements on which the caller has the + * specified access. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::searchEntitlementsAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/search_entitlements.php + * + * @param SearchEntitlementsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchEntitlements(SearchEntitlementsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchEntitlements', $request, $callOptions); + } + + /** + * `SearchGrants` returns grants that are related to the calling user in the + * specified way. + * + * The async variant is {@see PrivilegedAccessManagerClient::searchGrantsAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/search_grants.php + * + * @param SearchGrantsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchGrants(SearchGrantsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchGrants', $request, $callOptions); + } + + /** + * Updates the entitlement specified in the request. Updated fields in the + * entitlement need to be specified in an update mask. The changes made to an + * entitlement are applicable only on future grants of the entitlement. + * However, if new approvers are added or existing approvers are removed from + * the approval workflow, the changes are effective on existing grants. + * + * The following fields are not supported for updates: + * + * * All immutable fields + * * Entitlement name + * * Resource name + * * Resource type + * * Adding an approval workflow in an entitlement which previously had no + * approval workflow. + * * Deleting the approval workflow from an entitlement. + * * Adding or deleting a step in the approval workflow (only one step is + * supported) + * + * Note that updates are allowed on the list of approvers in an approval + * workflow step. + * + * The async variant is + * {@see PrivilegedAccessManagerClient::updateEntitlementAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/update_entitlement.php + * + * @param UpdateEntitlementRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEntitlement(UpdateEntitlementRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateEntitlement', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see PrivilegedAccessManagerClient::getLocationAsync()} . + * + * @example samples/V1/PrivilegedAccessManagerClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see PrivilegedAccessManagerClient::listLocationsAsync()} + * . + * + * @example samples/V1/PrivilegedAccessManagerClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..11348c76a35 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.privilegedaccessmanager.v1", + "libraryPackage": "Google\\Cloud\\PrivilegedAccessManager\\V1", + "services": { + "PrivilegedAccessManager": { + "clients": { + "grpc": { + "libraryClient": "PrivilegedAccessManagerGapicClient", + "rpcs": { + "ApproveGrant": { + "methods": [ + "approveGrant" + ] + }, + "CheckOnboardingStatus": { + "methods": [ + "checkOnboardingStatus" + ] + }, + "CreateEntitlement": { + "methods": [ + "createEntitlement" + ] + }, + "CreateGrant": { + "methods": [ + "createGrant" + ] + }, + "DeleteEntitlement": { + "methods": [ + "deleteEntitlement" + ] + }, + "DenyGrant": { + "methods": [ + "denyGrant" + ] + }, + "GetEntitlement": { + "methods": [ + "getEntitlement" + ] + }, + "GetGrant": { + "methods": [ + "getGrant" + ] + }, + "ListEntitlements": { + "methods": [ + "listEntitlements" + ] + }, + "ListGrants": { + "methods": [ + "listGrants" + ] + }, + "RevokeGrant": { + "methods": [ + "revokeGrant" + ] + }, + "SearchEntitlements": { + "methods": [ + "searchEntitlements" + ] + }, + "SearchGrants": { + "methods": [ + "searchGrants" + ] + }, + "UpdateEntitlement": { + "methods": [ + "updateEntitlement" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json new file mode 100644 index 00000000000..f0c28f65f16 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ApproveGrant": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckOnboardingStatus": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGrant": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DenyGrant": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetGrant": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEntitlements": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListGrants": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RevokeGrant": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchEntitlements": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchGrants": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php new file mode 100644 index 00000000000..d18ec8a088e --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php @@ -0,0 +1,304 @@ + [ + 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' => [ + 'CreateEntitlement' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', + 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '900000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntitlement' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', + 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '900000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RevokeGrant' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Grant', + 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '900000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateEntitlement' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', + 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '900000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'entitlement.name', + 'fieldAccessors' => [ + 'getEntitlement', + 'getName', + ], + ], + ], + ], + 'ApproveGrant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CheckOnboardingStatus' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateGrant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DenyGrant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEntitlement' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Entitlement', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGrant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEntitlements' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntitlements', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\ListEntitlementsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListGrants' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGrants', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\ListGrantsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchEntitlements' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntitlements', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchGrants' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGrants', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'entitlement' => 'projects/{project}/locations/{location}/entitlements/{entitlement}', + 'folderLocation' => 'folders/{folder}/locations/{location}', + 'folderLocationEntitlement' => 'folders/{folder}/locations/{location}/entitlements/{entitlement}', + 'folderLocationEntitlementGrant' => 'folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}', + 'grant' => 'projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}', + 'location' => 'projects/{project}/locations/{location}', + 'organizationLocation' => 'organizations/{organization}/locations/{location}', + 'organizationLocationEntitlement' => 'organizations/{organization}/locations/{location}/entitlements/{entitlement}', + 'organizationLocationEntitlementGrant' => 'organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}', + 'projectLocationEntitlement' => 'projects/{project}/locations/{location}/entitlements/{entitlement}', + 'projectLocationEntitlementGrant' => 'projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}', + ], + ], + ], +]; diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php new file mode 100644 index 00000000000..646f631df4f --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php @@ -0,0 +1,469 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*}/locations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' => [ + 'ApproveGrant' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:approve', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:approve', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:approve', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CheckOnboardingStatus' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:checkOnboardingStatus', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}:checkOnboardingStatus', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}:checkOnboardingStatus', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntitlement' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements', + 'body' => 'entitlement', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements', + 'body' => 'entitlement', + 'queryParams' => [ + 'entitlement_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements', + 'body' => 'entitlement', + 'queryParams' => [ + 'entitlement_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'entitlement_id', + ], + ], + 'CreateGrant' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants', + 'body' => 'grant', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants', + 'body' => 'grant', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants', + 'body' => 'grant', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntitlement' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DenyGrant' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:deny', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:deny', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:deny', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEntitlement' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGrant' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEntitlements' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListGrants' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RevokeGrant' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:revoke', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:revoke', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:revoke', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchEntitlements' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchGrants' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntitlement' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{entitlement.name=projects/*/locations/*/entitlements/*}', + 'body' => 'entitlement', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{entitlement.name=organizations/*/locations/*/entitlements/*}', + 'body' => 'entitlement', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{entitlement.name=folders/*/locations/*/entitlements/*}', + 'body' => 'entitlement', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'entitlement.name' => [ + 'getters' => [ + 'getEntitlement', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php b/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php new file mode 100644 index 00000000000..28f485267b0 --- /dev/null +++ b/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php @@ -0,0 +1,1499 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PrivilegedAccessManagerClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PrivilegedAccessManagerClient($options); + } + + /** @test */ + public function approveGrantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name2); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new ApproveGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->approveGrant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ApproveGrant', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function approveGrantExceptionTest() + { + $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new ApproveGrantRequest()) + ->setName($formattedName); + try { + $gapicClient->approveGrant($request); + // 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 checkOnboardingStatusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new CheckOnboardingStatusResponse(); + $expectedResponse->setServiceAccount($serviceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new CheckOnboardingStatusRequest()) + ->setParent($formattedParent); + $response = $gapicClient->checkOnboardingStatus($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/CheckOnboardingStatus', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkOnboardingStatusExceptionTest() + { + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new CheckOnboardingStatusRequest()) + ->setParent($formattedParent); + try { + $gapicClient->checkOnboardingStatus($request); + // 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 createEntitlementTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createEntitlementTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $etag = 'etag3123477'; + $expectedResponse = new Entitlement(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createEntitlementTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $entitlementId = 'entitlementId-1715775123'; + $entitlement = new Entitlement(); + $entitlementMaxRequestDuration = new Duration(); + $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); + $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); + $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $request = (new CreateEntitlementRequest()) + ->setParent($formattedParent) + ->setEntitlementId($entitlementId) + ->setEntitlement($entitlement); + $response = $gapicClient->createEntitlement($request); + $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.privilegedaccessmanager.v1.PrivilegedAccessManager/CreateEntitlement', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntitlementId(); + $this->assertProtobufEquals($entitlementId, $actualValue); + $actualValue = $actualApiRequestObject->getEntitlement(); + $this->assertProtobufEquals($entitlement, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createEntitlementTest'); + $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 createEntitlementExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createEntitlementTest'); + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $entitlementId = 'entitlementId-1715775123'; + $entitlement = new Entitlement(); + $entitlementMaxRequestDuration = new Duration(); + $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); + $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); + $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $request = (new CreateEntitlementRequest()) + ->setParent($formattedParent) + ->setEntitlementId($entitlementId) + ->setEntitlement($entitlement); + $response = $gapicClient->createEntitlement($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createEntitlementTest'); + 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 createGrantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $grant = new Grant(); + $grantRequestedDuration = new Duration(); + $grant->setRequestedDuration($grantRequestedDuration); + $request = (new CreateGrantRequest()) + ->setParent($formattedParent) + ->setGrant($grant); + $response = $gapicClient->createGrant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/CreateGrant', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGrant(); + $this->assertProtobufEquals($grant, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGrantExceptionTest() + { + $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $grant = new Grant(); + $grantRequestedDuration = new Duration(); + $grant->setRequestedDuration($grantRequestedDuration); + $request = (new CreateGrantRequest()) + ->setParent($formattedParent) + ->setGrant($grant); + try { + $gapicClient->createGrant($request); + // 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 deleteEntitlementTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteEntitlementTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new Entitlement(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteEntitlementTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new DeleteEntitlementRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteEntitlement($request); + $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.privilegedaccessmanager.v1.PrivilegedAccessManager/DeleteEntitlement', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteEntitlementTest'); + $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 deleteEntitlementExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteEntitlementTest'); + $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 + $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new DeleteEntitlementRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteEntitlement($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteEntitlementTest'); + 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 denyGrantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name2); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new DenyGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->denyGrant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/DenyGrant', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function denyGrantExceptionTest() + { + $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new DenyGrantRequest()) + ->setName($formattedName); + try { + $gapicClient->denyGrant($request); + // 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 getEntitlementTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new Entitlement(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new GetEntitlementRequest()) + ->setName($formattedName); + $response = $gapicClient->getEntitlement($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/GetEntitlement', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEntitlementExceptionTest() + { + $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new GetEntitlementRequest()) + ->setName($formattedName); + try { + $gapicClient->getEntitlement($request); + // 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 getGrantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name2); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new GetGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->getGrant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/GetGrant', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGrantExceptionTest() + { + $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new GetGrantRequest()) + ->setName($formattedName); + try { + $gapicClient->getGrant($request); + // 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 listEntitlementsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $entitlementsElement = new Entitlement(); + $entitlements = [ + $entitlementsElement, + ]; + $expectedResponse = new ListEntitlementsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEntitlements($entitlements); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListEntitlementsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEntitlements($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntitlements()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ListEntitlements', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEntitlementsExceptionTest() + { + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListEntitlementsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEntitlements($request); + // 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 listGrantsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $grantsElement = new Grant(); + $grants = [ + $grantsElement, + ]; + $expectedResponse = new ListGrantsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGrants($grants); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new ListGrantsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGrants($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGrants()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ListGrants', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGrantsExceptionTest() + { + $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $request = (new ListGrantsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGrants($request); + // 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 revokeGrantTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/revokeGrantTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name2); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/revokeGrantTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new RevokeGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->revokeGrant($request); + $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.privilegedaccessmanager.v1.PrivilegedAccessManager/RevokeGrant', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/revokeGrantTest'); + $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 revokeGrantExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/revokeGrantTest'); + $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 + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new RevokeGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->revokeGrant($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/revokeGrantTest'); + 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 searchEntitlementsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $entitlementsElement = new Entitlement(); + $entitlements = [ + $entitlementsElement, + ]; + $expectedResponse = new SearchEntitlementsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEntitlements($entitlements); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; + $request = (new SearchEntitlementsRequest()) + ->setParent($formattedParent) + ->setCallerAccessType($callerAccessType); + $response = $gapicClient->searchEntitlements($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntitlements()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/SearchEntitlements', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCallerAccessType(); + $this->assertProtobufEquals($callerAccessType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchEntitlementsExceptionTest() + { + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; + $request = (new SearchEntitlementsRequest()) + ->setParent($formattedParent) + ->setCallerAccessType($callerAccessType); + try { + $gapicClient->searchEntitlements($request); + // 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 searchGrantsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $grantsElement = new Grant(); + $grants = [ + $grantsElement, + ]; + $expectedResponse = new SearchGrantsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGrants($grants); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; + $request = (new SearchGrantsRequest()) + ->setParent($formattedParent) + ->setCallerRelationship($callerRelationship); + $response = $gapicClient->searchGrants($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGrants()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/SearchGrants', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCallerRelationship(); + $this->assertProtobufEquals($callerRelationship, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchGrantsExceptionTest() + { + $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); + $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; + $request = (new SearchGrantsRequest()) + ->setParent($formattedParent) + ->setCallerRelationship($callerRelationship); + try { + $gapicClient->searchGrants($request); + // 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 updateEntitlementTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateEntitlementTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $etag = 'etag3123477'; + $expectedResponse = new Entitlement(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateEntitlementTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $entitlement = new Entitlement(); + $entitlementMaxRequestDuration = new Duration(); + $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); + $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); + $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $updateMask = new FieldMask(); + $request = (new UpdateEntitlementRequest()) + ->setEntitlement($entitlement) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEntitlement($request); + $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.privilegedaccessmanager.v1.PrivilegedAccessManager/UpdateEntitlement', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getEntitlement(); + $this->assertProtobufEquals($entitlement, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateEntitlementTest'); + $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 updateEntitlementExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateEntitlementTest'); + $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 + $entitlement = new Entitlement(); + $entitlementMaxRequestDuration = new Duration(); + $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); + $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); + $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); + $updateMask = new FieldMask(); + $request = (new UpdateEntitlementRequest()) + ->setEntitlement($entitlement) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEntitlement($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateEntitlementTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 approveGrantAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $requester = 'requester693933948'; + $externallyModified = true; + $expectedResponse = new Grant(); + $expectedResponse->setName($name2); + $expectedResponse->setRequester($requester); + $expectedResponse->setExternallyModified($externallyModified); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); + $request = (new ApproveGrantRequest()) + ->setName($formattedName); + $response = $gapicClient->approveGrantAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ApproveGrant', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php b/owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php new file mode 100644 index 0000000000000000000000000000000000000000..2ccee3ee6a7c23632bd0a812ccfc4687680aa274 GIT binary patch literal 4189 zcmdT{&2!sC6i0SGnst-9TW0FI9S|m+x@jVVGcZLVfMPpoAdNkVTL#868d+W^BC;f; zb<)tufsf(9l>-M3oMDC;{)gUrESz$o2Tnb3;K+gDt+Z0)q``J>F?y|=&jdtbY6 zzw2x}=v8rrSj5#RX^G8!k!};wacyerwkbBd?KW{m-R?MsNnA-3%T;l`S{Ezj)%q)- z>e*daC$hL@+gm0nw8$>CZPP30rrm9UnKn}^>=p~*TJmipWN97ZIhszymDLbaAg zwZ@8Xrcvf*8l||I#{J>~Lb|DWo>=3i(L*G{pVMuchAw(kqwq6rc&cF;)X+@hGw^Cr zY-^@RK>4I>yKCvxuq}}(R4tw4Z;F9UCOhqbH=rK^gJY=;q%>A7N?c1b0jj6FhC^+) z2BNaOMQB7P`;x!Ok7eeJwwMnv%JK=2iz0QqB!0Rmx`cLJYr)6O3>-wO#&c*>9HXIF zmd#kOEl-w@d^$35nqtW`h((9fSvH8-S|Z!pu3@{wscsOSIs=1@xG#4hS;4`<4~$fO zz;`uo=M1`a12UFs9q0MFeyYs9WAMaKTCFG#mZ1ppQRG-0Z=mn4pu&(vgL#!nVU$lfTg70pR;#@kjf? z0Ue>ia=#1c#ga>)2SKP<&)6WJc7bjD9vX8r7yQVKh(dm1>9xO=IdseS zJ4D&hENu&VQ-BgY_ax|71u*mp(U}F*B93YAcbF9ctfY#wT=;Y*rE;W$OXxfRXQ))V z?~qJFOy;MGbNy{_U+SQg`(8j-0}re1wrN4b=1OqLbG!y6*GiWD7i!S z1IF%m@kZaGByJ)(%=bS7$Rwwv6IL)fhD?H?@gYX6rd}2}uxgQ0D zVugkg;?kYm)(nsG5O`sSDn%VC zDBSs{N@D0HbrDTC(8N>^?km2dqnMGwK2dvzSQ(b66S=RUOnWhS4h(vN7tlFij*;pC zZ!DRHsME{nf<+!sHFlgIbeutHZ^v*P(o!Sq49MurR{~0LB3O6B*HEUmQC(hLtElyl zY8Ca~`evOI1d|&2^ z`M{T;E+jThVj($dM>7YJ7ulbM$I7+;>Tpk#Z-i}19ZxP4_V)I8z@kfs)}`CQ+h@)( zHQKh_&TK#Njtwsl+cm7MAw;D;*Px{MR{~8|9yqp3!}R|}K1}K_d zwV)H_UO!a$jm?ij4)-mI{~PH`zX>n}?M~lfU78Gg6Z}%UCVaf&r&g%QZmC=Lv8OVm z610$>6m*&k$Nv8*ky-Iy%2J6vki%<%E8Qgoogle.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + */ +class CreateOfflineProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Contents of the profile to create. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; + */ + protected $profile = null; + + /** + * @param string $parent Parent project to create the profile in. + * @param \Google\Cloud\Profiler\V2\Profile $profile Contents of the profile to create. + * + * @return \Google\Cloud\Profiler\V2\CreateOfflineProfileRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Profiler\V2\Profile $profile): self + { + return (new self()) + ->setParent($parent) + ->setProfile($profile); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Parent project to create the profile in. + * @type \Google\Cloud\Profiler\V2\Profile $profile + * Contents of the profile to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Contents of the profile to create. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; + * @return \Google\Cloud\Profiler\V2\Profile|null + */ + public function getProfile() + { + return $this->profile; + } + + public function hasProfile() + { + return isset($this->profile); + } + + public function clearProfile() + { + unset($this->profile); + } + + /** + * Contents of the profile to create. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; + * @param \Google\Cloud\Profiler\V2\Profile $var + * @return $this + */ + public function setProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Profile::class); + $this->profile = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php new file mode 100644 index 00000000000..ef1a7c79063 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php @@ -0,0 +1,148 @@ +google.devtools.cloudprofiler.v2.CreateProfileRequest + */ +class CreateProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Deployment details. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; + */ + protected $deployment = null; + /** + * One or more profile types that the agent is capable of providing. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + */ + private $profile_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Parent project to create the profile in. + * @type \Google\Cloud\Profiler\V2\Deployment $deployment + * Deployment details. + * @type array|\Google\Protobuf\Internal\RepeatedField $profile_type + * One or more profile types that the agent is capable of providing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Parent project to create the profile in. + * + * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Deployment details. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; + * @return \Google\Cloud\Profiler\V2\Deployment|null + */ + public function getDeployment() + { + return $this->deployment; + } + + public function hasDeployment() + { + return isset($this->deployment); + } + + public function clearDeployment() + { + unset($this->deployment); + } + + /** + * Deployment details. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; + * @param \Google\Cloud\Profiler\V2\Deployment $var + * @return $this + */ + public function setDeployment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Deployment::class); + $this->deployment = $var; + + return $this; + } + + /** + * One or more profile types that the agent is capable of providing. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProfileType() + { + return $this->profile_type; + } + + /** + * One or more profile types that the agent is capable of providing. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProfileType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Profiler\V2\ProfileType::class); + $this->profile_type = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php new file mode 100644 index 00000000000..4ee6e5aaebc --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php @@ -0,0 +1,199 @@ +google.devtools.cloudprofiler.v2.Deployment + */ +class Deployment extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID is the ID of a cloud project. + * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * Target is the service name used to group related deployments: + * * Service name for App Engine Flex / Standard. + * * Cluster and container name for GKE. + * * User-specified string for direct Compute Engine profiling (e.g. Java). + * * Job name for Dataflow. + * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + * + * Generated from protobuf field string target = 2; + */ + protected $target = ''; + /** + * Labels identify the deployment within the user universe and same target. + * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + * Value for an individual label must be <= 512 bytes, the total + * size of all label names and values must be <= 1024 bytes. + * Label named "language" can be used to record the programming language of + * the profiled deployment. The standard choices for the value include "java", + * "go", "python", "ruby", "nodejs", "php", "dotnet". + * For deployments running on Google Cloud Platform, "zone" or "region" label + * should be present describing the deployment location. An example of a zone + * is "us-central1-a", an example of a region is "us-central1" or + * "us-central". + * + * Generated from protobuf field map labels = 3; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Project ID is the ID of a cloud project. + * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + * @type string $target + * Target is the service name used to group related deployments: + * * Service name for App Engine Flex / Standard. + * * Cluster and container name for GKE. + * * User-specified string for direct Compute Engine profiling (e.g. Java). + * * Job name for Dataflow. + * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels identify the deployment within the user universe and same target. + * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + * Value for an individual label must be <= 512 bytes, the total + * size of all label names and values must be <= 1024 bytes. + * Label named "language" can be used to record the programming language of + * the profiled deployment. The standard choices for the value include "java", + * "go", "python", "ruby", "nodejs", "php", "dotnet". + * For deployments running on Google Cloud Platform, "zone" or "region" label + * should be present describing the deployment location. An example of a zone + * is "us-central1-a", an example of a region is "us-central1" or + * "us-central". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Project ID is the ID of a cloud project. + * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Project ID is the ID of a cloud project. + * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Target is the service name used to group related deployments: + * * Service name for App Engine Flex / Standard. + * * Cluster and container name for GKE. + * * User-specified string for direct Compute Engine profiling (e.g. Java). + * * Job name for Dataflow. + * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + * + * Generated from protobuf field string target = 2; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Target is the service name used to group related deployments: + * * Service name for App Engine Flex / Standard. + * * Cluster and container name for GKE. + * * User-specified string for direct Compute Engine profiling (e.g. Java). + * * Job name for Dataflow. + * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + * + * Generated from protobuf field string target = 2; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Labels identify the deployment within the user universe and same target. + * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + * Value for an individual label must be <= 512 bytes, the total + * size of all label names and values must be <= 1024 bytes. + * Label named "language" can be used to record the programming language of + * the profiled deployment. The standard choices for the value include "java", + * "go", "python", "ruby", "nodejs", "php", "dotnet". + * For deployments running on Google Cloud Platform, "zone" or "region" label + * should be present describing the deployment location. An example of a zone + * is "us-central1-a", an example of a region is "us-central1" or + * "us-central". + * + * Generated from protobuf field map labels = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels identify the deployment within the user universe and same target. + * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + * Value for an individual label must be <= 512 bytes, the total + * size of all label names and values must be <= 1024 bytes. + * Label named "language" can be used to record the programming language of + * the profiled deployment. The standard choices for the value include "java", + * "go", "python", "ruby", "nodejs", "php", "dotnet". + * For deployments running on Google Cloud Platform, "zone" or "region" label + * should be present describing the deployment location. An example of a zone + * is "us-central1-a", an example of a region is "us-central1" or + * "us-central". + * + * Generated from protobuf field map labels = 3; + * @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/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php new file mode 100644 index 00000000000..ff53a3c48f1 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php @@ -0,0 +1,171 @@ +google.devtools.cloudprofiler.v2.ListProfilesRequest + */ +class ListProfilesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of profiles. + * Format: projects/{user_project_id} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * Default page_size is 1000. + * Max limit is 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The token to continue pagination and get profiles from a particular page. + * When paginating, all other parameters provided to `ListProfiles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of profiles. + * Format: projects/{user_project_id} + * Please see {@see ExportServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Profiler\V2\ListProfilesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of profiles. + * Format: projects/{user_project_id} + * @type int $page_size + * The maximum number of items to return. + * Default page_size is 1000. + * Max limit is 1000. + * @type string $page_token + * The token to continue pagination and get profiles from a particular page. + * When paginating, all other parameters provided to `ListProfiles` must match + * the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of profiles. + * Format: projects/{user_project_id} + * + * 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, which owns this collection of profiles. + * Format: projects/{user_project_id} + * + * 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; + } + + /** + * The maximum number of items to return. + * Default page_size is 1000. + * Max limit is 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * Default page_size is 1000. + * Max limit is 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The token to continue pagination and get profiles from a particular page. + * When paginating, all other parameters provided to `ListProfiles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The token to continue pagination and get profiles from a particular page. + * When paginating, all other parameters provided to `ListProfiles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @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/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php new file mode 100644 index 00000000000..a52a9ccd27a --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php @@ -0,0 +1,152 @@ +google.devtools.cloudprofiler.v2.ListProfilesResponse + */ +class ListProfilesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of profiles fetched. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; + */ + private $profiles; + /** + * Token to receive the next page of results. + * This field maybe empty if there are no more profiles to fetch. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Number of profiles that were skipped in the current page since they were + * not able to be fetched successfully. This should typically be zero. A + * non-zero value may indicate a transient failure, in which case if the + * number is too high for your use case, the call may be retried. + * + * Generated from protobuf field int32 skipped_profiles = 3; + */ + protected $skipped_profiles = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Profiler\V2\Profile>|\Google\Protobuf\Internal\RepeatedField $profiles + * List of profiles fetched. + * @type string $next_page_token + * Token to receive the next page of results. + * This field maybe empty if there are no more profiles to fetch. + * @type int $skipped_profiles + * Number of profiles that were skipped in the current page since they were + * not able to be fetched successfully. This should typically be zero. A + * non-zero value may indicate a transient failure, in which case if the + * number is too high for your use case, the call may be retried. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * List of profiles fetched. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProfiles() + { + return $this->profiles; + } + + /** + * List of profiles fetched. + * + * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; + * @param array<\Google\Cloud\Profiler\V2\Profile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProfiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Profiler\V2\Profile::class); + $this->profiles = $arr; + + return $this; + } + + /** + * Token to receive the next page of results. + * This field maybe empty if there are no more profiles to fetch. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to receive the next page of results. + * This field maybe empty if there are no more profiles to fetch. + * + * 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; + } + + /** + * Number of profiles that were skipped in the current page since they were + * not able to be fetched successfully. This should typically be zero. A + * non-zero value may indicate a transient failure, in which case if the + * number is too high for your use case, the call may be retried. + * + * Generated from protobuf field int32 skipped_profiles = 3; + * @return int + */ + public function getSkippedProfiles() + { + return $this->skipped_profiles; + } + + /** + * Number of profiles that were skipped in the current page since they were + * not able to be fetched successfully. This should typically be zero. A + * non-zero value may indicate a transient failure, in which case if the + * number is too high for your use case, the call may be retried. + * + * Generated from protobuf field int32 skipped_profiles = 3; + * @param int $var + * @return $this + */ + public function setSkippedProfiles($var) + { + GPBUtil::checkInt32($var); + $this->skipped_profiles = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php new file mode 100644 index 00000000000..90f9a635a62 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php @@ -0,0 +1,345 @@ +google.devtools.cloudprofiler.v2.Profile + */ +class Profile extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Opaque, server-assigned, unique ID for this profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Type of profile. + * For offline mode, this must be specified when creating the profile. For + * online mode it is assigned and returned by the server. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + */ + protected $profile_type = 0; + /** + * Deployment this profile corresponds to. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; + */ + protected $deployment = null; + /** + * Duration of the profiling session. + * Input (for the offline mode) or output (for the online mode). + * The field represents requested profiling duration. It may slightly differ + * from the effective profiling duration, which is recorded in the profile + * data, in case the profiling can't be stopped immediately (e.g. in case + * stopping the profiling is handled asynchronously). + * + * Generated from protobuf field .google.protobuf.Duration duration = 4; + */ + protected $duration = null; + /** + * Input only. Profile bytes, as a gzip compressed serialized proto, the + * format is https://github.com/google/pprof/blob/master/proto/profile.proto. + * + * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $profile_bytes = ''; + /** + * Input only. Labels associated to this specific profile. These labels will + * get merged with the deployment labels for the final data set. See + * documentation on deployment labels for validation rules and limits. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $labels; + /** + * Output only. Start time for the profile. + * This output is only present in response from the ListProfiles method. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Opaque, server-assigned, unique ID for this profile. + * @type int $profile_type + * Type of profile. + * For offline mode, this must be specified when creating the profile. For + * online mode it is assigned and returned by the server. + * @type \Google\Cloud\Profiler\V2\Deployment $deployment + * Deployment this profile corresponds to. + * @type \Google\Protobuf\Duration $duration + * Duration of the profiling session. + * Input (for the offline mode) or output (for the online mode). + * The field represents requested profiling duration. It may slightly differ + * from the effective profiling duration, which is recorded in the profile + * data, in case the profiling can't be stopped immediately (e.g. in case + * stopping the profiling is handled asynchronously). + * @type string $profile_bytes + * Input only. Profile bytes, as a gzip compressed serialized proto, the + * format is https://github.com/google/pprof/blob/master/proto/profile.proto. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Input only. Labels associated to this specific profile. These labels will + * get merged with the deployment labels for the final data set. See + * documentation on deployment labels for validation rules and limits. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Start time for the profile. + * This output is only present in response from the ListProfiles method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Opaque, server-assigned, unique ID for this profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Opaque, server-assigned, unique ID for this profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Type of profile. + * For offline mode, this must be specified when creating the profile. For + * online mode it is assigned and returned by the server. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + * @return int + */ + public function getProfileType() + { + return $this->profile_type; + } + + /** + * Type of profile. + * For offline mode, this must be specified when creating the profile. For + * online mode it is assigned and returned by the server. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; + * @param int $var + * @return $this + */ + public function setProfileType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Profiler\V2\ProfileType::class); + $this->profile_type = $var; + + return $this; + } + + /** + * Deployment this profile corresponds to. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; + * @return \Google\Cloud\Profiler\V2\Deployment|null + */ + public function getDeployment() + { + return $this->deployment; + } + + public function hasDeployment() + { + return isset($this->deployment); + } + + public function clearDeployment() + { + unset($this->deployment); + } + + /** + * Deployment this profile corresponds to. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; + * @param \Google\Cloud\Profiler\V2\Deployment $var + * @return $this + */ + public function setDeployment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Deployment::class); + $this->deployment = $var; + + return $this; + } + + /** + * Duration of the profiling session. + * Input (for the offline mode) or output (for the online mode). + * The field represents requested profiling duration. It may slightly differ + * from the effective profiling duration, which is recorded in the profile + * data, in case the profiling can't be stopped immediately (e.g. in case + * stopping the profiling is handled asynchronously). + * + * Generated from protobuf field .google.protobuf.Duration duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration of the profiling session. + * Input (for the offline mode) or output (for the online mode). + * The field represents requested profiling duration. It may slightly differ + * from the effective profiling duration, which is recorded in the profile + * data, in case the profiling can't be stopped immediately (e.g. in case + * stopping the profiling is handled asynchronously). + * + * Generated from protobuf field .google.protobuf.Duration duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Input only. Profile bytes, as a gzip compressed serialized proto, the + * format is https://github.com/google/pprof/blob/master/proto/profile.proto. + * + * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getProfileBytes() + { + return $this->profile_bytes; + } + + /** + * Input only. Profile bytes, as a gzip compressed serialized proto, the + * format is https://github.com/google/pprof/blob/master/proto/profile.proto. + * + * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProfileBytes($var) + { + GPBUtil::checkString($var, False); + $this->profile_bytes = $var; + + return $this; + } + + /** + * Input only. Labels associated to this specific profile. These labels will + * get merged with the deployment labels for the final data set. See + * documentation on deployment labels for validation rules and limits. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Input only. Labels associated to this specific profile. These labels will + * get merged with the deployment labels for the final data set. See + * documentation on deployment labels for validation rules and limits. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + * @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; + } + + /** + * Output only. Start time for the profile. + * This output is only present in response from the ListProfiles method. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Start time for the profile. + * This output is only present in response from the ListProfiles method. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php new file mode 100644 index 00000000000..c2adbcdd0cc --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php @@ -0,0 +1,104 @@ +google.devtools.cloudprofiler.v2.ProfileType + */ +class ProfileType +{ + /** + * Unspecified profile type. + * + * Generated from protobuf enum PROFILE_TYPE_UNSPECIFIED = 0; + */ + const PROFILE_TYPE_UNSPECIFIED = 0; + /** + * Thread CPU time sampling. + * + * Generated from protobuf enum CPU = 1; + */ + const CPU = 1; + /** + * Wallclock time sampling. More expensive as stops all threads. + * + * Generated from protobuf enum WALL = 2; + */ + const WALL = 2; + /** + * In-use heap profile. Represents a snapshot of the allocations that are + * live at the time of the profiling. + * + * Generated from protobuf enum HEAP = 3; + */ + const HEAP = 3; + /** + * Single-shot collection of all thread stacks. + * + * Generated from protobuf enum THREADS = 4; + */ + const THREADS = 4; + /** + * Synchronization contention profile. + * + * Generated from protobuf enum CONTENTION = 5; + */ + const CONTENTION = 5; + /** + * Peak heap profile. + * + * Generated from protobuf enum PEAK_HEAP = 6; + */ + const PEAK_HEAP = 6; + /** + * Heap allocation profile. It represents the aggregation of all allocations + * made over the duration of the profile. All allocations are included, + * including those that might have been freed by the end of the profiling + * interval. The profile is in particular useful for garbage collecting + * languages to understand which parts of the code create most of the garbage + * collection pressure to see if those can be optimized. + * + * Generated from protobuf enum HEAP_ALLOC = 7; + */ + const HEAP_ALLOC = 7; + + private static $valueToName = [ + self::PROFILE_TYPE_UNSPECIFIED => 'PROFILE_TYPE_UNSPECIFIED', + self::CPU => 'CPU', + self::WALL => 'WALL', + self::HEAP => 'HEAP', + self::THREADS => 'THREADS', + self::CONTENTION => 'CONTENTION', + self::PEAK_HEAP => 'PEAK_HEAP', + self::HEAP_ALLOC => 'HEAP_ALLOC', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php new file mode 100644 index 00000000000..3db9dcecdd2 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php @@ -0,0 +1,151 @@ +google.devtools.cloudprofiler.v2.UpdateProfileRequest + */ +class UpdateProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Profile to update. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; + */ + protected $profile = null; + /** + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Profiler\V2\Profile $profile Profile to update. + * @param \Google\Protobuf\FieldMask $updateMask Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * + * @return \Google\Cloud\Profiler\V2\UpdateProfileRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Profiler\V2\Profile $profile, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setProfile($profile) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Profiler\V2\Profile $profile + * Profile to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); + parent::__construct($data); + } + + /** + * Profile to update. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; + * @return \Google\Cloud\Profiler\V2\Profile|null + */ + public function getProfile() + { + return $this->profile; + } + + public function hasProfile() + { + return isset($this->profile); + } + + public function clearProfile() + { + unset($this->profile); + } + + /** + * Profile to update. + * + * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; + * @param \Google\Cloud\Profiler\V2\Profile $var + * @return $this + */ + public function setProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Profile::class); + $this->profile = $var; + + return $this; + } + + /** + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php b/owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php new file mode 100644 index 00000000000..53e4656ca44 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $exportServiceClient->listProfiles($request); + + /** @var Profile $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ExportServiceClient::projectName('[PROJECT]'); + + list_profiles_sample($formattedParent); +} +// [END cloudprofiler_v2_generated_ExportService_ListProfiles_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php new file mode 100644 index 00000000000..153364e2d38 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php @@ -0,0 +1,64 @@ +createOfflineProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php new file mode 100644 index 00000000000..9405319b606 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php @@ -0,0 +1,75 @@ +createProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php new file mode 100644 index 00000000000..957343f00a4 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php @@ -0,0 +1,65 @@ +updateProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php b/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php new file mode 100644 index 00000000000..2c4c7dfc1ec --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php @@ -0,0 +1,243 @@ + listProfilesAsync(ListProfilesRequest $request, array $optionalArgs = []) + */ +final class ExportServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.devtools.cloudprofiler.v2.ExportService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudprofiler.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprofiler.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/export_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/export_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/export_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/export_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudprofiler.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Lists profiles which have been collected so far and for which the caller + * has permission to view. + * + * The async variant is {@see ExportServiceClient::listProfilesAsync()} . + * + * @example samples/V2/ExportServiceClient/list_profiles.php + * + * @param ListProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProfiles(ListProfilesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProfiles', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php b/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php new file mode 100644 index 00000000000..0c34774d14f --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php @@ -0,0 +1,352 @@ + createOfflineProfileAsync(CreateOfflineProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface createProfileAsync(CreateProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateProfileAsync(UpdateProfileRequest $request, array $optionalArgs = []) + */ +final class ProfilerServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.devtools.cloudprofiler.v2.ProfilerService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudprofiler.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprofiler.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/profiler_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/profiler_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/profiler_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/profiler_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a profile + * resource. + * + * @param string $project + * @param string $profile + * + * @return string The formatted profile resource. + */ + public static function profileName(string $project, string $profile): string + { + return self::getPathTemplate('profile')->render([ + 'project' => $project, + 'profile' => $profile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - profile: projects/{project}/profiles/{profile} + * - project: projects/{project} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudprofiler.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * CreateOfflineProfile creates a new profile resource in the offline + * mode. The client provides the profile to create along with the profile + * bytes, the server records it. + * + * _Direct use of this API is discouraged, please use a [supported + * profiler + * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + * instead for profile collection._ + * + * The async variant is {@see ProfilerServiceClient::createOfflineProfileAsync()} . + * + * @example samples/V2/ProfilerServiceClient/create_offline_profile.php + * + * @param CreateOfflineProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Profile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createOfflineProfile(CreateOfflineProfileRequest $request, array $callOptions = []): Profile + { + return $this->startApiCall('CreateOfflineProfile', $request, $callOptions)->wait(); + } + + /** + * CreateProfile creates a new profile resource in the online mode. + * + * _Direct use of this API is discouraged, please use a [supported + * profiler + * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + * instead for profile collection._ + * + * The server ensures that the new profiles are created at a constant rate per + * deployment, so the creation request may hang for some time until the next + * profile session is available. + * + * The request may fail with ABORTED error if the creation is not available + * within ~1m, the response will indicate the duration of the backoff the + * client should take before attempting creating a profile again. The backoff + * duration is returned in google.rpc.RetryInfo extension on the response + * status. To a gRPC client, the extension will be return as a + * binary-serialized proto in the trailing metadata item named + * "google.rpc.retryinfo-bin". + * + * + * The async variant is {@see ProfilerServiceClient::createProfileAsync()} . + * + * @example samples/V2/ProfilerServiceClient/create_profile.php + * + * @param CreateProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Profile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProfile(CreateProfileRequest $request, array $callOptions = []): Profile + { + return $this->startApiCall('CreateProfile', $request, $callOptions)->wait(); + } + + /** + * UpdateProfile updates the profile bytes and labels on the profile resource + * created in the online mode. Updating the bytes for profiles created in the + * offline mode is currently not supported: the profile content must be + * provided at the time of the profile creation. + * + * _Direct use of this API is discouraged, please use a [supported + * profiler + * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + * instead for profile collection._ + * + * The async variant is {@see ProfilerServiceClient::updateProfileAsync()} . + * + * @example samples/V2/ProfilerServiceClient/update_profile.php + * + * @param UpdateProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Profile + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateProfile(UpdateProfileRequest $request, array $callOptions = []): Profile + { + return $this->startApiCall('UpdateProfile', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json new file mode 100644 index 00000000000..30bcd0779a5 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.devtools.cloudprofiler.v2", + "libraryPackage": "Google\\Cloud\\Profiler\\V2", + "services": { + "ProfilerService": { + "clients": { + "grpc": { + "libraryClient": "ProfilerServiceGapicClient", + "rpcs": { + "CreateOfflineProfile": { + "methods": [ + "createOfflineProfile" + ] + }, + "CreateProfile": { + "methods": [ + "createProfile" + ] + }, + "UpdateProfile": { + "methods": [ + "updateProfile" + ] + } + } + } + } + }, + "ExportService": { + "clients": { + "grpc": { + "libraryClient": "ExportServiceGapicClient", + "rpcs": { + "ListProfiles": { + "methods": [ + "listProfiles" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json new file mode 100644 index 00000000000..22dc5634732 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.devtools.cloudprofiler.v2.ExportService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "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_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 130000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 130000, + "total_timeout_millis": 130000 + } + }, + "methods": { + "ListProfiles": { + "timeout_millis": 130000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php new file mode 100644 index 00000000000..1770633a584 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php @@ -0,0 +1,51 @@ + [ + 'google.devtools.cloudprofiler.v2.ExportService' => [ + 'ListProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Profiler\V2\ListProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php new file mode 100644 index 00000000000..a2ee763f060 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php @@ -0,0 +1,40 @@ + [ + 'google.devtools.cloudprofiler.v2.ExportService' => [ + 'ListProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/profiles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json new file mode 100644 index 00000000000..3d4414a2036 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.devtools.cloudprofiler.v2.ProfilerService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [], + "no_retry_2_codes": [] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 3610000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3610000, + "total_timeout_millis": 3610000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateOfflineProfile": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "CreateProfile": { + "timeout_millis": 3610000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateProfile": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php new file mode 100644 index 00000000000..5caac201269 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php @@ -0,0 +1,69 @@ + [ + 'google.devtools.cloudprofiler.v2.ProfilerService' => [ + 'CreateOfflineProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Profiler\V2\Profile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Profiler\V2\Profile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Profiler\V2\Profile', + 'headerParams' => [ + [ + 'keyName' => 'profile.name', + 'fieldAccessors' => [ + 'getProfile', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'profile' => 'projects/{project}/profiles/{profile}', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php new file mode 100644 index 00000000000..95b5868f63e --- /dev/null +++ b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php @@ -0,0 +1,66 @@ + [ + 'google.devtools.cloudprofiler.v2.ProfilerService' => [ + 'CreateOfflineProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/profiles:createOffline', + 'body' => 'profile', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/profiles', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{profile.name=projects/*/profiles/*}', + 'body' => 'profile', + 'placeholders' => [ + 'profile.name' => [ + 'getters' => [ + 'getProfile', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php new file mode 100644 index 00000000000..8545dd2bd7a --- /dev/null +++ b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php @@ -0,0 +1,176 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExportServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExportServiceClient($options); + } + + /** @test */ + public function listProfilesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $skippedProfiles = 852593689; + $profilesElement = new Profile(); + $profiles = [ + $profilesElement, + ]; + $expectedResponse = new ListProfilesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSkippedProfiles($skippedProfiles); + $expectedResponse->setProfiles($profiles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListProfilesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProfiles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProfiles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ExportService/ListProfiles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProfilesExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ListProfilesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProfiles($request); + // 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 listProfilesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $skippedProfiles = 852593689; + $profilesElement = new Profile(); + $profiles = [ + $profilesElement, + ]; + $expectedResponse = new ListProfilesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSkippedProfiles($skippedProfiles); + $expectedResponse->setProfiles($profiles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListProfilesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProfilesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProfiles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ExportService/ListProfiles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php new file mode 100644 index 00000000000..6dbf9f964f9 --- /dev/null +++ b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php @@ -0,0 +1,264 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProfilerServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProfilerServiceClient($options); + } + + /** @test */ + public function createOfflineProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $profileBytes = '85'; + $expectedResponse = new Profile(); + $expectedResponse->setName($name); + $expectedResponse->setProfileBytes($profileBytes); + $transport->addResponse($expectedResponse); + $request = new CreateOfflineProfileRequest(); + $response = $gapicClient->createOfflineProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createOfflineProfileExceptionTest() + { + $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); + $request = new CreateOfflineProfileRequest(); + try { + $gapicClient->createOfflineProfile($request); + // 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 createProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $profileBytes = '85'; + $expectedResponse = new Profile(); + $expectedResponse->setName($name); + $expectedResponse->setProfileBytes($profileBytes); + $transport->addResponse($expectedResponse); + $request = new CreateProfileRequest(); + $response = $gapicClient->createProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProfileExceptionTest() + { + $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); + $request = new CreateProfileRequest(); + try { + $gapicClient->createProfile($request); + // 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 updateProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $profileBytes = '85'; + $expectedResponse = new Profile(); + $expectedResponse->setName($name); + $expectedResponse->setProfileBytes($profileBytes); + $transport->addResponse($expectedResponse); + $request = new UpdateProfileRequest(); + $response = $gapicClient->updateProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProfileExceptionTest() + { + $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); + $request = new UpdateProfileRequest(); + try { + $gapicClient->updateProfile($request); + // 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 createOfflineProfileAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $profileBytes = '85'; + $expectedResponse = new Profile(); + $expectedResponse->setName($name); + $expectedResponse->setProfileBytes($profileBytes); + $transport->addResponse($expectedResponse); + $request = new CreateOfflineProfileRequest(); + $response = $gapicClient->createOfflineProfileAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php b/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php new file mode 100644 index 0000000000000000000000000000000000000000..97038a175348fafc46d33a797451a9d8d62cd80c GIT binary patch literal 17622 zcmc&+&2L-Tb@!trTRM~_`P#B+jz8!(&RCXhYRqvn9!_izDbW^d>tjU9nM{?wK9Wz; zt0_K)@6obmVl*wfn0^95nij~SMNyz=Q?#oV2+~E-O$%hxBHd|~MK_(lpvbD{em!3D zU6GRQCbO}I_v_sA`8(%a@@o&8+f8^o^~h;BEjw^(smfj|*mhFQmKS(cub!&3H#ePD zs_N}D-MZ6Cr&0?mspXY&s<2QjU%{om*KSpvY--E%w(8DYvt9AqmAU7)#b0T*6F|e> zar~xTbyAO3^Gi-(*X+RFc*GWMtg=NLPj7z+P_5g(pW>gu=a9nxaL>A1P5FTx;6GPg z-*Ovn;M#TfGo<)lYSXU!4la$(-E23if$KF=biqoa>dahE@jdC>t4$AYcrO)_K`)IL z-Y7N#r`53Q8w-wKZMn_BYpvqcY<9~DLRQgFX0D54>2~gBYKGI8%|?j4mkL^KM?F22 zYB@o>)%cLnO*eQM{4_&8T%RAfl zbJuGfZRwgL)Z)-Yu1el7v{4c9f`>maT#8I9>@DjRkxiTTfdU&=dJs$(8gS?7AoIEG{%`wU8wS0gMa#M11|P8Lo&sO)7(na&u=Hs zi3N7kovSh>;TD^`tPE^YO|U9L6~u(|%7m7Xw-~x4hM4W6LCw{KP{sILz2goQn-~l| ziO`5Se)#;+eZqqWbKS&h7e-`Fck3;xY0GoUGQpcFpp+ zNZ4iLne5T_ou^v}p~{^f!`Wut4p3SJA$U#Tg?hIK5SE;-y>9T~t@QTJ_qEATc5Z9y9;cfDv{+nTAuPa;{vk z)|X4Gh56#cVqszG7y&q*n=coi7N!hx5zap@E*DD0lC@e`TPl`H#g%1ip|DJ+#^~_s zdj3hVw5S;#B4=Q#R9-9OmMnx2*29(c<%OwXau&$^%5rIasj#MeK9c)p4@l4@04lLtt57}l?G4TlddCQYW zaBX~@BXYP~_Yn;s+`CxnNmTan%;VR%%xb$*YFDD?%|mhrVaZN=$MPz_=~M%&ikcia z7WL4HNR&(m^j*D1LxK!%i z7LR>l82NDkD;!PY|8;0h5}4|x-~7Q*Y~XFUJpW{6eZeY~SJrZm3K~^Ej3wmP=N}i! zipCF9`zWuhSWCI(Z&)k&UoFg+OH(8H2^e=9&9+p={3u2e=9A5TG2o2OS&@e@>O0S! zmK*E|-!vB$w{B&+B$hE*m==u64@d&elnPG^YsK<6dK|yX6#~BUU8@ zMgp(tRy(qdktCdSS}m_-A>yL(TXl~%Om{^PYm@ILZ1=k7qtO?3E+riwhGA&LAMMFah8?( zhMe1(SRVms|-6Etud7`i@Tm!w)|!8V|YuC zzPb8c!3={&F@NrJ@z=|_fGQ?_!2W$nCTW;KNz`t!4=nRLF*u3g1&bg;d8iUoma!|1 za}g{8*g?>8EA7CMimY?c>OSdQxI$5C1ZPqqB+4i6!Z_Zl?)uw2?s8<&C+<>c>9uMY zE*e`@r90@*NZy9Yo`VO9r~s3XoPe=#&G}XvGYOLEcII!h+~;Cn?wh+n)|<#Vr)#Gh z>Q3>@xv0jm>6Fhg%(>!iwuMF0N9I`LN&+SA;~~v&Y4*=nncs#9lpy8bYmiUA3Zp_Y zQo@&`w03Cz5%D6V4}+I>`QVN;Dpdu5j@{x{JsS@ zScH_>`i|Ye7}^q4g_-9nS9*lyV@({ld@Qpu){SuGMSR9S54>j%4@Mj_o4)}>r9}{b z6OISWW{?)@u=`2OAQxb=L2Xint;yVVM@6gb&oBp;J{9@U#21y+Sf&-{N zz9dWBo`IeI5?%zdz#M9q(Z7OJ&2Pf_1*|hyw^gP}3;77fRq+TjLFr&g=1|fxFF;ba zJ-@v9cL3w+xjG~hUWzODVSFMwm3Xs_ejN(|o9>pVU|i7o6@Po4&EYnSn55!vp)YRj z$+d(P_eJN(G^6L)n^zq?OGixKnNgkr<%_q zj_@xgOe40jv9N|Su@)D4(Kn2P9)w78j5(&+=q*$cMgiqjIOjC%3f5etca}jkLE%sc z*-kkxnl7(uOT-yxd^4jb7Q(5#D9Oc#S;MAVr-|-3E)*q-c_5UH7Qzo4kvpF}Xy*l- z`-DwZcfJeb$ZXUK0fi^nat$V2qqEeN(=b|N_T|(PlekJ;_c~k@4}# zcDrJ!ZUKwCn_l7^BSDitcI}yyyDYNWNEn%lxCIsBP;vz>^qYjq|A{(=a>QW59Wi%_ z&`c#sNe+*SobMk2ITM(O;N?%g%&i|PaLs98vw8$1_gV@ z40mPb1DNVHXmSIFf}no58<{^C23SRh&s`|3e=zs&G-^!``$8%`1x-$IGwNVEyXg~( z9DwK6s#XWx=}Y7xQRx+&UZz-(`6{gC7h!_K8*8^^H?fr>;*`e0D%5Z&{B^#9Z)Fgq zrs0L#@WQ1gPgk~C_PV!7K7_H5LV`l;sf1hDesj4vgkMF+X18nDFRiMjnB=6)>%{)a z85j!>!)oNjE>_!UDB!(qCK~P&Um=IepMz<;jh%SR@T;uYL^s~{YP3!wxN83K5KMFj zYgRO)5lK}H?Dw>NEWuI`ZiyBY)luQFqm3XSfCUo7DZW7hXyQGZ8P(c|jm58km6cz;nA|t>A=~H9r7AH}VVLM_7OLUW^ z`NhIg&cgP_Qm#C|h$Ty``4*S0@>*`WR4iLhR_1fEs8C)jVsm6=8H<_!GlHEAr3EFd zR#WqfQFMMgOru#y1?OmfjKEc4zu-#*juRtPPOA};TU6*YHiadlOKNdX< zL|7fLs3|iy949QcZ#;K=nM>U@0d~0Rh2zj zG@&{mil7)G>E|I%q-8KMgfY)&4LV-y(s&@vM3v-?BLta;%{xBmw{c#K{(p1Bka zwCZANM6X(n`mO;9nr5r}g?aujsnXNtwTB*(MB<;-l|Bx|qCw>!meSK|t9tO86a4oK zIJbmPEjIT$c;b!i-kZ8}U^*~$kC}gDKzy}bufI7;t^mPI3!k1@?#_-=b1{O{_n38# z=0_3+ec;mTQfcsErWZ3mhH*|#Sm`>|5{{tbf_bU$O4KTPdIpcHHXB3Fj z(!iU$FD6#pFHztk-tff8L6r#Qs&(x5RVnbPJGHISnYFLs!^N6RroNR}waXl6yYY0$S*^3_V;@=lCaTlqsX8Yn2*6KDlN4UOU$ zWiVnl=!2(@Iw`?kq+RMX4hT9?-~99AFx|t+H>Rv)6B2lTsT91LM&F3g&MZeo529+X zr6#Q?7sE$l8)g(FfRvC9Wj9SlS;36qFL@r-RqeAB{do}^i=JA8bG}lyMri6`0vEW5 zxOf{$^TtVknChdkr66`;cT4^WdfEdnPsT0^J&|3bIi}lQCCs zH(2ov>xFWh>TpN5XmXB^{jkzS+sw+e&?Okj&){NT7QGT}sMiOc-61jg49@B~MrPrn zwv=Y^IvYn@B4wgRB>Ka$78y?KWL0PJ^ol!*J}qGGb3P2EK&?Vs z_>qLZF5|OLzRVQ|D%Qp|T`f`Yiq;XupD)d2AT%TBk>TAQ8II)-snQg7onf$B9wsg1 zmjt<8nC>A*gtSa=pKYL?4uaVq!!+-~y*Y0F8-m!9<2;j0>~$DCVLU?rjm*I?dsN7A z^dQZ~s$^DC1!@jV70{3ddbh=6^qEp%xA5B^Cceev_u$;m{3s4%Sh>W){kGF0--0;z zQmlJP4r+BL4;nDv-OsTXPrvhD|NXt#+sRAxi!`6p8qvMb4rb*Ol-ZYAW0qig7+0Q2 z5KZqx85aCMn1K2H+$mNmyxHzNoM6;k&s=5Hu+em1nlO<%A(%om4Ms5}Y0+c};SA1Y z6RDcuRLLR_Bk88Oajip>o<&VA9LlO)7?tl*h~`i^Ch0m*NOSu+{xp#hafMtSKm)-_ z4p8G|THzDTleNyMJY6G4b&_Dr?fsm5>d{4v&=!Ry^5qiwu>ohpom9x-6HPf!KT{I< zZZt|Cv_KGiuZwqczgp;2Y%n zK!W8KlJsVy{zD{D_X)=41Zg!y3{XMcO`a(g+s^~09jD}UZ$%0j1 zV=DMn^A2N?DmXdmp#t*F0_xn$C~O{B#;X7(fM`_dg=T1jbY{ATpq|mmDx|{`!9I2KAOVxdUr< zo^RZwnM#=0iI)(JhqKAAFdp`LS(T?g(ma&Rgh~_w)t)I*!h@(^ z*w1zKpBZ`5Y*ljliJ1H|vQ~g>m9-kPjm|nOrJwBQ5-LHF0QP<+6H&}a98-6Y9R6$Z z$WCRkPc*#*>PEUIN!m3R)yx%UbhpQ+&yaT*-8!G%MK1XZX7arSQoYId&XS}aFA4K$_AMx28RxHbPN|e<6 z{s!?EekAKbIxnvb54y##?dQ(uZo$m%zWKq?2uA-R>7u0mrvbyXu1GY`dz5;k&ZDUn zU-JuNKX%4j+HrrMF)&zCWMv#%(ccnx}`O*q+AeIlC20bLWM05+~g zU1ZNhVUEXUjCT#{!KS!Qc6tNkdUTK8Ir6-N%&OMwwUqe4STk?lKbp|FmUgJ5Z2CP^ zQW^jRG|?%kGAwECBvoM)kvo{^q{8Y5qjTdL;W5h>hjhtLVj_%L1ix>1l6gP*p-yOB z6C^=8q4i7@Lc7!BL$4C^U>_RN@n`t0-R>$A(H+@6MH1JKTOVOo#V~+s28?a*B(E^S zB9UGaC8GRaA!#BuiV-bo-BS)j+7s$=#FmkeIhUE`$|oj7!(|Vde}H6m*ABE~c2ALH z9%LgLU7J0muHl36VVbY&T%J;o(78M{%{TA8nw#?RXtcjyJhshaqI3qoMjmlcdF&-p zjJ-;;i&f*(41>;c8vWw=mM4G20|9vWJ08u-ha5FGEB|X4Ka8Dy#D2Pie_Jk%dzKKl zKfV1EIk2(89#(A7-}b8*I{u>xC;U&QT0mJ*2rT_o{ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php b/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php new file mode 100644 index 0000000000000000000000000000000000000000..b487097c7ca030f8c5f2d660ff2c131071ffb9b5 GIT binary patch literal 5034 zcmcIo%TwD%7>~>&VM&6skl>i4Q54#M19l)eiI9wJY~l{V9`op=;~9@EFQCSjR7r-= z440ldeav*GxAxXvI+-5&5A@Pwj_r*Tho15mbb9Ki-IZ*EjUlC6@MyosZ-3uwcON~m zwk&iSd>1PHfL49Bqr#)Ht<-kfGLyW2qVu7xT$y#8oS*s}>ijQZY}J zit96T2x(Q-al{p>j9wuT{=jBc*F?uvUHCVyJ0;!FU0to}p8?`|aYL;-1XPd8ZqyCU z)lEb66mo_}CMHE@(~}*yOxWSP7{Ks04I3_I4VT!4S}iURN3(UyHSIiz%JL?01FF0) z6O-JnXHMS`Cm2RqJ_2%HbnQB6_AZJxaqG4*M{#=w_JUuA!Jrf<}3aX_iG)g(k|LCoz zg$<9_QkfIW1+F&<*qlASG{%=`B|&;7h{w+%!@;8KlfVR|-$JOLRTI8~dc87?2%<1C zknA~7Liir)b$2Zi3Bjk!vp3_+RbxkSrW#)bA&e2KkPTXUrV;7!tl%*;Xp?Q-fs`!i zl}Il&-G89;9Vk6`9*qQxnoXd=lstHmevlfRjRxL$?BhWIJ#anJ9O|WhM^Je6c|KiQ zTVBbhQ`t;5y%0W!htW{JkXy~Aa!aM;S|*b&gav#7^(yOyTsS0W-YO|{gNKG~3!>u0 zp_3&zA9sMXPl)C^iC6sB9`9Q4#i1Q&Px?kc!zqfLX%)z)b;vUO5cONC4MoN290xl8 zQQpJHyPQV-%rIqqa5fTfKwBW>5NDi)=L#BN;vTn@aLGpDMdG$%nQaLyN77~UG1R-Q zlN}!U8=Y{hgN*cxfbf#;aIcO}LFy0%4=4rG=$=+J>lHtXYpS7c!sIvze}W}?VR;Rgabv8vS_%~9qTgh;70mNKv&n{ za0Dl;06epHCIx%Sa7ECy!(dn%N?(Q=OV5boKxO;vo(a$y-W6F;Z$ooFz9l|A2hGTD z&t9`VrbB@25IPUX4G%SKI~Va3xA%=et(B;-)gNt{Ma?&c&9am;w2~%8l z`S$rVz{fxc1_qt-(aFwW14)inrsy6@2^z~2pyLJrWYl`2Ty1;3 z`a@aUa$U=j6N#Oj9S$bAd#QDI3+~2nL729xs=Hy@wW)66%uUiucc{%H+e;3zfWno+ zHS@y9v(&sV1{#S?(|?!(9573mL90CH|M*)FUWcwN(&wmn%0m~=*UKyQa(sQ}jlWPV z(v_n3UIj}Vvj&gZ$=&8i>M@f*V#jR G2>lC@lYv_R literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php new file mode 100644 index 00000000000..bcea3e12824 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php @@ -0,0 +1,132 @@ +google.pubsub.v1.AcknowledgeRequest + */ +class AcknowledgeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $ack_ids; + + /** + * @param string $subscription Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * @param string[] $ackIds Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * + * @return \Google\Cloud\PubSub\V1\AcknowledgeRequest + * + * @experimental + */ + public static function build(string $subscription, array $ackIds): self + { + return (new self()) + ->setSubscription($subscription) + ->setAckIds($ackIds); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAckIds() + { + return $this->ack_ids; + } + + /** + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ack_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php new file mode 100644 index 00000000000..1f206785c59 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php @@ -0,0 +1,347 @@ +google.pubsub.v1.BigQueryConfig + */ +class BigQueryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the table to which to write data, of the form + * {projectId}.{datasetId}.{tableId} + * + * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $table = ''; + /** + * Optional. When true, use the topic's schema as the columns to write to in + * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_topic_schema = false; + /** + * Optional. When true, write the subscription name, message_id, publish_time, + * attributes, and ordering_key to additional columns in the table. The + * subscription name, message_id, and publish_time fields are put in their own + * columns while all other message properties (other than data) are written to + * a JSON object in the attributes column. + * + * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $write_metadata = false; + /** + * Optional. When true and use_topic_schema is true, any fields that are a + * part of the topic schema that are not part of the BigQuery table schema are + * dropped when writing to BigQuery. Otherwise, the schemas must be kept in + * sync and any messages with extra fields are not written and remain in the + * subscription's backlog. + * + * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $drop_unknown_fields = false; + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. When true, use the BigQuery table's schema as the columns to + * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_table_schema = false; + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account_email = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table + * Optional. The name of the table to which to write data, of the form + * {projectId}.{datasetId}.{tableId} + * @type bool $use_topic_schema + * Optional. When true, use the topic's schema as the columns to write to in + * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + * enabled at the same time. + * @type bool $write_metadata + * Optional. When true, write the subscription name, message_id, publish_time, + * attributes, and ordering_key to additional columns in the table. The + * subscription name, message_id, and publish_time fields are put in their own + * columns while all other message properties (other than data) are written to + * a JSON object in the attributes column. + * @type bool $drop_unknown_fields + * Optional. When true and use_topic_schema is true, any fields that are a + * part of the topic schema that are not part of the BigQuery table schema are + * dropped when writing to BigQuery. Otherwise, the schemas must be kept in + * sync and any messages with extra fields are not written and remain in the + * subscription's backlog. + * @type int $state + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * @type bool $use_table_schema + * Optional. When true, use the BigQuery table's schema as the columns to + * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + * enabled at the same time. + * @type string $service_account_email + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the table to which to write data, of the form + * {projectId}.{datasetId}.{tableId} + * + * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * Optional. The name of the table to which to write data, of the form + * {projectId}.{datasetId}.{tableId} + * + * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkString($var, True); + $this->table = $var; + + return $this; + } + + /** + * Optional. When true, use the topic's schema as the columns to write to in + * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseTopicSchema() + { + return $this->use_topic_schema; + } + + /** + * Optional. When true, use the topic's schema as the columns to write to in + * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseTopicSchema($var) + { + GPBUtil::checkBool($var); + $this->use_topic_schema = $var; + + return $this; + } + + /** + * Optional. When true, write the subscription name, message_id, publish_time, + * attributes, and ordering_key to additional columns in the table. The + * subscription name, message_id, and publish_time fields are put in their own + * columns while all other message properties (other than data) are written to + * a JSON object in the attributes column. + * + * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getWriteMetadata() + { + return $this->write_metadata; + } + + /** + * Optional. When true, write the subscription name, message_id, publish_time, + * attributes, and ordering_key to additional columns in the table. The + * subscription name, message_id, and publish_time fields are put in their own + * columns while all other message properties (other than data) are written to + * a JSON object in the attributes column. + * + * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setWriteMetadata($var) + { + GPBUtil::checkBool($var); + $this->write_metadata = $var; + + return $this; + } + + /** + * Optional. When true and use_topic_schema is true, any fields that are a + * part of the topic schema that are not part of the BigQuery table schema are + * dropped when writing to BigQuery. Otherwise, the schemas must be kept in + * sync and any messages with extra fields are not written and remain in the + * subscription's backlog. + * + * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDropUnknownFields() + { + return $this->drop_unknown_fields; + } + + /** + * Optional. When true and use_topic_schema is true, any fields that are a + * part of the topic schema that are not part of the BigQuery table schema are + * dropped when writing to BigQuery. Otherwise, the schemas must be kept in + * sync and any messages with extra fields are not written and remain in the + * subscription's backlog. + * + * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDropUnknownFields($var) + { + GPBUtil::checkBool($var); + $this->drop_unknown_fields = $var; + + return $this; + } + + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\BigQueryConfig\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. When true, use the BigQuery table's schema as the columns to + * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseTableSchema() + { + return $this->use_table_schema; + } + + /** + * Optional. When true, use the BigQuery table's schema as the columns to + * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + * enabled at the same time. + * + * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseTableSchema($var) + { + GPBUtil::checkBool($var); + $this->use_table_schema = $var; + + return $this; + } + + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php new file mode 100644 index 00000000000..e92d03742eb --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php @@ -0,0 +1,91 @@ +google.pubsub.v1.BigQueryConfig.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The subscription can actively send messages to BigQuery + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Cannot write to the BigQuery table because of permission denied errors. + * This can happen if + * - Pub/Sub SA has not been granted the [appropriate BigQuery IAM + * permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) + * - bigquery.googleapis.com API is not enabled for the project + * ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) + * + * Generated from protobuf enum PERMISSION_DENIED = 2; + */ + const PERMISSION_DENIED = 2; + /** + * Cannot write to the BigQuery table because it does not exist. + * + * Generated from protobuf enum NOT_FOUND = 3; + */ + const NOT_FOUND = 3; + /** + * Cannot write to the BigQuery table due to a schema mismatch. + * + * Generated from protobuf enum SCHEMA_MISMATCH = 4; + */ + const SCHEMA_MISMATCH = 4; + /** + * Cannot write to the destination because enforce_in_transit is set to true + * and the destination locations are not in the allowed regions. + * + * Generated from protobuf enum IN_TRANSIT_LOCATION_RESTRICTION = 5; + */ + const IN_TRANSIT_LOCATION_RESTRICTION = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + self::NOT_FOUND => 'NOT_FOUND', + self::SCHEMA_MISMATCH => 'SCHEMA_MISMATCH', + self::IN_TRANSIT_LOCATION_RESTRICTION => 'IN_TRANSIT_LOCATION_RESTRICTION', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\BigQueryConfig_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php new file mode 100644 index 00000000000..ca8c225b2fe --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php @@ -0,0 +1,506 @@ +google.pubsub.v1.CloudStorageConfig + */ +class CloudStorageConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. User-provided name for the Cloud Storage bucket. + * The bucket must be created by the user. The bucket name must be without + * any prefix like "gs://". See the [bucket naming + * requirements] (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = ''; + /** + * Optional. User-provided prefix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * + * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filename_prefix = ''; + /** + * Optional. User-provided suffix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * Must not end in "/". + * + * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filename_suffix = ''; + /** + * Optional. User-provided format string specifying how to represent datetimes + * in Cloud Storage filenames. See the [datetime format + * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + * + * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filename_datetime_format = ''; + /** + * Optional. The maximum duration that can elapse before a new Cloud Storage + * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + * exceed the subscription's acknowledgement deadline. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_duration = null; + /** + * Optional. The maximum bytes that can be written to a Cloud Storage file + * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + * be exceeded in cases where messages are larger than the limit. + * + * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_bytes = 0; + /** + * Optional. The maximum number of messages that can be written to a Cloud + * Storage file before a new file is created. Min 1000 messages. + * + * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_messages = 0; + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account_email = ''; + protected $output_format; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. User-provided name for the Cloud Storage bucket. + * The bucket must be created by the user. The bucket name must be without + * any prefix like "gs://". See the [bucket naming + * requirements] (https://cloud.google.com/storage/docs/buckets#naming). + * @type string $filename_prefix + * Optional. User-provided prefix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * @type string $filename_suffix + * Optional. User-provided suffix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * Must not end in "/". + * @type string $filename_datetime_format + * Optional. User-provided format string specifying how to represent datetimes + * in Cloud Storage filenames. See the [datetime format + * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + * @type \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig $text_config + * Optional. If set, message data will be written to Cloud Storage in text + * format. + * @type \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig $avro_config + * Optional. If set, message data will be written to Cloud Storage in Avro + * format. + * @type \Google\Protobuf\Duration $max_duration + * Optional. The maximum duration that can elapse before a new Cloud Storage + * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + * exceed the subscription's acknowledgement deadline. + * @type int|string $max_bytes + * Optional. The maximum bytes that can be written to a Cloud Storage file + * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + * be exceeded in cases where messages are larger than the limit. + * @type int|string $max_messages + * Optional. The maximum number of messages that can be written to a Cloud + * Storage file before a new file is created. Min 1000 messages. + * @type int $state + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * @type string $service_account_email + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. User-provided name for the Cloud Storage bucket. + * The bucket must be created by the user. The bucket name must be without + * any prefix like "gs://". See the [bucket naming + * requirements] (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. User-provided name for the Cloud Storage bucket. + * The bucket must be created by the user. The bucket name must be without + * any prefix like "gs://". See the [bucket naming + * requirements] (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. User-provided prefix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * + * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilenamePrefix() + { + return $this->filename_prefix; + } + + /** + * Optional. User-provided prefix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * + * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilenamePrefix($var) + { + GPBUtil::checkString($var, True); + $this->filename_prefix = $var; + + return $this; + } + + /** + * Optional. User-provided suffix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * Must not end in "/". + * + * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilenameSuffix() + { + return $this->filename_suffix; + } + + /** + * Optional. User-provided suffix for Cloud Storage filename. See the [object + * naming requirements](https://cloud.google.com/storage/docs/objects#naming). + * Must not end in "/". + * + * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilenameSuffix($var) + { + GPBUtil::checkString($var, True); + $this->filename_suffix = $var; + + return $this; + } + + /** + * Optional. User-provided format string specifying how to represent datetimes + * in Cloud Storage filenames. See the [datetime format + * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + * + * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilenameDatetimeFormat() + { + return $this->filename_datetime_format; + } + + /** + * Optional. User-provided format string specifying how to represent datetimes + * in Cloud Storage filenames. See the [datetime format + * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + * + * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilenameDatetimeFormat($var) + { + GPBUtil::checkString($var, True); + $this->filename_datetime_format = $var; + + return $this; + } + + /** + * Optional. If set, message data will be written to Cloud Storage in text + * format. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig|null + */ + public function getTextConfig() + { + return $this->readOneof(4); + } + + public function hasTextConfig() + { + return $this->hasOneof(4); + } + + /** + * Optional. If set, message data will be written to Cloud Storage in text + * format. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig $var + * @return $this + */ + public function setTextConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. If set, message data will be written to Cloud Storage in Avro + * format. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig|null + */ + public function getAvroConfig() + { + return $this->readOneof(5); + } + + public function hasAvroConfig() + { + return $this->hasOneof(5); + } + + /** + * Optional. If set, message data will be written to Cloud Storage in Avro + * format. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig $var + * @return $this + */ + public function setAvroConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The maximum duration that can elapse before a new Cloud Storage + * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + * exceed the subscription's acknowledgement deadline. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxDuration() + { + return $this->max_duration; + } + + public function hasMaxDuration() + { + return isset($this->max_duration); + } + + public function clearMaxDuration() + { + unset($this->max_duration); + } + + /** + * Optional. The maximum duration that can elapse before a new Cloud Storage + * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + * exceed the subscription's acknowledgement deadline. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_duration = $var; + + return $this; + } + + /** + * Optional. The maximum bytes that can be written to a Cloud Storage file + * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + * be exceeded in cases where messages are larger than the limit. + * + * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxBytes() + { + return $this->max_bytes; + } + + /** + * Optional. The maximum bytes that can be written to a Cloud Storage file + * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + * be exceeded in cases where messages are larger than the limit. + * + * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxBytes($var) + { + GPBUtil::checkInt64($var); + $this->max_bytes = $var; + + return $this; + } + + /** + * Optional. The maximum number of messages that can be written to a Cloud + * Storage file before a new file is created. Min 1000 messages. + * + * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxMessages() + { + return $this->max_messages; + } + + /** + * Optional. The maximum number of messages that can be written to a Cloud + * Storage file before a new file is created. Min 1000 messages. + * + * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxMessages($var) + { + GPBUtil::checkInt64($var); + $this->max_messages = $var; + + return $this; + } + + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field that indicates whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * @return string + */ + public function getOutputFormat() + { + return $this->whichOneof("output_format"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php new file mode 100644 index 00000000000..03971b1d3dc --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php @@ -0,0 +1,129 @@ +google.pubsub.v1.CloudStorageConfig.AvroConfig + */ +class AvroConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. When true, write the subscription name, message_id, + * publish_time, attributes, and ordering_key as additional fields in the + * output. The subscription name, message_id, and publish_time fields are + * put in their own fields while all other message properties other than + * data (for example, an ordering_key, if present) are added as entries in + * the attributes map. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $write_metadata = false; + /** + * Optional. When true, the output Cloud Storage file will be serialized + * using the topic schema, if it exists. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_topic_schema = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $write_metadata + * Optional. When true, write the subscription name, message_id, + * publish_time, attributes, and ordering_key as additional fields in the + * output. The subscription name, message_id, and publish_time fields are + * put in their own fields while all other message properties other than + * data (for example, an ordering_key, if present) are added as entries in + * the attributes map. + * @type bool $use_topic_schema + * Optional. When true, the output Cloud Storage file will be serialized + * using the topic schema, if it exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. When true, write the subscription name, message_id, + * publish_time, attributes, and ordering_key as additional fields in the + * output. The subscription name, message_id, and publish_time fields are + * put in their own fields while all other message properties other than + * data (for example, an ordering_key, if present) are added as entries in + * the attributes map. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getWriteMetadata() + { + return $this->write_metadata; + } + + /** + * Optional. When true, write the subscription name, message_id, + * publish_time, attributes, and ordering_key as additional fields in the + * output. The subscription name, message_id, and publish_time fields are + * put in their own fields while all other message properties other than + * data (for example, an ordering_key, if present) are added as entries in + * the attributes map. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setWriteMetadata($var) + { + GPBUtil::checkBool($var); + $this->write_metadata = $var; + + return $this; + } + + /** + * Optional. When true, the output Cloud Storage file will be serialized + * using the topic schema, if it exists. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseTopicSchema() + { + return $this->use_topic_schema; + } + + /** + * Optional. When true, the output Cloud Storage file will be serialized + * using the topic schema, if it exists. + * + * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseTopicSchema($var) + { + GPBUtil::checkBool($var); + $this->use_topic_schema = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvroConfig::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_AvroConfig::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php new file mode 100644 index 00000000000..394d25dbcc1 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php @@ -0,0 +1,88 @@ +google.pubsub.v1.CloudStorageConfig.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The subscription can actively send messages to Cloud Storage. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Cannot write to the Cloud Storage bucket because of permission denied + * errors. + * + * Generated from protobuf enum PERMISSION_DENIED = 2; + */ + const PERMISSION_DENIED = 2; + /** + * Cannot write to the Cloud Storage bucket because it does not exist. + * + * Generated from protobuf enum NOT_FOUND = 3; + */ + const NOT_FOUND = 3; + /** + * Cannot write to the destination because enforce_in_transit is set to true + * and the destination locations are not in the allowed regions. + * + * Generated from protobuf enum IN_TRANSIT_LOCATION_RESTRICTION = 4; + */ + const IN_TRANSIT_LOCATION_RESTRICTION = 4; + /** + * Cannot write to the Cloud Storage bucket due to an incompatibility + * between the topic schema and subscription settings. + * + * Generated from protobuf enum SCHEMA_MISMATCH = 5; + */ + const SCHEMA_MISMATCH = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + self::NOT_FOUND => 'NOT_FOUND', + self::IN_TRANSIT_LOCATION_RESTRICTION => 'IN_TRANSIT_LOCATION_RESTRICTION', + self::SCHEMA_MISMATCH => 'SCHEMA_MISMATCH', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php new file mode 100644 index 00000000000..b76638c3113 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php @@ -0,0 +1,38 @@ +google.pubsub.v1.CloudStorageConfig.TextConfig + */ +class TextConfig extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextConfig::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_TextConfig::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php new file mode 100644 index 00000000000..29f01208b3c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php @@ -0,0 +1,132 @@ +google.pubsub.v1.CommitSchemaRequest + */ +class CommitSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The schema revision to commit. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schema = null; + + /** + * @param string $name Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. Please see + * {@see SchemaServiceClient::schemaName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema revision to commit. + * + * @return \Google\Cloud\PubSub\V1\CommitSchemaRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\PubSub\V1\Schema $schema): self + { + return (new self()) + ->setName($name) + ->setSchema($schema); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * @type \Google\Cloud\PubSub\V1\Schema $schema + * Required. The schema revision to commit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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 name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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 schema revision to commit. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Required. The schema revision to commit. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); + $this->schema = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php new file mode 100644 index 00000000000..486fe277daa --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php @@ -0,0 +1,200 @@ +google.pubsub.v1.CreateSchemaRequest + */ +class CreateSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The schema object to create. + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schema = null; + /** + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * + * Generated from protobuf field string schema_id = 3; + */ + protected $schema_id = ''; + + /** + * @param string $parent Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. Please see + * {@see SchemaServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema object to create. + * + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * @param string $schemaId The ID to use for the schema, which will become the final component of + * the schema's resource name. + * + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * + * @return \Google\Cloud\PubSub\V1\CreateSchemaRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\PubSub\V1\Schema $schema, string $schemaId): self + { + return (new self()) + ->setParent($parent) + ->setSchema($schema) + ->setSchemaId($schemaId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * @type \Google\Cloud\PubSub\V1\Schema $schema + * Required. The schema object to create. + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * @type string $schema_id + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * + * 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 name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * + * 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 schema object to create. + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Required. The schema object to create. + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); + $this->schema = $var; + + return $this; + } + + /** + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * + * Generated from protobuf field string schema_id = 3; + * @return string + */ + public function getSchemaId() + { + return $this->schema_id; + } + + /** + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * + * Generated from protobuf field string schema_id = 3; + * @param string $var + * @return $this + */ + public function setSchemaId($var) + { + GPBUtil::checkString($var, True); + $this->schema_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php new file mode 100644 index 00000000000..d886092613f --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php @@ -0,0 +1,221 @@ +google.pubsub.v1.CreateSnapshotRequest + */ +class CreateSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * @param string $name Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. Please see + * {@see SubscriberClient::snapshotName()} for help formatting this field. + * @param string $subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\CreateSnapshotRequest + * + * @experimental + */ + public static function build(string $name, string $subscription): self + { + return (new self()) + ->setName($name) + ->setSubscription($subscription); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * @type string $subscription + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * + * 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. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * + * 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 subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 3 [(.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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php new file mode 100644 index 00000000000..b7286c36759 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php @@ -0,0 +1,164 @@ +google.pubsub.v1.DeadLetterPolicy + */ +class DeadLetterPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the topic to which dead letter messages should be + * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + * service account associated with the enclosing subscription's parent project + * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + * have permission to Publish() to this topic. + * The operation will fail if the topic does not exist. + * Users should ensure that there is a subscription attached to this topic + * since messages published to a topic with no subscriptions are lost. + * + * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dead_letter_topic = ''; + /** + * Optional. The maximum number of delivery attempts for any message. The + * value must be between 5 and 100. + * The number of delivery attempts is defined as 1 + (the sum of number of + * NACKs and number of times the acknowledgement deadline has been exceeded + * for the message). + * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + * client libraries may automatically extend ack_deadlines. + * This field will be honored on a best effort basis. + * If this parameter is 0, a default value of 5 is used. + * + * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_delivery_attempts = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dead_letter_topic + * Optional. The name of the topic to which dead letter messages should be + * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + * service account associated with the enclosing subscription's parent project + * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + * have permission to Publish() to this topic. + * The operation will fail if the topic does not exist. + * Users should ensure that there is a subscription attached to this topic + * since messages published to a topic with no subscriptions are lost. + * @type int $max_delivery_attempts + * Optional. The maximum number of delivery attempts for any message. The + * value must be between 5 and 100. + * The number of delivery attempts is defined as 1 + (the sum of number of + * NACKs and number of times the acknowledgement deadline has been exceeded + * for the message). + * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + * client libraries may automatically extend ack_deadlines. + * This field will be honored on a best effort basis. + * If this parameter is 0, a default value of 5 is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the topic to which dead letter messages should be + * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + * service account associated with the enclosing subscription's parent project + * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + * have permission to Publish() to this topic. + * The operation will fail if the topic does not exist. + * Users should ensure that there is a subscription attached to this topic + * since messages published to a topic with no subscriptions are lost. + * + * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeadLetterTopic() + { + return $this->dead_letter_topic; + } + + /** + * Optional. The name of the topic to which dead letter messages should be + * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + * service account associated with the enclosing subscription's parent project + * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + * have permission to Publish() to this topic. + * The operation will fail if the topic does not exist. + * Users should ensure that there is a subscription attached to this topic + * since messages published to a topic with no subscriptions are lost. + * + * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeadLetterTopic($var) + { + GPBUtil::checkString($var, True); + $this->dead_letter_topic = $var; + + return $this; + } + + /** + * Optional. The maximum number of delivery attempts for any message. The + * value must be between 5 and 100. + * The number of delivery attempts is defined as 1 + (the sum of number of + * NACKs and number of times the acknowledgement deadline has been exceeded + * for the message). + * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + * client libraries may automatically extend ack_deadlines. + * This field will be honored on a best effort basis. + * If this parameter is 0, a default value of 5 is used. + * + * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxDeliveryAttempts() + { + return $this->max_delivery_attempts; + } + + /** + * Optional. The maximum number of delivery attempts for any message. The + * value must be between 5 and 100. + * The number of delivery attempts is defined as 1 + (the sum of number of + * NACKs and number of times the acknowledgement deadline has been exceeded + * for the message). + * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + * client libraries may automatically extend ack_deadlines. + * This field will be honored on a best effort basis. + * If this parameter is 0, a default value of 5 is used. + * + * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxDeliveryAttempts($var) + { + GPBUtil::checkInt32($var); + $this->max_delivery_attempts = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php new file mode 100644 index 00000000000..ff8bdac822d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.DeleteSchemaRequest + */ +class DeleteSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. Please see + * {@see SchemaServiceClient::schemaName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\DeleteSchemaRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php new file mode 100644 index 00000000000..fdb3da46606 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php @@ -0,0 +1,143 @@ +google.pubsub.v1.DeleteSchemaRevisionRequest + */ +class DeleteSchemaRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * + * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $revision_id = ''; + + /** + * @param string $name Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * Please see {@see SchemaServiceClient::schemaName()} for help formatting this field. + * @param string $revisionId Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * + * @return \Google\Cloud\PubSub\V1\DeleteSchemaRevisionRequest + * + * @experimental + */ + public static function build(string $name, string $revisionId): self + { + return (new self()) + ->setName($name) + ->setRevisionId($revisionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * @type string $revision_id + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * + * 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 name of the schema revision to be deleted, with a revision ID + * explicitly included. + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * + * 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; + } + + /** + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * + * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getRevisionId() + { + @trigger_error('revision_id is deprecated.', E_USER_DEPRECATED); + return $this->revision_id; + } + + /** + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * + * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRevisionId($var) + { + @trigger_error('revision_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php new file mode 100644 index 00000000000..3b766a68341 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.DeleteSnapshotRequest + */ +class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $snapshot = ''; + + /** + * @param string $snapshot Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. Please see + * {@see SubscriberClient::snapshotName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\DeleteSnapshotRequest + * + * @experimental + */ + public static function build(string $snapshot): self + { + return (new self()) + ->setSnapshot($snapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $snapshot + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSnapshot() + { + return $this->snapshot; + } + + /** + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php new file mode 100644 index 00000000000..9bef784bfab --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.DeleteSubscriptionRequest + */ +class DeleteSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + + /** + * @param string $subscription Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\DeleteSubscriptionRequest + * + * @experimental + */ + public static function build(string $subscription): self + { + return (new self()) + ->setSubscription($subscription); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php new file mode 100644 index 00000000000..bdd8fbafdf8 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.DeleteTopicRequest + */ +class DeleteTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + + /** + * @param string $topic Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. Please see + * {@see PublisherClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\DeleteTopicRequest + * + * @experimental + */ + public static function build(string $topic): self + { + return (new self()) + ->setTopic($topic); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php new file mode 100644 index 00000000000..4279c67be0e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php @@ -0,0 +1,71 @@ +google.pubsub.v1.DetachSubscriptionRequest + */ +class DetachSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php new file mode 100644 index 00000000000..99d903a39c5 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php @@ -0,0 +1,34 @@ +google.pubsub.v1.DetachSubscriptionResponse + */ +class DetachSubscriptionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php new file mode 100644 index 00000000000..44b74224b4a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php @@ -0,0 +1,62 @@ +google.pubsub.v1.Encoding + */ +class Encoding +{ + /** + * Unspecified + * + * Generated from protobuf enum ENCODING_UNSPECIFIED = 0; + */ + const ENCODING_UNSPECIFIED = 0; + /** + * JSON encoding + * + * Generated from protobuf enum JSON = 1; + */ + const JSON = 1; + /** + * Binary encoding, as defined by the schema type. For some schema types, + * binary encoding may not be available. + * + * Generated from protobuf enum BINARY = 2; + */ + const BINARY = 2; + + private static $valueToName = [ + self::ENCODING_UNSPECIFIED => 'ENCODING_UNSPECIFIED', + self::JSON => 'JSON', + self::BINARY => 'BINARY', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php new file mode 100644 index 00000000000..dd88b82331f --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php @@ -0,0 +1,98 @@ +google.pubsub.v1.ExpirationPolicy + */ +class ExpirationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the "time-to-live" duration for an associated resource. + * The resource expires if it is not active for a period of `ttl`. The + * definition of "activity" depends on the type of the associated resource. + * The minimum and maximum allowed values for `ttl` depend on the type of the + * associated resource, as well. If `ttl` is not set, the associated resource + * never expires. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $ttl + * Optional. Specifies the "time-to-live" duration for an associated resource. + * The resource expires if it is not active for a period of `ttl`. The + * definition of "activity" depends on the type of the associated resource. + * The minimum and maximum allowed values for `ttl` depend on the type of the + * associated resource, as well. If `ttl` is not set, the associated resource + * never expires. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the "time-to-live" duration for an associated resource. + * The resource expires if it is not active for a period of `ttl`. The + * definition of "activity" depends on the type of the associated resource. + * The minimum and maximum allowed values for `ttl` depend on the type of the + * associated resource, as well. If `ttl` is not set, the associated resource + * never expires. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTtl() + { + return $this->ttl; + } + + public function hasTtl() + { + return isset($this->ttl); + } + + public function clearTtl() + { + unset($this->ttl); + } + + /** + * Optional. Specifies the "time-to-live" duration for an associated resource. + * The resource expires if it is not active for a period of `ttl`. The + * definition of "activity" depends on the type of the associated resource. + * The minimum and maximum allowed values for `ttl` depend on the type of the + * associated resource, as well. If `ttl` is not set, the associated resource + * never expires. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php new file mode 100644 index 00000000000..afbe7ce6056 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php @@ -0,0 +1,124 @@ +google.pubsub.v1.GetSchemaRequest + */ +class GetSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + */ + protected $view = 0; + + /** + * @param string $name Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. Please see + * {@see SchemaServiceClient::schemaName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\GetSchemaRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * @type int $view + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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 name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * + * 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; + } + + /** + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php new file mode 100644 index 00000000000..55f4ab4e63a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.GetSnapshotRequest + */ +class GetSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $snapshot = ''; + + /** + * @param string $snapshot Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. Please see + * {@see SubscriberClient::snapshotName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\GetSnapshotRequest + * + * @experimental + */ + public static function build(string $snapshot): self + { + return (new self()) + ->setSnapshot($snapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $snapshot + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSnapshot() + { + return $this->snapshot; + } + + /** + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php new file mode 100644 index 00000000000..e9a42ecdf58 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.GetSubscriptionRequest + */ +class GetSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + + /** + * @param string $subscription Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\GetSubscriptionRequest + * + * @experimental + */ + public static function build(string $subscription): self + { + return (new self()) + ->setSubscription($subscription); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php new file mode 100644 index 00000000000..0686a920c4e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php @@ -0,0 +1,86 @@ +google.pubsub.v1.GetTopicRequest + */ +class GetTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + + /** + * @param string $topic Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. Please see + * {@see PublisherClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\GetTopicRequest + * + * @experimental + */ + public static function build(string $topic): self + { + return (new self()) + ->setTopic($topic); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php new file mode 100644 index 00000000000..be496bec384 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php @@ -0,0 +1,156 @@ +google.pubsub.v1.IngestionDataSourceSettings + */ +class IngestionDataSourceSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $platform_logs_settings = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis $aws_kinesis + * Optional. Amazon Kinesis Data Streams. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $cloud_storage + * Optional. Cloud Storage. + * @type \Google\Cloud\PubSub\V1\PlatformLogsSettings $platform_logs_settings + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Amazon Kinesis Data Streams. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis aws_kinesis = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis|null + */ + public function getAwsKinesis() + { + return $this->readOneof(1); + } + + public function hasAwsKinesis() + { + return $this->hasOneof(1); + } + + /** + * Optional. Amazon Kinesis Data Streams. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis aws_kinesis = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis $var + * @return $this + */ + public function setAwsKinesis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage|null + */ + public function getCloudStorage() + { + return $this->readOneof(2); + } + + public function hasCloudStorage() + { + return $this->hasOneof(2); + } + + /** + * Optional. Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $var + * @return $this + */ + public function setCloudStorage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PlatformLogsSettings|null + */ + public function getPlatformLogsSettings() + { + return $this->platform_logs_settings; + } + + public function hasPlatformLogsSettings() + { + return isset($this->platform_logs_settings); + } + + public function clearPlatformLogsSettings() + { + unset($this->platform_logs_settings); + } + + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PlatformLogsSettings $var + * @return $this + */ + public function setPlatformLogsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings::class); + $this->platform_logs_settings = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php new file mode 100644 index 00000000000..ce30e3b1619 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php @@ -0,0 +1,234 @@ +google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + */ +class AwsKinesis extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. An output-only field that indicates the state of the Kinesis + * ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The Kinesis stream ARN to ingest data from. + * + * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $stream_arn = ''; + /** + * Required. The Kinesis consumer ARN to used for ingestion in Enhanced + * Fan-Out mode. The consumer must be already created and ready to be used. + * + * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $consumer_arn = ''; + /** + * Required. AWS role ARN to be used for Federated Identity authentication + * with Kinesis. Check the Pub/Sub docs for how to set up this role and the + * required permissions that need to be attached to it. + * + * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $aws_role_arn = ''; + /** + * Required. The GCP service account to be used for Federated Identity + * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + * the provided role). The `aws_role_arn` must be set up with + * `accounts.google.com:sub` equals to this service account number. + * + * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $gcp_service_account = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. An output-only field that indicates the state of the Kinesis + * ingestion source. + * @type string $stream_arn + * Required. The Kinesis stream ARN to ingest data from. + * @type string $consumer_arn + * Required. The Kinesis consumer ARN to used for ingestion in Enhanced + * Fan-Out mode. The consumer must be already created and ready to be used. + * @type string $aws_role_arn + * Required. AWS role ARN to be used for Federated Identity authentication + * with Kinesis. Check the Pub/Sub docs for how to set up this role and the + * required permissions that need to be attached to it. + * @type string $gcp_service_account + * Required. The GCP service account to be used for Federated Identity + * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + * the provided role). The `aws_role_arn` must be set up with + * `accounts.google.com:sub` equals to this service account number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. An output-only field that indicates the state of the Kinesis + * ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field that indicates the state of the Kinesis + * ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The Kinesis stream ARN to ingest data from. + * + * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStreamArn() + { + return $this->stream_arn; + } + + /** + * Required. The Kinesis stream ARN to ingest data from. + * + * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStreamArn($var) + { + GPBUtil::checkString($var, True); + $this->stream_arn = $var; + + return $this; + } + + /** + * Required. The Kinesis consumer ARN to used for ingestion in Enhanced + * Fan-Out mode. The consumer must be already created and ready to be used. + * + * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConsumerArn() + { + return $this->consumer_arn; + } + + /** + * Required. The Kinesis consumer ARN to used for ingestion in Enhanced + * Fan-Out mode. The consumer must be already created and ready to be used. + * + * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConsumerArn($var) + { + GPBUtil::checkString($var, True); + $this->consumer_arn = $var; + + return $this; + } + + /** + * Required. AWS role ARN to be used for Federated Identity authentication + * with Kinesis. Check the Pub/Sub docs for how to set up this role and the + * required permissions that need to be attached to it. + * + * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAwsRoleArn() + { + return $this->aws_role_arn; + } + + /** + * Required. AWS role ARN to be used for Federated Identity authentication + * with Kinesis. Check the Pub/Sub docs for how to set up this role and the + * required permissions that need to be attached to it. + * + * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAwsRoleArn($var) + { + GPBUtil::checkString($var, True); + $this->aws_role_arn = $var; + + return $this; + } + + /** + * Required. The GCP service account to be used for Federated Identity + * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + * the provided role). The `aws_role_arn` must be set up with + * `accounts.google.com:sub` equals to this service account number. + * + * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGcpServiceAccount() + { + return $this->gcp_service_account; + } + + /** + * Required. The GCP service account to be used for Federated Identity + * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + * the provided role). The `aws_role_arn` must be set up with + * `accounts.google.com:sub` equals to this service account number. + * + * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGcpServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service_account = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AwsKinesis::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_AwsKinesis::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php new file mode 100644 index 00000000000..b53ce8c6788 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php @@ -0,0 +1,95 @@ +google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Ingestion is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Permission denied encountered while consuming data from Kinesis. + * This can happen if: + * - The provided `aws_role_arn` does not exist or does not have the + * appropriate permissions attached. + * - The provided `aws_role_arn` is not set up properly for Identity + * Federation using `gcp_service_account`. + * - The Pub/Sub SA is not granted the + * `iam.serviceAccounts.getOpenIdToken` permission on + * `gcp_service_account`. + * + * Generated from protobuf enum KINESIS_PERMISSION_DENIED = 2; + */ + const KINESIS_PERMISSION_DENIED = 2; + /** + * Permission denied encountered while publishing to the topic. This can + * happen if the Pub/Sub SA has not been granted the [appropriate publish + * permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + * + * Generated from protobuf enum PUBLISH_PERMISSION_DENIED = 3; + */ + const PUBLISH_PERMISSION_DENIED = 3; + /** + * The Kinesis stream does not exist. + * + * Generated from protobuf enum STREAM_NOT_FOUND = 4; + */ + const STREAM_NOT_FOUND = 4; + /** + * The Kinesis consumer does not exist. + * + * Generated from protobuf enum CONSUMER_NOT_FOUND = 5; + */ + const CONSUMER_NOT_FOUND = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::KINESIS_PERMISSION_DENIED => 'KINESIS_PERMISSION_DENIED', + self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED', + self::STREAM_NOT_FOUND => 'STREAM_NOT_FOUND', + self::CONSUMER_NOT_FOUND => 'CONSUMER_NOT_FOUND', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_AwsKinesis_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php new file mode 100644 index 00000000000..bb8882fb169 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php @@ -0,0 +1,320 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + */ +class CloudStorage extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bucket = ''; + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_object_create_time = null; + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $match_glob = ''; + protected $input_format; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * @type string $bucket + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $text_format + * Optional. Data from Cloud Storage will be interpreted as text. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $avro_format + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $pubsub_avro_format + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * @type \Google\Protobuf\Timestamp $minimum_object_create_time + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * @type string $match_glob + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. Data from Cloud Storage will be interpreted as text. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat|null + */ + public function getTextFormat() + { + return $this->readOneof(3); + } + + public function hasTextFormat() + { + return $this->hasOneof(3); + } + + /** + * Optional. Data from Cloud Storage will be interpreted as text. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $var + * @return $this + */ + public function setTextFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat|null + */ + public function getAvroFormat() + { + return $this->readOneof(4); + } + + public function hasAvroFormat() + { + return $this->hasOneof(4); + } + + /** + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $var + * @return $this + */ + public function setAvroFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat|null + */ + public function getPubsubAvroFormat() + { + return $this->readOneof(5); + } + + public function hasPubsubAvroFormat() + { + return $this->hasOneof(5); + } + + /** + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $var + * @return $this + */ + public function setPubsubAvroFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getMinimumObjectCreateTime() + { + return $this->minimum_object_create_time; + } + + public function hasMinimumObjectCreateTime() + { + return isset($this->minimum_object_create_time); + } + + public function clearMinimumObjectCreateTime() + { + unset($this->minimum_object_create_time); + } + + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setMinimumObjectCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->minimum_object_create_time = $var; + + return $this; + } + + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMatchGlob() + { + return $this->match_glob; + } + + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMatchGlob($var) + { + GPBUtil::checkString($var, True); + $this->match_glob = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputFormat() + { + return $this->whichOneof("input_format"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudStorage::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php new file mode 100644 index 00000000000..6154e9ecb6b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php @@ -0,0 +1,38 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + */ +class AvroFormat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvroFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_AvroFormat::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php new file mode 100644 index 00000000000..907387cb33f --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php @@ -0,0 +1,39 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + */ +class PubSubAvroFormat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PubSubAvroFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_PubSubAvroFormat::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php new file mode 100644 index 00000000000..ed995e4efc5 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php @@ -0,0 +1,94 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Ingestion is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Permission denied encountered while calling the Cloud Storage API. This + * can happen if the Pub/Sub SA has not been granted the + * [appropriate + * permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions): + * - storage.objects.list: to list the objects in a bucket. + * - storage.objects.get: to read the objects in a bucket. + * - storage.buckets.get: to verify the bucket exists. + * + * Generated from protobuf enum CLOUD_STORAGE_PERMISSION_DENIED = 2; + */ + const CLOUD_STORAGE_PERMISSION_DENIED = 2; + /** + * Permission denied encountered while publishing to the topic. This can + * happen if the Pub/Sub SA has not been granted the [appropriate publish + * permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + * + * Generated from protobuf enum PUBLISH_PERMISSION_DENIED = 3; + */ + const PUBLISH_PERMISSION_DENIED = 3; + /** + * The provided Cloud Storage bucket doesn't exist. + * + * Generated from protobuf enum BUCKET_NOT_FOUND = 4; + */ + const BUCKET_NOT_FOUND = 4; + /** + * The Cloud Storage bucket has too many objects, ingestion will be + * paused. + * + * Generated from protobuf enum TOO_MANY_OBJECTS = 5; + */ + const TOO_MANY_OBJECTS = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::CLOUD_STORAGE_PERMISSION_DENIED => 'CLOUD_STORAGE_PERMISSION_DENIED', + self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED', + self::BUCKET_NOT_FOUND => 'BUCKET_NOT_FOUND', + self::TOO_MANY_OBJECTS => 'TOO_MANY_OBJECTS', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php new file mode 100644 index 00000000000..7ed0fe63dea --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php @@ -0,0 +1,82 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + */ +class TextFormat extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $delimiter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $delimiter + * Optional. When unset, '\n' is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDelimiter() + { + return isset($this->delimiter) ? $this->delimiter : ''; + } + + public function hasDelimiter() + { + return isset($this->delimiter); + } + + public function clearDelimiter() + { + unset($this->delimiter); + } + + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDelimiter($var) + { + GPBUtil::checkString($var, True); + $this->delimiter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_TextFormat::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php new file mode 100644 index 00000000000..c37496d79bd --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php @@ -0,0 +1,148 @@ +google.pubsub.v1.IngestionFailureEvent + */ +class IngestionFailureEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $topic = ''; + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $error_message = ''; + protected $failure; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * @type string $error_message + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $cloud_storage_failure + * Optional. Failure when ingesting from Cloud Storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * Optional. Failure when ingesting from Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure|null + */ + public function getCloudStorageFailure() + { + return $this->readOneof(3); + } + + public function hasCloudStorageFailure() + { + return $this->hasOneof(3); + } + + /** + * Optional. Failure when ingesting from Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $var + * @return $this + */ + public function setCloudStorageFailure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getFailure() + { + return $this->whichOneof("failure"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php new file mode 100644 index 00000000000..53cf93bd1cc --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php @@ -0,0 +1,43 @@ +google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + */ +class ApiViolationReason extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ApiViolationReason::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_ApiViolationReason::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php new file mode 100644 index 00000000000..2c47803b4fe --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php @@ -0,0 +1,37 @@ +google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + */ +class AvroFailureReason extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvroFailureReason::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_AvroFailureReason::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php new file mode 100644 index 00000000000..c973b736a1b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php @@ -0,0 +1,224 @@ +google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + */ +class CloudStorageFailure extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bucket = ''; + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $object_name = ''; + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $object_generation = 0; + protected $reason; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Optional. Name of the Cloud Storage bucket used for ingestion. + * @type string $object_name + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * @type int|string $object_generation + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $avro_failure_reason + * Optional. Failure encountered when parsing an Avro file. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $api_violation_reason + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getObjectName() + { + return $this->object_name; + } + + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setObjectName($var) + { + GPBUtil::checkString($var, True); + $this->object_name = $var; + + return $this; + } + + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getObjectGeneration() + { + return $this->object_generation; + } + + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setObjectGeneration($var) + { + GPBUtil::checkInt64($var); + $this->object_generation = $var; + + return $this; + } + + /** + * Optional. Failure encountered when parsing an Avro file. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason|null + */ + public function getAvroFailureReason() + { + return $this->readOneof(5); + } + + public function hasAvroFailureReason() + { + return $this->hasOneof(5); + } + + /** + * Optional. Failure encountered when parsing an Avro file. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $var + * @return $this + */ + public function setAvroFailureReason($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason|null + */ + public function getApiViolationReason() + { + return $this->readOneof(6); + } + + public function hasApiViolationReason() + { + return $this->hasOneof(6); + } + + /** + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $var + * @return $this + */ + public function setApiViolationReason($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getReason() + { + return $this->whichOneof("reason"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudStorageFailure::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_CloudStorageFailure::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php new file mode 100644 index 00000000000..b9f24a77534 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php @@ -0,0 +1,195 @@ +google.pubsub.v1.ListSchemaRevisionsRequest + */ +class ListSchemaRevisionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the schema to list revisions for. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + */ + protected $view = 0; + /** + * The maximum number of revisions to return per page. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $name Required. The name of the schema to list revisions for. Please see + * {@see SchemaServiceClient::schemaName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListSchemaRevisionsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the schema to list revisions for. + * @type int $view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @type int $page_size + * The maximum number of revisions to return per page. + * @type string $page_token + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the schema to list revisions for. + * + * 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 name of the schema to list revisions for. + * + * 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; + } + + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); + $this->view = $var; + + return $this; + } + + /** + * The maximum number of revisions to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of revisions to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 4; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php new file mode 100644 index 00000000000..634dc721e15 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php @@ -0,0 +1,105 @@ +google.pubsub.v1.ListSchemaRevisionsResponse + */ +class ListSchemaRevisionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The revisions of the schema. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + */ + private $schemas; + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is empty, there are no subsequent pages. + * + * 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\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $schemas + * The revisions of the schema. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is empty, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * The revisions of the schema. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchemas() + { + return $this->schemas; + } + + /** + * The revisions of the schema. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + * @param array<\Google\Cloud\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchemas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Schema::class); + $this->schemas = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is empty, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is empty, there are no subsequent pages. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php new file mode 100644 index 00000000000..32b97def03f --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php @@ -0,0 +1,204 @@ +google.pubsub.v1.ListSchemasRequest + */ +class ListSchemasRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + */ + protected $view = 0; + /** + * Maximum number of schemas to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. Please see + * {@see SchemaServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListSchemasRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @type int $view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @type int $page_size + * Maximum number of schemas to return. + * @type string $page_token + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * + * 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 name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * + * 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; + } + + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * + * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); + $this->view = $var; + + return $this; + } + + /** + * Maximum number of schemas to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of schemas to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 4; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php new file mode 100644 index 00000000000..c61109d326d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php @@ -0,0 +1,105 @@ +google.pubsub.v1.ListSchemasResponse + */ +class ListSchemasResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting schemas. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + */ + private $schemas; + /** + * If not empty, indicates that there may be more schemas that match the + * request; this value should be passed in a new `ListSchemasRequest`. + * + * 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\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $schemas + * The resulting schemas. + * @type string $next_page_token + * If not empty, indicates that there may be more schemas that match the + * request; this value should be passed in a new `ListSchemasRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * The resulting schemas. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchemas() + { + return $this->schemas; + } + + /** + * The resulting schemas. + * + * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; + * @param array<\Google\Cloud\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchemas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Schema::class); + $this->schemas = $arr; + + return $this; + } + + /** + * If not empty, indicates that there may be more schemas that match the + * request; this value should be passed in a new `ListSchemasRequest`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If not empty, indicates that there may be more schemas that match the + * request; this value should be passed in a new `ListSchemasRequest`. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php new file mode 100644 index 00000000000..b0bbf7bdb44 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php @@ -0,0 +1,162 @@ +google.pubsub.v1.ListSnapshotsRequest + */ +class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $project = ''; + /** + * Optional. Maximum number of snapshots to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $project Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. Please see + * {@see SubscriberClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListSnapshotsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @type int $page_size + * Optional. Maximum number of snapshots to return. + * @type string $page_token + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Optional. Maximum number of snapshots to return. + * + * 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 snapshots to return. + * + * 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 value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php new file mode 100644 index 00000000000..caf5bbb50e3 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php @@ -0,0 +1,109 @@ +google.pubsub.v1.ListSnapshotsResponse + */ +class ListSnapshotsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resulting snapshots. + * + * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $snapshots; + /** + * Optional. If not empty, indicates that there may be more snapshot that + * match the request; this value should be passed in a new + * `ListSnapshotsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PubSub\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $snapshots + * Optional. The resulting snapshots. + * @type string $next_page_token + * Optional. If not empty, indicates that there may be more snapshot that + * match the request; this value should be passed in a new + * `ListSnapshotsRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resulting snapshots. + * + * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnapshots() + { + return $this->snapshots; + } + + /** + * Optional. The resulting snapshots. + * + * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PubSub\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Snapshot::class); + $this->snapshots = $arr; + + return $this; + } + + /** + * Optional. If not empty, indicates that there may be more snapshot that + * match the request; this value should be passed in a new + * `ListSnapshotsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. If not empty, indicates that there may be more snapshot that + * match the request; this value should be passed in a new + * `ListSnapshotsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php new file mode 100644 index 00000000000..d1cce8a45b0 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php @@ -0,0 +1,162 @@ +google.pubsub.v1.ListSubscriptionsRequest + */ +class ListSubscriptionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $project = ''; + /** + * Optional. Maximum number of subscriptions to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $project Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. Please see + * {@see SubscriberClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListSubscriptionsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @type int $page_size + * Optional. Maximum number of subscriptions to return. + * @type string $page_token + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Optional. Maximum number of subscriptions to return. + * + * 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 subscriptions to return. + * + * 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 value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php new file mode 100644 index 00000000000..e875730c48c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php @@ -0,0 +1,109 @@ +google.pubsub.v1.ListSubscriptionsResponse + */ +class ListSubscriptionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The subscriptions that match the request. + * + * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $subscriptions; + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PubSub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $subscriptions + * Optional. The subscriptions that match the request. + * @type string $next_page_token + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The subscriptions that match the request. + * + * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubscriptions() + { + return $this->subscriptions; + } + + /** + * Optional. The subscriptions that match the request. + * + * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PubSub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Subscription::class); + $this->subscriptions = $arr; + + return $this; + } + + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php new file mode 100644 index 00000000000..be1957c835c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php @@ -0,0 +1,162 @@ +google.pubsub.v1.ListTopicSnapshotsRequest + */ +class ListTopicSnapshotsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + /** + * Optional. Maximum number of snapshot names to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $topic Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. Please see + * {@see PublisherClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListTopicSnapshotsRequest + * + * @experimental + */ + public static function build(string $topic): self + { + return (new self()) + ->setTopic($topic); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @type int $page_size + * Optional. Maximum number of snapshot names to return. + * @type string $page_token + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Optional. Maximum number of snapshot names to return. + * + * 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 snapshot names to return. + * + * 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 value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php new file mode 100644 index 00000000000..cb08491e566 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php @@ -0,0 +1,109 @@ +google.pubsub.v1.ListTopicSnapshotsResponse + */ +class ListTopicSnapshotsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The names of the snapshots that match the request. + * + * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $snapshots; + /** + * Optional. If not empty, indicates that there may be more snapshots that + * match the request; this value should be passed in a new + * `ListTopicSnapshotsRequest` to get more snapshots. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $snapshots + * Optional. The names of the snapshots that match the request. + * @type string $next_page_token + * Optional. If not empty, indicates that there may be more snapshots that + * match the request; this value should be passed in a new + * `ListTopicSnapshotsRequest` to get more snapshots. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The names of the snapshots that match the request. + * + * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnapshots() + { + return $this->snapshots; + } + + /** + * Optional. The names of the snapshots that match the request. + * + * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->snapshots = $arr; + + return $this; + } + + /** + * Optional. If not empty, indicates that there may be more snapshots that + * match the request; this value should be passed in a new + * `ListTopicSnapshotsRequest` to get more snapshots. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. If not empty, indicates that there may be more snapshots that + * match the request; this value should be passed in a new + * `ListTopicSnapshotsRequest` to get more snapshots. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php new file mode 100644 index 00000000000..2a3775252eb --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php @@ -0,0 +1,162 @@ +google.pubsub.v1.ListTopicSubscriptionsRequest + */ +class ListTopicSubscriptionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + /** + * Optional. Maximum number of subscription names to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $topic Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. Please see + * {@see PublisherClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListTopicSubscriptionsRequest + * + * @experimental + */ + public static function build(string $topic): self + { + return (new self()) + ->setTopic($topic); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @type int $page_size + * Optional. Maximum number of subscription names to return. + * @type string $page_token + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Optional. Maximum number of subscription names to return. + * + * 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 subscription names to return. + * + * 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 value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php new file mode 100644 index 00000000000..2b7f1c2324e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php @@ -0,0 +1,113 @@ +google.pubsub.v1.ListTopicSubscriptionsResponse + */ +class ListTopicSubscriptionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The names of subscriptions attached to the topic specified in the + * request. + * + * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $subscriptions; + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $subscriptions + * Optional. The names of subscriptions attached to the topic specified in the + * request. + * @type string $next_page_token + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The names of subscriptions attached to the topic specified in the + * request. + * + * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubscriptions() + { + return $this->subscriptions; + } + + /** + * Optional. The names of subscriptions attached to the topic specified in the + * request. + * + * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subscriptions = $arr; + + return $this; + } + + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. If not empty, indicates that there may be more subscriptions that + * match the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php new file mode 100644 index 00000000000..fe2336bce34 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php @@ -0,0 +1,162 @@ +google.pubsub.v1.ListTopicsRequest + */ +class ListTopicsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $project = ''; + /** + * Optional. Maximum number of topics to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $project Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. Please see + * {@see PublisherClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\PubSub\V1\ListTopicsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @type int $page_size + * Optional. Maximum number of topics to return. + * @type string $page_token + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Optional. Maximum number of topics to return. + * + * 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 topics to return. + * + * 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 value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * + * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php new file mode 100644 index 00000000000..79a07799e34 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php @@ -0,0 +1,105 @@ +google.pubsub.v1.ListTopicsResponse + */ +class ListTopicsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resulting topics. + * + * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $topics; + /** + * Optional. If not empty, indicates that there may be more topics that match + * the request; this value should be passed in a new `ListTopicsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PubSub\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $topics + * Optional. The resulting topics. + * @type string $next_page_token + * Optional. If not empty, indicates that there may be more topics that match + * the request; this value should be passed in a new `ListTopicsRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resulting topics. + * + * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTopics() + { + return $this->topics; + } + + /** + * Optional. The resulting topics. + * + * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PubSub\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTopics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Topic::class); + $this->topics = $arr; + + return $this; + } + + /** + * Optional. If not empty, indicates that there may be more topics that match + * the request; this value should be passed in a new `ListTopicsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. If not empty, indicates that there may be more topics that match + * the request; this value should be passed in a new `ListTopicsRequest`. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php new file mode 100644 index 00000000000..b31b0ad0391 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php @@ -0,0 +1,137 @@ +google.pubsub.v1.MessageStoragePolicy + */ +class MessageStoragePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of IDs of Google Cloud regions where messages that are + * published to the topic may be persisted in storage. Messages published by + * publishers running in non-allowed Google Cloud regions (or running outside + * of Google Cloud altogether) are routed for storage in one of the allowed + * regions. An empty list means that no regions are allowed, and is not a + * valid configuration. + * + * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_persistence_regions; + /** + * Optional. If true, `allowed_persistence_regions` is also used to enforce + * in-transit guarantees for messages. That is, Pub/Sub will fail + * Publish operations on this topic and subscribe operations + * on any subscription attached to this topic in any region that is + * not in `allowed_persistence_regions`. + * + * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enforce_in_transit = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_persistence_regions + * Optional. A list of IDs of Google Cloud regions where messages that are + * published to the topic may be persisted in storage. Messages published by + * publishers running in non-allowed Google Cloud regions (or running outside + * of Google Cloud altogether) are routed for storage in one of the allowed + * regions. An empty list means that no regions are allowed, and is not a + * valid configuration. + * @type bool $enforce_in_transit + * Optional. If true, `allowed_persistence_regions` is also used to enforce + * in-transit guarantees for messages. That is, Pub/Sub will fail + * Publish operations on this topic and subscribe operations + * on any subscription attached to this topic in any region that is + * not in `allowed_persistence_regions`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of IDs of Google Cloud regions where messages that are + * published to the topic may be persisted in storage. Messages published by + * publishers running in non-allowed Google Cloud regions (or running outside + * of Google Cloud altogether) are routed for storage in one of the allowed + * regions. An empty list means that no regions are allowed, and is not a + * valid configuration. + * + * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedPersistenceRegions() + { + return $this->allowed_persistence_regions; + } + + /** + * Optional. A list of IDs of Google Cloud regions where messages that are + * published to the topic may be persisted in storage. Messages published by + * publishers running in non-allowed Google Cloud regions (or running outside + * of Google Cloud altogether) are routed for storage in one of the allowed + * regions. An empty list means that no regions are allowed, and is not a + * valid configuration. + * + * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedPersistenceRegions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_persistence_regions = $arr; + + return $this; + } + + /** + * Optional. If true, `allowed_persistence_regions` is also used to enforce + * in-transit guarantees for messages. That is, Pub/Sub will fail + * Publish operations on this topic and subscribe operations + * on any subscription attached to this topic in any region that is + * not in `allowed_persistence_regions`. + * + * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnforceInTransit() + { + return $this->enforce_in_transit; + } + + /** + * Optional. If true, `allowed_persistence_regions` is also used to enforce + * in-transit guarantees for messages. That is, Pub/Sub will fail + * Publish operations on this topic and subscribe operations + * on any subscription attached to this topic in any region that is + * not in `allowed_persistence_regions`. + * + * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnforceInTransit($var) + { + GPBUtil::checkBool($var); + $this->enforce_in_transit = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php new file mode 100644 index 00000000000..91c8c3e18e2 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php @@ -0,0 +1,198 @@ +google.pubsub.v1.ModifyAckDeadlineRequest + */ +class ModifyAckDeadlineRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Required. List of acknowledgment IDs. + * + * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $ack_ids; + /** + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * + * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ack_deadline_seconds = 0; + + /** + * @param string $subscription Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * @param string[] $ackIds Required. List of acknowledgment IDs. + * @param int $ackDeadlineSeconds Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * + * @return \Google\Cloud\PubSub\V1\ModifyAckDeadlineRequest + * + * @experimental + */ + public static function build(string $subscription, array $ackIds, int $ackDeadlineSeconds): self + { + return (new self()) + ->setSubscription($subscription) + ->setAckIds($ackIds) + ->setAckDeadlineSeconds($ackDeadlineSeconds); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids + * Required. List of acknowledgment IDs. + * @type int $ack_deadline_seconds + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Required. List of acknowledgment IDs. + * + * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAckIds() + { + return $this->ack_ids; + } + + /** + * Required. List of acknowledgment IDs. + * + * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ack_ids = $arr; + + return $this; + } + + /** + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * + * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAckDeadlineSeconds() + { + return $this->ack_deadline_seconds; + } + + /** + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * + * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAckDeadlineSeconds($var) + { + GPBUtil::checkInt32($var); + $this->ack_deadline_seconds = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php new file mode 100644 index 00000000000..7a2f636dcaf --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php @@ -0,0 +1,153 @@ +google.pubsub.v1.ModifyPushConfigRequest + */ +class ModifyPushConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Required. The push configuration for future deliveries. + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $push_config = null; + + /** + * @param string $subscription Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\PushConfig $pushConfig Required. The push configuration for future deliveries. + * + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * + * @return \Google\Cloud\PubSub\V1\ModifyPushConfigRequest + * + * @experimental + */ + public static function build(string $subscription, \Google\Cloud\PubSub\V1\PushConfig $pushConfig): self + { + return (new self()) + ->setSubscription($subscription) + ->setPushConfig($pushConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type \Google\Cloud\PubSub\V1\PushConfig $push_config + * Required. The push configuration for future deliveries. + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Required. The push configuration for future deliveries. + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\PushConfig|null + */ + public function getPushConfig() + { + return $this->push_config; + } + + public function hasPushConfig() + { + return isset($this->push_config); + } + + public function clearPushConfig() + { + unset($this->push_config); + } + + /** + * Required. The push configuration for future deliveries. + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\PushConfig $var + * @return $this + */ + public function setPushConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class); + $this->push_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php new file mode 100644 index 00000000000..24f383ac5be --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php @@ -0,0 +1,67 @@ +google.pubsub.v1.PlatformLogsSettings + */ +class PlatformLogsSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $severity = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $severity + * Optional. The minimum severity level of Platform Logs that will be written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings\Severity::class); + $this->severity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php new file mode 100644 index 00000000000..81ecb94be83 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php @@ -0,0 +1,85 @@ +google.pubsub.v1.PlatformLogsSettings.Severity + */ +class Severity +{ + /** + * Default value. Logs level is unspecified. Logs will be disabled. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * Logs will be disabled. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Debug logs and higher-severity logs will be written. + * + * Generated from protobuf enum DEBUG = 2; + */ + const DEBUG = 2; + /** + * Info logs and higher-severity logs will be written. + * + * Generated from protobuf enum INFO = 3; + */ + const INFO = 3; + /** + * Warning logs and higher-severity logs will be written. + * + * Generated from protobuf enum WARNING = 4; + */ + const WARNING = 4; + /** + * Only error logs will be written. + * + * Generated from protobuf enum ERROR = 5; + */ + const ERROR = 5; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::DEBUG => 'DEBUG', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + ]; + + 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(Severity::class, \Google\Cloud\PubSub\V1\PlatformLogsSettings_Severity::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php new file mode 100644 index 00000000000..c548ceb7fcb --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php @@ -0,0 +1,122 @@ +google.pubsub.v1.PublishRequest + */ +class PublishRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + /** + * Required. The messages to publish. + * + * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $messages; + + /** + * @param string $topic Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. Please see + * {@see PublisherClient::topicName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\PubsubMessage[] $messages Required. The messages to publish. + * + * @return \Google\Cloud\PubSub\V1\PublishRequest + * + * @experimental + */ + public static function build(string $topic, array $messages): self + { + return (new self()) + ->setTopic($topic) + ->setMessages($messages); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * @type array<\Google\Cloud\PubSub\V1\PubsubMessage>|\Google\Protobuf\Internal\RepeatedField $messages + * Required. The messages to publish. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Required. The messages to publish. + * + * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Required. The messages to publish. + * + * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\PubSub\V1\PubsubMessage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\PubsubMessage::class); + $this->messages = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php new file mode 100644 index 00000000000..c36633c7d98 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php @@ -0,0 +1,75 @@ +google.pubsub.v1.PublishResponse + */ +class PublishResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The server-assigned ID of each published message, in the same + * order as the messages in the request. IDs are guaranteed to be unique + * within the topic. + * + * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $message_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $message_ids + * Optional. The server-assigned ID of each published message, in the same + * order as the messages in the request. IDs are guaranteed to be unique + * within the topic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The server-assigned ID of each published message, in the same + * order as the messages in the request. IDs are guaranteed to be unique + * within the topic. + * + * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessageIds() + { + return $this->message_ids; + } + + /** + * Optional. The server-assigned ID of each published message, in the same + * order as the messages in the request. IDs are guaranteed to be unique + * within the topic. + * + * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessageIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->message_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php new file mode 100644 index 00000000000..4c05dc58da3 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php @@ -0,0 +1,280 @@ +google.pubsub.v1.PubsubMessage + */ +class PubsubMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The message data field. If this field is empty, the message must + * contain at least one attribute. + * + * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data = ''; + /** + * Optional. Attributes for this message. If this field is empty, the message + * must contain non-empty data. This can be used to filter messages on the + * subscription. + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + /** + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + * + * Generated from protobuf field string message_id = 3; + */ + protected $message_id = ''; + /** + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the + * publisher in a `Publish` call. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; + */ + protected $publish_time = null; + /** + * Optional. If non-empty, identifies related messages for which publish order + * should be respected. If a `Subscription` has `enable_message_ordering` set + * to `true`, messages published with the same non-empty `ordering_key` value + * will be delivered to subscribers in the order in which they are received by + * the Pub/Sub system. All `PubsubMessage`s published in a given + * `PublishRequest` must specify the same `ordering_key` value. For more + * information, see [ordering + * messages](https://cloud.google.com/pubsub/docs/ordering). + * + * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ordering_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $data + * Optional. The message data field. If this field is empty, the message must + * contain at least one attribute. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Optional. Attributes for this message. If this field is empty, the message + * must contain non-empty data. This can be used to filter messages on the + * subscription. + * @type string $message_id + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + * @type \Google\Protobuf\Timestamp $publish_time + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the + * publisher in a `Publish` call. + * @type string $ordering_key + * Optional. If non-empty, identifies related messages for which publish order + * should be respected. If a `Subscription` has `enable_message_ordering` set + * to `true`, messages published with the same non-empty `ordering_key` value + * will be delivered to subscribers in the order in which they are received by + * the Pub/Sub system. All `PubsubMessage`s published in a given + * `PublishRequest` must specify the same `ordering_key` value. For more + * information, see [ordering + * messages](https://cloud.google.com/pubsub/docs/ordering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The message data field. If this field is empty, the message must + * contain at least one attribute. + * + * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Optional. The message data field. If this field is empty, the message must + * contain at least one attribute. + * + * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Optional. Attributes for this message. If this field is empty, the message + * must contain non-empty data. This can be used to filter messages on the + * subscription. + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. Attributes for this message. If this field is empty, the message + * must contain non-empty data. This can be used to filter messages on the + * subscription. + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->attributes = $arr; + + return $this; + } + + /** + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + * + * Generated from protobuf field string message_id = 3; + * @return string + */ + public function getMessageId() + { + return $this->message_id; + } + + /** + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + * + * Generated from protobuf field string message_id = 3; + * @param string $var + * @return $this + */ + public function setMessageId($var) + { + GPBUtil::checkString($var, True); + $this->message_id = $var; + + return $this; + } + + /** + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the + * publisher in a `Publish` call. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPublishTime() + { + return $this->publish_time; + } + + public function hasPublishTime() + { + return isset($this->publish_time); + } + + public function clearPublishTime() + { + unset($this->publish_time); + } + + /** + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the + * publisher in a `Publish` call. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPublishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->publish_time = $var; + + return $this; + } + + /** + * Optional. If non-empty, identifies related messages for which publish order + * should be respected. If a `Subscription` has `enable_message_ordering` set + * to `true`, messages published with the same non-empty `ordering_key` value + * will be delivered to subscribers in the order in which they are received by + * the Pub/Sub system. All `PubsubMessage`s published in a given + * `PublishRequest` must specify the same `ordering_key` value. For more + * information, see [ordering + * messages](https://cloud.google.com/pubsub/docs/ordering). + * + * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderingKey() + { + return $this->ordering_key; + } + + /** + * Optional. If non-empty, identifies related messages for which publish order + * should be respected. If a `Subscription` has `enable_message_ordering` set + * to `true`, messages published with the same non-empty `ordering_key` value + * will be delivered to subscribers in the order in which they are received by + * the Pub/Sub system. All `PubsubMessage`s published in a given + * `PublishRequest` must specify the same `ordering_key` value. For more + * information, see [ordering + * messages](https://cloud.google.com/pubsub/docs/ordering). + * + * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderingKey($var) + { + GPBUtil::checkString($var, True); + $this->ordering_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php new file mode 100644 index 00000000000..5d0f8c33aeb --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php @@ -0,0 +1,222 @@ +google.pubsub.v1.PullRequest + */ +class PullRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * + * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $return_immediately = false; + /** + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * + * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_messages = 0; + + /** + * @param string $subscription Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * @param bool $returnImmediately Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * @param int $maxMessages Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * + * @return \Google\Cloud\PubSub\V1\PullRequest + * + * @experimental + */ + public static function build(string $subscription, bool $returnImmediately, int $maxMessages): self + { + return (new self()) + ->setSubscription($subscription) + ->setReturnImmediately($returnImmediately) + ->setMaxMessages($maxMessages); + } + + /** + * @param string $subscription Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. Please see + * {@see SubscriberClient::subscriptionName()} for help formatting this field. + * @param int $maxMessages Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * + * @return \Google\Cloud\PubSub\V1\PullRequest + * + * @experimental + */ + public static function buildFromSubscriptionMaxMessages(string $subscription, int $maxMessages): self + { + return (new self()) + ->setSubscription($subscription) + ->setMaxMessages($maxMessages); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type bool $return_immediately + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * @type int $max_messages + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * + * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getReturnImmediately() + { + @trigger_error('return_immediately is deprecated.', E_USER_DEPRECATED); + return $this->return_immediately; + } + + /** + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * + * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setReturnImmediately($var) + { + @trigger_error('return_immediately is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->return_immediately = $var; + + return $this; + } + + /** + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * + * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxMessages() + { + return $this->max_messages; + } + + /** + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * + * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxMessages($var) + { + GPBUtil::checkInt32($var); + $this->max_messages = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php new file mode 100644 index 00000000000..44c90cd8571 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php @@ -0,0 +1,83 @@ +google.pubsub.v1.PullResponse + */ +class PullResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Received Pub/Sub messages. The list will be empty if there are no + * more messages available in the backlog, or if no messages could be returned + * before the request timeout. For JSON, the response can be entirely + * empty. The Pub/Sub system may return fewer than the `maxMessages` requested + * even if there are more messages available in the backlog. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $received_messages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $received_messages + * Optional. Received Pub/Sub messages. The list will be empty if there are no + * more messages available in the backlog, or if no messages could be returned + * before the request timeout. For JSON, the response can be entirely + * empty. The Pub/Sub system may return fewer than the `maxMessages` requested + * even if there are more messages available in the backlog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Received Pub/Sub messages. The list will be empty if there are no + * more messages available in the backlog, or if no messages could be returned + * before the request timeout. For JSON, the response can be entirely + * empty. The Pub/Sub system may return fewer than the `maxMessages` requested + * even if there are more messages available in the backlog. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReceivedMessages() + { + return $this->received_messages; + } + + /** + * Optional. Received Pub/Sub messages. The list will be empty if there are no + * more messages available in the backlog, or if no messages could be returned + * before the request timeout. For JSON, the response can be entirely + * empty. The Pub/Sub system may return fewer than the `maxMessages` requested + * even if there are more messages available in the backlog. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReceivedMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\ReceivedMessage::class); + $this->received_messages = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php new file mode 100644 index 00000000000..c0dd0f9777d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php @@ -0,0 +1,294 @@ +google.pubsub.v1.PushConfig + */ +class PushConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use `https://example.com/push`. + * + * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $push_endpoint = ''; + /** + * Optional. Endpoint configuration attributes that can be used to control + * different aspects of the message delivery. + * The only currently supported attribute is `x-goog-version`, which you can + * use to change the format of the pushed message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the pushed message (i.e., its fields and metadata). + * If not present during the `CreateSubscription` call, it will default to + * the version of the Pub/Sub API used to make such call. If not present in a + * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The only supported values for the `x-goog-version` attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + * For example: + * `attributes { "x-goog-version": "v1" }` + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + protected $authentication_method; + protected $wrapper; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $push_endpoint + * Optional. A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use `https://example.com/push`. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Optional. Endpoint configuration attributes that can be used to control + * different aspects of the message delivery. + * The only currently supported attribute is `x-goog-version`, which you can + * use to change the format of the pushed message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the pushed message (i.e., its fields and metadata). + * If not present during the `CreateSubscription` call, it will default to + * the version of the Pub/Sub API used to make such call. If not present in a + * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The only supported values for the `x-goog-version` attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + * For example: + * `attributes { "x-goog-version": "v1" }` + * @type \Google\Cloud\PubSub\V1\PushConfig\OidcToken $oidc_token + * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + * token as an `Authorization` header in the HTTP request for every pushed + * message. + * @type \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper $pubsub_wrapper + * Optional. When set, the payload to the push endpoint is in the form of + * the JSON representation of a PubsubMessage + * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + * @type \Google\Cloud\PubSub\V1\PushConfig\NoWrapper $no_wrapper + * Optional. When set, the payload to the push endpoint is not wrapped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use `https://example.com/push`. + * + * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPushEndpoint() + { + return $this->push_endpoint; + } + + /** + * Optional. A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use `https://example.com/push`. + * + * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPushEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->push_endpoint = $var; + + return $this; + } + + /** + * Optional. Endpoint configuration attributes that can be used to control + * different aspects of the message delivery. + * The only currently supported attribute is `x-goog-version`, which you can + * use to change the format of the pushed message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the pushed message (i.e., its fields and metadata). + * If not present during the `CreateSubscription` call, it will default to + * the version of the Pub/Sub API used to make such call. If not present in a + * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The only supported values for the `x-goog-version` attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + * For example: + * `attributes { "x-goog-version": "v1" }` + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. Endpoint configuration attributes that can be used to control + * different aspects of the message delivery. + * The only currently supported attribute is `x-goog-version`, which you can + * use to change the format of the pushed message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the pushed message (i.e., its fields and metadata). + * If not present during the `CreateSubscription` call, it will default to + * the version of the Pub/Sub API used to make such call. If not present in a + * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The only supported values for the `x-goog-version` attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + * For example: + * `attributes { "x-goog-version": "v1" }` + * + * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->attributes = $arr; + + return $this; + } + + /** + * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + * token as an `Authorization` header in the HTTP request for every pushed + * message. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PushConfig\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(3); + } + + public function hasOidcToken() + { + return $this->hasOneof(3); + } + + /** + * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + * token as an `Authorization` header in the HTTP request for every pushed + * message. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PushConfig\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\OidcToken::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. When set, the payload to the push endpoint is in the form of + * the JSON representation of a PubsubMessage + * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper|null + */ + public function getPubsubWrapper() + { + return $this->readOneof(4); + } + + public function hasPubsubWrapper() + { + return $this->hasOneof(4); + } + + /** + * Optional. When set, the payload to the push endpoint is in the form of + * the JSON representation of a PubsubMessage + * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper $var + * @return $this + */ + public function setPubsubWrapper($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. When set, the payload to the push endpoint is not wrapped. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PushConfig\NoWrapper|null + */ + public function getNoWrapper() + { + return $this->readOneof(5); + } + + public function hasNoWrapper() + { + return $this->hasOneof(5); + } + + /** + * Optional. When set, the payload to the push endpoint is not wrapped. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PushConfig\NoWrapper $var + * @return $this + */ + public function setNoWrapper($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\NoWrapper::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthenticationMethod() + { + return $this->whichOneof("authentication_method"); + } + + /** + * @return string + */ + public function getWrapper() + { + return $this->whichOneof("wrapper"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php new file mode 100644 index 00000000000..ccb4573e0a1 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php @@ -0,0 +1,78 @@ +google.pubsub.v1.PushConfig.NoWrapper + */ +class NoWrapper extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. When true, writes the Pub/Sub message metadata to + * `x-goog-pubsub-:` headers of the HTTP request. Writes the + * Pub/Sub message attributes to `:` headers of the HTTP request. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $write_metadata = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $write_metadata + * Optional. When true, writes the Pub/Sub message metadata to + * `x-goog-pubsub-:` headers of the HTTP request. Writes the + * Pub/Sub message attributes to `:` headers of the HTTP request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. When true, writes the Pub/Sub message metadata to + * `x-goog-pubsub-:` headers of the HTTP request. Writes the + * Pub/Sub message attributes to `:` headers of the HTTP request. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getWriteMetadata() + { + return $this->write_metadata; + } + + /** + * Optional. When true, writes the Pub/Sub message metadata to + * `x-goog-pubsub-:` headers of the HTTP request. Writes the + * Pub/Sub message attributes to `:` headers of the HTTP request. + * + * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setWriteMetadata($var) + { + GPBUtil::checkBool($var); + $this->write_metadata = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NoWrapper::class, \Google\Cloud\PubSub\V1\PushConfig_NoWrapper::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php new file mode 100644 index 00000000000..b9558bb3a7d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php @@ -0,0 +1,146 @@ +google.pubsub.v1.PushConfig.OidcToken + */ +class OidcToken extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. [Service account + * email](https://cloud.google.com/iam/docs/service-accounts) + * used for generating the OIDC token. For more information + * on setting up authentication, see + * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + * + * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account_email = ''; + /** + * Optional. Audience to be used when generating OIDC token. The audience + * claim identifies the recipients that the JWT is intended for. The + * audience value is a single case-sensitive string. Having multiple values + * (array) for the audience field is not supported. More info about the OIDC + * JWT token audience here: + * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + * the Push endpoint URL will be used. + * + * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $audience = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * Optional. [Service account + * email](https://cloud.google.com/iam/docs/service-accounts) + * used for generating the OIDC token. For more information + * on setting up authentication, see + * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + * @type string $audience + * Optional. Audience to be used when generating OIDC token. The audience + * claim identifies the recipients that the JWT is intended for. The + * audience value is a single case-sensitive string. Having multiple values + * (array) for the audience field is not supported. More info about the OIDC + * JWT token audience here: + * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + * the Push endpoint URL will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. [Service account + * email](https://cloud.google.com/iam/docs/service-accounts) + * used for generating the OIDC token. For more information + * on setting up authentication, see + * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + * + * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * Optional. [Service account + * email](https://cloud.google.com/iam/docs/service-accounts) + * used for generating the OIDC token. For more information + * on setting up authentication, see + * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + * + * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * Optional. Audience to be used when generating OIDC token. The audience + * claim identifies the recipients that the JWT is intended for. The + * audience value is a single case-sensitive string. Having multiple values + * (array) for the audience field is not supported. More info about the OIDC + * JWT token audience here: + * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + * the Push endpoint URL will be used. + * + * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Optional. Audience to be used when generating OIDC token. The audience + * claim identifies the recipients that the JWT is intended for. The + * audience value is a single case-sensitive string. Having multiple values + * (array) for the audience field is not supported. More info about the OIDC + * JWT token audience here: + * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + * the Push endpoint URL will be used. + * + * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkString($var, True); + $this->audience = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OidcToken::class, \Google\Cloud\PubSub\V1\PushConfig_OidcToken::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php new file mode 100644 index 00000000000..5053bfb8578 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php @@ -0,0 +1,38 @@ +google.pubsub.v1.PushConfig.PubsubWrapper + */ +class PubsubWrapper extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PubsubWrapper::class, \Google\Cloud\PubSub\V1\PushConfig_PubsubWrapper::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php new file mode 100644 index 00000000000..3531a302af6 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php @@ -0,0 +1,189 @@ +google.pubsub.v1.ReceivedMessage + */ +class ReceivedMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. This ID can be used to acknowledge the received message. + * + * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ack_id = ''; + /** + * Optional. The message. + * + * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message = null; + /** + * Optional. The approximate number of times that Pub/Sub has attempted to + * deliver the associated message to a subscriber. + * More precisely, this is 1 + (number of NACKs) + + * (number of ack_deadline exceeds) for this message. + * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + * exceeds event is whenever a message is not acknowledged within + * ack_deadline. Note that ack_deadline is initially + * Subscription.ackDeadlineSeconds, but may get extended automatically by + * the client library. + * Upon the first delivery of a given message, `delivery_attempt` will have a + * value of 1. The value is calculated at best effort and is approximate. + * If a DeadLetterPolicy is not set on the subscription, this will be 0. + * + * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $delivery_attempt = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ack_id + * Optional. This ID can be used to acknowledge the received message. + * @type \Google\Cloud\PubSub\V1\PubsubMessage $message + * Optional. The message. + * @type int $delivery_attempt + * Optional. The approximate number of times that Pub/Sub has attempted to + * deliver the associated message to a subscriber. + * More precisely, this is 1 + (number of NACKs) + + * (number of ack_deadline exceeds) for this message. + * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + * exceeds event is whenever a message is not acknowledged within + * ack_deadline. Note that ack_deadline is initially + * Subscription.ackDeadlineSeconds, but may get extended automatically by + * the client library. + * Upon the first delivery of a given message, `delivery_attempt` will have a + * value of 1. The value is calculated at best effort and is approximate. + * If a DeadLetterPolicy is not set on the subscription, this will be 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. This ID can be used to acknowledge the received message. + * + * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAckId() + { + return $this->ack_id; + } + + /** + * Optional. This ID can be used to acknowledge the received message. + * + * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAckId($var) + { + GPBUtil::checkString($var, True); + $this->ack_id = $var; + + return $this; + } + + /** + * Optional. The message. + * + * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PubsubMessage|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * Optional. The message. + * + * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PubsubMessage $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PubsubMessage::class); + $this->message = $var; + + return $this; + } + + /** + * Optional. The approximate number of times that Pub/Sub has attempted to + * deliver the associated message to a subscriber. + * More precisely, this is 1 + (number of NACKs) + + * (number of ack_deadline exceeds) for this message. + * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + * exceeds event is whenever a message is not acknowledged within + * ack_deadline. Note that ack_deadline is initially + * Subscription.ackDeadlineSeconds, but may get extended automatically by + * the client library. + * Upon the first delivery of a given message, `delivery_attempt` will have a + * value of 1. The value is calculated at best effort and is approximate. + * If a DeadLetterPolicy is not set on the subscription, this will be 0. + * + * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDeliveryAttempt() + { + return $this->delivery_attempt; + } + + /** + * Optional. The approximate number of times that Pub/Sub has attempted to + * deliver the associated message to a subscriber. + * More precisely, this is 1 + (number of NACKs) + + * (number of ack_deadline exceeds) for this message. + * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + * exceeds event is whenever a message is not acknowledged within + * ack_deadline. Note that ack_deadline is initially + * Subscription.ackDeadlineSeconds, but may get extended automatically by + * the client library. + * Upon the first delivery of a given message, `delivery_attempt` will have a + * value of 1. The value is calculated at best effort and is approximate. + * If a DeadLetterPolicy is not set on the subscription, this will be 0. + * + * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDeliveryAttempt($var) + { + GPBUtil::checkInt32($var); + $this->delivery_attempt = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php new file mode 100644 index 00000000000..db6cf2e3d73 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php @@ -0,0 +1,140 @@ +google.pubsub.v1.RetryPolicy + */ +class RetryPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The minimum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + * + * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_backoff = null; + /** + * Optional. The maximum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 600 + * seconds. + * + * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $maximum_backoff = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $minimum_backoff + * Optional. The minimum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + * @type \Google\Protobuf\Duration $maximum_backoff + * Optional. The maximum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 600 + * seconds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The minimum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + * + * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getMinimumBackoff() + { + return $this->minimum_backoff; + } + + public function hasMinimumBackoff() + { + return isset($this->minimum_backoff); + } + + public function clearMinimumBackoff() + { + unset($this->minimum_backoff); + } + + /** + * Optional. The minimum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + * + * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinimumBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->minimum_backoff = $var; + + return $this; + } + + /** + * Optional. The maximum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 600 + * seconds. + * + * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaximumBackoff() + { + return $this->maximum_backoff; + } + + public function hasMaximumBackoff() + { + return isset($this->maximum_backoff); + } + + public function clearMaximumBackoff() + { + unset($this->maximum_backoff); + } + + /** + * Optional. The maximum delay between consecutive deliveries of a given + * message. Value should be between 0 and 600 seconds. Defaults to 600 + * seconds. + * + * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaximumBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->maximum_backoff = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php new file mode 100644 index 00000000000..2bf316de83d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php @@ -0,0 +1,128 @@ +google.pubsub.v1.RollbackSchemaRequest + */ +class RollbackSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The schema being rolled back with revision id. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * Example: c7cfa2a8 + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $revision_id = ''; + + /** + * @param string $name Required. The schema being rolled back with revision id. Please see + * {@see SchemaServiceClient::schemaName()} for help formatting this field. + * @param string $revisionId Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * + * Example: c7cfa2a8 + * + * @return \Google\Cloud\PubSub\V1\RollbackSchemaRequest + * + * @experimental + */ + public static function build(string $name, string $revisionId): self + { + return (new self()) + ->setName($name) + ->setRevisionId($revisionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The schema being rolled back with revision id. + * @type string $revision_id + * Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * Example: c7cfa2a8 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The schema being rolled back with revision 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. The schema being rolled back with revision 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 revision ID to roll back to. + * It must be a revision of the same schema. + * Example: c7cfa2a8 + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * Example: c7cfa2a8 + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php new file mode 100644 index 00000000000..9521db88c5a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php @@ -0,0 +1,225 @@ +google.pubsub.v1.Schema + */ +class Schema extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the schema. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The type of the schema definition. + * + * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; + */ + protected $type = 0; + /** + * The definition of the schema. This should contain a string representing + * the full definition of the schema that is a valid schema definition of + * the type specified in `type`. + * + * Generated from protobuf field string definition = 3; + */ + protected $definition = ''; + /** + * Output only. Immutable. The revision ID of the schema. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the schema. + * Format is `projects/{project}/schemas/{schema}`. + * @type int $type + * The type of the schema definition. + * @type string $definition + * The definition of the schema. This should contain a string representing + * the full definition of the schema that is a valid schema definition of + * the type specified in `type`. + * @type string $revision_id + * Output only. Immutable. The revision ID of the schema. + * @type \Google\Protobuf\Timestamp $revision_create_time + * Output only. The timestamp that the revision was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the schema. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the schema. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the schema definition. + * + * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the schema definition. + * + * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Schema\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The definition of the schema. This should contain a string representing + * the full definition of the schema that is a valid schema definition of + * the type specified in `type`. + * + * Generated from protobuf field string definition = 3; + * @return string + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * The definition of the schema. This should contain a string representing + * the full definition of the schema that is a valid schema definition of + * the type specified in `type`. + * + * Generated from protobuf field string definition = 3; + * @param string $var + * @return $this + */ + public function setDefinition($var) + { + GPBUtil::checkString($var, True); + $this->definition = $var; + + return $this; + } + + /** + * Output only. Immutable. The revision ID of the schema. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. Immutable. The revision ID of the schema. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRevisionCreateTime() + { + return $this->revision_create_time; + } + + public function hasRevisionCreateTime() + { + return isset($this->revision_create_time); + } + + public function clearRevisionCreateTime() + { + unset($this->revision_create_time); + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRevisionCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->revision_create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php new file mode 100644 index 00000000000..31945e1e640 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php @@ -0,0 +1,64 @@ +google.pubsub.v1.Schema.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A Protocol Buffer schema definition. + * + * Generated from protobuf enum PROTOCOL_BUFFER = 1; + */ + const PROTOCOL_BUFFER = 1; + /** + * An Avro schema definition. + * + * Generated from protobuf enum AVRO = 2; + */ + const AVRO = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PROTOCOL_BUFFER => 'PROTOCOL_BUFFER', + self::AVRO => 'AVRO', + ]; + + 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(Type::class, \Google\Cloud\PubSub\V1\Schema_Type::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php new file mode 100644 index 00000000000..f32a917284c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php @@ -0,0 +1,197 @@ +google.pubsub.v1.SchemaSettings + */ +class SchemaSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the schema that messages published should be + * validated against. Format is `projects/{project}/schemas/{schema}`. The + * value of this field will be `_deleted-schema_` if the schema has been + * deleted. + * + * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $schema = ''; + /** + * Optional. The encoding of messages validated against `schema`. + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encoding = 0; + /** + * Optional. The minimum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * last_revision or any revision created before. + * + * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $first_revision_id = ''; + /** + * Optional. The maximum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * first_revision or any revision created after. + * + * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $last_revision_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $schema + * Required. The name of the schema that messages published should be + * validated against. Format is `projects/{project}/schemas/{schema}`. The + * value of this field will be `_deleted-schema_` if the schema has been + * deleted. + * @type int $encoding + * Optional. The encoding of messages validated against `schema`. + * @type string $first_revision_id + * Optional. The minimum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * last_revision or any revision created before. + * @type string $last_revision_id + * Optional. The maximum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * first_revision or any revision created after. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the schema that messages published should be + * validated against. Format is `projects/{project}/schemas/{schema}`. The + * value of this field will be `_deleted-schema_` if the schema has been + * deleted. + * + * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSchema() + { + return $this->schema; + } + + /** + * Required. The name of the schema that messages published should be + * validated against. Format is `projects/{project}/schemas/{schema}`. The + * value of this field will be `_deleted-schema_` if the schema has been + * deleted. + * + * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkString($var, True); + $this->schema = $var; + + return $this; + } + + /** + * Optional. The encoding of messages validated against `schema`. + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Optional. The encoding of messages validated against `schema`. + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Encoding::class); + $this->encoding = $var; + + return $this; + } + + /** + * Optional. The minimum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * last_revision or any revision created before. + * + * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFirstRevisionId() + { + return $this->first_revision_id; + } + + /** + * Optional. The minimum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * last_revision or any revision created before. + * + * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFirstRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->first_revision_id = $var; + + return $this; + } + + /** + * Optional. The maximum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * first_revision or any revision created after. + * + * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLastRevisionId() + { + return $this->last_revision_id; + } + + /** + * Optional. The maximum (inclusive) revision allowed for validating messages. + * If empty or not present, allow any revision to be validated against + * first_revision or any revision created after. + * + * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLastRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->last_revision_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php new file mode 100644 index 00000000000..5434e27c62b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php @@ -0,0 +1,62 @@ +google.pubsub.v1.SchemaView + */ +class SchemaView +{ + /** + * The default / unset value. + * The API will default to the BASIC view. + * + * Generated from protobuf enum SCHEMA_VIEW_UNSPECIFIED = 0; + */ + const SCHEMA_VIEW_UNSPECIFIED = 0; + /** + * Include the name and type of the schema, but not the definition. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * Include all Schema object fields. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::SCHEMA_VIEW_UNSPECIFIED => 'SCHEMA_VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php new file mode 100644 index 00000000000..0f726f6024e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php @@ -0,0 +1,178 @@ +google.pubsub.v1.SeekRequest + */ +class SeekRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription to affect. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + protected $target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription to affect. + * @type \Google\Protobuf\Timestamp $time + * Optional. The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * @type string $snapshot + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription to affect. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription to affect. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Optional. The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->readOneof(2); + } + + public function hasTime() + { + return $this->hasOneof(2); + } + + /** + * Optional. The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSnapshot() + { + return $this->readOneof(3); + } + + public function hasSnapshot() + { + return $this->hasOneof(3); + } + + /** + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + * + * Generated from protobuf field string snapshot = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getTarget() + { + return $this->whichOneof("target"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php new file mode 100644 index 00000000000..cf1f98bba3c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php @@ -0,0 +1,33 @@ +google.pubsub.v1.SeekResponse + */ +class SeekResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php new file mode 100644 index 00000000000..0861e885aad --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php @@ -0,0 +1,227 @@ +google.pubsub.v1.Snapshot + */ +class Snapshot extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The name of the topic from which this snapshot is retaining + * messages. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $topic = ''; + /** + * Optional. The snapshot is guaranteed to exist up until this time. + * A newly-created snapshot expires no later than 7 days from the time of its + * creation. Its exact lifetime is determined at creation by the existing + * backlog in the source subscription. Specifically, the lifetime of the + * snapshot is `7 days - (age of oldest unacked message in the subscription)`. + * For example, consider a subscription whose oldest unacked message is 3 days + * old. If a snapshot is created from this subscription, the snapshot -- which + * will always capture this 3-day-old backlog as long as the snapshot + * exists -- will expire in 4 days. The service will refuse to create a + * snapshot that would expire in less than 1 hour after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expire_time = null; + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the snapshot. + * @type string $topic + * Optional. The name of the topic from which this snapshot is retaining + * messages. + * @type \Google\Protobuf\Timestamp $expire_time + * Optional. The snapshot is guaranteed to exist up until this time. + * A newly-created snapshot expires no later than 7 days from the time of its + * creation. Its exact lifetime is determined at creation by the existing + * backlog in the source subscription. Specifically, the lifetime of the + * snapshot is `7 days - (age of oldest unacked message in the subscription)`. + * For example, consider a subscription whose oldest unacked message is 3 days + * old. If a snapshot is created from this subscription, the snapshot -- which + * will always capture this 3-day-old backlog as long as the snapshot + * exists -- will expire in 4 days. The service will refuse to create a + * snapshot that would expire in less than 1 hour after creation. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The name of the topic from which this snapshot is retaining + * messages. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Optional. The name of the topic from which this snapshot is retaining + * messages. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Optional. The snapshot is guaranteed to exist up until this time. + * A newly-created snapshot expires no later than 7 days from the time of its + * creation. Its exact lifetime is determined at creation by the existing + * backlog in the source subscription. Specifically, the lifetime of the + * snapshot is `7 days - (age of oldest unacked message in the subscription)`. + * For example, consider a subscription whose oldest unacked message is 3 days + * old. If a snapshot is created from this subscription, the snapshot -- which + * will always capture this 3-day-old backlog as long as the snapshot + * exists -- will expire in 4 days. The service will refuse to create a + * snapshot that would expire in less than 1 hour after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Optional. The snapshot is guaranteed to exist up until this time. + * A newly-created snapshot expires no later than 7 days from the time of its + * creation. Its exact lifetime is determined at creation by the existing + * backlog in the source subscription. Specifically, the lifetime of the + * snapshot is `7 days - (age of oldest unacked message in the subscription)`. + * For example, consider a subscription whose oldest unacked message is 3 days + * old. If a snapshot is created from this subscription, the snapshot -- which + * will always capture this 3-day-old backlog as long as the snapshot + * exists -- will expire in 4 days. The service will refuse to create a + * snapshot that would expire in less than 1 hour after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 4 [(.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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php new file mode 100644 index 00000000000..f51c899b073 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php @@ -0,0 +1,491 @@ +google.pubsub.v1.StreamingPullRequest + */ +class StreamingPullRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The subscription for which to initialize the new stream. This + * must be provided in the first request on the stream, and must not be set in + * subsequent requests from client to server. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $subscription = ''; + /** + * Optional. List of acknowledgement IDs for acknowledging previously received + * messages (received on this stream or a different stream). If an ack ID has + * expired, the corresponding message may be redelivered later. Acknowledging + * a message more than once will not result in an error. If the + * acknowledgement ID is malformed, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ack_ids; + /** + * Optional. The list of new ack deadlines for the IDs listed in + * `modify_deadline_ack_ids`. The size of this list must be the same as the + * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + * with `INVALID_ARGUMENT`. Each element in this list is applied to the + * element in the same position in `modify_deadline_ack_ids`. The new ack + * deadline is with respect to the time this request was sent to the Pub/Sub + * system. Must be >= 0. For example, if the value is 10, the new ack deadline + * will expire 10 seconds after this request is received. If the value is 0, + * the message is immediately made available for another streaming or + * non-streaming pull request. If the value is < 0 (an error), the stream will + * be aborted with status `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $modify_deadline_seconds; + /** + * Optional. List of acknowledgement IDs whose deadline will be modified based + * on the corresponding element in `modify_deadline_seconds`. This field can + * be used to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. + * + * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $modify_deadline_ack_ids; + /** + * Required. The ack deadline to use for the stream. This must be provided in + * the first request on the stream, but it can also be updated on subsequent + * requests from client to server. The minimum deadline you can specify is 10 + * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + * + * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $stream_ack_deadline_seconds = 0; + /** + * Optional. A unique identifier that is used to distinguish client instances + * from each other. Only needs to be provided on the initial request. When a + * stream disconnects and reconnects for the same stream, the client_id should + * be set to the same value so that state associated with the old stream can + * be transferred to the new stream. The same client_id should not be used for + * different client instances. + * + * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_id = ''; + /** + * Optional. Flow control settings for the maximum number of outstanding + * messages. When there are `max_outstanding_messages` currently sent to the + * streaming pull client that have not yet been acked or nacked, the server + * stops sending more messages. The sending of messages resumes once the + * number of outstanding messages is less than this value. If the value is + * <= 0, there is no limit to the number of outstanding messages. This + * property can only be set on the initial StreamingPullRequest. If it is set + * on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_outstanding_messages = 0; + /** + * Optional. Flow control settings for the maximum number of outstanding + * bytes. When there are `max_outstanding_bytes` or more worth of messages + * currently sent to the streaming pull client that have not yet been acked or + * nacked, the server will stop sending more messages. The sending of messages + * resumes once the number of outstanding bytes is less than this value. If + * the value is <= 0, there is no limit to the number of outstanding bytes. + * This property can only be set on the initial StreamingPullRequest. If it is + * set on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_outstanding_bytes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription + * Required. The subscription for which to initialize the new stream. This + * must be provided in the first request on the stream, and must not be set in + * subsequent requests from client to server. + * Format is `projects/{project}/subscriptions/{sub}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids + * Optional. List of acknowledgement IDs for acknowledging previously received + * messages (received on this stream or a different stream). If an ack ID has + * expired, the corresponding message may be redelivered later. Acknowledging + * a message more than once will not result in an error. If the + * acknowledgement ID is malformed, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * @type array|\Google\Protobuf\Internal\RepeatedField $modify_deadline_seconds + * Optional. The list of new ack deadlines for the IDs listed in + * `modify_deadline_ack_ids`. The size of this list must be the same as the + * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + * with `INVALID_ARGUMENT`. Each element in this list is applied to the + * element in the same position in `modify_deadline_ack_ids`. The new ack + * deadline is with respect to the time this request was sent to the Pub/Sub + * system. Must be >= 0. For example, if the value is 10, the new ack deadline + * will expire 10 seconds after this request is received. If the value is 0, + * the message is immediately made available for another streaming or + * non-streaming pull request. If the value is < 0 (an error), the stream will + * be aborted with status `INVALID_ARGUMENT`. + * @type array|\Google\Protobuf\Internal\RepeatedField $modify_deadline_ack_ids + * Optional. List of acknowledgement IDs whose deadline will be modified based + * on the corresponding element in `modify_deadline_seconds`. This field can + * be used to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. + * @type int $stream_ack_deadline_seconds + * Required. The ack deadline to use for the stream. This must be provided in + * the first request on the stream, but it can also be updated on subsequent + * requests from client to server. The minimum deadline you can specify is 10 + * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + * @type string $client_id + * Optional. A unique identifier that is used to distinguish client instances + * from each other. Only needs to be provided on the initial request. When a + * stream disconnects and reconnects for the same stream, the client_id should + * be set to the same value so that state associated with the old stream can + * be transferred to the new stream. The same client_id should not be used for + * different client instances. + * @type int|string $max_outstanding_messages + * Optional. Flow control settings for the maximum number of outstanding + * messages. When there are `max_outstanding_messages` currently sent to the + * streaming pull client that have not yet been acked or nacked, the server + * stops sending more messages. The sending of messages resumes once the + * number of outstanding messages is less than this value. If the value is + * <= 0, there is no limit to the number of outstanding messages. This + * property can only be set on the initial StreamingPullRequest. If it is set + * on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * @type int|string $max_outstanding_bytes + * Optional. Flow control settings for the maximum number of outstanding + * bytes. When there are `max_outstanding_bytes` or more worth of messages + * currently sent to the streaming pull client that have not yet been acked or + * nacked, the server will stop sending more messages. The sending of messages + * resumes once the number of outstanding bytes is less than this value. If + * the value is <= 0, there is no limit to the number of outstanding bytes. + * This property can only be set on the initial StreamingPullRequest. If it is + * set on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The subscription for which to initialize the new stream. This + * must be provided in the first request on the stream, and must not be set in + * subsequent requests from client to server. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. The subscription for which to initialize the new stream. This + * must be provided in the first request on the stream, and must not be set in + * subsequent requests from client to server. + * Format is `projects/{project}/subscriptions/{sub}`. + * + * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs for acknowledging previously received + * messages (received on this stream or a different stream). If an ack ID has + * expired, the corresponding message may be redelivered later. Acknowledging + * a message more than once will not result in an error. If the + * acknowledgement ID is malformed, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAckIds() + { + return $this->ack_ids; + } + + /** + * Optional. List of acknowledgement IDs for acknowledging previously received + * messages (received on this stream or a different stream). If an ack ID has + * expired, the corresponding message may be redelivered later. Acknowledging + * a message more than once will not result in an error. If the + * acknowledgement ID is malformed, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ack_ids = $arr; + + return $this; + } + + /** + * Optional. The list of new ack deadlines for the IDs listed in + * `modify_deadline_ack_ids`. The size of this list must be the same as the + * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + * with `INVALID_ARGUMENT`. Each element in this list is applied to the + * element in the same position in `modify_deadline_ack_ids`. The new ack + * deadline is with respect to the time this request was sent to the Pub/Sub + * system. Must be >= 0. For example, if the value is 10, the new ack deadline + * will expire 10 seconds after this request is received. If the value is 0, + * the message is immediately made available for another streaming or + * non-streaming pull request. If the value is < 0 (an error), the stream will + * be aborted with status `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModifyDeadlineSeconds() + { + return $this->modify_deadline_seconds; + } + + /** + * Optional. The list of new ack deadlines for the IDs listed in + * `modify_deadline_ack_ids`. The size of this list must be the same as the + * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + * with `INVALID_ARGUMENT`. Each element in this list is applied to the + * element in the same position in `modify_deadline_ack_ids`. The new ack + * deadline is with respect to the time this request was sent to the Pub/Sub + * system. Must be >= 0. For example, if the value is 10, the new ack deadline + * will expire 10 seconds after this request is received. If the value is 0, + * the message is immediately made available for another streaming or + * non-streaming pull request. If the value is < 0 (an error), the stream will + * be aborted with status `INVALID_ARGUMENT`. + * + * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModifyDeadlineSeconds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->modify_deadline_seconds = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs whose deadline will be modified based + * on the corresponding element in `modify_deadline_seconds`. This field can + * be used to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. + * + * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModifyDeadlineAckIds() + { + return $this->modify_deadline_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs whose deadline will be modified based + * on the corresponding element in `modify_deadline_seconds`. This field can + * be used to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. + * + * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModifyDeadlineAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->modify_deadline_ack_ids = $arr; + + return $this; + } + + /** + * Required. The ack deadline to use for the stream. This must be provided in + * the first request on the stream, but it can also be updated on subsequent + * requests from client to server. The minimum deadline you can specify is 10 + * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + * + * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStreamAckDeadlineSeconds() + { + return $this->stream_ack_deadline_seconds; + } + + /** + * Required. The ack deadline to use for the stream. This must be provided in + * the first request on the stream, but it can also be updated on subsequent + * requests from client to server. The minimum deadline you can specify is 10 + * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + * + * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStreamAckDeadlineSeconds($var) + { + GPBUtil::checkInt32($var); + $this->stream_ack_deadline_seconds = $var; + + return $this; + } + + /** + * Optional. A unique identifier that is used to distinguish client instances + * from each other. Only needs to be provided on the initial request. When a + * stream disconnects and reconnects for the same stream, the client_id should + * be set to the same value so that state associated with the old stream can + * be transferred to the new stream. The same client_id should not be used for + * different client instances. + * + * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Optional. A unique identifier that is used to distinguish client instances + * from each other. Only needs to be provided on the initial request. When a + * stream disconnects and reconnects for the same stream, the client_id should + * be set to the same value so that state associated with the old stream can + * be transferred to the new stream. The same client_id should not be used for + * different client instances. + * + * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Optional. Flow control settings for the maximum number of outstanding + * messages. When there are `max_outstanding_messages` currently sent to the + * streaming pull client that have not yet been acked or nacked, the server + * stops sending more messages. The sending of messages resumes once the + * number of outstanding messages is less than this value. If the value is + * <= 0, there is no limit to the number of outstanding messages. This + * property can only be set on the initial StreamingPullRequest. If it is set + * on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxOutstandingMessages() + { + return $this->max_outstanding_messages; + } + + /** + * Optional. Flow control settings for the maximum number of outstanding + * messages. When there are `max_outstanding_messages` currently sent to the + * streaming pull client that have not yet been acked or nacked, the server + * stops sending more messages. The sending of messages resumes once the + * number of outstanding messages is less than this value. If the value is + * <= 0, there is no limit to the number of outstanding messages. This + * property can only be set on the initial StreamingPullRequest. If it is set + * on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxOutstandingMessages($var) + { + GPBUtil::checkInt64($var); + $this->max_outstanding_messages = $var; + + return $this; + } + + /** + * Optional. Flow control settings for the maximum number of outstanding + * bytes. When there are `max_outstanding_bytes` or more worth of messages + * currently sent to the streaming pull client that have not yet been acked or + * nacked, the server will stop sending more messages. The sending of messages + * resumes once the number of outstanding bytes is less than this value. If + * the value is <= 0, there is no limit to the number of outstanding bytes. + * This property can only be set on the initial StreamingPullRequest. If it is + * set on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxOutstandingBytes() + { + return $this->max_outstanding_bytes; + } + + /** + * Optional. Flow control settings for the maximum number of outstanding + * bytes. When there are `max_outstanding_bytes` or more worth of messages + * currently sent to the streaming pull client that have not yet been acked or + * nacked, the server will stop sending more messages. The sending of messages + * resumes once the number of outstanding bytes is less than this value. If + * the value is <= 0, there is no limit to the number of outstanding bytes. + * This property can only be set on the initial StreamingPullRequest. If it is + * set on a subsequent request, the stream will be aborted with status + * `INVALID_ARGUMENT`. + * + * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxOutstandingBytes($var) + { + GPBUtil::checkInt64($var); + $this->max_outstanding_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php new file mode 100644 index 00000000000..009b14fcc2a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php @@ -0,0 +1,208 @@ +google.pubsub.v1.StreamingPullResponse + */ +class StreamingPullResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Received Pub/Sub messages. This will not be empty. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $received_messages; + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $acknowledge_confirmation = null; + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $modify_ack_deadline_confirmation = null; + /** + * Optional. Properties associated with this subscription. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subscription_properties = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $received_messages + * Optional. Received Pub/Sub messages. This will not be empty. + * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $acknowledge_confirmation + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation $modify_ack_deadline_confirmation + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties $subscription_properties + * Optional. Properties associated with this subscription. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Received Pub/Sub messages. This will not be empty. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReceivedMessages() + { + return $this->received_messages; + } + + /** + * Optional. Received Pub/Sub messages. This will not be empty. + * + * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReceivedMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\ReceivedMessage::class); + $this->received_messages = $arr; + + return $this; + } + + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation|null + */ + public function getAcknowledgeConfirmation() + { + return $this->acknowledge_confirmation; + } + + public function hasAcknowledgeConfirmation() + { + return isset($this->acknowledge_confirmation); + } + + public function clearAcknowledgeConfirmation() + { + unset($this->acknowledge_confirmation); + } + + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $var + * @return $this + */ + public function setAcknowledgeConfirmation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation::class); + $this->acknowledge_confirmation = $var; + + return $this; + } + + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation|null + */ + public function getModifyAckDeadlineConfirmation() + { + return $this->modify_ack_deadline_confirmation; + } + + public function hasModifyAckDeadlineConfirmation() + { + return isset($this->modify_ack_deadline_confirmation); + } + + public function clearModifyAckDeadlineConfirmation() + { + unset($this->modify_ack_deadline_confirmation); + } + + /** + * Optional. This field will only be set if `enable_exactly_once_delivery` is + * set to `true`. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation $var + * @return $this + */ + public function setModifyAckDeadlineConfirmation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation::class); + $this->modify_ack_deadline_confirmation = $var; + + return $this; + } + + /** + * Optional. Properties associated with this subscription. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties|null + */ + public function getSubscriptionProperties() + { + return $this->subscription_properties; + } + + public function hasSubscriptionProperties() + { + return isset($this->subscription_properties); + } + + public function clearSubscriptionProperties() + { + unset($this->subscription_properties); + } + + /** + * Optional. Properties associated with this subscription. + * + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties $var + * @return $this + */ + public function setSubscriptionProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties::class); + $this->subscription_properties = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php new file mode 100644 index 00000000000..fd94ce279a9 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php @@ -0,0 +1,181 @@ +google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + */ +class AcknowledgeConfirmation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ack_ids; + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $invalid_ack_ids; + /** + * Optional. List of acknowledgement IDs that were out of order. + * + * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $unordered_ack_ids; + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $temporary_failed_ack_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids + * Optional. Successfully processed acknowledgement IDs. + * @type array|\Google\Protobuf\Internal\RepeatedField $invalid_ack_ids + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * @type array|\Google\Protobuf\Internal\RepeatedField $unordered_ack_ids + * Optional. List of acknowledgement IDs that were out of order. + * @type array|\Google\Protobuf\Internal\RepeatedField $temporary_failed_ack_ids + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAckIds() + { + return $this->ack_ids; + } + + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ack_ids = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInvalidAckIds() + { + return $this->invalid_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInvalidAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->invalid_ack_ids = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs that were out of order. + * + * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnorderedAckIds() + { + return $this->unordered_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs that were out of order. + * + * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnorderedAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unordered_ack_ids = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTemporaryFailedAckIds() + { + return $this->temporary_failed_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTemporaryFailedAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->temporary_failed_ack_ids = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AcknowledgeConfirmation::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_AcknowledgeConfirmation::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php new file mode 100644 index 00000000000..1fd67ae753a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php @@ -0,0 +1,147 @@ +google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + */ +class ModifyAckDeadlineConfirmation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ack_ids; + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $invalid_ack_ids; + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $temporary_failed_ack_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids + * Optional. Successfully processed acknowledgement IDs. + * @type array|\Google\Protobuf\Internal\RepeatedField $invalid_ack_ids + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * @type array|\Google\Protobuf\Internal\RepeatedField $temporary_failed_ack_ids + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAckIds() + { + return $this->ack_ids; + } + + /** + * Optional. Successfully processed acknowledgement IDs. + * + * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ack_ids = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInvalidAckIds() + { + return $this->invalid_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs that were malformed or whose + * acknowledgement deadline has expired. + * + * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInvalidAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->invalid_ack_ids = $arr; + + return $this; + } + + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTemporaryFailedAckIds() + { + return $this->temporary_failed_ack_ids; + } + + /** + * Optional. List of acknowledgement IDs that failed processing with + * temporary issues. + * + * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTemporaryFailedAckIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->temporary_failed_ack_ids = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ModifyAckDeadlineConfirmation::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_ModifyAckDeadlineConfirmation::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php new file mode 100644 index 00000000000..f531ca2a7d5 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php @@ -0,0 +1,108 @@ +google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + */ +class SubscriptionProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. True iff exactly once delivery is enabled for this + * subscription. + * + * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $exactly_once_delivery_enabled = false; + /** + * Optional. True iff message ordering is enabled for this subscription. + * + * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_ordering_enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $exactly_once_delivery_enabled + * Optional. True iff exactly once delivery is enabled for this + * subscription. + * @type bool $message_ordering_enabled + * Optional. True iff message ordering is enabled for this subscription. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. True iff exactly once delivery is enabled for this + * subscription. + * + * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExactlyOnceDeliveryEnabled() + { + return $this->exactly_once_delivery_enabled; + } + + /** + * Optional. True iff exactly once delivery is enabled for this + * subscription. + * + * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExactlyOnceDeliveryEnabled($var) + { + GPBUtil::checkBool($var); + $this->exactly_once_delivery_enabled = $var; + + return $this; + } + + /** + * Optional. True iff message ordering is enabled for this subscription. + * + * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMessageOrderingEnabled() + { + return $this->message_ordering_enabled; + } + + /** + * Optional. True iff message ordering is enabled for this subscription. + * + * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMessageOrderingEnabled($var) + { + GPBUtil::checkBool($var); + $this->message_ordering_enabled = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SubscriptionProperties::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_SubscriptionProperties::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php new file mode 100644 index 00000000000..5beaed0dcde --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php @@ -0,0 +1,1138 @@ +google.pubsub.v1.Subscription + */ +class Subscription extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $topic = ''; + /** + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $push_config = null; + /** + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bigquery_config = null; + /** + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cloud_storage_config = null; + /** + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * + * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ack_deadline_seconds = 0; + /** + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * + * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $retain_acked_messages = false; + /** + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_retention_duration = null; + /** + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * + * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_message_ordering = false; + /** + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * + * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expiration_policy = null; + /** + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * + * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * + * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dead_letter_policy = null; + /** + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * + * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $retry_policy = null; + /** + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * + * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $detached = false; + /** + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgement deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * + * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_exactly_once_delivery = false; + /** + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $topic_message_retention_duration = null; + /** + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Information about the associated Analytics Hub subscription. + * Only set if the subscritpion is created by Analytics Hub. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $analytics_hub_subscription_info = null; + + /** + * @param string $name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * @param string $topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. Please see + * {@see SubscriberClient::topicName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\PushConfig $pushConfig Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * @param int $ackDeadlineSeconds Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * + * @return \Google\Cloud\PubSub\V1\Subscription + * + * @experimental + */ + public static function build(string $name, string $topic, \Google\Cloud\PubSub\V1\PushConfig $pushConfig, int $ackDeadlineSeconds): self + { + return (new self()) + ->setName($name) + ->setTopic($topic) + ->setPushConfig($pushConfig) + ->setAckDeadlineSeconds($ackDeadlineSeconds); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * @type string $topic + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * @type \Google\Cloud\PubSub\V1\PushConfig $push_config + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * @type \Google\Cloud\PubSub\V1\BigQueryConfig $bigquery_config + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * @type \Google\Cloud\PubSub\V1\CloudStorageConfig $cloud_storage_config + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * @type int $ack_deadline_seconds + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * @type bool $retain_acked_messages + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * @type \Google\Protobuf\Duration $message_retention_duration + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 31 days or less than 10 minutes. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * @type bool $enable_message_ordering + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * @type \Google\Cloud\PubSub\V1\ExpirationPolicy $expiration_policy + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * @type string $filter + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * @type \Google\Cloud\PubSub\V1\DeadLetterPolicy $dead_letter_policy + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * @type \Google\Cloud\PubSub\V1\RetryPolicy $retry_policy + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * @type bool $detached + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * @type bool $enable_exactly_once_delivery + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgement deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * @type \Google\Protobuf\Duration $topic_message_retention_duration + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * @type int $state + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * @type \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo $analytics_hub_subscription_info + * Output only. Information about the associated Analytics Hub subscription. + * Only set if the subscritpion is created by Analytics Hub. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * + * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PushConfig|null + */ + public function getPushConfig() + { + return $this->push_config; + } + + public function hasPushConfig() + { + return isset($this->push_config); + } + + public function clearPushConfig() + { + unset($this->push_config); + } + + /** + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PushConfig $var + * @return $this + */ + public function setPushConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class); + $this->push_config = $var; + + return $this; + } + + /** + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\BigQueryConfig|null + */ + public function getBigqueryConfig() + { + return $this->bigquery_config; + } + + public function hasBigqueryConfig() + { + return isset($this->bigquery_config); + } + + public function clearBigqueryConfig() + { + unset($this->bigquery_config); + } + + /** + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\BigQueryConfig $var + * @return $this + */ + public function setBigqueryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\BigQueryConfig::class); + $this->bigquery_config = $var; + + return $this; + } + + /** + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\CloudStorageConfig|null + */ + public function getCloudStorageConfig() + { + return $this->cloud_storage_config; + } + + public function hasCloudStorageConfig() + { + return isset($this->cloud_storage_config); + } + + public function clearCloudStorageConfig() + { + unset($this->cloud_storage_config); + } + + /** + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * + * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\CloudStorageConfig $var + * @return $this + */ + public function setCloudStorageConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig::class); + $this->cloud_storage_config = $var; + + return $this; + } + + /** + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * + * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAckDeadlineSeconds() + { + return $this->ack_deadline_seconds; + } + + /** + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * + * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAckDeadlineSeconds($var) + { + GPBUtil::checkInt32($var); + $this->ack_deadline_seconds = $var; + + return $this; + } + + /** + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * + * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRetainAckedMessages() + { + return $this->retain_acked_messages; + } + + /** + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * + * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRetainAckedMessages($var) + { + GPBUtil::checkBool($var); + $this->retain_acked_messages = $var; + + return $this; + } + + /** + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getMessageRetentionDuration() + { + return $this->message_retention_duration; + } + + public function hasMessageRetentionDuration() + { + return isset($this->message_retention_duration); + } + + public function clearMessageRetentionDuration() + { + unset($this->message_retention_duration); + } + + /** + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMessageRetentionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->message_retention_duration = $var; + + return $this; + } + + /** + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/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. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/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; + } + + /** + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * + * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableMessageOrdering() + { + return $this->enable_message_ordering; + } + + /** + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * + * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableMessageOrdering($var) + { + GPBUtil::checkBool($var); + $this->enable_message_ordering = $var; + + return $this; + } + + /** + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * + * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\ExpirationPolicy|null + */ + public function getExpirationPolicy() + { + return $this->expiration_policy; + } + + public function hasExpirationPolicy() + { + return isset($this->expiration_policy); + } + + public function clearExpirationPolicy() + { + unset($this->expiration_policy); + } + + /** + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * + * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\ExpirationPolicy $var + * @return $this + */ + public function setExpirationPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\ExpirationPolicy::class); + $this->expiration_policy = $var; + + return $this; + } + + /** + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * + * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * + * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * + * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\DeadLetterPolicy|null + */ + public function getDeadLetterPolicy() + { + return $this->dead_letter_policy; + } + + public function hasDeadLetterPolicy() + { + return isset($this->dead_letter_policy); + } + + public function clearDeadLetterPolicy() + { + unset($this->dead_letter_policy); + } + + /** + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * + * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\DeadLetterPolicy $var + * @return $this + */ + public function setDeadLetterPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\DeadLetterPolicy::class); + $this->dead_letter_policy = $var; + + return $this; + } + + /** + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * + * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\RetryPolicy|null + */ + public function getRetryPolicy() + { + return $this->retry_policy; + } + + public function hasRetryPolicy() + { + return isset($this->retry_policy); + } + + public function clearRetryPolicy() + { + unset($this->retry_policy); + } + + /** + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * + * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\RetryPolicy $var + * @return $this + */ + public function setRetryPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\RetryPolicy::class); + $this->retry_policy = $var; + + return $this; + } + + /** + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * + * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDetached() + { + return $this->detached; + } + + /** + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * + * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDetached($var) + { + GPBUtil::checkBool($var); + $this->detached = $var; + + return $this; + } + + /** + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgement deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * + * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableExactlyOnceDelivery() + { + return $this->enable_exactly_once_delivery; + } + + /** + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgement deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * + * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableExactlyOnceDelivery($var) + { + GPBUtil::checkBool($var); + $this->enable_exactly_once_delivery = $var; + + return $this; + } + + /** + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getTopicMessageRetentionDuration() + { + return $this->topic_message_retention_duration; + } + + public function hasTopicMessageRetentionDuration() + { + return isset($this->topic_message_retention_duration); + } + + public function clearTopicMessageRetentionDuration() + { + unset($this->topic_message_retention_duration); + } + + /** + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTopicMessageRetentionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->topic_message_retention_duration = $var; + + return $this; + } + + /** + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Subscription\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Information about the associated Analytics Hub subscription. + * Only set if the subscritpion is created by Analytics Hub. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo|null + */ + public function getAnalyticsHubSubscriptionInfo() + { + return $this->analytics_hub_subscription_info; + } + + public function hasAnalyticsHubSubscriptionInfo() + { + return isset($this->analytics_hub_subscription_info); + } + + public function clearAnalyticsHubSubscriptionInfo() + { + unset($this->analytics_hub_subscription_info); + } + + /** + * Output only. Information about the associated Analytics Hub subscription. + * Only set if the subscritpion is created by Analytics Hub. + * + * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo $var + * @return $this + */ + public function setAnalyticsHubSubscriptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo::class); + $this->analytics_hub_subscription_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php new file mode 100644 index 00000000000..78ff21e92e4 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php @@ -0,0 +1,121 @@ +google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + */ +class AnalyticsHubSubscriptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the associated Analytics Hub listing resource. + * Pattern: + * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + * + * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $listing = ''; + /** + * Optional. The name of the associated Analytics Hub subscription resource. + * Pattern: + * "projects/{project}/locations/{location}/subscriptions/{subscription}" + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subscription = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $listing + * Optional. The name of the associated Analytics Hub listing resource. + * Pattern: + * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + * @type string $subscription + * Optional. The name of the associated Analytics Hub subscription resource. + * Pattern: + * "projects/{project}/locations/{location}/subscriptions/{subscription}" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the associated Analytics Hub listing resource. + * Pattern: + * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + * + * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getListing() + { + return $this->listing; + } + + /** + * Optional. The name of the associated Analytics Hub listing resource. + * Pattern: + * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + * + * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkString($var, True); + $this->listing = $var; + + return $this; + } + + /** + * Optional. The name of the associated Analytics Hub subscription resource. + * Pattern: + * "projects/{project}/locations/{location}/subscriptions/{subscription}" + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Optional. The name of the associated Analytics Hub subscription resource. + * Pattern: + * "projects/{project}/locations/{location}/subscriptions/{subscription}" + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnalyticsHubSubscriptionInfo::class, \Google\Cloud\PubSub\V1\Subscription_AnalyticsHubSubscriptionInfo::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php new file mode 100644 index 00000000000..9dd0c05877e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php @@ -0,0 +1,66 @@ +google.pubsub.v1.Subscription.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The subscription can actively receive messages + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The subscription cannot receive messages because of an error with the + * resource to which it pushes messages. See the more detailed error state + * in the corresponding configuration. + * + * Generated from protobuf enum RESOURCE_ERROR = 2; + */ + const RESOURCE_ERROR = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::RESOURCE_ERROR => 'RESOURCE_ERROR', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\Subscription_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php new file mode 100644 index 00000000000..aa0e5f0fca3 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php @@ -0,0 +1,473 @@ +google.pubsub.v1.Topic + */ +class Topic extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * + * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_storage_policy = null; + /** + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kms_key_name = ''; + /** + * Optional. Settings for validating messages published against a schema. + * + * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema_settings = null; + /** + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $satisfies_pzs = false; + /** + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_retention_duration = null; + /** + * Output only. An output-only field indicating the state of the topic. + * + * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Settings for ingestion from a data source into this topic. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ingestion_data_source_settings = null; + + /** + * @param string $name Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * + * @return \Google\Cloud\PubSub\V1\Topic + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * @type \Google\Cloud\PubSub\V1\MessageStoragePolicy $message_storage_policy + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * @type string $kms_key_name + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * @type \Google\Cloud\PubSub\V1\SchemaSettings $schema_settings + * Optional. Settings for validating messages published against a schema. + * @type bool $satisfies_pzs + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * @type \Google\Protobuf\Duration $message_retention_duration + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * @type int $state + * Output only. An output-only field indicating the state of the topic. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings $ingestion_data_source_settings + * Optional. Settings for ingestion from a data source into this topic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * + * Generated from protobuf field map labels = 2 [(.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; + } + + /** + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * + * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\MessageStoragePolicy|null + */ + public function getMessageStoragePolicy() + { + return $this->message_storage_policy; + } + + public function hasMessageStoragePolicy() + { + return isset($this->message_storage_policy); + } + + public function clearMessageStoragePolicy() + { + unset($this->message_storage_policy); + } + + /** + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * + * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\MessageStoragePolicy $var + * @return $this + */ + public function setMessageStoragePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\MessageStoragePolicy::class); + $this->message_storage_policy = $var; + + return $this; + } + + /** + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * Optional. Settings for validating messages published against a schema. + * + * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\SchemaSettings|null + */ + public function getSchemaSettings() + { + return $this->schema_settings; + } + + public function hasSchemaSettings() + { + return isset($this->schema_settings); + } + + public function clearSchemaSettings() + { + unset($this->schema_settings); + } + + /** + * Optional. Settings for validating messages published against a schema. + * + * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\SchemaSettings $var + * @return $this + */ + public function setSchemaSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\SchemaSettings::class); + $this->schema_settings = $var; + + return $this; + } + + /** + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * + * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getMessageRetentionDuration() + { + return $this->message_retention_duration; + } + + public function hasMessageRetentionDuration() + { + return isset($this->message_retention_duration); + } + + public function clearMessageRetentionDuration() + { + unset($this->message_retention_duration); + } + + /** + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * + * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMessageRetentionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->message_retention_duration = $var; + + return $this; + } + + /** + * Output only. An output-only field indicating the state of the topic. + * + * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field indicating the state of the topic. + * + * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Topic\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Settings for ingestion from a data source into this topic. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings|null + */ + public function getIngestionDataSourceSettings() + { + return $this->ingestion_data_source_settings; + } + + public function hasIngestionDataSourceSettings() + { + return isset($this->ingestion_data_source_settings); + } + + public function clearIngestionDataSourceSettings() + { + unset($this->ingestion_data_source_settings); + } + + /** + * Optional. Settings for ingestion from a data source into this topic. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings $var + * @return $this + */ + public function setIngestionDataSourceSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings::class); + $this->ingestion_data_source_settings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php new file mode 100644 index 00000000000..ca6a253e650 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php @@ -0,0 +1,66 @@ +google.pubsub.v1.Topic.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The topic does not have any persistent errors. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Ingestion from the data source has encountered a permanent error. + * See the more detailed error state in the corresponding ingestion + * source configuration. + * + * Generated from protobuf enum INGESTION_RESOURCE_ERROR = 2; + */ + const INGESTION_RESOURCE_ERROR = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INGESTION_RESOURCE_ERROR => 'INGESTION_RESOURCE_ERROR', + ]; + + 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(State::class, \Google\Cloud\PubSub\V1\Topic_State::class); + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php new file mode 100644 index 00000000000..aa2378043b3 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php @@ -0,0 +1,141 @@ +google.pubsub.v1.UpdateSnapshotRequest + */ +class UpdateSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated snapshot object. + * + * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot = null; + /** + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\PubSub\V1\Snapshot $snapshot Required. The updated snapshot object. + * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * + * @return \Google\Cloud\PubSub\V1\UpdateSnapshotRequest + * + * @experimental + */ + public static function build(\Google\Cloud\PubSub\V1\Snapshot $snapshot, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSnapshot($snapshot) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PubSub\V1\Snapshot $snapshot + * Required. The updated snapshot object. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated snapshot object. + * + * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Snapshot|null + */ + public function getSnapshot() + { + return $this->snapshot; + } + + public function hasSnapshot() + { + return isset($this->snapshot); + } + + public function clearSnapshot() + { + unset($this->snapshot); + } + + /** + * Required. The updated snapshot object. + * + * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Snapshot $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Snapshot::class); + $this->snapshot = $var; + + return $this; + } + + /** + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php new file mode 100644 index 00000000000..d6400874635 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php @@ -0,0 +1,141 @@ +google.pubsub.v1.UpdateSubscriptionRequest + */ +class UpdateSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated subscription object. + * + * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subscription = null; + /** + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\PubSub\V1\Subscription $subscription Required. The updated subscription object. + * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * + * @return \Google\Cloud\PubSub\V1\UpdateSubscriptionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\PubSub\V1\Subscription $subscription, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSubscription($subscription) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PubSub\V1\Subscription $subscription + * Required. The updated subscription object. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated subscription object. + * + * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Subscription|null + */ + public function getSubscription() + { + return $this->subscription; + } + + public function hasSubscription() + { + return isset($this->subscription); + } + + public function clearSubscription() + { + unset($this->subscription); + } + + /** + * Required. The updated subscription object. + * + * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Subscription $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription::class); + $this->subscription = $var; + + return $this; + } + + /** + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php new file mode 100644 index 00000000000..1a09ea4292a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php @@ -0,0 +1,156 @@ +google.pubsub.v1.UpdateTopicRequest + */ +class UpdateTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated topic object. + * + * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $topic = null; + /** + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\PubSub\V1\Topic $topic Required. The updated topic object. + * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * + * @return \Google\Cloud\PubSub\V1\UpdateTopicRequest + * + * @experimental + */ + public static function build(\Google\Cloud\PubSub\V1\Topic $topic, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTopic($topic) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\PubSub\V1\Topic $topic + * Required. The updated topic object. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated topic object. + * + * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Topic|null + */ + public function getTopic() + { + return $this->topic; + } + + public function hasTopic() + { + return isset($this->topic); + } + + public function clearTopic() + { + unset($this->topic); + } + + /** + * Required. The updated topic object. + * + * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Topic $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Topic::class); + $this->topic = $var; + + return $this; + } + + /** + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php new file mode 100644 index 00000000000..cc85b3a7abd --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php @@ -0,0 +1,217 @@ +google.pubsub.v1.ValidateMessageRequest + */ +class ValidateMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Message to validate against the provided `schema_spec`. + * + * Generated from protobuf field bytes message = 4; + */ + protected $message = ''; + /** + * The encoding expected for messages + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; + */ + protected $encoding = 0; + protected $schema_spec; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @type string $name + * Name of the schema against which to validate. + * Format is `projects/{project}/schemas/{schema}`. + * @type \Google\Cloud\PubSub\V1\Schema $schema + * Ad-hoc schema against which to validate + * @type string $message + * Message to validate against the provided `schema_spec`. + * @type int $encoding + * The encoding expected for messages + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * 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 name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * 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; + } + + /** + * Name of the schema against which to validate. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->readOneof(2); + } + + public function hasName() + { + return $this->hasOneof(2); + } + + /** + * Name of the schema against which to validate. + * Format is `projects/{project}/schemas/{schema}`. + * + * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Ad-hoc schema against which to validate + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 3; + * @return \Google\Cloud\PubSub\V1\Schema|null + */ + public function getSchema() + { + return $this->readOneof(3); + } + + public function hasSchema() + { + return $this->hasOneof(3); + } + + /** + * Ad-hoc schema against which to validate + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 3; + * @param \Google\Cloud\PubSub\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Message to validate against the provided `schema_spec`. + * + * Generated from protobuf field bytes message = 4; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Message to validate against the provided `schema_spec`. + * + * Generated from protobuf field bytes message = 4; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, False); + $this->message = $var; + + return $this; + } + + /** + * The encoding expected for messages + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; + * @return int + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * The encoding expected for messages + * + * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; + * @param int $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Encoding::class); + $this->encoding = $var; + + return $this; + } + + /** + * @return string + */ + public function getSchemaSpec() + { + return $this->whichOneof("schema_spec"); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php new file mode 100644 index 00000000000..3447bdcc8e1 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php @@ -0,0 +1,34 @@ +google.pubsub.v1.ValidateMessageResponse + */ +class ValidateMessageResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php new file mode 100644 index 00000000000..25fd4f172a7 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php @@ -0,0 +1,132 @@ +google.pubsub.v1.ValidateSchemaRequest + */ +class ValidateSchemaRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The schema object to validate. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schema = null; + + /** + * @param string $parent Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. Please see + * {@see SchemaServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema object to validate. + * + * @return \Google\Cloud\PubSub\V1\ValidateSchemaRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\PubSub\V1\Schema $schema): self + { + return (new self()) + ->setParent($parent) + ->setSchema($schema); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @type \Google\Cloud\PubSub\V1\Schema $schema + * Required. The schema object to validate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * 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 name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * + * 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 schema object to validate. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\PubSub\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Required. The schema object to validate. + * + * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\PubSub\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); + $this->schema = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php new file mode 100644 index 00000000000..777511b5f98 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php @@ -0,0 +1,34 @@ +google.pubsub.v1.ValidateSchemaResponse + */ +class ValidateSchemaResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php new file mode 100644 index 00000000000..316f4cb7a67 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php @@ -0,0 +1,75 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $publisherClient->createTopic($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_topic_sample($name); +} +// [END pubsub_v1_generated_Publisher_CreateTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php new file mode 100644 index 00000000000..128ab5472a7 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php @@ -0,0 +1,74 @@ +setTopic($formattedTopic); + + // Call the API and handle any network failures. + try { + $publisherClient->deleteTopic($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); + + delete_topic_sample($formattedTopic); +} +// [END pubsub_v1_generated_Publisher_DeleteTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php new file mode 100644 index 00000000000..4c1c766c4bc --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php @@ -0,0 +1,75 @@ +setSubscription($formattedSubscription); + + // Call the API and handle any network failures. + try { + /** @var DetachSubscriptionResponse $response */ + $response = $publisherClient->detachSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = PublisherClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + detach_subscription_sample($formattedSubscription); +} +// [END pubsub_v1_generated_Publisher_DetachSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php new file mode 100644 index 00000000000..54e97ffbd1c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $publisherClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_Publisher_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php new file mode 100644 index 00000000000..5b08a9beef4 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php @@ -0,0 +1,72 @@ +setTopic($formattedTopic); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $publisherClient->getTopic($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); + + get_topic_sample($formattedTopic); +} +// [END pubsub_v1_generated_Publisher_GetTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php new file mode 100644 index 00000000000..640c0a2f75a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php @@ -0,0 +1,80 @@ +setTopic($formattedTopic); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publisherClient->listTopicSnapshots($request); + + /** @var string $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); + + list_topic_snapshots_sample($formattedTopic); +} +// [END pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php new file mode 100644 index 00000000000..4c808e9a7ca --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php @@ -0,0 +1,76 @@ +setTopic($formattedTopic); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publisherClient->listTopicSubscriptions($request); + + /** @var string $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); + + list_topic_subscriptions_sample($formattedTopic); +} +// [END pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php new file mode 100644 index 00000000000..84f7989720d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php @@ -0,0 +1,77 @@ +setProject($formattedProject); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publisherClient->listTopics($request); + + /** @var Topic $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProject = PublisherClient::projectName('[PROJECT]'); + + list_topics_sample($formattedProject); +} +// [END pubsub_v1_generated_Publisher_ListTopics_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php new file mode 100644 index 00000000000..c58244cd996 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php @@ -0,0 +1,76 @@ +setTopic($formattedTopic) + ->setMessages($messages); + + // Call the API and handle any network failures. + try { + /** @var PublishResponse $response */ + $response = $publisherClient->publish($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); + + publish_sample($formattedTopic); +} +// [END pubsub_v1_generated_Publisher_Publish_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php new file mode 100644 index 00000000000..a5dc7d4bf3e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $publisherClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_Publisher_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php new file mode 100644 index 00000000000..42eb4aacb66 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $publisherClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END pubsub_v1_generated_Publisher_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php new file mode 100644 index 00000000000..2685411cef6 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php @@ -0,0 +1,81 @@ +setName($topicName); + $updateMask = new FieldMask(); + $request = (new UpdateTopicRequest()) + ->setTopic($topic) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $publisherClient->updateTopic($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $topicName = '[NAME]'; + + update_topic_sample($topicName); +} +// [END pubsub_v1_generated_Publisher_UpdateTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php new file mode 100644 index 00000000000..de8d6bd5fe4 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php @@ -0,0 +1,78 @@ +setName($schemaName); + $request = (new CommitSchemaRequest()) + ->setName($formattedName) + ->setSchema($schema); + + // Call the API and handle any network failures. + try { + /** @var Schema $response */ + $response = $schemaServiceClient->commitSchema($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + $schemaName = '[NAME]'; + + commit_schema_sample($formattedName, $schemaName); +} +// [END pubsub_v1_generated_SchemaService_CommitSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php new file mode 100644 index 00000000000..3daea89e090 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php @@ -0,0 +1,78 @@ +setName($schemaName); + $request = (new CreateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + + // Call the API and handle any network failures. + try { + /** @var Schema $response */ + $response = $schemaServiceClient->createSchema($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); + $schemaName = '[NAME]'; + + create_schema_sample($formattedParent, $schemaName); +} +// [END pubsub_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php new file mode 100644 index 00000000000..5ffc378dba8 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $schemaServiceClient->deleteSchema($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + + delete_schema_sample($formattedName); +} +// [END pubsub_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php new file mode 100644 index 00000000000..86c02a21127 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php @@ -0,0 +1,79 @@ +setName($formattedName) + ->setRevisionId($revisionId); + + // Call the API and handle any network failures. + try { + /** @var Schema $response */ + $response = $schemaServiceClient->deleteSchemaRevision($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = '[REVISION_ID]'; + + delete_schema_revision_sample($formattedName, $revisionId); +} +// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php new file mode 100644 index 00000000000..64bf89b99ec --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $schemaServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_SchemaService_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php new file mode 100644 index 00000000000..bcff150482e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Schema $response */ + $response = $schemaServiceClient->getSchema($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + + get_schema_sample($formattedName); +} +// [END pubsub_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php new file mode 100644 index 00000000000..f2c3c2eec7e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $schemaServiceClient->listSchemaRevisions($request); + + /** @var Schema $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + + list_schema_revisions_sample($formattedName); +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php new file mode 100644 index 00000000000..530a62b9392 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $schemaServiceClient->listSchemas($request); + + /** @var Schema $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); + + list_schemas_sample($formattedParent); +} +// [END pubsub_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php new file mode 100644 index 00000000000..7fb67a43d5c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php @@ -0,0 +1,77 @@ +setName($formattedName) + ->setRevisionId($revisionId); + + // Call the API and handle any network failures. + try { + /** @var Schema $response */ + $response = $schemaServiceClient->rollbackSchema($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = '[REVISION_ID]'; + + rollback_schema_sample($formattedName, $revisionId); +} +// [END pubsub_v1_generated_SchemaService_RollbackSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php new file mode 100644 index 00000000000..330633f3b16 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $schemaServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_SchemaService_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php new file mode 100644 index 00000000000..6adbcab9c43 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $schemaServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END pubsub_v1_generated_SchemaService_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php new file mode 100644 index 00000000000..276757f2673 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php @@ -0,0 +1,72 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ValidateMessageResponse $response */ + $response = $schemaServiceClient->validateMessage($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); + + validate_message_sample($formattedParent); +} +// [END pubsub_v1_generated_SchemaService_ValidateMessage_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php new file mode 100644 index 00000000000..fc186436fb9 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php @@ -0,0 +1,79 @@ +setName($schemaName); + $request = (new ValidateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + + // Call the API and handle any network failures. + try { + /** @var ValidateSchemaResponse $response */ + $response = $schemaServiceClient->validateSchema($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); + $schemaName = '[NAME]'; + + validate_schema_sample($formattedParent, $schemaName); +} +// [END pubsub_v1_generated_SchemaService_ValidateSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php new file mode 100644 index 00000000000..c06acebd45c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php @@ -0,0 +1,82 @@ +setSubscription($formattedSubscription) + ->setAckIds($ackIds); + + // Call the API and handle any network failures. + try { + $subscriberClient->acknowledge($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIdsElement = '[ACK_IDS]'; + + acknowledge_sample($formattedSubscription, $ackIdsElement); +} +// [END pubsub_v1_generated_Subscriber_Acknowledge_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php new file mode 100644 index 00000000000..1616d96fe49 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php @@ -0,0 +1,103 @@ +setName($formattedName) + ->setSubscription($formattedSubscription); + + // Call the API and handle any network failures. + try { + /** @var Snapshot $response */ + $response = $subscriberClient->createSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + create_snapshot_sample($formattedName, $formattedSubscription); +} +// [END pubsub_v1_generated_Subscriber_CreateSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php new file mode 100644 index 00000000000..3d740e589e8 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php @@ -0,0 +1,90 @@ +setName($name) + ->setTopic($formattedTopic); + + // Call the API and handle any network failures. + try { + /** @var Subscription $response */ + $response = $subscriberClient->createSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $formattedTopic = SubscriberClient::topicName('[PROJECT]', '[TOPIC]'); + + create_subscription_sample($name, $formattedTopic); +} +// [END pubsub_v1_generated_Subscriber_CreateSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php new file mode 100644 index 00000000000..e76cd30d0f1 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php @@ -0,0 +1,78 @@ +setSnapshot($formattedSnapshot); + + // Call the API and handle any network failures. + try { + $subscriberClient->deleteSnapshot($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSnapshot = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); + + delete_snapshot_sample($formattedSnapshot); +} +// [END pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php new file mode 100644 index 00000000000..052c67f9c8b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php @@ -0,0 +1,74 @@ +setSubscription($formattedSubscription); + + // Call the API and handle any network failures. + try { + $subscriberClient->deleteSubscription($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + delete_subscription_sample($formattedSubscription); +} +// [END pubsub_v1_generated_Subscriber_DeleteSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php new file mode 100644 index 00000000000..8e003f43b71 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $subscriberClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_Subscriber_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php new file mode 100644 index 00000000000..8b2da513c2b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php @@ -0,0 +1,76 @@ +setSnapshot($formattedSnapshot); + + // Call the API and handle any network failures. + try { + /** @var Snapshot $response */ + $response = $subscriberClient->getSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSnapshot = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); + + get_snapshot_sample($formattedSnapshot); +} +// [END pubsub_v1_generated_Subscriber_GetSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php new file mode 100644 index 00000000000..63d0dcfdf6a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php @@ -0,0 +1,72 @@ +setSubscription($formattedSubscription); + + // Call the API and handle any network failures. + try { + /** @var Subscription $response */ + $response = $subscriberClient->getSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + get_subscription_sample($formattedSubscription); +} +// [END pubsub_v1_generated_Subscriber_GetSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php new file mode 100644 index 00000000000..781a23c3e60 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php @@ -0,0 +1,81 @@ +setProject($formattedProject); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $subscriberClient->listSnapshots($request); + + /** @var Snapshot $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProject = SubscriberClient::projectName('[PROJECT]'); + + list_snapshots_sample($formattedProject); +} +// [END pubsub_v1_generated_Subscriber_ListSnapshots_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php new file mode 100644 index 00000000000..2ea97dfabe5 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php @@ -0,0 +1,77 @@ +setProject($formattedProject); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $subscriberClient->listSubscriptions($request); + + /** @var Subscription $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProject = SubscriberClient::projectName('[PROJECT]'); + + list_subscriptions_sample($formattedProject); +} +// [END pubsub_v1_generated_Subscriber_ListSubscriptions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php new file mode 100644 index 00000000000..531956b0e38 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php @@ -0,0 +1,92 @@ +setSubscription($formattedSubscription) + ->setAckIds($ackIds) + ->setAckDeadlineSeconds($ackDeadlineSeconds); + + // Call the API and handle any network failures. + try { + $subscriberClient->modifyAckDeadline($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIdsElement = '[ACK_IDS]'; + $ackDeadlineSeconds = 0; + + modify_ack_deadline_sample($formattedSubscription, $ackIdsElement, $ackDeadlineSeconds); +} +// [END pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php new file mode 100644 index 00000000000..efaef2f965d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php @@ -0,0 +1,78 @@ +setSubscription($formattedSubscription) + ->setPushConfig($pushConfig); + + // Call the API and handle any network failures. + try { + $subscriberClient->modifyPushConfig($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + modify_push_config_sample($formattedSubscription); +} +// [END pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php new file mode 100644 index 00000000000..36a57b63ff4 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php @@ -0,0 +1,77 @@ +setSubscription($formattedSubscription) + ->setMaxMessages($maxMessages); + + // Call the API and handle any network failures. + try { + /** @var PullResponse $response */ + $response = $subscriberClient->pull($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $maxMessages = 0; + + pull_sample($formattedSubscription, $maxMessages); +} +// [END pubsub_v1_generated_Subscriber_Pull_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php new file mode 100644 index 00000000000..0a17e35acc6 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php @@ -0,0 +1,77 @@ +setSubscription($formattedSubscription); + + // Call the API and handle any network failures. + try { + /** @var SeekResponse $response */ + $response = $subscriberClient->seek($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + + seek_sample($formattedSubscription); +} +// [END pubsub_v1_generated_Subscriber_Seek_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php new file mode 100644 index 00000000000..2f60a915d17 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $subscriberClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END pubsub_v1_generated_Subscriber_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php new file mode 100644 index 00000000000..1c4ebff6908 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php @@ -0,0 +1,92 @@ +setSubscription($formattedSubscription) + ->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $subscriberClient->streamingPull(); + $stream->writeAll([$request,]); + + /** @var StreamingPullResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $streamAckDeadlineSeconds = 0; + + streaming_pull_sample($formattedSubscription, $streamAckDeadlineSeconds); +} +// [END pubsub_v1_generated_Subscriber_StreamingPull_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php new file mode 100644 index 00000000000..32207175dd0 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $subscriberClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END pubsub_v1_generated_Subscriber_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php new file mode 100644 index 00000000000..bdd5bb3027d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php @@ -0,0 +1,67 @@ +setSnapshot($snapshot) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Snapshot $response */ + $response = $subscriberClient->updateSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php new file mode 100644 index 00000000000..e3eb7cee7f6 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php @@ -0,0 +1,90 @@ +setName($subscriptionName) + ->setTopic($formattedSubscriptionTopic); + $updateMask = new FieldMask(); + $request = (new UpdateSubscriptionRequest()) + ->setSubscription($subscription) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Subscription $response */ + $response = $subscriberClient->updateSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $subscriptionName = '[NAME]'; + $formattedSubscriptionTopic = SubscriberClient::topicName('[PROJECT]', '[TOPIC]'); + + update_subscription_sample($subscriptionName, $formattedSubscriptionTopic); +} +// [END pubsub_v1_generated_Subscriber_UpdateSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php new file mode 100644 index 00000000000..cb154fd306c --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php @@ -0,0 +1,660 @@ + createTopicAsync(Topic $request, array $optionalArgs = []) + * @method PromiseInterface deleteTopicAsync(DeleteTopicRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachSubscriptionAsync(DetachSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTopicAsync(GetTopicRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTopicSnapshotsAsync(ListTopicSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTopicSubscriptionsAsync(ListTopicSubscriptionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTopicsAsync(ListTopicsRequest $request, array $optionalArgs = []) + * @method PromiseInterface publishAsync(PublishRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateTopicAsync(UpdateTopicRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class PublisherClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.pubsub.v1.Publisher'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/publisher_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/publisher_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/publisher_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/publisher_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * _deleted-topic_ resource. + * + * @return string The formatted _deleted-topic_ resource. + */ + public static function deletedTopicName(): string + { + return self::getPathTemplate('deletedTopic')->render([]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_topic resource. + * + * @param string $project + * @param string $topic + * + * @return string The formatted project_topic resource. + */ + public static function projectTopicName(string $project, string $topic): string + { + return self::getPathTemplate('projectTopic')->render([ + 'project' => $project, + 'topic' => $topic, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a schema + * resource. + * + * @param string $project + * @param string $schema + * + * @return string The formatted schema resource. + */ + public static function schemaName(string $project, string $schema): string + { + return self::getPathTemplate('schema')->render([ + 'project' => $project, + 'schema' => $schema, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a subscription + * resource. + * + * @param string $project + * @param string $subscription + * + * @return string The formatted subscription resource. + */ + public static function subscriptionName(string $project, string $subscription): string + { + return self::getPathTemplate('subscription')->render([ + 'project' => $project, + 'subscription' => $subscription, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a topic + * resource. + * + * @param string $project + * @param string $topic + * + * @return string The formatted topic resource. + */ + public static function topicName(string $project, string $topic): string + { + return self::getPathTemplate('topic')->render([ + 'project' => $project, + 'topic' => $topic, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - deletedTopic: _deleted-topic_ + * - project: projects/{project} + * - projectTopic: projects/{project}/topics/{topic} + * - schema: projects/{project}/schemas/{schema} + * - subscription: projects/{project}/subscriptions/{subscription} + * - topic: projects/{project}/topics/{topic} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'pubsub.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates the given topic with the given name. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * + * The async variant is {@see PublisherClient::createTopicAsync()} . + * + * @example samples/V1/PublisherClient/create_topic.php + * + * @param Topic $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTopic(Topic $request, array $callOptions = []): Topic + { + return $this->startApiCall('CreateTopic', $request, $callOptions)->wait(); + } + + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + * does not exist. After a topic is deleted, a new topic may be created with + * the same name; this is an entirely new topic with none of the old + * configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + * The async variant is {@see PublisherClient::deleteTopicAsync()} . + * + * @example samples/V1/PublisherClient/delete_topic.php + * + * @param DeleteTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteTopic(DeleteTopicRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTopic', $request, $callOptions)->wait(); + } + + /** + * Detaches a subscription from this topic. All messages retained in the + * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + * will return FAILED_PRECONDITION. If the subscription is a push + * subscription, pushes to the endpoint will stop. + * + * The async variant is {@see PublisherClient::detachSubscriptionAsync()} . + * + * @example samples/V1/PublisherClient/detach_subscription.php + * + * @param DetachSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 DetachSubscriptionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachSubscription(DetachSubscriptionRequest $request, array $callOptions = []): DetachSubscriptionResponse + { + return $this->startApiCall('DetachSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets the configuration of a topic. + * + * The async variant is {@see PublisherClient::getTopicAsync()} . + * + * @example samples/V1/PublisherClient/get_topic.php + * + * @param GetTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTopic(GetTopicRequest $request, array $callOptions = []): Topic + { + return $this->startApiCall('GetTopic', $request, $callOptions)->wait(); + } + + /** + * Lists the names of the snapshots on this topic. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * The async variant is {@see PublisherClient::listTopicSnapshotsAsync()} . + * + * @example samples/V1/PublisherClient/list_topic_snapshots.php + * + * @param ListTopicSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTopicSnapshots(ListTopicSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTopicSnapshots', $request, $callOptions); + } + + /** + * Lists the names of the attached subscriptions on this topic. + * + * The async variant is {@see PublisherClient::listTopicSubscriptionsAsync()} . + * + * @example samples/V1/PublisherClient/list_topic_subscriptions.php + * + * @param ListTopicSubscriptionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTopicSubscriptions(ListTopicSubscriptionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTopicSubscriptions', $request, $callOptions); + } + + /** + * Lists matching topics. + * + * The async variant is {@see PublisherClient::listTopicsAsync()} . + * + * @example samples/V1/PublisherClient/list_topics.php + * + * @param ListTopicsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTopics(ListTopicsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTopics', $request, $callOptions); + } + + /** + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + * does not exist. + * + * The async variant is {@see PublisherClient::publishAsync()} . + * + * @example samples/V1/PublisherClient/publish.php + * + * @param PublishRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PublishResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function publish(PublishRequest $request, array $callOptions = []): PublishResponse + { + return $this->startApiCall('Publish', $request, $callOptions)->wait(); + } + + /** + * Updates an existing topic by updating the fields specified in the update + * mask. Note that certain properties of a topic are not modifiable. + * + * The async variant is {@see PublisherClient::updateTopicAsync()} . + * + * @example samples/V1/PublisherClient/update_topic.php + * + * @param UpdateTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTopic(UpdateTopicRequest $request, array $callOptions = []): Topic + { + return $this->startApiCall('UpdateTopic', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see PublisherClient::getIamPolicyAsync()} . + * + * @example samples/V1/PublisherClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see PublisherClient::setIamPolicyAsync()} . + * + * @example samples/V1/PublisherClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see PublisherClient::testIamPermissionsAsync()} . + * + * @example samples/V1/PublisherClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php new file mode 100644 index 00000000000..a234595fc98 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php @@ -0,0 +1,608 @@ + commitSchemaAsync(CommitSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSchemaAsync(CreateSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSchemaAsync(DeleteSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSchemaRevisionAsync(DeleteSchemaRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSchemaAsync(GetSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSchemaRevisionsAsync(ListSchemaRevisionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSchemasAsync(ListSchemasRequest $request, array $optionalArgs = []) + * @method PromiseInterface rollbackSchemaAsync(RollbackSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface validateMessageAsync(ValidateMessageRequest $request, array $optionalArgs = []) + * @method PromiseInterface validateSchemaAsync(ValidateSchemaRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class SchemaServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.pubsub.v1.SchemaService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/schema_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/schema_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/schema_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/schema_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a schema + * resource. + * + * @param string $project + * @param string $schema + * + * @return string The formatted schema resource. + */ + public static function schemaName(string $project, string $schema): string + { + return self::getPathTemplate('schema')->render([ + 'project' => $project, + 'schema' => $schema, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * - schema: projects/{project}/schemas/{schema} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'pubsub.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Commits a new schema revision to an existing schema. + * + * The async variant is {@see SchemaServiceClient::commitSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/commit_schema.php + * + * @param CommitSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Schema + * + * @throws ApiException Thrown if the API call fails. + */ + public function commitSchema(CommitSchemaRequest $request, array $callOptions = []): Schema + { + return $this->startApiCall('CommitSchema', $request, $callOptions)->wait(); + } + + /** + * Creates a schema. + * + * The async variant is {@see SchemaServiceClient::createSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/create_schema.php + * + * @param CreateSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Schema + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSchema(CreateSchemaRequest $request, array $callOptions = []): Schema + { + return $this->startApiCall('CreateSchema', $request, $callOptions)->wait(); + } + + /** + * Deletes a schema. + * + * The async variant is {@see SchemaServiceClient::deleteSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/delete_schema.php + * + * @param DeleteSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteSchema(DeleteSchemaRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSchema', $request, $callOptions)->wait(); + } + + /** + * Deletes a specific schema revision. + * + * The async variant is {@see SchemaServiceClient::deleteSchemaRevisionAsync()} . + * + * @example samples/V1/SchemaServiceClient/delete_schema_revision.php + * + * @param DeleteSchemaRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Schema + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSchemaRevision(DeleteSchemaRevisionRequest $request, array $callOptions = []): Schema + { + return $this->startApiCall('DeleteSchemaRevision', $request, $callOptions)->wait(); + } + + /** + * Gets a schema. + * + * The async variant is {@see SchemaServiceClient::getSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/get_schema.php + * + * @param GetSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Schema + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSchema(GetSchemaRequest $request, array $callOptions = []): Schema + { + return $this->startApiCall('GetSchema', $request, $callOptions)->wait(); + } + + /** + * Lists all schema revisions for the named schema. + * + * The async variant is {@see SchemaServiceClient::listSchemaRevisionsAsync()} . + * + * @example samples/V1/SchemaServiceClient/list_schema_revisions.php + * + * @param ListSchemaRevisionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSchemaRevisions(ListSchemaRevisionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSchemaRevisions', $request, $callOptions); + } + + /** + * Lists schemas in a project. + * + * The async variant is {@see SchemaServiceClient::listSchemasAsync()} . + * + * @example samples/V1/SchemaServiceClient/list_schemas.php + * + * @param ListSchemasRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSchemas(ListSchemasRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSchemas', $request, $callOptions); + } + + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + * The async variant is {@see SchemaServiceClient::rollbackSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/rollback_schema.php + * + * @param RollbackSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Schema + * + * @throws ApiException Thrown if the API call fails. + */ + public function rollbackSchema(RollbackSchemaRequest $request, array $callOptions = []): Schema + { + return $this->startApiCall('RollbackSchema', $request, $callOptions)->wait(); + } + + /** + * Validates a message against a schema. + * + * The async variant is {@see SchemaServiceClient::validateMessageAsync()} . + * + * @example samples/V1/SchemaServiceClient/validate_message.php + * + * @param ValidateMessageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ValidateMessageResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function validateMessage(ValidateMessageRequest $request, array $callOptions = []): ValidateMessageResponse + { + return $this->startApiCall('ValidateMessage', $request, $callOptions)->wait(); + } + + /** + * Validates a schema. + * + * The async variant is {@see SchemaServiceClient::validateSchemaAsync()} . + * + * @example samples/V1/SchemaServiceClient/validate_schema.php + * + * @param ValidateSchemaRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ValidateSchemaResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function validateSchema(ValidateSchemaRequest $request, array $callOptions = []): ValidateSchemaResponse + { + return $this->startApiCall('ValidateSchema', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see SchemaServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/SchemaServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see SchemaServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/SchemaServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see SchemaServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/SchemaServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php new file mode 100644 index 00000000000..58397867d91 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php @@ -0,0 +1,909 @@ + acknowledgeAsync(AcknowledgeRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSnapshotAsync(CreateSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSubscriptionAsync(Subscription $request, array $optionalArgs = []) + * @method PromiseInterface deleteSnapshotAsync(DeleteSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSubscriptionAsync(DeleteSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSnapshotAsync(GetSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSubscriptionAsync(GetSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSnapshotsAsync(ListSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSubscriptionsAsync(ListSubscriptionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface modifyAckDeadlineAsync(ModifyAckDeadlineRequest $request, array $optionalArgs = []) + * @method PromiseInterface modifyPushConfigAsync(ModifyPushConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface pullAsync(PullRequest $request, array $optionalArgs = []) + * @method PromiseInterface seekAsync(SeekRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSnapshotAsync(UpdateSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSubscriptionAsync(UpdateSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class SubscriberClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.pubsub.v1.Subscriber'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/subscriber_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/subscriber_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/subscriber_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/subscriber_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * _deleted-topic_ resource. + * + * @return string The formatted _deleted-topic_ resource. + */ + public static function deletedTopicName(): string + { + return self::getPathTemplate('deletedTopic')->render([]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_topic resource. + * + * @param string $project + * @param string $topic + * + * @return string The formatted project_topic resource. + */ + public static function projectTopicName(string $project, string $topic): string + { + return self::getPathTemplate('projectTopic')->render([ + 'project' => $project, + 'topic' => $topic, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snapshot + * resource. + * + * @param string $project + * @param string $snapshot + * + * @return string The formatted snapshot resource. + */ + public static function snapshotName(string $project, string $snapshot): string + { + return self::getPathTemplate('snapshot')->render([ + 'project' => $project, + 'snapshot' => $snapshot, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a subscription + * resource. + * + * @param string $project + * @param string $subscription + * + * @return string The formatted subscription resource. + */ + public static function subscriptionName(string $project, string $subscription): string + { + return self::getPathTemplate('subscription')->render([ + 'project' => $project, + 'subscription' => $subscription, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a topic + * resource. + * + * @param string $project + * @param string $topic + * + * @return string The formatted topic resource. + */ + public static function topicName(string $project, string $topic): string + { + return self::getPathTemplate('topic')->render([ + 'project' => $project, + 'topic' => $topic, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - deletedTopic: _deleted-topic_ + * - project: projects/{project} + * - projectTopic: projects/{project}/topics/{topic} + * - snapshot: projects/{project}/snapshots/{snapshot} + * - subscription: projects/{project}/subscriptions/{subscription} + * - topic: projects/{project}/topics/{topic} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'pubsub.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. + * + * Acknowledging a message whose ack deadline has expired may succeed, + * but such a message may be redelivered later. Acknowledging a message more + * than once will not result in an error. + * + * The async variant is {@see SubscriberClient::acknowledgeAsync()} . + * + * @example samples/V1/SubscriberClient/acknowledge.php + * + * @param AcknowledgeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function acknowledge(AcknowledgeRequest $request, array $callOptions = []): void + { + $this->startApiCall('Acknowledge', $request, $callOptions)->wait(); + } + + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * If the snapshot already exists, returns `ALREADY_EXISTS`. + * If the requested subscription doesn't exist, returns `NOT_FOUND`. + * If the backlog in the subscription is too old -- and the resulting snapshot + * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + * See also the `Snapshot.expire_time` field. If the name is not provided in + * the request, the server will assign a random + * name for this snapshot on the same project as the subscription, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for + * REST API requests, you must specify a name in the request. + * + * The async variant is {@see SubscriberClient::createSnapshotAsync()} . + * + * @example samples/V1/SubscriberClient/create_snapshot.php + * + * @param CreateSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Snapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSnapshot(CreateSnapshotRequest $request, array $callOptions = []): Snapshot + { + return $this->startApiCall('CreateSnapshot', $request, $callOptions)->wait(); + } + + /** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * If the subscription already exists, returns `ALREADY_EXISTS`. + * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * If the name is not provided in the request, the server will assign a random + * name for this subscription on the same project as the topic, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Subscription object. Note that + * for REST API requests, you must specify a name in the request. + * + * The async variant is {@see SubscriberClient::createSubscriptionAsync()} . + * + * @example samples/V1/SubscriberClient/create_subscription.php + * + * @param Subscription $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Subscription + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSubscription(Subscription $request, array $callOptions = []): Subscription + { + return $this->startApiCall('CreateSubscription', $request, $callOptions)->wait(); + } + + /** + * Removes an existing snapshot. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * When the snapshot is deleted, all messages retained in the snapshot + * are immediately dropped. After a snapshot is deleted, a new one may be + * created with the same name, but the new one has no association with the old + * snapshot or its subscription, unless the same subscription is specified. + * + * The async variant is {@see SubscriberClient::deleteSnapshotAsync()} . + * + * @example samples/V1/SubscriberClient/delete_snapshot.php + * + * @param DeleteSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteSnapshot(DeleteSnapshotRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSnapshot', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing subscription. All messages retained in the subscription + * are immediately dropped. Calls to `Pull` after deletion will return + * `NOT_FOUND`. After a subscription is deleted, a new one may be created with + * the same name, but the new one has no association with the old + * subscription or its topic unless the same topic is specified. + * + * The async variant is {@see SubscriberClient::deleteSubscriptionAsync()} . + * + * @example samples/V1/SubscriberClient/delete_subscription.php + * + * @param DeleteSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteSubscription(DeleteSubscriptionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets the configuration details of a snapshot. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * The async variant is {@see SubscriberClient::getSnapshotAsync()} . + * + * @example samples/V1/SubscriberClient/get_snapshot.php + * + * @param GetSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Snapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSnapshot(GetSnapshotRequest $request, array $callOptions = []): Snapshot + { + return $this->startApiCall('GetSnapshot', $request, $callOptions)->wait(); + } + + /** + * Gets the configuration details of a subscription. + * + * The async variant is {@see SubscriberClient::getSubscriptionAsync()} . + * + * @example samples/V1/SubscriberClient/get_subscription.php + * + * @param GetSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Subscription + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSubscription(GetSubscriptionRequest $request, array $callOptions = []): Subscription + { + return $this->startApiCall('GetSubscription', $request, $callOptions)->wait(); + } + + /** + * Lists the existing snapshots. Snapshots are used in [Seek]( + * https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * The async variant is {@see SubscriberClient::listSnapshotsAsync()} . + * + * @example samples/V1/SubscriberClient/list_snapshots.php + * + * @param ListSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSnapshots(ListSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSnapshots', $request, $callOptions); + } + + /** + * Lists matching subscriptions. + * + * The async variant is {@see SubscriberClient::listSubscriptionsAsync()} . + * + * @example samples/V1/SubscriberClient/list_subscriptions.php + * + * @param ListSubscriptionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSubscriptions(ListSubscriptionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSubscriptions', $request, $callOptions); + } + + /** + * Modifies the ack deadline for a specific message. This method is useful + * to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + * The async variant is {@see SubscriberClient::modifyAckDeadlineAsync()} . + * + * @example samples/V1/SubscriberClient/modify_ack_deadline.php + * + * @param ModifyAckDeadlineRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function modifyAckDeadline(ModifyAckDeadlineRequest $request, array $callOptions = []): void + { + $this->startApiCall('ModifyAckDeadline', $request, $callOptions)->wait(); + } + + /** + * Modifies the `PushConfig` for a specified subscription. + * + * This may be used to change a push subscription to a pull one (signified by + * an empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * + * The async variant is {@see SubscriberClient::modifyPushConfigAsync()} . + * + * @example samples/V1/SubscriberClient/modify_push_config.php + * + * @param ModifyPushConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function modifyPushConfig(ModifyPushConfigRequest $request, array $callOptions = []): void + { + $this->startApiCall('ModifyPushConfig', $request, $callOptions)->wait(); + } + + /** + * Pulls messages from the server. + * + * The async variant is {@see SubscriberClient::pullAsync()} . + * + * @example samples/V1/SubscriberClient/pull.php + * + * @param PullRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PullResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function pull(PullRequest $request, array $callOptions = []): PullResponse + { + return $this->startApiCall('Pull', $request, $callOptions)->wait(); + } + + /** + * Seeks an existing subscription to a point in time or to a given snapshot, + * whichever is provided in the request. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. Note that both the subscription and the + * snapshot must be on the same topic. + * + * The async variant is {@see SubscriberClient::seekAsync()} . + * + * @example samples/V1/SubscriberClient/seek.php + * + * @param SeekRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 SeekResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function seek(SeekRequest $request, array $callOptions = []): SeekResponse + { + return $this->startApiCall('Seek', $request, $callOptions)->wait(); + } + + /** + * Establishes a stream with the server, which sends messages down to the + * client. The client streams acknowledgements and ack deadline modifications + * back to the server. The server will close the stream and return the status + * on any error. The server may close the stream with status `UNAVAILABLE` to + * reassign server-side resources, in which case, the client should + * re-establish the stream. Flow control can be achieved by configuring the + * underlying RPC channel. + * + * @example samples/V1/SubscriberClient/streaming_pull.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingPull(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingPull', null, $callOptions); + } + + /** + * Updates an existing snapshot by updating the fields specified in the update + * mask. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * The async variant is {@see SubscriberClient::updateSnapshotAsync()} . + * + * @example samples/V1/SubscriberClient/update_snapshot.php + * + * @param UpdateSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Snapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSnapshot(UpdateSnapshotRequest $request, array $callOptions = []): Snapshot + { + return $this->startApiCall('UpdateSnapshot', $request, $callOptions)->wait(); + } + + /** + * Updates an existing subscription by updating the fields specified in the + * update mask. Note that certain properties of a subscription, such as its + * topic, are not modifiable. + * + * The async variant is {@see SubscriberClient::updateSubscriptionAsync()} . + * + * @example samples/V1/SubscriberClient/update_subscription.php + * + * @param UpdateSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Subscription + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSubscription(UpdateSubscriptionRequest $request, array $callOptions = []): Subscription + { + return $this->startApiCall('UpdateSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see SubscriberClient::getIamPolicyAsync()} . + * + * @example samples/V1/SubscriberClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see SubscriberClient::setIamPolicyAsync()} . + * + * @example samples/V1/SubscriberClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see SubscriberClient::testIamPermissionsAsync()} . + * + * @example samples/V1/SubscriberClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..3c57bdf7d8e --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json @@ -0,0 +1,256 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.pubsub.v1", + "libraryPackage": "Google\\Cloud\\PubSub\\V1", + "services": { + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "SchemaServiceGapicClient", + "rpcs": { + "CommitSchema": { + "methods": [ + "commitSchema" + ] + }, + "CreateSchema": { + "methods": [ + "createSchema" + ] + }, + "DeleteSchema": { + "methods": [ + "deleteSchema" + ] + }, + "DeleteSchemaRevision": { + "methods": [ + "deleteSchemaRevision" + ] + }, + "GetSchema": { + "methods": [ + "getSchema" + ] + }, + "ListSchemaRevisions": { + "methods": [ + "listSchemaRevisions" + ] + }, + "ListSchemas": { + "methods": [ + "listSchemas" + ] + }, + "RollbackSchema": { + "methods": [ + "rollbackSchema" + ] + }, + "ValidateMessage": { + "methods": [ + "validateMessage" + ] + }, + "ValidateSchema": { + "methods": [ + "validateSchema" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "Publisher": { + "clients": { + "grpc": { + "libraryClient": "PublisherGapicClient", + "rpcs": { + "CreateTopic": { + "methods": [ + "createTopic" + ] + }, + "DeleteTopic": { + "methods": [ + "deleteTopic" + ] + }, + "DetachSubscription": { + "methods": [ + "detachSubscription" + ] + }, + "GetTopic": { + "methods": [ + "getTopic" + ] + }, + "ListTopicSnapshots": { + "methods": [ + "listTopicSnapshots" + ] + }, + "ListTopicSubscriptions": { + "methods": [ + "listTopicSubscriptions" + ] + }, + "ListTopics": { + "methods": [ + "listTopics" + ] + }, + "Publish": { + "methods": [ + "publish" + ] + }, + "UpdateTopic": { + "methods": [ + "updateTopic" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "Subscriber": { + "clients": { + "grpc": { + "libraryClient": "SubscriberGapicClient", + "rpcs": { + "Acknowledge": { + "methods": [ + "acknowledge" + ] + }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "CreateSubscription": { + "methods": [ + "createSubscription" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "DeleteSubscription": { + "methods": [ + "deleteSubscription" + ] + }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "GetSubscription": { + "methods": [ + "getSubscription" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots" + ] + }, + "ListSubscriptions": { + "methods": [ + "listSubscriptions" + ] + }, + "ModifyAckDeadline": { + "methods": [ + "modifyAckDeadline" + ] + }, + "ModifyPushConfig": { + "methods": [ + "modifyPushConfig" + ] + }, + "Pull": { + "methods": [ + "pull" + ] + }, + "Seek": { + "methods": [ + "seek" + ] + }, + "StreamingPull": { + "methods": [ + "streamingPull" + ] + }, + "UpdateSnapshot": { + "methods": [ + "updateSnapshot" + ] + }, + "UpdateSubscription": { + "methods": [ + "updateSubscription" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json new file mode 100644 index 00000000000..8c794fca07d --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json @@ -0,0 +1,132 @@ +{ + "interfaces": { + "google.pubsub.v1.Publisher": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "ABORTED", + "CANCELLED", + "INTERNAL", + "RESOURCE_EXHAUSTED", + "UNKNOWN", + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "retry_policy_3_codes": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" + ] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4.0, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTopic": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DetachSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTopic": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ListTopicSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ListTopicSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ListTopics": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "Publish": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params", + "bundling": { + "delay_threshold_millis": 10, + "element_count_threshold": 100, + "request_byte_limit": 10485760, + "request_byte_threshold": 1048576 + } + }, + "UpdateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php new file mode 100644 index 00000000000..d39d0d038d3 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php @@ -0,0 +1,208 @@ + [ + 'google.pubsub.v1.Publisher' => [ + 'CreateTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'topic', + 'fieldAccessors' => [ + 'getTopic', + ], + ], + ], + ], + 'DetachSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\DetachSubscriptionResponse', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'GetTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'topic', + 'fieldAccessors' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopicSnapshots' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSnapshots', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicSnapshotsResponse', + 'headerParams' => [ + [ + 'keyName' => 'topic', + 'fieldAccessors' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopicSubscriptions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSubscriptions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicSubscriptionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'topic', + 'fieldAccessors' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopics' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTopics', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Publish' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\PublishResponse', + 'headerParams' => [ + [ + 'keyName' => 'topic', + 'fieldAccessors' => [ + 'getTopic', + ], + ], + ], + ], + 'UpdateTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'topic.name', + 'fieldAccessors' => [ + 'getTopic', + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'deletedTopic' => '_deleted-topic_', + 'project' => 'projects/{project}', + 'projectTopic' => 'projects/{project}/topics/{topic}', + 'schema' => 'projects/{project}/schemas/{schema}', + 'subscription' => 'projects/{project}/subscriptions/{subscription}', + 'topic' => 'projects/{project}/topics/{topic}', + ], + ], + ], +]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php new file mode 100644 index 00000000000..a62253330e6 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php @@ -0,0 +1,217 @@ + [ + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.pubsub.v1.Publisher' => [ + 'CreateTopic' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{name=projects/*/topics/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTopic' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{topic=projects/*/topics/*}', + 'placeholders' => [ + 'topic' => [ + 'getters' => [ + 'getTopic', + ], + ], + ], + ], + 'DetachSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:detach', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'GetTopic' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{topic=projects/*/topics/*}', + 'placeholders' => [ + 'topic' => [ + 'getters' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopicSnapshots' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{topic=projects/*/topics/*}/snapshots', + 'placeholders' => [ + 'topic' => [ + 'getters' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopicSubscriptions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{topic=projects/*/topics/*}/subscriptions', + 'placeholders' => [ + 'topic' => [ + 'getters' => [ + 'getTopic', + ], + ], + ], + ], + 'ListTopics' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{project=projects/*}/topics', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Publish' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{topic=projects/*/topics/*}:publish', + 'body' => '*', + 'placeholders' => [ + 'topic' => [ + 'getters' => [ + 'getTopic', + ], + ], + ], + ], + 'UpdateTopic' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{topic.name=projects/*/topics/*}', + 'body' => '*', + 'placeholders' => [ + 'topic.name' => [ + 'getters' => [ + 'getTopic', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json new file mode 100644 index 00000000000..2773e2ae2d5 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.pubsub.v1.SchemaService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_8_codes": [ + "UNAVAILABLE" + ] + }, + "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_8_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CommitSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "CreateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "DeleteSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "DeleteSchemaRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "GetSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "ListSchemaRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "ListSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "RollbackSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "ValidateMessage": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "ValidateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php new file mode 100644 index 00000000000..f11afb7e2cf --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php @@ -0,0 +1,207 @@ + [ + 'google.pubsub.v1.SchemaService' => [ + 'CommitSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Schema', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Schema', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSchemaRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Schema', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Schema', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSchemaRevisions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSchemas', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListSchemaRevisionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSchemas' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSchemas', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListSchemasResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RollbackSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Schema', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ValidateMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ValidateMessageResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ValidateSchema' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ValidateSchemaResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + 'schema' => 'projects/{project}/schemas/{schema}', + ], + ], + ], +]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php new file mode 100644 index 00000000000..db359582076 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php @@ -0,0 +1,229 @@ + [ + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.pubsub.v1.SchemaService' => [ + 'CommitSchema' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:commit', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateSchema' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/schemas', + 'body' => 'schema', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSchema' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSchemaRevision' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:deleteRevision', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSchema' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSchemaRevisions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:listRevisions', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSchemas' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/schemas', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RollbackSchema' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:rollback', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ValidateMessage' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/schemas:validateMessage', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ValidateSchema' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/schemas:validate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json new file mode 100644 index 00000000000..c4812e9de3f --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json @@ -0,0 +1,172 @@ +{ + "interfaces": { + "google.pubsub.v1.Subscriber": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_4_codes": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "retry_policy_5_codes": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE", + "INTERNAL" + ], + "retry_policy_6_codes": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" + ], + "retry_policy_7_codes": [ + "UNAVAILABLE" + ] + }, + "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_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4.0, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 900000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 900000, + "total_timeout_millis": 900000 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_6_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_7_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "Acknowledge": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "CreateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "CreateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "DeleteSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "DeleteSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "GetSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "ListSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "ModifyAckDeadline": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "ModifyPushConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "Pull": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "Seek": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "StreamingPull": { + "timeout_millis": 900000 + }, + "UpdateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "UpdateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + } + } + } + } +} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php new file mode 100644 index 00000000000..4b0fead5900 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php @@ -0,0 +1,280 @@ + [ + 'google.pubsub.v1.Subscriber' => [ + 'Acknowledge' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'CreateSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'snapshot', + 'fieldAccessors' => [ + 'getSnapshot', + ], + ], + ], + ], + 'DeleteSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'GetSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', + 'headerParams' => [ + [ + 'keyName' => 'snapshot', + 'fieldAccessors' => [ + 'getSnapshot', + ], + ], + ], + ], + 'GetSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'ListSnapshots' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSnapshots', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListSnapshotsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListSubscriptions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSubscriptions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\ListSubscriptionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ModifyAckDeadline' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'ModifyPushConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'Pull' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\PullResponse', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'Seek' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\SeekResponse', + 'headerParams' => [ + [ + 'keyName' => 'subscription', + 'fieldAccessors' => [ + 'getSubscription', + ], + ], + ], + ], + 'StreamingPull' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\StreamingPullResponse', + ], + 'UpdateSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', + 'headerParams' => [ + [ + 'keyName' => 'snapshot.name', + 'fieldAccessors' => [ + 'getSnapshot', + 'getName', + ], + ], + ], + ], + 'UpdateSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', + 'headerParams' => [ + [ + 'keyName' => 'subscription.name', + 'fieldAccessors' => [ + 'getSubscription', + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'deletedTopic' => '_deleted-topic_', + 'project' => 'projects/{project}', + 'projectTopic' => 'projects/{project}/topics/{topic}', + 'snapshot' => 'projects/{project}/snapshots/{snapshot}', + 'subscription' => 'projects/{project}/subscriptions/{subscription}', + 'topic' => 'projects/{project}/topics/{topic}', + ], + ], + ], +]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php new file mode 100644 index 00000000000..e39849a4274 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php @@ -0,0 +1,290 @@ + [ + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.pubsub.v1.Subscriber' => [ + 'Acknowledge' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:acknowledge', + 'body' => '*', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'CreateSnapshot' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{name=projects/*/snapshots/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateSubscription' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{name=projects/*/subscriptions/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSnapshot' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{snapshot=projects/*/snapshots/*}', + 'placeholders' => [ + 'snapshot' => [ + 'getters' => [ + 'getSnapshot', + ], + ], + ], + ], + 'DeleteSubscription' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'GetSnapshot' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{snapshot=projects/*/snapshots/*}', + 'placeholders' => [ + 'snapshot' => [ + 'getters' => [ + 'getSnapshot', + ], + ], + ], + ], + 'GetSubscription' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'ListSnapshots' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{project=projects/*}/snapshots', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListSubscriptions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{project=projects/*}/subscriptions', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ModifyAckDeadline' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline', + 'body' => '*', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'ModifyPushConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig', + 'body' => '*', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'Pull' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:pull', + 'body' => '*', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'Seek' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:seek', + 'body' => '*', + 'placeholders' => [ + 'subscription' => [ + 'getters' => [ + 'getSubscription', + ], + ], + ], + ], + 'UpdateSnapshot' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{snapshot.name=projects/*/snapshots/*}', + 'body' => '*', + 'placeholders' => [ + 'snapshot.name' => [ + 'getters' => [ + 'getSnapshot', + 'getName', + ], + ], + ], + ], + 'UpdateSubscription' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{subscription.name=projects/*/subscriptions/*}', + 'body' => '*', + 'placeholders' => [ + 'subscription.name' => [ + 'getters' => [ + 'getSubscription', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php new file mode 100644 index 00000000000..a14d598012b --- /dev/null +++ b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php @@ -0,0 +1,941 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublisherClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublisherClient($options); + } + + /** @test */ + public function createTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName2 = 'kmsKeyName2-1057489140'; + $satisfiesPzs2 = true; + $expectedResponse = new Topic(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName2); + $expectedResponse->setSatisfiesPzs($satisfiesPzs2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new Topic()) + ->setName($name); + $response = $gapicClient->createTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/CreateTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTopicExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new Topic()) + ->setName($name); + try { + $gapicClient->createTopic($request); + // 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 deleteTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new DeleteTopicRequest()) + ->setTopic($formattedTopic); + $gapicClient->deleteTopic($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/DeleteTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTopicExceptionTest() + { + $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 + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new DeleteTopicRequest()) + ->setTopic($formattedTopic); + try { + $gapicClient->deleteTopic($request); + // 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 detachSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DetachSubscriptionResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new DetachSubscriptionRequest()) + ->setSubscription($formattedSubscription); + $response = $gapicClient->detachSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/DetachSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function detachSubscriptionExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new DetachSubscriptionRequest()) + ->setSubscription($formattedSubscription); + try { + $gapicClient->detachSubscription($request); + // 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 getTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $expectedResponse = new Topic(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new GetTopicRequest()) + ->setTopic($formattedTopic); + $response = $gapicClient->getTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/GetTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTopicExceptionTest() + { + $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 + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new GetTopicRequest()) + ->setTopic($formattedTopic); + try { + $gapicClient->getTopic($request); + // 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 listTopicSnapshotsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snapshotsElement = 'snapshotsElement1339034092'; + $snapshots = [ + $snapshotsElement, + ]; + $expectedResponse = new ListTopicSnapshotsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnapshots($snapshots); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new ListTopicSnapshotsRequest()) + ->setTopic($formattedTopic); + $response = $gapicClient->listTopicSnapshots($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/ListTopicSnapshots', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTopicSnapshotsExceptionTest() + { + $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 + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new ListTopicSnapshotsRequest()) + ->setTopic($formattedTopic); + try { + $gapicClient->listTopicSnapshots($request); + // 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 listTopicSubscriptionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $subscriptionsElement = 'subscriptionsElement1698708147'; + $subscriptions = [ + $subscriptionsElement, + ]; + $expectedResponse = new ListTopicSubscriptionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSubscriptions($subscriptions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new ListTopicSubscriptionsRequest()) + ->setTopic($formattedTopic); + $response = $gapicClient->listTopicSubscriptions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSubscriptions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/ListTopicSubscriptions', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTopicSubscriptionsExceptionTest() + { + $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 + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new ListTopicSubscriptionsRequest()) + ->setTopic($formattedTopic); + try { + $gapicClient->listTopicSubscriptions($request); + // 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 listTopicsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $topicsElement = new Topic(); + $topics = [ + $topicsElement, + ]; + $expectedResponse = new ListTopicsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTopics($topics); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListTopicsRequest()) + ->setProject($formattedProject); + $response = $gapicClient->listTopics($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTopics()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/ListTopics', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($formattedProject, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTopicsExceptionTest() + { + $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 + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListTopicsRequest()) + ->setProject($formattedProject); + try { + $gapicClient->listTopics($request); + // 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 publishTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PublishResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $messages = []; + $request = (new PublishRequest()) + ->setTopic($formattedTopic) + ->setMessages($messages); + $response = $gapicClient->publish($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/Publish', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $actualValue = $actualRequestObject->getMessages(); + $this->assertProtobufEquals($messages, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function publishExceptionTest() + { + $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 + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $messages = []; + $request = (new PublishRequest()) + ->setTopic($formattedTopic) + ->setMessages($messages); + try { + $gapicClient->publish($request); + // 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 updateTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $expectedResponse = new Topic(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $topic = new Topic(); + $topicName = 'topicName388205658'; + $topic->setName($topicName); + $updateMask = new FieldMask(); + $request = (new UpdateTopicRequest()) + ->setTopic($topic) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/UpdateTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($topic, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTopicExceptionTest() + { + $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 + $topic = new Topic(); + $topicName = 'topicName388205658'; + $topic->setName($topicName); + $updateMask = new FieldMask(); + $request = (new UpdateTopicRequest()) + ->setTopic($topic) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateTopic($request); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 createTopicAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName2 = 'kmsKeyName2-1057489140'; + $satisfiesPzs2 = true; + $expectedResponse = new Topic(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName2); + $expectedResponse->setSatisfiesPzs($satisfiesPzs2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new Topic()) + ->setName($name); + $response = $gapicClient->createTopicAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Publisher/CreateTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php new file mode 100644 index 00000000000..cb6a7fbd721 --- /dev/null +++ b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php @@ -0,0 +1,1037 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SchemaServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SchemaServiceClient($options); + } + + /** @test */ + public function commitSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $definition = 'definition-1014418093'; + $revisionId = 'revisionId513861631'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name2); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new CommitSchemaRequest()) + ->setName($formattedName) + ->setSchema($schema); + $response = $gapicClient->commitSchema($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/CommitSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getSchema(); + $this->assertProtobufEquals($schema, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitSchemaExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new CommitSchemaRequest()) + ->setName($formattedName) + ->setSchema($schema); + try { + $gapicClient->commitSchema($request); + // 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 createSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $definition = 'definition-1014418093'; + $revisionId = 'revisionId513861631'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new CreateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + $response = $gapicClient->createSchema($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/CreateSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSchema(); + $this->assertProtobufEquals($schema, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSchemaExceptionTest() + { + $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->projectName('[PROJECT]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new CreateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + try { + $gapicClient->createSchema($request); + // 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 deleteSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new DeleteSchemaRequest()) + ->setName($formattedName); + $gapicClient->deleteSchema($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/DeleteSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSchemaExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new DeleteSchemaRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSchema($request); + // 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 deleteSchemaRevisionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $definition = 'definition-1014418093'; + $revisionId2 = 'revisionId2-100208654'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name2); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = 'revisionId513861631'; + $request = (new DeleteSchemaRevisionRequest()) + ->setName($formattedName) + ->setRevisionId($revisionId); + $response = $gapicClient->deleteSchemaRevision($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/DeleteSchemaRevision', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getRevisionId(); + $this->assertProtobufEquals($revisionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSchemaRevisionExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = 'revisionId513861631'; + $request = (new DeleteSchemaRevisionRequest()) + ->setName($formattedName) + ->setRevisionId($revisionId); + try { + $gapicClient->deleteSchemaRevision($request); + // 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 getSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $definition = 'definition-1014418093'; + $revisionId = 'revisionId513861631'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name2); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new GetSchemaRequest()) + ->setName($formattedName); + $response = $gapicClient->getSchema($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/GetSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSchemaExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new GetSchemaRequest()) + ->setName($formattedName); + try { + $gapicClient->getSchema($request); + // 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 listSchemaRevisionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $schemasElement = new Schema(); + $schemas = [ + $schemasElement, + ]; + $expectedResponse = new ListSchemaRevisionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSchemas($schemas); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new ListSchemaRevisionsRequest()) + ->setName($formattedName); + $response = $gapicClient->listSchemaRevisions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSchemas()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/ListSchemaRevisions', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSchemaRevisionsExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $request = (new ListSchemaRevisionsRequest()) + ->setName($formattedName); + try { + $gapicClient->listSchemaRevisions($request); + // 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 listSchemasTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $schemasElement = new Schema(); + $schemas = [ + $schemasElement, + ]; + $expectedResponse = new ListSchemasResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSchemas($schemas); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSchemasRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSchemas($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSchemas()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/ListSchemas', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSchemasExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ListSchemasRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSchemas($request); + // 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 rollbackSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $definition = 'definition-1014418093'; + $revisionId2 = 'revisionId2-100208654'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name2); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = 'revisionId513861631'; + $request = (new RollbackSchemaRequest()) + ->setName($formattedName) + ->setRevisionId($revisionId); + $response = $gapicClient->rollbackSchema($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/RollbackSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getRevisionId(); + $this->assertProtobufEquals($revisionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackSchemaExceptionTest() + { + $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->schemaName('[PROJECT]', '[SCHEMA]'); + $revisionId = 'revisionId513861631'; + $request = (new RollbackSchemaRequest()) + ->setName($formattedName) + ->setRevisionId($revisionId); + try { + $gapicClient->rollbackSchema($request); + // 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 validateMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ValidateMessageResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ValidateMessageRequest()) + ->setParent($formattedParent); + $response = $gapicClient->validateMessage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/ValidateMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateMessageExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ValidateMessageRequest()) + ->setParent($formattedParent); + try { + $gapicClient->validateMessage($request); + // 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 validateSchemaTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ValidateSchemaResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new ValidateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + $response = $gapicClient->validateSchema($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/ValidateSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSchema(); + $this->assertProtobufEquals($schema, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateSchemaExceptionTest() + { + $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->projectName('[PROJECT]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new ValidateSchemaRequest()) + ->setParent($formattedParent) + ->setSchema($schema); + try { + $gapicClient->validateSchema($request); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 commitSchemaAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $definition = 'definition-1014418093'; + $revisionId = 'revisionId513861631'; + $expectedResponse = new Schema(); + $expectedResponse->setName($name2); + $expectedResponse->setDefinition($definition); + $expectedResponse->setRevisionId($revisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); + $schema = new Schema(); + $schemaName = 'schemaName-448762932'; + $schema->setName($schemaName); + $request = (new CommitSchemaRequest()) + ->setName($formattedName) + ->setSchema($schema); + $response = $gapicClient->commitSchemaAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.SchemaService/CommitSchema', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getSchema(); + $this->assertProtobufEquals($schema, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php new file mode 100644 index 00000000000..cb8d2dee95a --- /dev/null +++ b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php @@ -0,0 +1,1494 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SubscriberClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SubscriberClient($options); + } + + /** @test */ + public function acknowledgeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIds = []; + $request = (new AcknowledgeRequest()) + ->setSubscription($formattedSubscription) + ->setAckIds($ackIds); + $gapicClient->acknowledge($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/Acknowledge', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $actualValue = $actualRequestObject->getAckIds(); + $this->assertProtobufEquals($ackIds, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acknowledgeExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIds = []; + $request = (new AcknowledgeRequest()) + ->setSubscription($formattedSubscription) + ->setAckIds($ackIds); + try { + $gapicClient->acknowledge($request); + // 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 createSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $topic = 'topic110546223'; + $expectedResponse = new Snapshot(); + $expectedResponse->setName($name2); + $expectedResponse->setTopic($topic); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new CreateSnapshotRequest()) + ->setName($formattedName) + ->setSubscription($formattedSubscription); + $response = $gapicClient->createSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/CreateSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSnapshotExceptionTest() + { + $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->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new CreateSnapshotRequest()) + ->setName($formattedName) + ->setSubscription($formattedSubscription); + try { + $gapicClient->createSnapshot($request); + // 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 createSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $topic2 = 'topic2-1139259102'; + $ackDeadlineSeconds2 = 921632575; + $retainAckedMessages2 = true; + $enableMessageOrdering2 = false; + $filter2 = 'filter2-721168085'; + $detached2 = false; + $enableExactlyOnceDelivery2 = true; + $expectedResponse = new Subscription(); + $expectedResponse->setName($name2); + $expectedResponse->setTopic($topic2); + $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds2); + $expectedResponse->setRetainAckedMessages($retainAckedMessages2); + $expectedResponse->setEnableMessageOrdering($enableMessageOrdering2); + $expectedResponse->setFilter($filter2); + $expectedResponse->setDetached($detached2); + $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new Subscription()) + ->setName($name) + ->setTopic($formattedTopic); + $response = $gapicClient->createSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/CreateSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($formattedTopic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSubscriptionExceptionTest() + { + $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 + $name = 'name3373707'; + $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $request = (new Subscription()) + ->setName($name) + ->setTopic($formattedTopic); + try { + $gapicClient->createSubscription($request); + // 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 deleteSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $request = (new DeleteSnapshotRequest()) + ->setSnapshot($formattedSnapshot); + $gapicClient->deleteSnapshot($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/DeleteSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getSnapshot(); + $this->assertProtobufEquals($formattedSnapshot, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSnapshotExceptionTest() + { + $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 + $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $request = (new DeleteSnapshotRequest()) + ->setSnapshot($formattedSnapshot); + try { + $gapicClient->deleteSnapshot($request); + // 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 deleteSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new DeleteSubscriptionRequest()) + ->setSubscription($formattedSubscription); + $gapicClient->deleteSubscription($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/DeleteSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSubscriptionExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new DeleteSubscriptionRequest()) + ->setSubscription($formattedSubscription); + try { + $gapicClient->deleteSubscription($request); + // 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 getSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $topic = 'topic110546223'; + $expectedResponse = new Snapshot(); + $expectedResponse->setName($name); + $expectedResponse->setTopic($topic); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $request = (new GetSnapshotRequest()) + ->setSnapshot($formattedSnapshot); + $response = $gapicClient->getSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/GetSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getSnapshot(); + $this->assertProtobufEquals($formattedSnapshot, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnapshotExceptionTest() + { + $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 + $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); + $request = (new GetSnapshotRequest()) + ->setSnapshot($formattedSnapshot); + try { + $gapicClient->getSnapshot($request); + // 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 getSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $topic = 'topic110546223'; + $ackDeadlineSeconds = 2135351438; + $retainAckedMessages = false; + $enableMessageOrdering = true; + $filter = 'filter-1274492040'; + $detached = true; + $enableExactlyOnceDelivery = false; + $expectedResponse = new Subscription(); + $expectedResponse->setName($name); + $expectedResponse->setTopic($topic); + $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds); + $expectedResponse->setRetainAckedMessages($retainAckedMessages); + $expectedResponse->setEnableMessageOrdering($enableMessageOrdering); + $expectedResponse->setFilter($filter); + $expectedResponse->setDetached($detached); + $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new GetSubscriptionRequest()) + ->setSubscription($formattedSubscription); + $response = $gapicClient->getSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/GetSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSubscriptionExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new GetSubscriptionRequest()) + ->setSubscription($formattedSubscription); + try { + $gapicClient->getSubscription($request); + // 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 listSnapshotsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snapshotsElement = new Snapshot(); + $snapshots = [ + $snapshotsElement, + ]; + $expectedResponse = new ListSnapshotsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnapshots($snapshots); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSnapshotsRequest()) + ->setProject($formattedProject); + $response = $gapicClient->listSnapshots($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/ListSnapshots', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($formattedProject, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnapshotsExceptionTest() + { + $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 + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSnapshotsRequest()) + ->setProject($formattedProject); + try { + $gapicClient->listSnapshots($request); + // 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 listSubscriptionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $subscriptionsElement = new Subscription(); + $subscriptions = [ + $subscriptionsElement, + ]; + $expectedResponse = new ListSubscriptionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSubscriptions($subscriptions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSubscriptionsRequest()) + ->setProject($formattedProject); + $response = $gapicClient->listSubscriptions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSubscriptions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/ListSubscriptions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($formattedProject, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubscriptionsExceptionTest() + { + $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 + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSubscriptionsRequest()) + ->setProject($formattedProject); + try { + $gapicClient->listSubscriptions($request); + // 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 modifyAckDeadlineTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIds = []; + $ackDeadlineSeconds = 2135351438; + $request = (new ModifyAckDeadlineRequest()) + ->setSubscription($formattedSubscription) + ->setAckIds($ackIds) + ->setAckDeadlineSeconds($ackDeadlineSeconds); + $gapicClient->modifyAckDeadline($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/ModifyAckDeadline', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $actualValue = $actualRequestObject->getAckIds(); + $this->assertProtobufEquals($ackIds, $actualValue); + $actualValue = $actualRequestObject->getAckDeadlineSeconds(); + $this->assertProtobufEquals($ackDeadlineSeconds, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function modifyAckDeadlineExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIds = []; + $ackDeadlineSeconds = 2135351438; + $request = (new ModifyAckDeadlineRequest()) + ->setSubscription($formattedSubscription) + ->setAckIds($ackIds) + ->setAckDeadlineSeconds($ackDeadlineSeconds); + try { + $gapicClient->modifyAckDeadline($request); + // 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 modifyPushConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $pushConfig = new PushConfig(); + $request = (new ModifyPushConfigRequest()) + ->setSubscription($formattedSubscription) + ->setPushConfig($pushConfig); + $gapicClient->modifyPushConfig($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/ModifyPushConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $actualValue = $actualRequestObject->getPushConfig(); + $this->assertProtobufEquals($pushConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function modifyPushConfigExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $pushConfig = new PushConfig(); + $request = (new ModifyPushConfigRequest()) + ->setSubscription($formattedSubscription) + ->setPushConfig($pushConfig); + try { + $gapicClient->modifyPushConfig($request); + // 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 pullTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PullResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $maxMessages = 496131527; + $request = (new PullRequest()) + ->setSubscription($formattedSubscription) + ->setMaxMessages($maxMessages); + $response = $gapicClient->pull($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/Pull', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $actualValue = $actualRequestObject->getMaxMessages(); + $this->assertProtobufEquals($maxMessages, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pullExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $maxMessages = 496131527; + $request = (new PullRequest()) + ->setSubscription($formattedSubscription) + ->setMaxMessages($maxMessages); + try { + $gapicClient->pull($request); + // 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 seekTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SeekResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new SeekRequest()) + ->setSubscription($formattedSubscription); + $response = $gapicClient->seek($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/Seek', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function seekExceptionTest() + { + $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 + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $request = (new SeekRequest()) + ->setSubscription($formattedSubscription); + try { + $gapicClient->seek($request); + // 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 streamingPullTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new StreamingPullResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new StreamingPullResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new StreamingPullResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $streamAckDeadlineSeconds = 1875467245; + $request = new StreamingPullRequest(); + $request->setSubscription($formattedSubscription); + $request->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds); + $formattedSubscription2 = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $streamAckDeadlineSeconds2 = 1562238880; + $request2 = new StreamingPullRequest(); + $request2->setSubscription($formattedSubscription2); + $request2->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds2); + $formattedSubscription3 = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $streamAckDeadlineSeconds3 = 1562238879; + $request3 = new StreamingPullRequest(); + $request3->setSubscription($formattedSubscription3); + $request3->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds3); + $bidi = $gapicClient->streamingPull(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/StreamingPull', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingPullExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $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->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingPull(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream 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 updateSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $topic = 'topic110546223'; + $expectedResponse = new Snapshot(); + $expectedResponse->setName($name); + $expectedResponse->setTopic($topic); + $transport->addResponse($expectedResponse); + // Mock request + $snapshot = new Snapshot(); + $updateMask = new FieldMask(); + $request = (new UpdateSnapshotRequest()) + ->setSnapshot($snapshot) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/UpdateSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSnapshotExceptionTest() + { + $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 + $snapshot = new Snapshot(); + $updateMask = new FieldMask(); + $request = (new UpdateSnapshotRequest()) + ->setSnapshot($snapshot) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSnapshot($request); + // 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 updateSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $topic = 'topic110546223'; + $ackDeadlineSeconds = 2135351438; + $retainAckedMessages = false; + $enableMessageOrdering = true; + $filter = 'filter-1274492040'; + $detached = true; + $enableExactlyOnceDelivery = false; + $expectedResponse = new Subscription(); + $expectedResponse->setName($name); + $expectedResponse->setTopic($topic); + $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds); + $expectedResponse->setRetainAckedMessages($retainAckedMessages); + $expectedResponse->setEnableMessageOrdering($enableMessageOrdering); + $expectedResponse->setFilter($filter); + $expectedResponse->setDetached($detached); + $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery); + $transport->addResponse($expectedResponse); + // Mock request + $subscription = new Subscription(); + $subscriptionName = 'subscriptionName-515935928'; + $subscription->setName($subscriptionName); + $subscriptionTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $subscription->setTopic($subscriptionTopic); + $updateMask = new FieldMask(); + $request = (new UpdateSubscriptionRequest()) + ->setSubscription($subscription) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/UpdateSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($subscription, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSubscriptionExceptionTest() + { + $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 + $subscription = new Subscription(); + $subscriptionName = 'subscriptionName-515935928'; + $subscription->setName($subscriptionName); + $subscriptionTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); + $subscription->setTopic($subscriptionTopic); + $updateMask = new FieldMask(); + $request = (new UpdateSubscriptionRequest()) + ->setSubscription($subscription) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSubscription($request); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 acknowledgeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); + $ackIds = []; + $request = (new AcknowledgeRequest()) + ->setSubscription($formattedSubscription) + ->setAckIds($ackIds); + $gapicClient->acknowledgeAsync($request)->wait(); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.pubsub.v1.Subscriber/Acknowledge', $actualFuncCall); + $actualValue = $actualRequestObject->getSubscription(); + $this->assertProtobufEquals($formattedSubscription, $actualValue); + $actualValue = $actualRequestObject->getAckIds(); + $this->assertProtobufEquals($ackIds, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php b/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php new file mode 100644 index 00000000000..42123bf06e8 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php @@ -0,0 +1,78 @@ +internalAddGeneratedFile( + ' +�" ++google/api/cloudquotas/v1/cloudquotas.protogoogle.api.cloudquotas.v1google/api/client.proto)google/api/cloudquotas/v1/resources.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/protobuf/field_mask.proto"� +ListQuotaInfosRequest< +parent ( B,�A�A&$cloudquotas.googleapis.com/QuotaInfo + page_size (B�A + +page_token ( B�A"l +ListQuotaInfosResponse9 + quota_infos ( 2$.google.api.cloudquotas.v1.QuotaInfo +next_page_token ( "Q +GetQuotaInfoRequest: +name ( B,�A�A& +$cloudquotas.googleapis.com/QuotaInfo"� +ListQuotaPreferencesRequestB +parent ( B2�A�A,*cloudquotas.googleapis.com/QuotaPreference + page_size (B�A + +page_token ( B�A +filter ( B�A +order_by ( B�A"� +ListQuotaPreferencesResponseE +quota_preferences ( 2*.google.api.cloudquotas.v1.QuotaPreference +next_page_token (  + unreachable ( "] +GetQuotaPreferenceRequest@ +name ( B2�A�A, +*cloudquotas.googleapis.com/QuotaPreference"� +CreateQuotaPreferenceRequestB +parent ( B2�A�A,*cloudquotas.googleapis.com/QuotaPreference +quota_preference_id ( B�AI +quota_preference ( 2*.google.api.cloudquotas.v1.QuotaPreferenceB�AI +ignore_safety_checks (2+.google.api.cloudquotas.v1.QuotaSafetyCheck"� +UpdateQuotaPreferenceRequest4 + update_mask ( 2.google.protobuf.FieldMaskB�AI +quota_preference ( 2*.google.api.cloudquotas.v1.QuotaPreferenceB�A + allow_missing (B�A + validate_only (B�AI +ignore_safety_checks (2+.google.api.cloudquotas.v1.QuotaSafetyCheck2� + CloudQuotas� +ListQuotaInfos0.google.api.cloudquotas.v1.ListQuotaInfosRequest1.google.api.cloudquotas.v1.ListQuotaInfosResponse"��Aparent����9/v1/{parent=projects/*/locations/*/services/*}/quotaInfosZ@>/v1/{parent=organizations/*/locations/*/services/*}/quotaInfosZ:8/v1/{parent=folders/*/locations/*/services/*}/quotaInfos� + GetQuotaInfo..google.api.cloudquotas.v1.GetQuotaInfoRequest$.google.api.cloudquotas.v1.QuotaInfo"��Aname����9/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}Z@>/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}Z:8/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}� +ListQuotaPreferences6.google.api.cloudquotas.v1.ListQuotaPreferencesRequest7.google.api.cloudquotas.v1.ListQuotaPreferencesResponse"��Aparent����4/v1/{parent=projects/*/locations/*}/quotaPreferencesZ53/v1/{parent=folders/*/locations/*}/quotaPreferencesZ;9/v1/{parent=organizations/*/locations/*}/quotaPreferences� +GetQuotaPreference4.google.api.cloudquotas.v1.GetQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��Aname����4/v1/{name=projects/*/locations/*/quotaPreferences/*}Z;9/v1/{name=organizations/*/locations/*/quotaPreferences/*}Z53/v1/{name=folders/*/locations/*/quotaPreferences/*}� +CreateQuotaPreference7.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��A+parent,quota_preference,quota_preference_id�Aparent,quota_preference����"4/v1/{parent=projects/*/locations/*}/quotaPreferences:quota_preferenceZG"3/v1/{parent=folders/*/locations/*}/quotaPreferences:quota_preferenceZM"9/v1/{parent=organizations/*/locations/*}/quotaPreferences:quota_preference� +UpdateQuotaPreference7.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��Aquota_preference,update_mask����2E/v1/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}:quota_preferenceZX2D/v1/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}:quota_preferenceZ^2J/v1/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}:quota_preferenceN�Acloudquotas.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.api.cloudquotas.v1BCloudquotasProtoPZAcloud.google.com/go/cloudquotas/apiv1/cloudquotaspb;cloudquotaspb�Google.Cloud.CloudQuotas.V1�Google\\Cloud\\CloudQuotas\\V1�Google::Cloud::CloudQuotas::V1�A� +"cloudquotas.googleapis.com/Service:projects/{project}/locations/{location}/services/{service}8folders/{folder}/locations/{location}/services/{service}Dorganizations/{organization}/locations/{location}/services/{service}�A� +#cloudquotas.googleapis.com/Location\'projects/{project}/locations/{location}%folders/{folder}/locations/{location}1organizations/{organization}/locations/{location}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php b/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..9f2589e17b500e7021afaf1b8516d5900e053203 GIT binary patch literal 4114 zcmbtXUvt~W5idzuqL%u@z)lL&t&6Z8Th1iph{-f59k&CK5CumeXcCmiE@v=HMkG`m|1_X32`h@yG?cbsDq2%F-$&KRpM(yn zD`VduyQFFdwCcG2Wcba*kL{>>wp$H}kcleXDu8F7k|?kpqO>}DUy|4!+Oa)oaRUQ2 zpo7NDz~E^234r6;QKWQJL+~0D{0k<>E_IYBwqyKxKqHHKG^VyozeP`;DkIyC2x?!I z9ZftZroN{z1;ca5&SOQ`WU>zeA3cAnq(|zoU|=8yx)+nsv)w_HL{3P9*bh4>TCa~u zJPjdR*?F97%goV{vLnt|uU|RjQzZ^3WPW!=2}wK&y(j$K%)rI;X>d)z_9=0Pd*sAE zqkdSg&%Bx$xlT0=>hfCCaF`VH7~7}8&(M7l+Cf0V=%-bA20r=|P2#N%htu%xBMf(@ z0b${J1V7$|$4lc+x+_F02-V6QR4Zq@rQ{PwaSB_3+S2cm4LF7o4AnUGJ`uRTDDcwG&hnKlSUn|iNF6!H-?w2cBHY44zt6cgSY&pIc+Z5~Eiq8Wgui^Su ztyZ}<7?tT^D~(juL`?~I9-{AFgas7Ic_oJq+=JWVxYm$Hfoq>z+`DzYc?l%p-KB59 zzuksHqBy})lnZ?E1(cF-cuq*{h*-p>V|q+o8lTG>C{w6?eDleLt~OI;amJvH=-
!RF=Q-iK1dXq&3u*1DGYvZGo3cCVu~^nG1x7JnrbV6D?No@ouU zn88G>?i+_qty|2ZYa2$lrMC4~s;L|8Vy^x}_Ko^|79PxFTx1)OA61ajtJ4%qUBvZQ z#EGNo>*VR8>iP~cD<--6I(@vTCLZBh@^n$@Rfdb2VOe{w2oKg$5Qff5i{mQiKF|8canglq& zBwCDam(aR1qjN^Y>*7%F&b5L3Y*~f^(mb*Y@}D=B8FA*t=14qWO`@2NsHoJ0KTEKQ z;<4?-7CE)4%PEuZu~OQF?S+^kr{umS=SeHtgj?7)CPeh1diJwS{W~O*e`Vo=n}}qV zHtCCH>4fKTrZ{DgU<#-UNnegfmNC_zCk)(d{`DIESi)@i-#I8eXT4oO3=3#mI1rMd zCBn%XeNLqLE^M%QkXS>6AZCYme38&kVRIbX*t=6T*8K~$dsk41qv#(#Ibw-Qk&ur= z9I4p^!3PAf{2U6l=i$LPk0Yj8XZtj@c69<0O<#CXQD>Ud;>$=lN~GP)53wtIe8kwQ zeYB)igDdglm1<{YE%F^QTI0~@H!bX>J>yUlB&YUG!%~~i z`aP3#*P9G%%_@QS@h>ltRfY%ak8g47vic%dNuR-*$Z*6{T&N8my~P;EPm?1eLIB;t z`513E_OVN>wEITLbU1DOj2bTg1vV~iFfDVAOX+ji2z?i?T``}5mSEJb5NB~KKZL^E ztMqHw_Pw!>TxBIjIk)6L_&XH&A$s#H4e1K7Yhvx zhaw@<)EcbAY1W>0XuJ@e3A6hU$_w8+TDPI$7=?|?Gz@HBt%G8A@4p%NEsj0cCt+_Z zy$(ekcIoS6Ua6e*QWZ8djr~hETr48Igoogle.api.cloudquotas.v1.CreateQuotaPreferenceRequest + */ +class CreateQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * Example: + * `projects/123/locations/global` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * + * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $quota_preference_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $quota_preference = null; + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + */ + private $ignore_safety_checks; + + /** + * @param string $parent Required. Value for parent. + * + * Example: + * `projects/123/locations/global` + * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. + * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being created + * @param string $quotaPreferenceId Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * + * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference, string $quotaPreferenceId): self + { + return (new self()) + ->setParent($parent) + ->setQuotaPreference($quotaPreference) + ->setQuotaPreferenceId($quotaPreferenceId); + } + + /** + * @param string $parent Required. Value for parent. + * + * Example: + * `projects/123/locations/global` + * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. + * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being created + * + * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest + * + * @experimental + */ + public static function buildFromParentQuotaPreference(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference): self + { + return (new self()) + ->setParent($parent) + ->setQuotaPreference($quotaPreference); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * Example: + * `projects/123/locations/global` + * @type string $quota_preference_id + * Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * @type \Google\Cloud\CloudQuotas\V1\QuotaPreference $quota_preference + * Required. The resource being created + * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_safety_checks + * The list of quota safety checks to be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * Example: + * `projects/123/locations/global` + * + * 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. Value for parent. + * Example: + * `projects/123/locations/global` + * + * 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. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * + * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuotaPreferenceId() + { + return $this->quota_preference_id; + } + + /** + * Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * + * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuotaPreferenceId($var) + { + GPBUtil::checkString($var, True); + $this->quota_preference_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\CloudQuotas\V1\QuotaPreference|null + */ + public function getQuotaPreference() + { + return $this->quota_preference; + } + + public function hasQuotaPreference() + { + return isset($this->quota_preference); + } + + public function clearQuotaPreference() + { + unset($this->quota_preference); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $var + * @return $this + */ + public function setQuotaPreference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); + $this->quota_preference = $var; + + return $this; + } + + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoreSafetyChecks() + { + return $this->ignore_safety_checks; + } + + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoreSafetyChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\CloudQuotas\V1\QuotaSafetyCheck::class); + $this->ignore_safety_checks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php new file mode 100644 index 00000000000..e762ea504de --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php @@ -0,0 +1,186 @@ +google.api.cloudquotas.v1.DimensionsInfo + */ +class DimensionsInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The map of dimensions for this dimensions info. The key of a map entry + * is "region", "zone" or the name of a service specific dimension, and the + * value of a map entry is the value of the dimension. If a dimension does + * not appear in the map of dimensions, the dimensions info applies to all + * the dimension values except for those that have another DimenisonInfo + * instance configured for the specific value. + * Example: {"provider" : "Foo Inc"} where "provider" is a service specific + * dimension of a quota. + * + * Generated from protobuf field map dimensions = 1; + */ + private $dimensions; + /** + * Quota details for the specified dimensions. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + protected $details = null; + /** + * The applicable regions or zones of this dimensions info. The field will be + * set to ['global'] for quotas that are not per region or per zone. + * Otherwise, it will be set to the list of locations this dimension info is + * applicable to. + * + * Generated from protobuf field repeated string applicable_locations = 3; + */ + private $applicable_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $dimensions + * The map of dimensions for this dimensions info. The key of a map entry + * is "region", "zone" or the name of a service specific dimension, and the + * value of a map entry is the value of the dimension. If a dimension does + * not appear in the map of dimensions, the dimensions info applies to all + * the dimension values except for those that have another DimenisonInfo + * instance configured for the specific value. + * Example: {"provider" : "Foo Inc"} where "provider" is a service specific + * dimension of a quota. + * @type \Google\Cloud\CloudQuotas\V1\QuotaDetails $details + * Quota details for the specified dimensions. + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_locations + * The applicable regions or zones of this dimensions info. The field will be + * set to ['global'] for quotas that are not per region or per zone. + * Otherwise, it will be set to the list of locations this dimension info is + * applicable to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The map of dimensions for this dimensions info. The key of a map entry + * is "region", "zone" or the name of a service specific dimension, and the + * value of a map entry is the value of the dimension. If a dimension does + * not appear in the map of dimensions, the dimensions info applies to all + * the dimension values except for those that have another DimenisonInfo + * instance configured for the specific value. + * Example: {"provider" : "Foo Inc"} where "provider" is a service specific + * dimension of a quota. + * + * Generated from protobuf field map dimensions = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * The map of dimensions for this dimensions info. The key of a map entry + * is "region", "zone" or the name of a service specific dimension, and the + * value of a map entry is the value of the dimension. If a dimension does + * not appear in the map of dimensions, the dimensions info applies to all + * the dimension values except for those that have another DimenisonInfo + * instance configured for the specific value. + * Example: {"provider" : "Foo Inc"} where "provider" is a service specific + * dimension of a quota. + * + * Generated from protobuf field map dimensions = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->dimensions = $arr; + + return $this; + } + + /** + * Quota details for the specified dimensions. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; + * @return \Google\Cloud\CloudQuotas\V1\QuotaDetails|null + */ + public function getDetails() + { + return $this->details; + } + + public function hasDetails() + { + return isset($this->details); + } + + public function clearDetails() + { + unset($this->details); + } + + /** + * Quota details for the specified dimensions. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; + * @param \Google\Cloud\CloudQuotas\V1\QuotaDetails $var + * @return $this + */ + public function setDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaDetails::class); + $this->details = $var; + + return $this; + } + + /** + * The applicable regions or zones of this dimensions info. The field will be + * set to ['global'] for quotas that are not per region or per zone. + * Otherwise, it will be set to the list of locations this dimension info is + * applicable to. + * + * Generated from protobuf field repeated string applicable_locations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableLocations() + { + return $this->applicable_locations; + } + + /** + * The applicable regions or zones of this dimensions info. The field will be + * set to ['global'] for quotas that are not per region or per zone. + * Otherwise, it will be set to the list of locations this dimension info is + * applicable to. + * + * Generated from protobuf field repeated string applicable_locations = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_locations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php new file mode 100644 index 00000000000..d28953dfb23 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php @@ -0,0 +1,92 @@ +google.api.cloudquotas.v1.GetQuotaInfoRequest + */ +class GetQuotaInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the quota info. + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the quota info. + * + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * Please see {@see CloudQuotasClient::quotaInfoName()} for help formatting this field. + * + * @return \Google\Cloud\CloudQuotas\V1\GetQuotaInfoRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the quota info. + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the quota info. + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * 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 resource name of the quota info. + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php new file mode 100644 index 00000000000..d4e3772f568 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php @@ -0,0 +1,92 @@ +google.api.cloudquotas.v1.GetQuotaPreferenceRequest + */ +class GetQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * Please see {@see CloudQuotasClient::quotaPreferenceName()} for help formatting this field. + * + * @return \Google\Cloud\CloudQuotas\V1\GetQuotaPreferenceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * + * 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. Name of the resource + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * + * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php new file mode 100644 index 00000000000..1620a7795fd --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php @@ -0,0 +1,184 @@ +google.api.cloudquotas.v1.ListQuotaInfosRequest + */ +class ListQuotaInfosRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * Please see {@see CloudQuotasClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\CloudQuotas\V1\ListQuotaInfosRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * + * 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. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php new file mode 100644 index 00000000000..0eefa66e027 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php @@ -0,0 +1,105 @@ +google.api.cloudquotas.v1.ListQuotaInfosResponse + */ +class ListQuotaInfosResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of QuotaInfo + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + private $quota_infos; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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\CloudQuotas\V1\QuotaInfo>|\Google\Protobuf\Internal\RepeatedField $quota_infos + * The list of QuotaInfo + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * The list of QuotaInfo + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuotaInfos() + { + return $this->quota_infos; + } + + /** + * The list of QuotaInfo + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + * @param array<\Google\Cloud\CloudQuotas\V1\QuotaInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuotaInfos($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\QuotaInfo::class); + $this->quota_infos = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php new file mode 100644 index 00000000000..e657eb87622 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php @@ -0,0 +1,290 @@ +google.api.cloudquotas.v1.ListQuotaPreferencesRequest + */ +class ListQuotaPreferencesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * Example parents: + * `projects/123/locations/global` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * Example orders: + * `quota_id`, + * `service, create_time` + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * + * Example parents: + * `projects/123/locations/global` + * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\CloudQuotas\V1\ListQuotaPreferencesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * Example parents: + * `projects/123/locations/global` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * @type string $order_by + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * Example orders: + * `quota_id`, + * `service, create_time` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * Example parents: + * `projects/123/locations/global` + * + * 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. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * Example parents: + * `projects/123/locations/global` + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate 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. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filter result QuotaPreferences by their state, type, + * create/update time range. + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * + * 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; + } + + /** + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * Example orders: + * `quota_id`, + * `service, create_time` + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * Example orders: + * `quota_id`, + * `service, create_time` + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php new file mode 100644 index 00000000000..123679124c1 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php @@ -0,0 +1,139 @@ +google.api.cloudquotas.v1.ListQuotaPreferencesResponse + */ +class ListQuotaPreferencesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of QuotaPreference + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + private $quota_preferences; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\CloudQuotas\V1\QuotaPreference>|\Google\Protobuf\Internal\RepeatedField $quota_preferences + * The list of QuotaPreference + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * The list of QuotaPreference + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuotaPreferences() + { + return $this->quota_preferences; + } + + /** + * The list of QuotaPreference + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + * @param array<\Google\Cloud\CloudQuotas\V1\QuotaPreference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuotaPreferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); + $this->quota_preferences = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php new file mode 100644 index 00000000000..d1eadeec449 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php @@ -0,0 +1,302 @@ +google.api.cloudquotas.v1.QuotaConfig + */ +class QuotaConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The preferred value. Must be greater than or equal to -1. If set + * to -1, it means the value is "unlimited". + * + * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $preferred_value = 0; + /** + * Output only. Optional details about the state of this quota preference. + * + * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_detail = ''; + /** + * Output only. Granted quota value. + * + * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $granted_value = null; + /** + * Output only. The trace id that the Google Cloud uses to provision the + * requested quota. This trace id may be used by the client to contact Cloud + * support to track the state of a quota preference request. The trace id is + * only produced for increase requests and is unique for each request. The + * quota decrease requests do not have a trace id. + * + * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $trace_id = ''; + /** + * Optional. The annotations map for clients to store small amounts of + * arbitrary data. Do not put PII or other sensitive information here. See + * https://google.aip.dev/128#annotations + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. The origin of the quota preference request. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request_origin = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $preferred_value + * Required. The preferred value. Must be greater than or equal to -1. If set + * to -1, it means the value is "unlimited". + * @type string $state_detail + * Output only. Optional details about the state of this quota preference. + * @type \Google\Protobuf\Int64Value $granted_value + * Output only. Granted quota value. + * @type string $trace_id + * Output only. The trace id that the Google Cloud uses to provision the + * requested quota. This trace id may be used by the client to contact Cloud + * support to track the state of a quota preference request. The trace id is + * only produced for increase requests and is unique for each request. The + * quota decrease requests do not have a trace id. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. The annotations map for clients to store small amounts of + * arbitrary data. Do not put PII or other sensitive information here. See + * https://google.aip.dev/128#annotations + * @type int $request_origin + * Output only. The origin of the quota preference request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The preferred value. Must be greater than or equal to -1. If set + * to -1, it means the value is "unlimited". + * + * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getPreferredValue() + { + return $this->preferred_value; + } + + /** + * Required. The preferred value. Must be greater than or equal to -1. If set + * to -1, it means the value is "unlimited". + * + * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setPreferredValue($var) + { + GPBUtil::checkInt64($var); + $this->preferred_value = $var; + + return $this; + } + + /** + * Output only. Optional details about the state of this quota preference. + * + * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStateDetail() + { + return $this->state_detail; + } + + /** + * Output only. Optional details about the state of this quota preference. + * + * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStateDetail($var) + { + GPBUtil::checkString($var, True); + $this->state_detail = $var; + + return $this; + } + + /** + * Output only. Granted quota value. + * + * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getGrantedValue() + { + return $this->granted_value; + } + + public function hasGrantedValue() + { + return isset($this->granted_value); + } + + public function clearGrantedValue() + { + unset($this->granted_value); + } + + /** + * Returns the unboxed value from getGrantedValue() + + * Output only. Granted quota value. + * + * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string|null + */ + public function getGrantedValueUnwrapped() + { + return $this->readWrapperValue("granted_value"); + } + + /** + * Output only. Granted quota value. + * + * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setGrantedValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->granted_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Output only. Granted quota value. + * + * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string|null $var + * @return $this + */ + public function setGrantedValueUnwrapped($var) + { + $this->writeWrapperValue("granted_value", $var); + return $this;} + + /** + * Output only. The trace id that the Google Cloud uses to provision the + * requested quota. This trace id may be used by the client to contact Cloud + * support to track the state of a quota preference request. The trace id is + * only produced for increase requests and is unique for each request. The + * quota decrease requests do not have a trace id. + * + * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * Output only. The trace id that the Google Cloud uses to provision the + * requested quota. This trace id may be used by the client to contact Cloud + * support to track the state of a quota preference request. The trace id is + * only produced for increase requests and is unique for each request. The + * quota decrease requests do not have a trace id. + * + * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, True); + $this->trace_id = $var; + + return $this; + } + + /** + * Optional. The annotations map for clients to store small amounts of + * arbitrary data. Do not put PII or other sensitive information here. See + * https://google.aip.dev/128#annotations + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. The annotations map for clients to store small amounts of + * arbitrary data. Do not put PII or other sensitive information here. See + * https://google.aip.dev/128#annotations + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The origin of the quota preference request. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRequestOrigin() + { + return $this->request_origin; + } + + /** + * Output only. The origin of the quota preference request. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRequestOrigin($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaConfig\Origin::class); + $this->request_origin = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php new file mode 100644 index 00000000000..e4945a8aba1 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php @@ -0,0 +1,64 @@ +google.api.cloudquotas.v1.QuotaConfig.Origin + */ +class Origin +{ + /** + * The unspecified value. + * + * Generated from protobuf enum ORIGIN_UNSPECIFIED = 0; + */ + const ORIGIN_UNSPECIFIED = 0; + /** + * Created through Cloud Console. + * + * Generated from protobuf enum CLOUD_CONSOLE = 1; + */ + const CLOUD_CONSOLE = 1; + /** + * Generated by automatic quota adjustment. + * + * Generated from protobuf enum AUTO_ADJUSTER = 2; + */ + const AUTO_ADJUSTER = 2; + + private static $valueToName = [ + self::ORIGIN_UNSPECIFIED => 'ORIGIN_UNSPECIFIED', + self::CLOUD_CONSOLE => 'CLOUD_CONSOLE', + self::AUTO_ADJUSTER => 'AUTO_ADJUSTER', + ]; + + 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(Origin::class, \Google\Cloud\CloudQuotas\V1\QuotaConfig_Origin::class); + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php new file mode 100644 index 00000000000..989b3f46d03 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php @@ -0,0 +1,119 @@ +google.api.cloudquotas.v1.QuotaDetails + */ +class QuotaDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The value currently in effect and being enforced. + * + * Generated from protobuf field int64 value = 1; + */ + protected $value = 0; + /** + * Rollout information of this quota. + * This field is present only if the effective limit will change due to the + * ongoing rollout of the service config. + * + * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; + */ + protected $rollout_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The value currently in effect and being enforced. + * @type \Google\Cloud\CloudQuotas\V1\RolloutInfo $rollout_info + * Rollout information of this quota. + * This field is present only if the effective limit will change due to the + * ongoing rollout of the service config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The value currently in effect and being enforced. + * + * Generated from protobuf field int64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value currently in effect and being enforced. + * + * Generated from protobuf field int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * Rollout information of this quota. + * This field is present only if the effective limit will change due to the + * ongoing rollout of the service config. + * + * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; + * @return \Google\Cloud\CloudQuotas\V1\RolloutInfo|null + */ + public function getRolloutInfo() + { + return $this->rollout_info; + } + + public function hasRolloutInfo() + { + return isset($this->rollout_info); + } + + public function clearRolloutInfo() + { + unset($this->rollout_info); + } + + /** + * Rollout information of this quota. + * This field is present only if the effective limit will change due to the + * ongoing rollout of the service config. + * + * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; + * @param \Google\Cloud\CloudQuotas\V1\RolloutInfo $var + * @return $this + */ + public function setRolloutInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\RolloutInfo::class); + $this->rollout_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php new file mode 100644 index 00000000000..daf06c473eb --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php @@ -0,0 +1,109 @@ +google.api.cloudquotas.v1.QuotaIncreaseEligibility + */ +class QuotaIncreaseEligibility extends \Google\Protobuf\Internal\Message +{ + /** + * Whether a higher quota value can be requested for the quota. + * + * Generated from protobuf field bool is_eligible = 1; + */ + protected $is_eligible = false; + /** + * The reason of why it is ineligible to request increased value of the quota. + * If the is_eligible field is true, it defaults to + * INELIGIBILITY_REASON_UNSPECIFIED. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + */ + protected $ineligibility_reason = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $is_eligible + * Whether a higher quota value can be requested for the quota. + * @type int $ineligibility_reason + * The reason of why it is ineligible to request increased value of the quota. + * If the is_eligible field is true, it defaults to + * INELIGIBILITY_REASON_UNSPECIFIED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Whether a higher quota value can be requested for the quota. + * + * Generated from protobuf field bool is_eligible = 1; + * @return bool + */ + public function getIsEligible() + { + return $this->is_eligible; + } + + /** + * Whether a higher quota value can be requested for the quota. + * + * Generated from protobuf field bool is_eligible = 1; + * @param bool $var + * @return $this + */ + public function setIsEligible($var) + { + GPBUtil::checkBool($var); + $this->is_eligible = $var; + + return $this; + } + + /** + * The reason of why it is ineligible to request increased value of the quota. + * If the is_eligible field is true, it defaults to + * INELIGIBILITY_REASON_UNSPECIFIED. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * @return int + */ + public function getIneligibilityReason() + { + return $this->ineligibility_reason; + } + + /** + * The reason of why it is ineligible to request increased value of the quota. + * If the is_eligible field is true, it defaults to + * INELIGIBILITY_REASON_UNSPECIFIED. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * @param int $var + * @return $this + */ + public function setIneligibilityReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility\IneligibilityReason::class); + $this->ineligibility_reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php new file mode 100644 index 00000000000..e4861a1587d --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php @@ -0,0 +1,79 @@ +google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + */ +class IneligibilityReason +{ + /** + * Default value when is_eligible is true. + * + * Generated from protobuf enum INELIGIBILITY_REASON_UNSPECIFIED = 0; + */ + const INELIGIBILITY_REASON_UNSPECIFIED = 0; + /** + * The container is not linked with a valid billing account. + * + * Generated from protobuf enum NO_VALID_BILLING_ACCOUNT = 1; + */ + const NO_VALID_BILLING_ACCOUNT = 1; + /** + * Quota increase is not supported for the quota. + * + * Generated from protobuf enum NOT_SUPPORTED = 3; + */ + const NOT_SUPPORTED = 3; + /** + * There is not enough usage history to determine the eligibility. + * + * Generated from protobuf enum NOT_ENOUGH_USAGE_HISTORY = 4; + */ + const NOT_ENOUGH_USAGE_HISTORY = 4; + /** + * Other reasons. + * + * Generated from protobuf enum OTHER = 2; + */ + const OTHER = 2; + + private static $valueToName = [ + self::INELIGIBILITY_REASON_UNSPECIFIED => 'INELIGIBILITY_REASON_UNSPECIFIED', + self::NO_VALID_BILLING_ACCOUNT => 'NO_VALID_BILLING_ACCOUNT', + self::NOT_SUPPORTED => 'NOT_SUPPORTED', + self::NOT_ENOUGH_USAGE_HISTORY => 'NOT_ENOUGH_USAGE_HISTORY', + self::OTHER => 'OTHER', + ]; + + 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(IneligibilityReason::class, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility_IneligibilityReason::class); + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php new file mode 100644 index 00000000000..6de76fb1156 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php @@ -0,0 +1,648 @@ +google.api.cloudquotas.v1.QuotaInfo + */ +class QuotaInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of this QuotaInfo. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The id of the quota, which is unquie within the service. + * Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 2; + */ + protected $quota_id = ''; + /** + * The metric of the quota. It specifies the resources consumption the quota + * is defined for. + * Example: `compute.googleapis.com/cpus` + * + * Generated from protobuf field string metric = 3; + */ + protected $metric = ''; + /** + * The name of the service in which the quota is defined. + * Example: `compute.googleapis.com` + * + * Generated from protobuf field string service = 4; + */ + protected $service = ''; + /** + * Whether this is a precise quota. A precise quota is tracked with absolute + * precision. In contrast, an imprecise quota is not tracked with precision. + * + * Generated from protobuf field bool is_precise = 5; + */ + protected $is_precise = false; + /** + * The reset time interval for the quota. Refresh interval applies to rate + * quota only. + * Example: "minute" for per minute, "day" for per day, or "10 seconds" for + * every 10 seconds. + * + * Generated from protobuf field string refresh_interval = 6; + */ + protected $refresh_interval = ''; + /** + * The container type of the QuotaInfo. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + */ + protected $container_type = 0; + /** + * The dimensions the quota is defined on. + * + * Generated from protobuf field repeated string dimensions = 8; + */ + private $dimensions; + /** + * The display name of the quota metric + * + * Generated from protobuf field string metric_display_name = 9; + */ + protected $metric_display_name = ''; + /** + * The display name of the quota. + * + * Generated from protobuf field string quota_display_name = 10; + */ + protected $quota_display_name = ''; + /** + * The unit in which the metric value is reported, e.g., "MByte". + * + * Generated from protobuf field string metric_unit = 11; + */ + protected $metric_unit = ''; + /** + * Whether it is eligible to request a higher quota value for this quota. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + */ + protected $quota_increase_eligibility = null; + /** + * Whether the quota value is fixed or adjustable + * + * Generated from protobuf field bool is_fixed = 13; + */ + protected $is_fixed = false; + /** + * The collection of dimensions info ordered by their dimensions from more + * specific ones to less specific ones. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + private $dimensions_infos; + /** + * Whether the quota is a concurrent quota. Concurrent quotas are enforced + * on the total number of concurrent operations in flight at any given time. + * + * Generated from protobuf field bool is_concurrent = 15; + */ + protected $is_concurrent = false; + /** + * URI to the page where users can request more quota for the cloud + * service—for example, + * https://console.cloud.google.com/iam-admin/quotas. + * + * Generated from protobuf field string service_request_quota_uri = 17; + */ + protected $service_request_quota_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of this QuotaInfo. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @type string $quota_id + * The id of the quota, which is unquie within the service. + * Example: `CpusPerProjectPerRegion` + * @type string $metric + * The metric of the quota. It specifies the resources consumption the quota + * is defined for. + * Example: `compute.googleapis.com/cpus` + * @type string $service + * The name of the service in which the quota is defined. + * Example: `compute.googleapis.com` + * @type bool $is_precise + * Whether this is a precise quota. A precise quota is tracked with absolute + * precision. In contrast, an imprecise quota is not tracked with precision. + * @type string $refresh_interval + * The reset time interval for the quota. Refresh interval applies to rate + * quota only. + * Example: "minute" for per minute, "day" for per day, or "10 seconds" for + * every 10 seconds. + * @type int $container_type + * The container type of the QuotaInfo. + * @type array|\Google\Protobuf\Internal\RepeatedField $dimensions + * The dimensions the quota is defined on. + * @type string $metric_display_name + * The display name of the quota metric + * @type string $quota_display_name + * The display name of the quota. + * @type string $metric_unit + * The unit in which the metric value is reported, e.g., "MByte". + * @type \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility $quota_increase_eligibility + * Whether it is eligible to request a higher quota value for this quota. + * @type bool $is_fixed + * Whether the quota value is fixed or adjustable + * @type array<\Google\Cloud\CloudQuotas\V1\DimensionsInfo>|\Google\Protobuf\Internal\RepeatedField $dimensions_infos + * The collection of dimensions info ordered by their dimensions from more + * specific ones to less specific ones. + * @type bool $is_concurrent + * Whether the quota is a concurrent quota. Concurrent quotas are enforced + * on the total number of concurrent operations in flight at any given time. + * @type string $service_request_quota_uri + * URI to the page where users can request more quota for the cloud + * service—for example, + * https://console.cloud.google.com/iam-admin/quotas. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of this QuotaInfo. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of this QuotaInfo. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The id of the quota, which is unquie within the service. + * Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 2; + * @return string + */ + public function getQuotaId() + { + return $this->quota_id; + } + + /** + * The id of the quota, which is unquie within the service. + * Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 2; + * @param string $var + * @return $this + */ + public function setQuotaId($var) + { + GPBUtil::checkString($var, True); + $this->quota_id = $var; + + return $this; + } + + /** + * The metric of the quota. It specifies the resources consumption the quota + * is defined for. + * Example: `compute.googleapis.com/cpus` + * + * Generated from protobuf field string metric = 3; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * The metric of the quota. It specifies the resources consumption the quota + * is defined for. + * Example: `compute.googleapis.com/cpus` + * + * Generated from protobuf field string metric = 3; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * The name of the service in which the quota is defined. + * Example: `compute.googleapis.com` + * + * Generated from protobuf field string service = 4; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * The name of the service in which the quota is defined. + * Example: `compute.googleapis.com` + * + * Generated from protobuf field string service = 4; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Whether this is a precise quota. A precise quota is tracked with absolute + * precision. In contrast, an imprecise quota is not tracked with precision. + * + * Generated from protobuf field bool is_precise = 5; + * @return bool + */ + public function getIsPrecise() + { + return $this->is_precise; + } + + /** + * Whether this is a precise quota. A precise quota is tracked with absolute + * precision. In contrast, an imprecise quota is not tracked with precision. + * + * Generated from protobuf field bool is_precise = 5; + * @param bool $var + * @return $this + */ + public function setIsPrecise($var) + { + GPBUtil::checkBool($var); + $this->is_precise = $var; + + return $this; + } + + /** + * The reset time interval for the quota. Refresh interval applies to rate + * quota only. + * Example: "minute" for per minute, "day" for per day, or "10 seconds" for + * every 10 seconds. + * + * Generated from protobuf field string refresh_interval = 6; + * @return string + */ + public function getRefreshInterval() + { + return $this->refresh_interval; + } + + /** + * The reset time interval for the quota. Refresh interval applies to rate + * quota only. + * Example: "minute" for per minute, "day" for per day, or "10 seconds" for + * every 10 seconds. + * + * Generated from protobuf field string refresh_interval = 6; + * @param string $var + * @return $this + */ + public function setRefreshInterval($var) + { + GPBUtil::checkString($var, True); + $this->refresh_interval = $var; + + return $this; + } + + /** + * The container type of the QuotaInfo. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * @return int + */ + public function getContainerType() + { + return $this->container_type; + } + + /** + * The container type of the QuotaInfo. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * @param int $var + * @return $this + */ + public function setContainerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaInfo\ContainerType::class); + $this->container_type = $var; + + return $this; + } + + /** + * The dimensions the quota is defined on. + * + * Generated from protobuf field repeated string dimensions = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * The dimensions the quota is defined on. + * + * Generated from protobuf field repeated string dimensions = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dimensions = $arr; + + return $this; + } + + /** + * The display name of the quota metric + * + * Generated from protobuf field string metric_display_name = 9; + * @return string + */ + public function getMetricDisplayName() + { + return $this->metric_display_name; + } + + /** + * The display name of the quota metric + * + * Generated from protobuf field string metric_display_name = 9; + * @param string $var + * @return $this + */ + public function setMetricDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->metric_display_name = $var; + + return $this; + } + + /** + * The display name of the quota. + * + * Generated from protobuf field string quota_display_name = 10; + * @return string + */ + public function getQuotaDisplayName() + { + return $this->quota_display_name; + } + + /** + * The display name of the quota. + * + * Generated from protobuf field string quota_display_name = 10; + * @param string $var + * @return $this + */ + public function setQuotaDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->quota_display_name = $var; + + return $this; + } + + /** + * The unit in which the metric value is reported, e.g., "MByte". + * + * Generated from protobuf field string metric_unit = 11; + * @return string + */ + public function getMetricUnit() + { + return $this->metric_unit; + } + + /** + * The unit in which the metric value is reported, e.g., "MByte". + * + * Generated from protobuf field string metric_unit = 11; + * @param string $var + * @return $this + */ + public function setMetricUnit($var) + { + GPBUtil::checkString($var, True); + $this->metric_unit = $var; + + return $this; + } + + /** + * Whether it is eligible to request a higher quota value for this quota. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * @return \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility|null + */ + public function getQuotaIncreaseEligibility() + { + return $this->quota_increase_eligibility; + } + + public function hasQuotaIncreaseEligibility() + { + return isset($this->quota_increase_eligibility); + } + + public function clearQuotaIncreaseEligibility() + { + unset($this->quota_increase_eligibility); + } + + /** + * Whether it is eligible to request a higher quota value for this quota. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * @param \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility $var + * @return $this + */ + public function setQuotaIncreaseEligibility($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility::class); + $this->quota_increase_eligibility = $var; + + return $this; + } + + /** + * Whether the quota value is fixed or adjustable + * + * Generated from protobuf field bool is_fixed = 13; + * @return bool + */ + public function getIsFixed() + { + return $this->is_fixed; + } + + /** + * Whether the quota value is fixed or adjustable + * + * Generated from protobuf field bool is_fixed = 13; + * @param bool $var + * @return $this + */ + public function setIsFixed($var) + { + GPBUtil::checkBool($var); + $this->is_fixed = $var; + + return $this; + } + + /** + * The collection of dimensions info ordered by their dimensions from more + * specific ones to less specific ones. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensionsInfos() + { + return $this->dimensions_infos; + } + + /** + * The collection of dimensions info ordered by their dimensions from more + * specific ones to less specific ones. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + * @param array<\Google\Cloud\CloudQuotas\V1\DimensionsInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensionsInfos($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\DimensionsInfo::class); + $this->dimensions_infos = $arr; + + return $this; + } + + /** + * Whether the quota is a concurrent quota. Concurrent quotas are enforced + * on the total number of concurrent operations in flight at any given time. + * + * Generated from protobuf field bool is_concurrent = 15; + * @return bool + */ + public function getIsConcurrent() + { + return $this->is_concurrent; + } + + /** + * Whether the quota is a concurrent quota. Concurrent quotas are enforced + * on the total number of concurrent operations in flight at any given time. + * + * Generated from protobuf field bool is_concurrent = 15; + * @param bool $var + * @return $this + */ + public function setIsConcurrent($var) + { + GPBUtil::checkBool($var); + $this->is_concurrent = $var; + + return $this; + } + + /** + * URI to the page where users can request more quota for the cloud + * service—for example, + * https://console.cloud.google.com/iam-admin/quotas. + * + * Generated from protobuf field string service_request_quota_uri = 17; + * @return string + */ + public function getServiceRequestQuotaUri() + { + return $this->service_request_quota_uri; + } + + /** + * URI to the page where users can request more quota for the cloud + * service—for example, + * https://console.cloud.google.com/iam-admin/quotas. + * + * Generated from protobuf field string service_request_quota_uri = 17; + * @param string $var + * @return $this + */ + public function setServiceRequestQuotaUri($var) + { + GPBUtil::checkString($var, True); + $this->service_request_quota_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php new file mode 100644 index 00000000000..d571476865a --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php @@ -0,0 +1,71 @@ +google.api.cloudquotas.v1.QuotaInfo.ContainerType + */ +class ContainerType +{ + /** + * Unspecified container type. + * + * Generated from protobuf enum CONTAINER_TYPE_UNSPECIFIED = 0; + */ + const CONTAINER_TYPE_UNSPECIFIED = 0; + /** + * consumer project + * + * Generated from protobuf enum PROJECT = 1; + */ + const PROJECT = 1; + /** + * folder + * + * Generated from protobuf enum FOLDER = 2; + */ + const FOLDER = 2; + /** + * organization + * + * Generated from protobuf enum ORGANIZATION = 3; + */ + const ORGANIZATION = 3; + + private static $valueToName = [ + self::CONTAINER_TYPE_UNSPECIFIED => 'CONTAINER_TYPE_UNSPECIFIED', + self::PROJECT => 'PROJECT', + self::FOLDER => 'FOLDER', + self::ORGANIZATION => 'ORGANIZATION', + ]; + + 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(ContainerType::class, \Google\Cloud\CloudQuotas\V1\QuotaInfo_ContainerType::class); + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php new file mode 100644 index 00000000000..fde3b44c65a --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php @@ -0,0 +1,543 @@ +google.api.cloudquotas.v1.QuotaPreference + */ +class QuotaPreference extends \Google\Protobuf\Internal\Message +{ + /** + * Required except in the CREATE requests. + * The resource name of the quota preference. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Immutable. The dimensions that this quota preference applies to. The key of + * the map entry is the name of a dimension, such as "region", "zone", + * "network_id", and the value of the map entry is the dimension value. + * If a dimension is missing from the map of dimensions, the quota preference + * applies to all the dimension values except for those that have other quota + * preferences configured for the specific value. + * NOTE: QuotaPreferences can only be applied across all values of "user" and + * "resource" dimension. Do not set values for "user" or "resource" in the + * dimension map. + * Example: {"provider", "Foo Inc"} where "provider" is a service specific + * dimension. + * + * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $dimensions; + /** + * Required. Preferred quota configuration. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $quota_config = null; + /** + * Optional. The current etag of the quota preference. If an etag is provided + * on update and does not match the current server's etag of the quota + * preference, the request will be blocked and an ABORTED error will be + * returned. See https://google.aip.dev/134#etags for more details on etags. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The name of the service to which the quota preference is applied. + * + * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = ''; + /** + * Required. The id of the quota to which the quota preference is applied. A + * quota name is unique in the service. Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $quota_id = ''; + /** + * Output only. Is the quota preference pending Google Cloud approval and + * fulfillment. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * The reason / justification for this quota preference. + * + * Generated from protobuf field string justification = 11; + */ + protected $justification = ''; + /** + * Input only. An email address that can be used to contact the the user, in + * case Google Cloud needs more information to make a decision before + * additional quota can be granted. + * When requesting a quota increase, the email address is required. + * When requesting a quota decrease, the email address is optional. + * For example, the email address is optional when the + * `QuotaConfig.preferred_value` is smaller than the + * `QuotaDetails.reset_value`. + * + * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $contact_email = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required except in the CREATE requests. + * The resource name of the quota preference. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + * @type array|\Google\Protobuf\Internal\MapField $dimensions + * Immutable. The dimensions that this quota preference applies to. The key of + * the map entry is the name of a dimension, such as "region", "zone", + * "network_id", and the value of the map entry is the dimension value. + * If a dimension is missing from the map of dimensions, the quota preference + * applies to all the dimension values except for those that have other quota + * preferences configured for the specific value. + * NOTE: QuotaPreferences can only be applied across all values of "user" and + * "resource" dimension. Do not set values for "user" or "resource" in the + * dimension map. + * Example: {"provider", "Foo Inc"} where "provider" is a service specific + * dimension. + * @type \Google\Cloud\CloudQuotas\V1\QuotaConfig $quota_config + * Required. Preferred quota configuration. + * @type string $etag + * Optional. The current etag of the quota preference. If an etag is provided + * on update and does not match the current server's etag of the quota + * preference, the request will be blocked and an ABORTED error will be + * returned. See https://google.aip.dev/134#etags for more details on etags. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type string $service + * Required. The name of the service to which the quota preference is applied. + * @type string $quota_id + * Required. The id of the quota to which the quota preference is applied. A + * quota name is unique in the service. Example: `CpusPerProjectPerRegion` + * @type bool $reconciling + * Output only. Is the quota preference pending Google Cloud approval and + * fulfillment. + * @type string $justification + * The reason / justification for this quota preference. + * @type string $contact_email + * Input only. An email address that can be used to contact the the user, in + * case Google Cloud needs more information to make a decision before + * additional quota can be granted. + * When requesting a quota increase, the email address is required. + * When requesting a quota decrease, the email address is optional. + * For example, the email address is optional when the + * `QuotaConfig.preferred_value` is smaller than the + * `QuotaDetails.reset_value`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required except in the CREATE requests. + * The resource name of the quota preference. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required except in the CREATE requests. + * The resource name of the quota preference. + * The ID component following "locations/" must be "global". + * Example: + * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The dimensions that this quota preference applies to. The key of + * the map entry is the name of a dimension, such as "region", "zone", + * "network_id", and the value of the map entry is the dimension value. + * If a dimension is missing from the map of dimensions, the quota preference + * applies to all the dimension values except for those that have other quota + * preferences configured for the specific value. + * NOTE: QuotaPreferences can only be applied across all values of "user" and + * "resource" dimension. Do not set values for "user" or "resource" in the + * dimension map. + * Example: {"provider", "Foo Inc"} where "provider" is a service specific + * dimension. + * + * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * Immutable. The dimensions that this quota preference applies to. The key of + * the map entry is the name of a dimension, such as "region", "zone", + * "network_id", and the value of the map entry is the dimension value. + * If a dimension is missing from the map of dimensions, the quota preference + * applies to all the dimension values except for those that have other quota + * preferences configured for the specific value. + * NOTE: QuotaPreferences can only be applied across all values of "user" and + * "resource" dimension. Do not set values for "user" or "resource" in the + * dimension map. + * Example: {"provider", "Foo Inc"} where "provider" is a service specific + * dimension. + * + * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->dimensions = $arr; + + return $this; + } + + /** + * Required. Preferred quota configuration. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\CloudQuotas\V1\QuotaConfig|null + */ + public function getQuotaConfig() + { + return $this->quota_config; + } + + public function hasQuotaConfig() + { + return isset($this->quota_config); + } + + public function clearQuotaConfig() + { + unset($this->quota_config); + } + + /** + * Required. Preferred quota configuration. + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\CloudQuotas\V1\QuotaConfig $var + * @return $this + */ + public function setQuotaConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaConfig::class); + $this->quota_config = $var; + + return $this; + } + + /** + * Optional. The current etag of the quota preference. If an etag is provided + * on update and does not match the current server's etag of the quota + * preference, the request will be blocked and an ABORTED error will be + * returned. See https://google.aip.dev/134#etags for more details on etags. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the quota preference. If an etag is provided + * on update and does not match the current server's etag of the quota + * preference, the request will be blocked and an ABORTED error will be + * returned. See https://google.aip.dev/134#etags for more details on etags. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The name of the service to which the quota preference is applied. + * + * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The name of the service to which the quota preference is applied. + * + * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Required. The id of the quota to which the quota preference is applied. A + * quota name is unique in the service. Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuotaId() + { + return $this->quota_id; + } + + /** + * Required. The id of the quota to which the quota preference is applied. A + * quota name is unique in the service. Example: `CpusPerProjectPerRegion` + * + * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuotaId($var) + { + GPBUtil::checkString($var, True); + $this->quota_id = $var; + + return $this; + } + + /** + * Output only. Is the quota preference pending Google Cloud approval and + * fulfillment. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Is the quota preference pending Google Cloud approval and + * fulfillment. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * The reason / justification for this quota preference. + * + * Generated from protobuf field string justification = 11; + * @return string + */ + public function getJustification() + { + return $this->justification; + } + + /** + * The reason / justification for this quota preference. + * + * Generated from protobuf field string justification = 11; + * @param string $var + * @return $this + */ + public function setJustification($var) + { + GPBUtil::checkString($var, True); + $this->justification = $var; + + return $this; + } + + /** + * Input only. An email address that can be used to contact the the user, in + * case Google Cloud needs more information to make a decision before + * additional quota can be granted. + * When requesting a quota increase, the email address is required. + * When requesting a quota decrease, the email address is optional. + * For example, the email address is optional when the + * `QuotaConfig.preferred_value` is smaller than the + * `QuotaDetails.reset_value`. + * + * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getContactEmail() + { + return $this->contact_email; + } + + /** + * Input only. An email address that can be used to contact the the user, in + * case Google Cloud needs more information to make a decision before + * additional quota can be granted. + * When requesting a quota increase, the email address is required. + * When requesting a quota decrease, the email address is optional. + * For example, the email address is optional when the + * `QuotaConfig.preferred_value` is smaller than the + * `QuotaDetails.reset_value`. + * + * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContactEmail($var) + { + GPBUtil::checkString($var, True); + $this->contact_email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php new file mode 100644 index 00000000000..659dd6869ac --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php @@ -0,0 +1,63 @@ +google.api.cloudquotas.v1.QuotaSafetyCheck + */ +class QuotaSafetyCheck +{ + /** + * Unspecified quota safety check. + * + * Generated from protobuf enum QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + */ + const QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + /** + * Validates that a quota mutation would not cause the consumer's effective + * limit to be lower than the consumer's quota usage. + * + * Generated from protobuf enum QUOTA_DECREASE_BELOW_USAGE = 1; + */ + const QUOTA_DECREASE_BELOW_USAGE = 1; + /** + * Validates that a quota mutation would not cause the consumer's effective + * limit to decrease by more than 10 percent. + * + * Generated from protobuf enum QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; + */ + const QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; + + private static $valueToName = [ + self::QUOTA_SAFETY_CHECK_UNSPECIFIED => 'QUOTA_SAFETY_CHECK_UNSPECIFIED', + self::QUOTA_DECREASE_BELOW_USAGE => 'QUOTA_DECREASE_BELOW_USAGE', + self::QUOTA_DECREASE_PERCENTAGE_TOO_HIGH => 'QUOTA_DECREASE_PERCENTAGE_TOO_HIGH', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php new file mode 100644 index 00000000000..1d0c7e5fec5 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php @@ -0,0 +1,67 @@ +google.api.cloudquotas.v1.RolloutInfo + */ +class RolloutInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Whether there is an ongoing rollout for a quota or not. + * + * Generated from protobuf field bool ongoing_rollout = 1; + */ + protected $ongoing_rollout = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $ongoing_rollout + * Whether there is an ongoing rollout for a quota or not. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Whether there is an ongoing rollout for a quota or not. + * + * Generated from protobuf field bool ongoing_rollout = 1; + * @return bool + */ + public function getOngoingRollout() + { + return $this->ongoing_rollout; + } + + /** + * Whether there is an ongoing rollout for a quota or not. + * + * Generated from protobuf field bool ongoing_rollout = 1; + * @param bool $var + * @return $this + */ + public function setOngoingRollout($var) + { + GPBUtil::checkBool($var); + $this->ongoing_rollout = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php new file mode 100644 index 00000000000..adb2aaf264f --- /dev/null +++ b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php @@ -0,0 +1,270 @@ +google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest + */ +class UpdateQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $quota_preference = null; + /** + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + /** + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + */ + private $ignore_safety_checks; + + /** + * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\CloudQuotas\V1\UpdateQuotaPreferenceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setQuotaPreference($quotaPreference) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\CloudQuotas\V1\QuotaPreference $quota_preference + * Required. The resource being updated + * @type bool $allow_missing + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + * @type bool $validate_only + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_safety_checks + * The list of quota safety checks to be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @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. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\CloudQuotas\V1\QuotaPreference|null + */ + public function getQuotaPreference() + { + return $this->quota_preference; + } + + public function hasQuotaPreference() + { + return isset($this->quota_preference); + } + + public function clearQuotaPreference() + { + unset($this->quota_preference); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $var + * @return $this + */ + public function setQuotaPreference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); + $this->quota_preference = $var; + + return $this; + } + + /** + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoreSafetyChecks() + { + return $this->ignore_safety_checks; + } + + /** + * The list of quota safety checks to be ignored. + * + * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoreSafetyChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\CloudQuotas\V1\QuotaSafetyCheck::class); + $this->ignore_safety_checks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php new file mode 100644 index 00000000000..0ce0e304421 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php @@ -0,0 +1,99 @@ +setPreferredValue($quotaPreferenceQuotaConfigPreferredValue); + $quotaPreference = (new QuotaPreference()) + ->setQuotaConfig($quotaPreferenceQuotaConfig) + ->setService($quotaPreferenceService) + ->setQuotaId($quotaPreferenceQuotaId); + $request = (new CreateQuotaPreferenceRequest()) + ->setParent($formattedParent) + ->setQuotaPreference($quotaPreference); + + // Call the API and handle any network failures. + try { + /** @var QuotaPreference $response */ + $response = $cloudQuotasClient->createQuotaPreference($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudQuotasClient::locationName('[PROJECT]', '[LOCATION]'); + $quotaPreferenceQuotaConfigPreferredValue = 0; + $quotaPreferenceService = '[SERVICE]'; + $quotaPreferenceQuotaId = '[QUOTA_ID]'; + + create_quota_preference_sample( + $formattedParent, + $quotaPreferenceQuotaConfigPreferredValue, + $quotaPreferenceService, + $quotaPreferenceQuotaId + ); +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php new file mode 100644 index 00000000000..4a0cea6ac5a --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QuotaInfo $response */ + $response = $cloudQuotasClient->getQuotaInfo($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudQuotasClient::quotaInfoName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]', + '[QUOTA_INFO]' + ); + + get_quota_info_sample($formattedName); +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php new file mode 100644 index 00000000000..9ef87f2cde1 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QuotaPreference $response */ + $response = $cloudQuotasClient->getQuotaPreference($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudQuotasClient::quotaPreferenceName( + '[PROJECT]', + '[LOCATION]', + '[QUOTA_PREFERENCE]' + ); + + get_quota_preference_sample($formattedName); +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php new file mode 100644 index 00000000000..6b69cee4cc7 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudQuotasClient->listQuotaInfos($request); + + /** @var QuotaInfo $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudQuotasClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + list_quota_infos_sample($formattedParent); +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php new file mode 100644 index 00000000000..54fa1a273da --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php @@ -0,0 +1,85 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudQuotasClient->listQuotaPreferences($request); + + /** @var QuotaPreference $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudQuotasClient::locationName('[PROJECT]', '[LOCATION]'); + + list_quota_preferences_sample($formattedParent); +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php new file mode 100644 index 00000000000..b8e6bc6b5af --- /dev/null +++ b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php @@ -0,0 +1,91 @@ +setPreferredValue($quotaPreferenceQuotaConfigPreferredValue); + $quotaPreference = (new QuotaPreference()) + ->setQuotaConfig($quotaPreferenceQuotaConfig) + ->setService($quotaPreferenceService) + ->setQuotaId($quotaPreferenceQuotaId); + $request = (new UpdateQuotaPreferenceRequest()) + ->setQuotaPreference($quotaPreference); + + // Call the API and handle any network failures. + try { + /** @var QuotaPreference $response */ + $response = $cloudQuotasClient->updateQuotaPreference($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $quotaPreferenceQuotaConfigPreferredValue = 0; + $quotaPreferenceService = '[SERVICE]'; + $quotaPreferenceQuotaId = '[QUOTA_ID]'; + + update_quota_preference_sample( + $quotaPreferenceQuotaConfigPreferredValue, + $quotaPreferenceService, + $quotaPreferenceQuotaId + ); +} +// [END cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php b/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php new file mode 100644 index 00000000000..5eda6b6500b --- /dev/null +++ b/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php @@ -0,0 +1,692 @@ + createQuotaPreferenceAsync(CreateQuotaPreferenceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getQuotaInfoAsync(GetQuotaInfoRequest $request, array $optionalArgs = []) + * @method PromiseInterface getQuotaPreferenceAsync(GetQuotaPreferenceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listQuotaInfosAsync(ListQuotaInfosRequest $request, array $optionalArgs = []) + * @method PromiseInterface listQuotaPreferencesAsync(ListQuotaPreferencesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateQuotaPreferenceAsync(UpdateQuotaPreferenceRequest $request, array $optionalArgs = []) + */ +final class CloudQuotasClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.api.cloudquotas.v1.CloudQuotas'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudquotas.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudquotas.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_quotas_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_quotas_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_quotas_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_quotas_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location resource. + * + * @param string $folder + * @param string $location + * + * @return string The formatted folder_location resource. + */ + public static function folderLocationName(string $folder, string $location): string + { + return self::getPathTemplate('folderLocation')->render([ + 'folder' => $folder, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_quota_preference resource. + * + * @param string $folder + * @param string $location + * @param string $quotaPreference + * + * @return string The formatted folder_location_quota_preference resource. + */ + public static function folderLocationQuotaPreferenceName(string $folder, string $location, string $quotaPreference): string + { + return self::getPathTemplate('folderLocationQuotaPreference')->render([ + 'folder' => $folder, + 'location' => $location, + 'quota_preference' => $quotaPreference, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_service resource. + * + * @param string $folder + * @param string $location + * @param string $service + * + * @return string The formatted folder_location_service resource. + */ + public static function folderLocationServiceName(string $folder, string $location, string $service): string + { + return self::getPathTemplate('folderLocationService')->render([ + 'folder' => $folder, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_service_quota_info resource. + * + * @param string $folder + * @param string $location + * @param string $service + * @param string $quotaInfo + * + * @return string The formatted folder_location_service_quota_info resource. + */ + public static function folderLocationServiceQuotaInfoName(string $folder, string $location, string $service, string $quotaInfo): string + { + return self::getPathTemplate('folderLocationServiceQuotaInfo')->render([ + 'folder' => $folder, + 'location' => $location, + 'service' => $service, + 'quota_info' => $quotaInfo, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted organization_location resource. + */ + public static function organizationLocationName(string $organization, string $location): string + { + return self::getPathTemplate('organizationLocation')->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_quota_preference resource. + * + * @param string $organization + * @param string $location + * @param string $quotaPreference + * + * @return string The formatted organization_location_quota_preference resource. + */ + public static function organizationLocationQuotaPreferenceName(string $organization, string $location, string $quotaPreference): string + { + return self::getPathTemplate('organizationLocationQuotaPreference')->render([ + 'organization' => $organization, + 'location' => $location, + 'quota_preference' => $quotaPreference, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_service resource. + * + * @param string $organization + * @param string $location + * @param string $service + * + * @return string The formatted organization_location_service resource. + */ + public static function organizationLocationServiceName(string $organization, string $location, string $service): string + { + return self::getPathTemplate('organizationLocationService')->render([ + 'organization' => $organization, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_service_quota_info resource. + * + * @param string $organization + * @param string $location + * @param string $service + * @param string $quotaInfo + * + * @return string The formatted organization_location_service_quota_info resource. + */ + public static function organizationLocationServiceQuotaInfoName(string $organization, string $location, string $service, string $quotaInfo): string + { + return self::getPathTemplate('organizationLocationServiceQuotaInfo')->render([ + 'organization' => $organization, + 'location' => $location, + 'service' => $service, + 'quota_info' => $quotaInfo, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location resource. + */ + public static function projectLocationName(string $project, string $location): string + { + return self::getPathTemplate('projectLocation')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_quota_preference resource. + * + * @param string $project + * @param string $location + * @param string $quotaPreference + * + * @return string The formatted project_location_quota_preference resource. + */ + public static function projectLocationQuotaPreferenceName(string $project, string $location, string $quotaPreference): string + { + return self::getPathTemplate('projectLocationQuotaPreference')->render([ + 'project' => $project, + 'location' => $location, + 'quota_preference' => $quotaPreference, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_service resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted project_location_service resource. + */ + public static function projectLocationServiceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('projectLocationService')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_service_quota_info resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $quotaInfo + * + * @return string The formatted project_location_service_quota_info resource. + */ + public static function projectLocationServiceQuotaInfoName(string $project, string $location, string $service, string $quotaInfo): string + { + return self::getPathTemplate('projectLocationServiceQuotaInfo')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'quota_info' => $quotaInfo, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a quota_info + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $quotaInfo + * + * @return string The formatted quota_info resource. + */ + public static function quotaInfoName(string $project, string $location, string $service, string $quotaInfo): string + { + return self::getPathTemplate('quotaInfo')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'quota_info' => $quotaInfo, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * quota_preference resource. + * + * @param string $project + * @param string $location + * @param string $quotaPreference + * + * @return string The formatted quota_preference resource. + */ + public static function quotaPreferenceName(string $project, string $location, string $quotaPreference): string + { + return self::getPathTemplate('quotaPreference')->render([ + 'project' => $project, + 'location' => $location, + 'quota_preference' => $quotaPreference, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderLocation: folders/{folder}/locations/{location} + * - folderLocationQuotaPreference: folders/{folder}/locations/{location}/quotaPreferences/{quota_preference} + * - folderLocationService: folders/{folder}/locations/{location}/services/{service} + * - folderLocationServiceQuotaInfo: folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info} + * - location: projects/{project}/locations/{location} + * - organizationLocation: organizations/{organization}/locations/{location} + * - organizationLocationQuotaPreference: organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference} + * - organizationLocationService: organizations/{organization}/locations/{location}/services/{service} + * - organizationLocationServiceQuotaInfo: organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info} + * - projectLocation: projects/{project}/locations/{location} + * - projectLocationQuotaPreference: projects/{project}/locations/{location}/quotaPreferences/{quota_preference} + * - projectLocationService: projects/{project}/locations/{location}/services/{service} + * - projectLocationServiceQuotaInfo: projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info} + * - quotaInfo: projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info} + * - quotaPreference: projects/{project}/locations/{location}/quotaPreferences/{quota_preference} + * - service: projects/{project}/locations/{location}/services/{service} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudquotas.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + * The async variant is {@see CloudQuotasClient::createQuotaPreferenceAsync()} . + * + * @example samples/V1/CloudQuotasClient/create_quota_preference.php + * + * @param CreateQuotaPreferenceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 QuotaPreference + * + * @throws ApiException Thrown if the API call fails. + */ + public function createQuotaPreference(CreateQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference + { + return $this->startApiCall('CreateQuotaPreference', $request, $callOptions)->wait(); + } + + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + * The async variant is {@see CloudQuotasClient::getQuotaInfoAsync()} . + * + * @example samples/V1/CloudQuotasClient/get_quota_info.php + * + * @param GetQuotaInfoRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 QuotaInfo + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQuotaInfo(GetQuotaInfoRequest $request, array $callOptions = []): QuotaInfo + { + return $this->startApiCall('GetQuotaInfo', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single QuotaPreference. + * + * The async variant is {@see CloudQuotasClient::getQuotaPreferenceAsync()} . + * + * @example samples/V1/CloudQuotasClient/get_quota_preference.php + * + * @param GetQuotaPreferenceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 QuotaPreference + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQuotaPreference(GetQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference + { + return $this->startApiCall('GetQuotaPreference', $request, $callOptions)->wait(); + } + + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + * The async variant is {@see CloudQuotasClient::listQuotaInfosAsync()} . + * + * @example samples/V1/CloudQuotasClient/list_quota_infos.php + * + * @param ListQuotaInfosRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listQuotaInfos(ListQuotaInfosRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListQuotaInfos', $request, $callOptions); + } + + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + * The async variant is {@see CloudQuotasClient::listQuotaPreferencesAsync()} . + * + * @example samples/V1/CloudQuotasClient/list_quota_preferences.php + * + * @param ListQuotaPreferencesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listQuotaPreferences(ListQuotaPreferencesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListQuotaPreferences', $request, $callOptions); + } + + /** + * Updates the parameters of a single QuotaPreference. It can updates the + * config in any states, not just the ones pending approval. + * + * The async variant is {@see CloudQuotasClient::updateQuotaPreferenceAsync()} . + * + * @example samples/V1/CloudQuotasClient/update_quota_preference.php + * + * @param UpdateQuotaPreferenceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 QuotaPreference + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateQuotaPreference(UpdateQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference + { + return $this->startApiCall('UpdateQuotaPreference', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..79ee8e757db --- /dev/null +++ b/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.api.cloudquotas.v1", + "libraryPackage": "Google\\Cloud\\CloudQuotas\\V1", + "services": { + "CloudQuotas": { + "clients": { + "grpc": { + "libraryClient": "CloudQuotasGapicClient", + "rpcs": { + "CreateQuotaPreference": { + "methods": [ + "createQuotaPreference" + ] + }, + "GetQuotaInfo": { + "methods": [ + "getQuotaInfo" + ] + }, + "GetQuotaPreference": { + "methods": [ + "getQuotaPreference" + ] + }, + "ListQuotaInfos": { + "methods": [ + "listQuotaInfos" + ] + }, + "ListQuotaPreferences": { + "methods": [ + "listQuotaPreferences" + ] + }, + "UpdateQuotaPreference": { + "methods": [ + "updateQuotaPreference" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json new file mode 100644 index 00000000000..ae40b97f70f --- /dev/null +++ b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.api.cloudquotas.v1.CloudQuotas": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQuotaInfo": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQuotaInfos": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQuotaPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php new file mode 100644 index 00000000000..41d398d899d --- /dev/null +++ b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php @@ -0,0 +1,135 @@ + [ + 'google.api.cloudquotas.v1.CloudQuotas' => [ + 'CreateQuotaPreference' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetQuotaInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaInfo', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetQuotaPreference' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListQuotaInfos' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQuotaInfos', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\ListQuotaInfosResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListQuotaPreferences' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQuotaPreferences', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\ListQuotaPreferencesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateQuotaPreference' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', + 'headerParams' => [ + [ + 'keyName' => 'quota_preference.name', + 'fieldAccessors' => [ + 'getQuotaPreference', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'folderLocation' => 'folders/{folder}/locations/{location}', + 'folderLocationQuotaPreference' => 'folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}', + 'folderLocationService' => 'folders/{folder}/locations/{location}/services/{service}', + 'folderLocationServiceQuotaInfo' => 'folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}', + 'location' => 'projects/{project}/locations/{location}', + 'organizationLocation' => 'organizations/{organization}/locations/{location}', + 'organizationLocationQuotaPreference' => 'organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}', + 'organizationLocationService' => 'organizations/{organization}/locations/{location}/services/{service}', + 'organizationLocationServiceQuotaInfo' => 'organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}', + 'projectLocation' => 'projects/{project}/locations/{location}', + 'projectLocationQuotaPreference' => 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}', + 'projectLocationService' => 'projects/{project}/locations/{location}/services/{service}', + 'projectLocationServiceQuotaInfo' => 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}', + 'quotaInfo' => 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}', + 'quotaPreference' => 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php new file mode 100644 index 00000000000..b9078725af7 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php @@ -0,0 +1,162 @@ + [ + 'google.api.cloudquotas.v1.CloudQuotas' => [ + 'CreateQuotaPreference' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/quotaPreferences', + 'body' => 'quota_preference', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/quotaPreferences', + 'body' => 'quota_preference', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/quotaPreferences', + 'body' => 'quota_preference', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetQuotaInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetQuotaPreference' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/quotaPreferences/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/quotaPreferences/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/quotaPreferences/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListQuotaInfos' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/services/*}/quotaInfos', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/services/*}/quotaInfos', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/services/*}/quotaInfos', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListQuotaPreferences' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/quotaPreferences', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/quotaPreferences', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/quotaPreferences', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateQuotaPreference' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}', + 'body' => 'quota_preference', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}', + 'body' => 'quota_preference', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}', + 'body' => 'quota_preference', + ], + ], + 'placeholders' => [ + 'quota_preference.name' => [ + 'getters' => [ + 'getQuotaPreference', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php b/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php new file mode 100644 index 00000000000..136af5b7439 --- /dev/null +++ b/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php @@ -0,0 +1,620 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudQuotasClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudQuotasClient($options); + } + + /** @test */ + public function createQuotaPreferenceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $service = 'service1984153269'; + $quotaId = 'quotaId-879230910'; + $reconciling = false; + $justification = 'justification1864993522'; + $contactEmail = 'contactEmail947010237'; + $expectedResponse = new QuotaPreference(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setService($service); + $expectedResponse->setQuotaId($quotaId); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setJustification($justification); + $expectedResponse->setContactEmail($contactEmail); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $quotaPreference = new QuotaPreference(); + $quotaPreferenceQuotaConfig = new QuotaConfig(); + $quotaConfigPreferredValue = 557434902; + $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); + $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); + $quotaPreferenceService = 'quotaPreferenceService-1057995326'; + $quotaPreference->setService($quotaPreferenceService); + $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; + $quotaPreference->setQuotaId($quotaPreferenceQuotaId); + $request = (new CreateQuotaPreferenceRequest()) + ->setParent($formattedParent) + ->setQuotaPreference($quotaPreference); + $response = $gapicClient->createQuotaPreference($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQuotaPreference(); + $this->assertProtobufEquals($quotaPreference, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQuotaPreferenceExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $quotaPreference = new QuotaPreference(); + $quotaPreferenceQuotaConfig = new QuotaConfig(); + $quotaConfigPreferredValue = 557434902; + $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); + $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); + $quotaPreferenceService = 'quotaPreferenceService-1057995326'; + $quotaPreference->setService($quotaPreferenceService); + $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; + $quotaPreference->setQuotaId($quotaPreferenceQuotaId); + $request = (new CreateQuotaPreferenceRequest()) + ->setParent($formattedParent) + ->setQuotaPreference($quotaPreference); + try { + $gapicClient->createQuotaPreference($request); + // 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 getQuotaInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $quotaId = 'quotaId-879230910'; + $metric = 'metric-1077545552'; + $service = 'service1984153269'; + $isPrecise = true; + $refreshInterval = 'refreshInterval1816824233'; + $metricDisplayName = 'metricDisplayName900625943'; + $quotaDisplayName = 'quotaDisplayName-1616924081'; + $metricUnit = 'metricUnit-1737381197'; + $isFixed = false; + $isConcurrent = true; + $serviceRequestQuotaUri = 'serviceRequestQuotaUri-773207445'; + $expectedResponse = new QuotaInfo(); + $expectedResponse->setName($name2); + $expectedResponse->setQuotaId($quotaId); + $expectedResponse->setMetric($metric); + $expectedResponse->setService($service); + $expectedResponse->setIsPrecise($isPrecise); + $expectedResponse->setRefreshInterval($refreshInterval); + $expectedResponse->setMetricDisplayName($metricDisplayName); + $expectedResponse->setQuotaDisplayName($quotaDisplayName); + $expectedResponse->setMetricUnit($metricUnit); + $expectedResponse->setIsFixed($isFixed); + $expectedResponse->setIsConcurrent($isConcurrent); + $expectedResponse->setServiceRequestQuotaUri($serviceRequestQuotaUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->quotaInfoName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[QUOTA_INFO]'); + $request = (new GetQuotaInfoRequest()) + ->setName($formattedName); + $response = $gapicClient->getQuotaInfo($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/GetQuotaInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQuotaInfoExceptionTest() + { + $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->quotaInfoName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[QUOTA_INFO]'); + $request = (new GetQuotaInfoRequest()) + ->setName($formattedName); + try { + $gapicClient->getQuotaInfo($request); + // 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 getQuotaPreferenceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $service = 'service1984153269'; + $quotaId = 'quotaId-879230910'; + $reconciling = false; + $justification = 'justification1864993522'; + $contactEmail = 'contactEmail947010237'; + $expectedResponse = new QuotaPreference(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setService($service); + $expectedResponse->setQuotaId($quotaId); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setJustification($justification); + $expectedResponse->setContactEmail($contactEmail); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->quotaPreferenceName('[PROJECT]', '[LOCATION]', '[QUOTA_PREFERENCE]'); + $request = (new GetQuotaPreferenceRequest()) + ->setName($formattedName); + $response = $gapicClient->getQuotaPreference($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/GetQuotaPreference', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQuotaPreferenceExceptionTest() + { + $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->quotaPreferenceName('[PROJECT]', '[LOCATION]', '[QUOTA_PREFERENCE]'); + $request = (new GetQuotaPreferenceRequest()) + ->setName($formattedName); + try { + $gapicClient->getQuotaPreference($request); + // 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 listQuotaInfosTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $quotaInfosElement = new QuotaInfo(); + $quotaInfos = [ + $quotaInfosElement, + ]; + $expectedResponse = new ListQuotaInfosResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQuotaInfos($quotaInfos); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListQuotaInfosRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listQuotaInfos($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQuotaInfos()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/ListQuotaInfos', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQuotaInfosExceptionTest() + { + $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListQuotaInfosRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listQuotaInfos($request); + // 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 listQuotaPreferencesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $quotaPreferencesElement = new QuotaPreference(); + $quotaPreferences = [ + $quotaPreferencesElement, + ]; + $expectedResponse = new ListQuotaPreferencesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQuotaPreferences($quotaPreferences); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQuotaPreferencesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listQuotaPreferences($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQuotaPreferences()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/ListQuotaPreferences', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQuotaPreferencesExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQuotaPreferencesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listQuotaPreferences($request); + // 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 updateQuotaPreferenceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $service = 'service1984153269'; + $quotaId = 'quotaId-879230910'; + $reconciling = false; + $justification = 'justification1864993522'; + $contactEmail = 'contactEmail947010237'; + $expectedResponse = new QuotaPreference(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setService($service); + $expectedResponse->setQuotaId($quotaId); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setJustification($justification); + $expectedResponse->setContactEmail($contactEmail); + $transport->addResponse($expectedResponse); + // Mock request + $quotaPreference = new QuotaPreference(); + $quotaPreferenceQuotaConfig = new QuotaConfig(); + $quotaConfigPreferredValue = 557434902; + $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); + $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); + $quotaPreferenceService = 'quotaPreferenceService-1057995326'; + $quotaPreference->setService($quotaPreferenceService); + $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; + $quotaPreference->setQuotaId($quotaPreferenceQuotaId); + $request = (new UpdateQuotaPreferenceRequest()) + ->setQuotaPreference($quotaPreference); + $response = $gapicClient->updateQuotaPreference($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/UpdateQuotaPreference', $actualFuncCall); + $actualValue = $actualRequestObject->getQuotaPreference(); + $this->assertProtobufEquals($quotaPreference, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQuotaPreferenceExceptionTest() + { + $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 + $quotaPreference = new QuotaPreference(); + $quotaPreferenceQuotaConfig = new QuotaConfig(); + $quotaConfigPreferredValue = 557434902; + $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); + $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); + $quotaPreferenceService = 'quotaPreferenceService-1057995326'; + $quotaPreference->setService($quotaPreferenceService); + $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; + $quotaPreference->setQuotaId($quotaPreferenceQuotaId); + $request = (new UpdateQuotaPreferenceRequest()) + ->setQuotaPreference($quotaPreference); + try { + $gapicClient->updateQuotaPreference($request); + // 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 createQuotaPreferenceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $service = 'service1984153269'; + $quotaId = 'quotaId-879230910'; + $reconciling = false; + $justification = 'justification1864993522'; + $contactEmail = 'contactEmail947010237'; + $expectedResponse = new QuotaPreference(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setService($service); + $expectedResponse->setQuotaId($quotaId); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setJustification($justification); + $expectedResponse->setContactEmail($contactEmail); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $quotaPreference = new QuotaPreference(); + $quotaPreferenceQuotaConfig = new QuotaConfig(); + $quotaConfigPreferredValue = 557434902; + $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); + $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); + $quotaPreferenceService = 'quotaPreferenceService-1057995326'; + $quotaPreference->setService($quotaPreferenceService); + $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; + $quotaPreference->setQuotaId($quotaPreferenceQuotaId); + $request = (new CreateQuotaPreferenceRequest()) + ->setParent($formattedParent) + ->setQuotaPreference($quotaPreference); + $response = $gapicClient->createQuotaPreferenceAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQuotaPreference(); + $this->assertProtobufEquals($quotaPreference, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php new file mode 100644 index 0000000000000000000000000000000000000000..60d444872fd1ae6ba2a52434d861b373fb792d28 GIT binary patch literal 2874 zcmc&$-EQMV6efTDnY7(t3YdamC@XDN>^e#T30%6nPU1!uZJbTKg{~r5jy+Ayy0+z? zh_K3&@CID*3S1%a6kPWaxZ;e*al&pRQn(;j&dfRAIp>@2%$%y0JB*3P3<=YMk1dLlM?x-4;TZ;BExQ1RFm_)=Q&l@?UW;$MM z)dIt}tt)#3n6~E{VMxO8invj2T(7~F4xe^plTb+FAmkcXB=ilF;C8ohN+QEDB4f}_ zAO}qfIp{5c9Guk;5i%VJf+gRUQ)KiKVfgv+(6LP%Mv#b!@7kemyAauM>>r`nBYa^v zAp!r_Z7*Wiq{(CIpt>fh-p34++TQg&Am<3ra_myRfUAMxMkH_zXV4;{8Q6a01zj)| z#Sw`zmg!3Mej1j-*%!FVaumhal03pu5R=8|7zZSZ1NSh=n*vO;ufYur0xyGOn>bd3 zTpDBB3q)~V)f{A*YmcOdys}qDhi1dUM#hzYbHs$khmY)(G|93uj*dZY)vPL7<303i z1s(neopDv>EF>ZomWfmt*Z1B_!+_{&L0Uc&>)uD{Rw7+E@>(>jks0joqjEcjs@1S> z8ZP%1Dw|$FbjBf{!@24vwK?nimn0y|ZT?(Gn@!JghzTO%wos9F3G?SZ2he~($LcgX zp9j$L!Jd%TH%m>(=x-GMkP6f*_Mx>>ufl3xDq3@lA#p;!hzk(r@hr?g(kNu<3nvKz zbZ0Q(cF~q)hrVM>^rWN`rG)Zir9A^}$FC)e@1i>)3C6Zbbi*{g*p2x0)Ou|gn=eSj zZ_xj&z7NnY`N0Rih^5m@C(@bACYThsQ&gfoMtB5&cMiV#H)ZrG01Ng$+A$p)ZZdsL zf{>KR*$(LAr`NTw#H#18HTuhTf_yyF+?C2u6U|1 z$X>UMNyzU2Xo;(!4H7$s9tSpmhZeQ>5S15Cu#5^X$RyR`HY$w`CuS<#6!Tx^_J7Nv zQbHB?HhQzKNt&!b>-4*FQ#n@TR^<)u9mKI^rK4zybfP?0I_*kszTT6i*14{!`m?@V z$%AAn%)TeLmA)qT0HpwVZn0IVsVQf2r8r;dO5oV4lsFFUFq@WqB5O3t8posE*;-RQ zJyrUBMeTs~I(G+^*^b=nslCdEIKGxbR9|{ku!e(MA{5|>tYv!V9zhR&56p(Om+9BE z=6GiE9>Ut}b6QJJzzbkC`=0LqR76N}U5`Fop8G#`fA^K{f3muS=lTDw{oAM*O?<-B zw!c*yF5qbZa9dG!P?5S(EotZ7R~7jo+DleX$tRc#oV06-k`Khwr9dGrAEw(?OlDhs1gm(D8P-1AFz zf2VH-mG8(~KDmL$VR&0stv@_mzV&my+D=9}AsOX_9$;Cgv*}RErbFSZ{`<^ykdA$9 z?z_Qw0E6Fk{!<1liV3nPE`t`uv-)ric#pi#?qyTO12$PL3}WemN F=r3eSq*(v} literal 0 HcmV?d00001 diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php new file mode 100644 index 00000000000..72bb8c1dc62 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php @@ -0,0 +1,121 @@ +internalAddGeneratedFile( + ' +�& +Ggoogle/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto(google.cloud.rapidmigrationassessment.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto;google/cloud/rapidmigrationassessment/v1/api_entities.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� +CreateAnnotationRequest9 +parent ( B)�A�A# +!locations.googleapis.com/LocationM + +annotation ( 24.google.cloud.rapidmigrationassessment.v1.AnnotationB�A + +request_id ( B�A"` +GetAnnotationRequestH +name ( B:�A�A4 +2rapidmigrationassessment.googleapis.com/Annotation"� +CreateCollectorRequest9 +parent ( B)�A�A# +!locations.googleapis.com/Location + collector_id ( B�AK + collector ( 23.google.cloud.rapidmigrationassessment.v1.CollectorB�A + +request_id ( B�A"� +ListCollectorsRequest9 +parent ( B)�A�A# +!locations.googleapis.com/Location + page_size ( + +page_token (  +filter (  +order_by ( "� +ListCollectorsResponseG + +collectors ( 23.google.cloud.rapidmigrationassessment.v1.Collector +next_page_token (  + unreachable ( "^ +GetCollectorRequestG +name ( B9�A�A3 +1rapidmigrationassessment.googleapis.com/Collector"z +DeleteCollectorRequestG +name ( B9�A�A3 +1rapidmigrationassessment.googleapis.com/Collector + +request_id ( B�A"� +UpdateCollectorRequest4 + update_mask ( 2.google.protobuf.FieldMaskB�AK + collector ( 23.google.cloud.rapidmigrationassessment.v1.CollectorB�A + +request_id ( B�A"z +ResumeCollectorRequestG +name ( B9�A�A3 +1rapidmigrationassessment.googleapis.com/Collector + +request_id ( B�A"| +RegisterCollectorRequestG +name ( B9�A�A3 +1rapidmigrationassessment.googleapis.com/Collector + +request_id ( B�A"y +PauseCollectorRequestG +name ( B9�A�A3 +1rapidmigrationassessment.googleapis.com/Collector + +request_id ( B�A"� +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampB�A1 +end_time ( 2.google.protobuf.TimestampB�A +target ( B�A +verb ( B�A +status_message ( B�A# +requested_cancellation (B�A + api_version ( B�A2� +RapidMigrationAssessment� +CreateCollector@.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.google.longrunning.Operation"��A + CollectorOperationMetadata�Aparent,collector,collector_id���;"./v1/{parent=projects/*/locations/*}/collectors: collector� +CreateAnnotationA.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.google.longrunning.Operation"y�A + +AnnotationOperationMetadata�Aparent,annotation���="//v1/{parent=projects/*/locations/*}/annotations: +annotation� + GetAnnotation>.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest4.google.cloud.rapidmigrationassessment.v1.Annotation">�Aname���1//v1/{name=projects/*/locations/*/annotations/*}� +ListCollectors?.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest@.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse"?�Aparent���0./v1/{parent=projects/*/locations/*}/collectors� + GetCollector=.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest3.google.cloud.rapidmigrationassessment.v1.Collector"=�Aname���0./v1/{name=projects/*/locations/*/collectors/*}� +UpdateCollector@.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.google.longrunning.Operation"��A + CollectorOperationMetadata�Acollector,update_mask���E28/v1/{collector.name=projects/*/locations/*/collectors/*}: collector� +DeleteCollector@.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.google.longrunning.Operation"^�A + CollectorOperationMetadata�Aname���0*./v1/{name=projects/*/locations/*/collectors/*}� +ResumeCollector@.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.google.longrunning.Operation"h�A + CollectorOperationMetadata�Aname���:"5/v1/{name=projects/*/locations/*/collectors/*}:resume:*� +RegisterCollectorB.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.google.longrunning.Operation"j�A + CollectorOperationMetadata�Aname���<"7/v1/{name=projects/*/locations/*/collectors/*}:register:*� +PauseCollector?.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.google.longrunning.Operation"g�A + CollectorOperationMetadata�Aname���9"4/v1/{name=projects/*/locations/*/collectors/*}:pause:*[�A\'rapidmigrationassessment.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +,com.google.cloud.rapidmigrationassessment.v1BRapidMigrationAssessmentProtoPZhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb�(Google.Cloud.RapidMigrationAssessment.V1�(Google\\Cloud\\RapidMigrationAssessment\\V1�+Google::Cloud::RapidMigrationAssessment::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php new file mode 100644 index 00000000000..c4f66f0d672 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php @@ -0,0 +1,223 @@ +google.cloud.rapidmigrationassessment.v1.Annotation + */ +class Annotation extends \Google\Protobuf\Internal\Message +{ + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Type of an annotation. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * name of resource. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type int $type + * Type of an annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); + parent::__construct($data); + } + + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + * @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; + } + + /** + * Type of an annotation. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of an annotation. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RapidMigrationAssessment\V1\Annotation\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php new file mode 100644 index 00000000000..c5f5dabc798 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php @@ -0,0 +1,64 @@ +google.cloud.rapidmigrationassessment.v1.Annotation.Type + */ +class Type +{ + /** + * Unknown type + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Indicates that this project has opted into StratoZone export. + * + * Generated from protobuf enum TYPE_LEGACY_EXPORT_CONSENT = 1; + */ + const TYPE_LEGACY_EXPORT_CONSENT = 1; + /** + * Indicates that this project is created by Qwiklab. + * + * Generated from protobuf enum TYPE_QWIKLAB = 2; + */ + const TYPE_QWIKLAB = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::TYPE_LEGACY_EXPORT_CONSENT => 'TYPE_LEGACY_EXPORT_CONSENT', + self::TYPE_QWIKLAB => 'TYPE_QWIKLAB', + ]; + + 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(Type::class, \Google\Cloud\RapidMigrationAssessment\V1\Annotation_Type::class); + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php new file mode 100644 index 00000000000..bee99c1a431 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php @@ -0,0 +1,587 @@ +google.cloud.rapidmigrationassessment.v1.Collector + */ +class Collector extends \Google\Protobuf\Internal\Message +{ + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * User specified name of the Collector. + * + * Generated from protobuf field string display_name = 5; + */ + protected $display_name = ''; + /** + * User specified description of the Collector. + * + * Generated from protobuf field string description = 6; + */ + protected $description = ''; + /** + * Service Account email used to ingest data to this Collector. + * + * Generated from protobuf field string service_account = 7; + */ + protected $service_account = ''; + /** + * Output only. Store cloud storage bucket name (which is a guid) created with + * this Collector. + * + * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $bucket = ''; + /** + * User specified expected asset count. + * + * Generated from protobuf field int64 expected_asset_count = 9; + */ + protected $expected_asset_count = 0; + /** + * Output only. State of the Collector. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Client version. + * + * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $client_version = ''; + /** + * Output only. Reference to MC Source Guest Os Scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $guest_os_scan = null; + /** + * Output only. Reference to MC Source vsphere_scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vsphere_scan = null; + /** + * How many days to collect data. + * + * Generated from protobuf field int32 collection_days = 14; + */ + protected $collection_days = 0; + /** + * Uri for EULA (End User License Agreement) from customer. + * + * Generated from protobuf field string eula_uri = 15; + */ + protected $eula_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * name of resource. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type string $display_name + * User specified name of the Collector. + * @type string $description + * User specified description of the Collector. + * @type string $service_account + * Service Account email used to ingest data to this Collector. + * @type string $bucket + * Output only. Store cloud storage bucket name (which is a guid) created with + * this Collector. + * @type int|string $expected_asset_count + * User specified expected asset count. + * @type int $state + * Output only. State of the Collector. + * @type string $client_version + * Output only. Client version. + * @type \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan $guest_os_scan + * Output only. Reference to MC Source Guest Os Scan. + * @type \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan $vsphere_scan + * Output only. Reference to MC Source vsphere_scan. + * @type int $collection_days + * How many days to collect data. + * @type string $eula_uri + * Uri for EULA (End User License Agreement) from customer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); + parent::__construct($data); + } + + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * name of resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 4; + * @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; + } + + /** + * User specified name of the Collector. + * + * Generated from protobuf field string display_name = 5; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User specified name of the Collector. + * + * Generated from protobuf field string display_name = 5; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * User specified description of the Collector. + * + * Generated from protobuf field string description = 6; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User specified description of the Collector. + * + * Generated from protobuf field string description = 6; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Service Account email used to ingest data to this Collector. + * + * Generated from protobuf field string service_account = 7; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Service Account email used to ingest data to this Collector. + * + * Generated from protobuf field string service_account = 7; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Output only. Store cloud storage bucket name (which is a guid) created with + * this Collector. + * + * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Output only. Store cloud storage bucket name (which is a guid) created with + * this Collector. + * + * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * User specified expected asset count. + * + * Generated from protobuf field int64 expected_asset_count = 9; + * @return int|string + */ + public function getExpectedAssetCount() + { + return $this->expected_asset_count; + } + + /** + * User specified expected asset count. + * + * Generated from protobuf field int64 expected_asset_count = 9; + * @param int|string $var + * @return $this + */ + public function setExpectedAssetCount($var) + { + GPBUtil::checkInt64($var); + $this->expected_asset_count = $var; + + return $this; + } + + /** + * Output only. State of the Collector. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the Collector. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Client version. + * + * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClientVersion() + { + return $this->client_version; + } + + /** + * Output only. Client version. + * + * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClientVersion($var) + { + GPBUtil::checkString($var, True); + $this->client_version = $var; + + return $this; + } + + /** + * Output only. Reference to MC Source Guest Os Scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan|null + */ + public function getGuestOsScan() + { + return $this->guest_os_scan; + } + + public function hasGuestOsScan() + { + return isset($this->guest_os_scan); + } + + public function clearGuestOsScan() + { + unset($this->guest_os_scan); + } + + /** + * Output only. Reference to MC Source Guest Os Scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan $var + * @return $this + */ + public function setGuestOsScan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan::class); + $this->guest_os_scan = $var; + + return $this; + } + + /** + * Output only. Reference to MC Source vsphere_scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan|null + */ + public function getVsphereScan() + { + return $this->vsphere_scan; + } + + public function hasVsphereScan() + { + return isset($this->vsphere_scan); + } + + public function clearVsphereScan() + { + unset($this->vsphere_scan); + } + + /** + * Output only. Reference to MC Source vsphere_scan. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan $var + * @return $this + */ + public function setVsphereScan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan::class); + $this->vsphere_scan = $var; + + return $this; + } + + /** + * How many days to collect data. + * + * Generated from protobuf field int32 collection_days = 14; + * @return int + */ + public function getCollectionDays() + { + return $this->collection_days; + } + + /** + * How many days to collect data. + * + * Generated from protobuf field int32 collection_days = 14; + * @param int $var + * @return $this + */ + public function setCollectionDays($var) + { + GPBUtil::checkInt32($var); + $this->collection_days = $var; + + return $this; + } + + /** + * Uri for EULA (End User License Agreement) from customer. + * + * Generated from protobuf field string eula_uri = 15; + * @return string + */ + public function getEulaUri() + { + return $this->eula_uri; + } + + /** + * Uri for EULA (End User License Agreement) from customer. + * + * Generated from protobuf field string eula_uri = 15; + * @param string $var + * @return $this + */ + public function setEulaUri($var) + { + GPBUtil::checkString($var, True); + $this->eula_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php new file mode 100644 index 00000000000..80e3ca98246 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php @@ -0,0 +1,113 @@ +google.cloud.rapidmigrationassessment.v1.Collector.State + */ +class State +{ + /** + * Collector state is not recognized. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Collector started to create, but hasn't been completed MC source creation + * and db object creation. + * + * Generated from protobuf enum STATE_INITIALIZING = 1; + */ + const STATE_INITIALIZING = 1; + /** + * Collector has been created, MC source creation and db object creation + * completed. + * + * Generated from protobuf enum STATE_READY_TO_USE = 2; + */ + const STATE_READY_TO_USE = 2; + /** + * Collector client has been registered with client. + * + * Generated from protobuf enum STATE_REGISTERED = 3; + */ + const STATE_REGISTERED = 3; + /** + * Collector client is actively scanning. + * + * Generated from protobuf enum STATE_ACTIVE = 4; + */ + const STATE_ACTIVE = 4; + /** + * Collector is not actively scanning. + * + * Generated from protobuf enum STATE_PAUSED = 5; + */ + const STATE_PAUSED = 5; + /** + * Collector is starting background job for deletion. + * + * Generated from protobuf enum STATE_DELETING = 6; + */ + const STATE_DELETING = 6; + /** + * Collector completed all tasks for deletion. + * + * Generated from protobuf enum STATE_DECOMMISSIONED = 7; + */ + const STATE_DECOMMISSIONED = 7; + /** + * Collector is in error state. + * + * Generated from protobuf enum STATE_ERROR = 8; + */ + const STATE_ERROR = 8; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::STATE_INITIALIZING => 'STATE_INITIALIZING', + self::STATE_READY_TO_USE => 'STATE_READY_TO_USE', + self::STATE_REGISTERED => 'STATE_REGISTERED', + self::STATE_ACTIVE => 'STATE_ACTIVE', + self::STATE_PAUSED => 'STATE_PAUSED', + self::STATE_DELETING => 'STATE_DELETING', + self::STATE_DECOMMISSIONED => 'STATE_DECOMMISSIONED', + self::STATE_ERROR => 'STATE_ERROR', + ]; + + 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(State::class, \Google\Cloud\RapidMigrationAssessment\V1\Collector_State::class); + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php new file mode 100644 index 00000000000..87efb5b2232 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php @@ -0,0 +1,161 @@ +google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + */ +class CreateAnnotationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the parent (project+location). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $annotation = null; + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Name of the parent (project+location). Please see + * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. + * @param \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation Required. The resource being created. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\CreateAnnotationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation): self + { + return (new self()) + ->setParent($parent) + ->setAnnotation($annotation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the parent (project+location). + * @type \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the parent (project+location). + * + * 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. Name of the parent (project+location). + * + * 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 resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RapidMigrationAssessment\V1\Annotation|null + */ + public function getAnnotation() + { + return $this->annotation; + } + + public function hasAnnotation() + { + return isset($this->annotation); + } + + public function clearAnnotation() + { + unset($this->annotation); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RapidMigrationAssessment\V1\Annotation $var + * @return $this + */ + public function setAnnotation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Annotation::class); + $this->annotation = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php new file mode 100644 index 00000000000..c309fb5898b --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php @@ -0,0 +1,197 @@ +google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + */ +class CreateCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the parent (project+location). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object. + * + * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $collector_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $collector = null; + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Name of the parent (project+location). Please see + * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. + * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector Required. The resource being created. + * @param string $collectorId Required. Id of the requesting object. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\CreateCollectorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector, string $collectorId): self + { + return (new self()) + ->setParent($parent) + ->setCollector($collector) + ->setCollectorId($collectorId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the parent (project+location). + * @type string $collector_id + * Required. Id of the requesting object. + * @type \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the parent (project+location). + * + * 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. Name of the parent (project+location). + * + * 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. Id of the requesting object. + * + * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCollectorId() + { + return $this->collector_id; + } + + /** + * Required. Id of the requesting object. + * + * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCollectorId($var) + { + GPBUtil::checkString($var, True); + $this->collector_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RapidMigrationAssessment\V1\Collector|null + */ + public function getCollector() + { + return $this->collector; + } + + public function hasCollector() + { + return isset($this->collector); + } + + public function clearCollector() + { + unset($this->collector); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $var + * @return $this + */ + public function setCollector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); + $this->collector = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php new file mode 100644 index 00000000000..1afa5dd029b --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php @@ -0,0 +1,155 @@ +google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + */ +class DeleteCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\DeleteCollectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php new file mode 100644 index 00000000000..00e49e06416 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php @@ -0,0 +1,81 @@ +google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + */ +class GetAnnotationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::annotationName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\GetAnnotationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php new file mode 100644 index 00000000000..f70f9965ac4 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php @@ -0,0 +1,81 @@ +google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + */ +class GetCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\GetCollectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php new file mode 100644 index 00000000000..f93d7fb6a1b --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php @@ -0,0 +1,67 @@ +google.cloud.rapidmigrationassessment.v1.GuestOsScan + */ +class GuestOsScan extends \Google\Protobuf\Internal\Message +{ + /** + * reference to the corresponding Guest OS Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + */ + protected $core_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $core_source + * reference to the corresponding Guest OS Scan in MC Source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); + parent::__construct($data); + } + + /** + * reference to the corresponding Guest OS Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + * @return string + */ + public function getCoreSource() + { + return $this->core_source; + } + + /** + * reference to the corresponding Guest OS Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + * @param string $var + * @return $this + */ + public function setCoreSource($var) + { + GPBUtil::checkString($var, True); + $this->core_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php new file mode 100644 index 00000000000..cc6aaa40547 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php @@ -0,0 +1,221 @@ +google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + */ +class ListCollectorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListCollectorsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListCollectorsRequest. Please see + * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\ListCollectorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListCollectorsRequest. + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results. + * @type string $order_by + * Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListCollectorsRequest. + * + * 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. Parent value for ListCollectorsRequest. + * + * 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; + } + + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php new file mode 100644 index 00000000000..855e4171f23 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php @@ -0,0 +1,135 @@ +google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + */ +class ListCollectorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Collectors. + * + * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + private $collectors; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RapidMigrationAssessment\V1\Collector>|\Google\Protobuf\Internal\RepeatedField $collectors + * The list of Collectors. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * The list of Collectors. + * + * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectors() + { + return $this->collectors; + } + + /** + * The list of Collectors. + * + * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + * @param array<\Google\Cloud\RapidMigrationAssessment\V1\Collector>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); + $this->collectors = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php new file mode 100644 index 00000000000..25fc6047fd7 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.rapidmigrationassessment.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php new file mode 100644 index 00000000000..5b121be3f81 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php @@ -0,0 +1,155 @@ +google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + */ +class PauseCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\PauseCollectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php new file mode 100644 index 00000000000..f012e81aed8 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php @@ -0,0 +1,155 @@ +google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + */ +class RegisterCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\RegisterCollectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php new file mode 100644 index 00000000000..77e3fad9004 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php @@ -0,0 +1,155 @@ +google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + */ +class ResumeCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\ResumeCollectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * 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. Name of the resource. + * + * 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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * 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; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php new file mode 100644 index 00000000000..602d2ef1154 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php @@ -0,0 +1,230 @@ +google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + */ +class UpdateCollectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $collector = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector Required. The resource being updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\RapidMigrationAssessment\V1\UpdateCollectorRequest + * + * @experimental + */ + public static function build(\Google\Cloud\RapidMigrationAssessment\V1\Collector $collector, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCollector($collector) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector + * Required. The resource being updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RapidMigrationAssessment\V1\Collector|null + */ + public function getCollector() + { + return $this->collector; + } + + public function hasCollector() + { + return isset($this->collector); + } + + public function clearCollector() + { + unset($this->collector); + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $var + * @return $this + */ + public function setCollector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); + $this->collector = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php new file mode 100644 index 00000000000..a143f6bc875 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php @@ -0,0 +1,67 @@ +google.cloud.rapidmigrationassessment.v1.VSphereScan + */ +class VSphereScan extends \Google\Protobuf\Internal\Message +{ + /** + * reference to the corresponding VSphere Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + */ + protected $core_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $core_source + * reference to the corresponding VSphere Scan in MC Source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); + parent::__construct($data); + } + + /** + * reference to the corresponding VSphere Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + * @return string + */ + public function getCoreSource() + { + return $this->core_source; + } + + /** + * reference to the corresponding VSphere Scan in MC Source. + * + * Generated from protobuf field string core_source = 1; + * @param string $var + * @return $this + */ + public function setCoreSource($var) + { + GPBUtil::checkString($var, True); + $this->core_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php new file mode 100644 index 00000000000..21ae280ef3a --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setAnnotation($annotation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->createAnnotation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Annotation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); + + create_annotation_sample($formattedParent); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php new file mode 100644 index 00000000000..85046037f46 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php @@ -0,0 +1,89 @@ +setParent($formattedParent) + ->setCollectorId($collectorId) + ->setCollector($collector); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->createCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); + $collectorId = '[COLLECTOR_ID]'; + + create_collector_sample($formattedParent, $collectorId); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php new file mode 100644 index 00000000000..054bbffd29a --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->deleteCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::collectorName( + '[PROJECT]', + '[LOCATION]', + '[COLLECTOR]' + ); + + delete_collector_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php new file mode 100644 index 00000000000..91134e80889 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Annotation $response */ + $response = $rapidMigrationAssessmentClient->getAnnotation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::annotationName( + '[PROJECT]', + '[LOCATION]', + '[ANNOTATION]' + ); + + get_annotation_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php new file mode 100644 index 00000000000..652fc907540 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Collector $response */ + $response = $rapidMigrationAssessmentClient->getCollector($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::collectorName( + '[PROJECT]', + '[LOCATION]', + '[COLLECTOR]' + ); + + get_collector_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php new file mode 100644 index 00000000000..632bf3f8855 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php new file mode 100644 index 00000000000..839bfe97aca --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $rapidMigrationAssessmentClient->listCollectors($request); + + /** @var Collector $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); + + list_collectors_sample($formattedParent); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php new file mode 100644 index 00000000000..55b1227945c --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php new file mode 100644 index 00000000000..b7075c547e6 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->pauseCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::collectorName( + '[PROJECT]', + '[LOCATION]', + '[COLLECTOR]' + ); + + pause_collector_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php new file mode 100644 index 00000000000..539268cf039 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->registerCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::collectorName( + '[PROJECT]', + '[LOCATION]', + '[COLLECTOR]' + ); + + register_collector_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php new file mode 100644 index 00000000000..d3f055621b0 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->resumeCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RapidMigrationAssessmentClient::collectorName( + '[PROJECT]', + '[LOCATION]', + '[COLLECTOR]' + ); + + resume_collector_sample($formattedName); +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php new file mode 100644 index 00000000000..649482bbc89 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setCollector($collector); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $rapidMigrationAssessmentClient->updateCollector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Collector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php new file mode 100644 index 00000000000..97985d92384 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php @@ -0,0 +1,659 @@ + createAnnotationAsync(CreateAnnotationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createCollectorAsync(CreateCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteCollectorAsync(DeleteCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAnnotationAsync(GetAnnotationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getCollectorAsync(GetCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface listCollectorsAsync(ListCollectorsRequest $request, array $optionalArgs = []) + * @method PromiseInterface pauseCollectorAsync(PauseCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface registerCollectorAsync(RegisterCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeCollectorAsync(ResumeCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateCollectorAsync(UpdateCollectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class RapidMigrationAssessmentClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'rapidmigrationassessment.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'rapidmigrationassessment.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/rapid_migration_assessment_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a annotation + * resource. + * + * @param string $project + * @param string $location + * @param string $annotation + * + * @return string The formatted annotation resource. + */ + public static function annotationName(string $project, string $location, string $annotation): string + { + return self::getPathTemplate('annotation')->render([ + 'project' => $project, + 'location' => $location, + 'annotation' => $annotation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a collector + * resource. + * + * @param string $project + * @param string $location + * @param string $collector + * + * @return string The formatted collector resource. + */ + public static function collectorName(string $project, string $location, string $collector): string + { + return self::getPathTemplate('collector')->render([ + 'project' => $project, + 'location' => $location, + 'collector' => $collector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - annotation: projects/{project}/locations/{location}/annotations/{annotation} + * - collector: projects/{project}/locations/{location}/collectors/{collector} + * - location: projects/{project}/locations/{location} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'rapidmigrationassessment.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an Annotation + * + * The async variant is + * {@see RapidMigrationAssessmentClient::createAnnotationAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/create_annotation.php + * + * @param CreateAnnotationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAnnotation(CreateAnnotationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAnnotation', $request, $callOptions)->wait(); + } + + /** + * Create a Collector to manage the on-prem appliance which collects + * information about Customer assets. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::createCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/create_collector.php + * + * @param CreateCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCollector(CreateCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCollector', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * Background jobs does final deletion thorugh producer api. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::deleteCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/delete_collector.php + * + * @param DeleteCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCollector(DeleteCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCollector', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Annotation. + * + * The async variant is {@see RapidMigrationAssessmentClient::getAnnotationAsync()} + * . + * + * @example samples/V1/RapidMigrationAssessmentClient/get_annotation.php + * + * @param GetAnnotationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Annotation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAnnotation(GetAnnotationRequest $request, array $callOptions = []): Annotation + { + return $this->startApiCall('GetAnnotation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Collector. + * + * The async variant is {@see RapidMigrationAssessmentClient::getCollectorAsync()} + * . + * + * @example samples/V1/RapidMigrationAssessmentClient/get_collector.php + * + * @param GetCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Collector + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCollector(GetCollectorRequest $request, array $callOptions = []): Collector + { + return $this->startApiCall('GetCollector', $request, $callOptions)->wait(); + } + + /** + * Lists Collectors in a given project and location. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::listCollectorsAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/list_collectors.php + * + * @param ListCollectorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCollectors(ListCollectorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCollectors', $request, $callOptions); + } + + /** + * Pauses the given collector. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::pauseCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/pause_collector.php + * + * @param PauseCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function pauseCollector(PauseCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PauseCollector', $request, $callOptions)->wait(); + } + + /** + * Registers the given collector. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::registerCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/register_collector.php + * + * @param RegisterCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function registerCollector(RegisterCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RegisterCollector', $request, $callOptions)->wait(); + } + + /** + * Resumes the given collector. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::resumeCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/resume_collector.php + * + * @param ResumeCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeCollector(ResumeCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ResumeCollector', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single Collector. + * + * The async variant is + * {@see RapidMigrationAssessmentClient::updateCollectorAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/update_collector.php + * + * @param UpdateCollectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCollector(UpdateCollectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCollector', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see RapidMigrationAssessmentClient::getLocationAsync()} . + * + * @example samples/V1/RapidMigrationAssessmentClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see RapidMigrationAssessmentClient::listLocationsAsync()} + * . + * + * @example samples/V1/RapidMigrationAssessmentClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..c2befd3145f --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json @@ -0,0 +1,78 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.rapidmigrationassessment.v1", + "libraryPackage": "Google\\Cloud\\RapidMigrationAssessment\\V1", + "services": { + "RapidMigrationAssessment": { + "clients": { + "grpc": { + "libraryClient": "RapidMigrationAssessmentGapicClient", + "rpcs": { + "CreateAnnotation": { + "methods": [ + "createAnnotation" + ] + }, + "CreateCollector": { + "methods": [ + "createCollector" + ] + }, + "DeleteCollector": { + "methods": [ + "deleteCollector" + ] + }, + "GetAnnotation": { + "methods": [ + "getAnnotation" + ] + }, + "GetCollector": { + "methods": [ + "getCollector" + ] + }, + "ListCollectors": { + "methods": [ + "listCollectors" + ] + }, + "PauseCollector": { + "methods": [ + "pauseCollector" + ] + }, + "RegisterCollector": { + "methods": [ + "registerCollector" + ] + }, + "ResumeCollector": { + "methods": [ + "resumeCollector" + ] + }, + "UpdateCollector": { + "methods": [ + "updateCollector" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json new file mode 100644 index 00000000000..66abca8631c --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateAnnotation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetAnnotation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetCollector": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListCollectors": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RegisterCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCollector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php new file mode 100644 index 00000000000..186a1712b14 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php @@ -0,0 +1,245 @@ + [ + 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' => [ + 'CreateAnnotation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Annotation', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'PauseCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RegisterCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResumeCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCollector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'collector.name', + 'fieldAccessors' => [ + 'getCollector', + 'getName', + ], + ], + ], + ], + 'GetAnnotation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\Annotation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCollector' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\Collector', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCollectors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCollectors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\ListCollectorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'annotation' => 'projects/{project}/locations/{location}/annotations/{annotation}', + 'collector' => 'projects/{project}/locations/{location}/collectors/{collector}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php new file mode 100644 index 00000000000..d2d9306a498 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php @@ -0,0 +1,223 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' => [ + 'CreateAnnotation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/annotations', + 'body' => 'annotation', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCollector' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/collectors', + 'body' => 'collector', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'collector_id', + ], + ], + 'DeleteCollector' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAnnotation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/annotations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCollector' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCollectors' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/collectors', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseCollector' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RegisterCollector' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:register', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeCollector' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCollector' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{collector.name=projects/*/locations/*/collectors/*}', + 'body' => 'collector', + 'placeholders' => [ + 'collector.name' => [ + 'getters' => [ + 'getCollector', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php b/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php new file mode 100644 index 00000000000..723ff2b6097 --- /dev/null +++ b/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php @@ -0,0 +1,1473 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RapidMigrationAssessmentClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RapidMigrationAssessmentClient($options); + } + + /** @test */ + public function createAnnotationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createAnnotationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Annotation(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAnnotationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $annotation = new Annotation(); + $request = (new CreateAnnotationRequest()) + ->setParent($formattedParent) + ->setAnnotation($annotation); + $response = $gapicClient->createAnnotation($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAnnotation(); + $this->assertProtobufEquals($annotation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); + $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 createAnnotationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createAnnotationTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $annotation = new Annotation(); + $request = (new CreateAnnotationRequest()) + ->setParent($formattedParent) + ->setAnnotation($annotation); + $response = $gapicClient->createAnnotation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); + 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 createCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $collectorId = 'collectorId1641692685'; + $collector = new Collector(); + $request = (new CreateCollectorRequest()) + ->setParent($formattedParent) + ->setCollectorId($collectorId) + ->setCollector($collector); + $response = $gapicClient->createCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getCollectorId(); + $this->assertProtobufEquals($collectorId, $actualValue); + $actualValue = $actualApiRequestObject->getCollector(); + $this->assertProtobufEquals($collector, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createCollectorTest'); + $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 createCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createCollectorTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $collectorId = 'collectorId1641692685'; + $collector = new Collector(); + $request = (new CreateCollectorRequest()) + ->setParent($formattedParent) + ->setCollectorId($collectorId) + ->setCollector($collector); + $response = $gapicClient->createCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createCollectorTest'); + 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 deleteCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new DeleteCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/DeleteCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteCollectorTest'); + $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 deleteCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteCollectorTest'); + $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 + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new DeleteCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteCollectorTest'); + 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 getAnnotationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Annotation(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->annotationName('[PROJECT]', '[LOCATION]', '[ANNOTATION]'); + $request = (new GetAnnotationRequest()) + ->setName($formattedName); + $response = $gapicClient->getAnnotation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetAnnotation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnnotationExceptionTest() + { + $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->annotationName('[PROJECT]', '[LOCATION]', '[ANNOTATION]'); + $request = (new GetAnnotationRequest()) + ->setName($formattedName); + try { + $gapicClient->getAnnotation($request); + // 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 getCollectorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new GetCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->getCollector($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetCollector', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCollectorExceptionTest() + { + $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->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new GetCollectorRequest()) + ->setName($formattedName); + try { + $gapicClient->getCollector($request); + // 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 listCollectorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $collectorsElement = new Collector(); + $collectors = [ + $collectorsElement, + ]; + $expectedResponse = new ListCollectorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCollectors($collectors); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCollectorsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCollectors($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCollectors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ListCollectors', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCollectorsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCollectorsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCollectors($request); + // 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 pauseCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/pauseCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/pauseCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new PauseCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->pauseCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/PauseCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/pauseCollectorTest'); + $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 pauseCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/pauseCollectorTest'); + $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 + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new PauseCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->pauseCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/pauseCollectorTest'); + 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 registerCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/registerCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/registerCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new RegisterCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->registerCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/RegisterCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/registerCollectorTest'); + $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 registerCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/registerCollectorTest'); + $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 + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new RegisterCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->registerCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/registerCollectorTest'); + 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 resumeCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/resumeCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/resumeCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new ResumeCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->resumeCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/ResumeCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resumeCollectorTest'); + $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 resumeCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/resumeCollectorTest'); + $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 + $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); + $request = (new ResumeCollectorRequest()) + ->setName($formattedName); + $response = $gapicClient->resumeCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resumeCollectorTest'); + 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 updateCollectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateCollectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $serviceAccount = 'serviceAccount-1948028253'; + $bucket = 'bucket-1378203158'; + $expectedAssetCount = 290454521; + $clientVersion = 'clientVersion-1506231196'; + $collectionDays = 1060007256; + $eulaUri = 'eulaUri-421590958'; + $expectedResponse = new Collector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setBucket($bucket); + $expectedResponse->setExpectedAssetCount($expectedAssetCount); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setCollectionDays($collectionDays); + $expectedResponse->setEulaUri($eulaUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateCollectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $collector = new Collector(); + $request = (new UpdateCollectorRequest()) + ->setUpdateMask($updateMask) + ->setCollector($collector); + $response = $gapicClient->updateCollector($request); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/UpdateCollector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getCollector(); + $this->assertProtobufEquals($collector, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateCollectorTest'); + $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 updateCollectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateCollectorTest'); + $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 + $updateMask = new FieldMask(); + $collector = new Collector(); + $request = (new UpdateCollectorRequest()) + ->setUpdateMask($updateMask) + ->setCollector($collector); + $response = $gapicClient->updateCollector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateCollectorTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createAnnotationAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createAnnotationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Annotation(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAnnotationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $annotation = new Annotation(); + $request = (new CreateAnnotationRequest()) + ->setParent($formattedParent) + ->setAnnotation($annotation); + $response = $gapicClient->createAnnotationAsync($request)->wait(); + $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAnnotation(); + $this->assertProtobufEquals($annotation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); + $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()); + } +} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php new file mode 100644 index 0000000000000000000000000000000000000000..0577623efb24959f2671829c3bfaea1d19557ea5 GIT binary patch literal 24700 zcmd5^TWllOc{WK&D;;Vj?pWT{YJH){YkMv4Qdw^7IP@(;ijtV6NSYU|*H$v6$dSY> zMKT;xYt`L8qy^HV1&StUfxfgwkS1-@qCnFdnwR#WKoPVJ&^9f)MNv1sp?)g**oUIu zf6kd3Ig)3!euy8|;+Z-B`Okm;`~RPL?akhPk3AD#H#$bYJ}{c`oul|*--!46-9fj} zZO32ro9~fq@-Z0|prSzsTs5k3_`t~{px}71Q+vRbf z+gsOPWvtPzn`YeSF?*lI@n3Ja({455=Ab^n|1P&oz13+ATJ?78N3rAAif|Uyl#^L&Lp#Jl;13!+z&gjyD0gXaBYBLqx6D z+SWRqE>WS|F;gjLPY#IVCT7|#9OZ+}S!)^XX4=@VAGW&vQ%ucucDoNYt!zkc47@k{ z$Uv~{L2qyrd_j9E-{)rCymN}V)fU)(P(SDepIh!VwktTq;W0;~>?eF=KXG_{>4IFN-fKZg5H|_YUwX>*V3$}% z-;q2cU$`{(LJOQBA6|4l?91aHna4E@#B#-;1C|dhePursOCR7E z?HYTL6VKYgLA_JogSHi$1If$;H1G;o?h8g^plmP(jVB>5h5;y=T#+xIcnS#zp>zZ* zt6!O9v1-5GG3#8KlH&-&)|5@B|jSo{3xiz=s*<^Y2}deD4PO_%x;I{ zKO+VeHhEZY4~@kL_7oChH*9P`|HTQu*(D1b>u?gbAn{4+A4k}N-`dJ^Os$r+LPg6| zbH#$5-O3iKdi8cGtJeyZQZ|!Y%Vk$%k0=W)wwWzwHZ(leN~LmfD;o#&YBrP46|%8O5MsWh-QFZT zGFquxD`#U<$|ZJTWYC^*Mqz9!qZKmQd~8}d&lDh8UeBhr%uPL4c&nBx-;T`?{;qK? zpDkBojNV==YqeD!792ax2=t=L9AnPgv03GDw&?uE#!BUE1qc$7v9lvwnDJIETdBt8U1QdcV}!qWFLuuL+=8R1KXHa#l$Od@f+omWkn-~qm!B1O z%}?!&h>yek$_^yRwuPJn=aM;#sZP>kiDMD7p1`;Y#(kHa5gcxUog-J~lG%q`pv>h( z0Kb3@G#cF@q_ovsJi~Pfm#Zh)x&6AiZ!~q+bCQ}_F|o$Z4IF{jxu7pja;bVL5PqX# zB?Rur8FQQqWr>~F3g9u$Un7zQUdw0KbJg6YRwbFjZ_bmoJaJc8S!A)2R;k=7mRI#m zv0Tn(sPRuo7txYdf5$z)4aD3aOHCsGPlg&0{fzLBk!bCqf?Q{ek5%KHJ;xb_~5UJlHY%LiJ;OiJk2W1E~+XcZ?3#|J)`-lsDOV`1b?-(6x$A zwm6tAh@=^tHYBF%KTfadXF%Uz^J|+NFt7-gAh3EtzGZz4PnsrMz<+! zo3wXrw$z53FuFU?Y}g)fsh&$_0^xAXrV?ciiZF?QA*P2W1ty>!ISn)E@M1{)b1pfw zppcwOEngjx99XYP4J=)$=(S3=tV7`oI~gKFl`WTxW$^$a?>r1EmswmqtmLX$y;w*W zweo7Nuns$wDQ=eXSx8nyd5T>UZ$Z>^r5qVTf}`d0#aj@e3FQU$?C1+x8i?rm+-9z- zXW!n?Y88^UNe7)w84{EMH|Gk~Y`LK2VN_N2q=1vb>qQuH{jC~wlncNa2N|(PVIlSO zZ6SBi4^V9a2wqstWvcpSt^!S#*@(@ke-UC&mHMqi9BBy-+TCuynK$Zp+?<95ly?|*o5e}%sVYQyn8=K|}t_E80BN$$6aF;FZw))21db_Rny2!>Hx%bET za>11CngmngP)4^0LhknK!zS@Rg)nf&+zUk?fRJkhr(}Z}T?u?ERx(?A;6QWnEQcM8 zZ#nFWm?+NW^X$B^i~=Z*#yb324)@c+&Vr092R@3f&dxh9b)$3G>UTR7m@dw7_^Ckf z9jI9c0zcu@dmn1U2lc{Vgpg7|Yp%R6|GKy0V2M%Z$GzpK^TSNK;$QWbC)p%dCTaJRlI+#@$j&p6X#Eb@i=jYX0sISI?`8+B+Cb1@2sMviVjKQ4_1#ogS4 zTO@{)2$42*1q+mum3$shn>v$MF<0y|%Vq?H;VLf9W3g!RS|IML!5ET%DZt!jF(E6C zs4t!aw7Fz3Ugj*5;KJfaIR~v4*!;-25@(N#$Qhw9`bkHD)!EZUMuxaT zK75zO?1z?zFHBT0Q#eA31X7eF3F27aVe>n!cAFNqU{iD(O@0ip^K61RkBe0_8BC>) zB1=ptFnx>792k8RIXVN<{uD1fEXYkZ30-wyLMfjfTn-QfhVQc3Jy`m?^&?a~AZ)_U zekPExjqZD00J7z8>FXhOMxGo3hZ*EwT0KhZx>*(a$2!EYqko{1+ua7rFM}gDkH*=f z_2vPp5+(#=&^k19BueYtdy|T5kwyE)9@%ux!^E%7lU^4|*tU2=+$f$beJ#W$=*$q5 zx-%xu8;H=O@UXe=(?NQ&9T7o4NCuB%-G&2_A!1wMFd0q01*tDDj>NYvDI<~Qp|3rU z&=>QTcG(1-8Zw7&7uzeHzM!dy7&%VJG1U)E-TT~SL-D+EcsTOhp+))}o7Zv1R@NCAEcMqyY}(TA%4_UV zej?xind9Q|KAlW7`BAywk%M-jofh#gmJ?x7H2Gp6QQ&wrIZLQN!luMem~hD)j@cHRRQpjc#9LJi~-WMA_bUl8Yo+ zbIG+pTX6$UWT=aQdYzFGD-8MRV zA{#T8eDxG)SRnY;)c*>x1wYJy)YF+f(qDGs8fj+#G#^s!Ma1NkdZ(=6`C1|SHgfxv zPsB&G6^h^y47ia;x6M6M$?MH5`ZcD6otM%`pH8Ef}cBS6wUk2EOO z^ZFKN*-W8G)d9SKEg^v}^ATbCTO|Kt5%oI}_!-^+mbeE79PS0NDOWcUMQ3xZ4j+}L z$`#yPG9BpfMpj7V1SmKEd{U}ZLnP`%NdFOnOL@%ceJF9BpR%<@M1kj9?=<^eNC+AP z?ob|$zhXPb5y~I7x~9G}>@?d3CB(@qmQ0F5lPGRE9(qLm`4Btn!CQHfE#(SZT0TeB z3m>-PY;?0wyj4I-$^9PA1IM$e<=2YkO*nsHg*?HxOSv+BM3iYZv05u-!8aI2uBd|i z7gz-~qI9`t!t%qDX1An(FAbVE* zF}7$Gi(&e)ZIMYOeI>I#wTE2U>R+h0s|4M>`qEW);TW2bVI4W4B}84y_&)sJyvok| zFUtd5Lc?|P>c2+VEI%}vPf*@wvqLyMx|Ns^W;0-Rg_0f;P=XAdCrJUw{E#ikWZZ%# z$=xU>hz@SZOC=U{t%k($1(I2~fX(`mskgg#v7a4OyM!8>6g)>k%25aHN@(lRIk^cT zArMQ*#YSDrD0QeLikjN>9Rt}K%J0u5*MoD1MHClIzKuM=6PD{8Xmc#VN674u1<>(qr68so9CrS`LrU>OW(+?Z^S0luZGZS z0OxRE+%%3p);5~w?{6BiRM9WSh+F^ zQPjc5MFP_C?$rj1If#gWN_m-0U}sj9G4R%~$b1KmIs71CAXef5hWa`7WZ4+>TS$86 zjlFu~sA3?3qTO4Ye^n4u1S<*NHF1SK7ockbFyN=2UH3qH%@e3TC^&?nv04w=L^sRG z(-smPm?ZqP75JM&4iD8Y_(j4ljr*H+ryk7;sU;R$HQI&;i-+6T?}ykWAq(Czg>?uY zOZV4XY<{GcA~$>^kcfCO6Vd`1zC=vwd4|&2$BOp@OAciCaeu6&7!}w#FD0njCo1=+ zp~dmy)nJR@e-CwR!CLo-!l$`p-C)-PNR}6#`VAa{kP7bu>kxd-T?or*_WCe#v&$|C zx$(#IVbFBiiddZpohlRvpm&BRS&|IpGeSVfC?qa zEPP5xL0Xv=8(IYC8%+jlbF=d@5@KrqL(O;)@+i;xR5!`$ue^_c@2$u!E}xNqB&|Qx z*NBUbG3HY9U1aCl+|KJJH}t%`$!)v(?I{)kYf)st(y?^YK^FwJty*ujDoITd+Mlnt$njSY|(BbxkFAQPpDbdMJ(Fr*xh z4N&wf2E#B{tayO|Ls@@y0E*^-U>Iga@zx78XGaQCoY8{SNC6|kg8(zz8T7gP8X|{A zX27}Rhzi&Vl0%0WQD7mg{7bjTZ+Y-USTq@oN;1Pz6jKRgNFlyJ+1aMLC?S0!&@tYs z?^;a3fh}EQQP)lp`EviBGbnOsvh|xYWh(qiC{_DVD+hH^l_yS=wq@>bCuzO(qwE|+ zV6fZmAK3d+|0l%ey!)r5qD9S-{Ch}gqKj5$x@JS_%2nRyv$s>gSQ3 z7OU6~kPUsJiq>lCq6?TUM!bz|axuR}eQ*z?4pa4 zr~Iu-6*WHa=O_$VPs!mD^(EKrgC13QcF`8f$s+4xJ1mBNQG?7MRq^=!0#Xb?yBxj9 zBJ*s+vMv^cmG{{b_L1OxQT9fejQ7JCRR1=38h9>Q493D9)t0c20pS&gi_QUDk0Y?+ z#NK7|BS=vMO+AR~Wzh`nbJt*oO^ONv?;FT$WHUF@#kUciBd?51Nv@K^!6ChWh~UDq zY2yee*VqdVM^v&Iv=mow>qs=MWy`!wF;-JRX(OG>Qzn3?q0(BOt`%Tmv@ciyu~`TZp!Oz258T$Z7YH1f-I1 zYiG#&Y$&vre$8(|XuYZ(;<4cHuU!xDU<7x`!pQZ43!N>z(CeX)&_p=hrdB{IDTpFQ zFy}#|>8sZ4oU9!#FlF3ssPC}Y=bJsdmV>ffxFVbHBF~4jvK=_#LB4!CM5$;xCrUv!K=Syb0admeIb`vO z86~P>*KJ72*r#Za3@nPBr?#Ozux!1Fnmz7@aL$SFxE2i; z{6?;PK&(R@;j_Ew(}yw_uM>~+QR)q~M@d6R)L%fyzb6bka#g3ELovMH@AhR&tYV!I z?#7{RM0evzKXMOc*V_jwn{k49DBkrsNcBroY|a`N^jAu3l1sRZINr3dIq_nT7e+!O z)h6JV3sYA6@LHN zUUiF2qnR8hfC8Ctpo7(XM~G9FFl@N*AkZ7`p!7Ew4#W+Ipi(sgxne`HVc!O9W1x#h zMp@Pib}3>MwlUb?-H;aOrL!#RI%oRnI;5p1VYyEr=TZ#!-8_U?dX~jTH$ZV%uRhq9 zN}QbPrBAVWIL2;VaHYucg}Eys3-`DSX>0jV`T~1w*AkyP*EOlE*hW%>@7(i8x~|dfG;vYh+uWK%PZwX>1fP=jd@#`!wC7t){aoln?Po%# z$dxId^zrsB%JBYjtUZ9j?*`RwlO<9du?{|m2 zO@pp1QRAbXLV0`SGVcaYqNJ72*bNSV{bc%k-8JKlgO< ziU}r~BhZge6b`C{9ek{I{ICj}GJ>g~rTQ&=#-MB*U^Qpj5AQaX*y1>{awk6>V&_SK zoqgEK<&6>L@_?nx2UjNd*o84vB=hEw;dD;dQXIj|tFtwJyWm)bi`$-0oTx4AOuon) zi%fnP-iW(_&%eQXtzz; z%KOfbd&^JC*N?IC$tO;HuKq1ra?0a=fwvas|wg}qh>jIPDe{&Gz`-LsAyJ#F4qPLmY=9FO91PBgR?J|ay zG7j9{5`Wo6<@Li3OE-ZYm!pWDF(Bz9O7&>SwxaLf^d#c5o*#dH5xa==K79vI> z)Uk#BPJ9xh5}Q;Joj6;w7DQX;Rt}B9-i+H63uk2e?wVGq=5M1tls-z3FVGusWIt_ydR0TQ3kaRn7%yECv0rq{7o|CCZ>wiS}PA>8W8nYh#z zwlB3IKXTT#Ej%|%HhL}@?81n5m4s#Z?8L143Y&EgQfm^vs!}eaiQ4ZAEXa!TE8wwE z^4~ABB|D-;vPHVo6@&AW@>g~Tl0z;f*mWV%tl>LnPFP=JbyzIH_m~!1{R6gJdSN^Fk*9TCPfER$pcTHRqtxW~XTAc9F zhunQ_o(hLo>-M)(+EG#p4QkGN#E~14&Z}R?o9uw~!3BH)odgS+3pJ zp2wofW2VypZoch-E1#!9ec$+0D8{^6>nU}ddifyiBH_cfv`-_lFU4SoRl?PePM zG*`eaXkYW|XH(FtG$oqRlw_a`nWuAYDLBu(cwgfcbPxSUSzKbP{5JU6ZfOh1&-VKk zs|3gGO-Le^zUu0F<7jR_pNv~XO&o)(;A}Kk&Dh;<0TH&}w-7#W9RR!&{^`R6|A?OI zCEc=M-DA*EekH`1(-NZuONu)aEL?&UZ-tZU1@*G8(z5vPKy>Mlvid%5i+ExrCD=tz z&m0TSltr@>v(Y0{rTA>#*B&D>UUkI@JPPDHT2Yrz+)>>fkkY>X1%`7pXbNaJN2gi4 z3wF(5e74+R>BJ2t)oUkius;&5(jNa(HUc~DiKzs;q&60&2}Kypu^5{yHweLXtMyMP z3BIE-=U~NR!?rhWRlW&nahkaTN{chWI;X3FxKI|B)EjP9_?&W*;8=Z4_Y{7Sk2i*| z$(*&!Ob7EPg|+uiwXhEs6MN^X@7&kUOCP|>`pR#SaOrtfz2biq_g1Xet;}+2v;kN7 zJLG%l$URFU!K?(^tKU>>uUep!@`oUq?$chTTUG+^RQVHBkik8keH|&mq2L>Xl-HCri`8x90}$Ba5jE@wE@q@Z|XyBq^BdTY^_^{D9Mq3J28fiX z&)(N&r7odenOuXsq<$i>2I-5wX0lNKfx*S&fq zp@^_=%y`{fk%=WwdQSODn5oCC;i^_Bg}@5Whhi>3*5-qCdVMrvW%)S-iuK(#{52)z zf9$?gfP}g;lFILf+2tT54kcJSKoC$CVS?St4F*wih;d)LC^MB;$38>Kg(RcCA*dxj z{p5=Le7VNS*P1Dl*Sa7wOIzR7)Q_(I{k4|Z9}IeCYGvi_-Mf;j>;i0kIM^4TtG{No zgQkBe%$~-FmMsSKTjKC~8ifYgu;JvQN)!Nm@%J5xN)yYamJ4e_huv-Ga7*rSmj*KvKmV9(zaUz)$i?lJcN Db9MLR literal 0 HcmV?d00001 diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php new file mode 100644 index 00000000000..a9ab1644bb8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php @@ -0,0 +1,67 @@ +google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + */ +class AccountDefenderAssessment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Labels for this request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $labels + * Output only. Labels for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Labels for this request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Labels for this request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment\AccountDefenderLabel::class); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php new file mode 100644 index 00000000000..1b83b9790b3 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php @@ -0,0 +1,82 @@ +google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + */ +class AccountDefenderLabel +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; + */ + const ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; + /** + * The request matches a known good profile for the user. + * + * Generated from protobuf enum PROFILE_MATCH = 1; + */ + const PROFILE_MATCH = 1; + /** + * The request is potentially a suspicious login event and must be further + * verified either through multi-factor authentication or another system. + * + * Generated from protobuf enum SUSPICIOUS_LOGIN_ACTIVITY = 2; + */ + const SUSPICIOUS_LOGIN_ACTIVITY = 2; + /** + * The request matched a profile that previously had suspicious account + * creation behavior. This can mean that this is a fake account. + * + * Generated from protobuf enum SUSPICIOUS_ACCOUNT_CREATION = 3; + */ + const SUSPICIOUS_ACCOUNT_CREATION = 3; + /** + * The account in the request has a high number of related accounts. It does + * not necessarily imply that the account is bad but can require further + * investigation. + * + * Generated from protobuf enum RELATED_ACCOUNTS_NUMBER_HIGH = 4; + */ + const RELATED_ACCOUNTS_NUMBER_HIGH = 4; + + private static $valueToName = [ + self::ACCOUNT_DEFENDER_LABEL_UNSPECIFIED => 'ACCOUNT_DEFENDER_LABEL_UNSPECIFIED', + self::PROFILE_MATCH => 'PROFILE_MATCH', + self::SUSPICIOUS_LOGIN_ACTIVITY => 'SUSPICIOUS_LOGIN_ACTIVITY', + self::SUSPICIOUS_ACCOUNT_CREATION => 'SUSPICIOUS_ACCOUNT_CREATION', + self::RELATED_ACCOUNTS_NUMBER_HIGH => 'RELATED_ACCOUNTS_NUMBER_HIGH', + ]; + + 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(AccountDefenderLabel::class, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment_AccountDefenderLabel::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php new file mode 100644 index 00000000000..5e8e0f49030 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php @@ -0,0 +1,182 @@ +google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + */ +class AccountVerificationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Endpoints that can be used for identity verification. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $endpoints; + /** + * Optional. Language code preference for the verification message, set as a + * IETF BCP 47 language code. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Output only. Result of the latest account verification challenge. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $latest_verification_result = 0; + /** + * Username of the account that is being verified. Deprecated. Customers + * should now provide the `account_id` field in `event.user_info`. + * + * Generated from protobuf field string username = 2 [deprecated = true]; + * @deprecated + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo>|\Google\Protobuf\Internal\RepeatedField $endpoints + * Optional. Endpoints that can be used for identity verification. + * @type string $language_code + * Optional. Language code preference for the verification message, set as a + * IETF BCP 47 language code. + * @type int $latest_verification_result + * Output only. Result of the latest account verification challenge. + * @type string $username + * Username of the account that is being verified. Deprecated. Customers + * should now provide the `account_id` field in `event.user_info`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Endpoints that can be used for identity verification. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * Optional. Endpoints that can be used for identity verification. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Optional. Language code preference for the verification message, set as a + * IETF BCP 47 language code. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. Language code preference for the verification message, set as a + * IETF BCP 47 language code. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Output only. Result of the latest account verification challenge. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLatestVerificationResult() + { + return $this->latest_verification_result; + } + + /** + * Output only. Result of the latest account verification challenge. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLatestVerificationResult($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo\Result::class); + $this->latest_verification_result = $var; + + return $this; + } + + /** + * Username of the account that is being verified. Deprecated. Customers + * should now provide the `account_id` field in `event.user_info`. + * + * Generated from protobuf field string username = 2 [deprecated = true]; + * @return string + * @deprecated + */ + public function getUsername() + { + @trigger_error('username is deprecated.', E_USER_DEPRECATED); + return $this->username; + } + + /** + * Username of the account that is being verified. Deprecated. Customers + * should now provide the `account_id` field in `event.user_info`. + * + * Generated from protobuf field string username = 2 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setUsername($var) + { + @trigger_error('username is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php new file mode 100644 index 00000000000..2b334806016 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php @@ -0,0 +1,123 @@ +google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result + */ +class Result +{ + /** + * No information about the latest account verification. + * + * Generated from protobuf enum RESULT_UNSPECIFIED = 0; + */ + const RESULT_UNSPECIFIED = 0; + /** + * The user was successfully verified. This means the account verification + * challenge was successfully completed. + * + * Generated from protobuf enum SUCCESS_USER_VERIFIED = 1; + */ + const SUCCESS_USER_VERIFIED = 1; + /** + * The user failed the verification challenge. + * + * Generated from protobuf enum ERROR_USER_NOT_VERIFIED = 2; + */ + const ERROR_USER_NOT_VERIFIED = 2; + /** + * The site is not properly onboarded to use the account verification + * feature. + * + * Generated from protobuf enum ERROR_SITE_ONBOARDING_INCOMPLETE = 3; + */ + const ERROR_SITE_ONBOARDING_INCOMPLETE = 3; + /** + * The recipient is not allowed for account verification. This can occur + * during integration but should not occur in production. + * + * Generated from protobuf enum ERROR_RECIPIENT_NOT_ALLOWED = 4; + */ + const ERROR_RECIPIENT_NOT_ALLOWED = 4; + /** + * The recipient has already been sent too many verification codes in a + * short amount of time. + * + * Generated from protobuf enum ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5; + */ + const ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5; + /** + * The verification flow could not be completed due to a critical internal + * error. + * + * Generated from protobuf enum ERROR_CRITICAL_INTERNAL = 6; + */ + const ERROR_CRITICAL_INTERNAL = 6; + /** + * The client has exceeded their two factor request quota for this period of + * time. + * + * Generated from protobuf enum ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7; + */ + const ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7; + /** + * The request cannot be processed at the time because of an incident. This + * bypass can be restricted to a problematic destination email domain, a + * customer, or could affect the entire service. + * + * Generated from protobuf enum ERROR_VERIFICATION_BYPASSED = 8; + */ + const ERROR_VERIFICATION_BYPASSED = 8; + /** + * The request parameters do not match with the token provided and cannot be + * processed. + * + * Generated from protobuf enum ERROR_VERDICT_MISMATCH = 9; + */ + const ERROR_VERDICT_MISMATCH = 9; + + private static $valueToName = [ + self::RESULT_UNSPECIFIED => 'RESULT_UNSPECIFIED', + self::SUCCESS_USER_VERIFIED => 'SUCCESS_USER_VERIFIED', + self::ERROR_USER_NOT_VERIFIED => 'ERROR_USER_NOT_VERIFIED', + self::ERROR_SITE_ONBOARDING_INCOMPLETE => 'ERROR_SITE_ONBOARDING_INCOMPLETE', + self::ERROR_RECIPIENT_NOT_ALLOWED => 'ERROR_RECIPIENT_NOT_ALLOWED', + self::ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED => 'ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED', + self::ERROR_CRITICAL_INTERNAL => 'ERROR_CRITICAL_INTERNAL', + self::ERROR_CUSTOMER_QUOTA_EXHAUSTED => 'ERROR_CUSTOMER_QUOTA_EXHAUSTED', + self::ERROR_VERIFICATION_BYPASSED => 'ERROR_VERIFICATION_BYPASSED', + self::ERROR_VERDICT_MISMATCH => 'ERROR_VERDICT_MISMATCH', + ]; + + 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(Result::class, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo_Result::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php new file mode 100644 index 00000000000..7c007dfb749 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php @@ -0,0 +1,132 @@ +google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest + */ +class AddIpOverrideRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. IP override added to the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ip_override_data = null; + + /** + * @param string $name Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData Required. IP override added to the key. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\AddIpOverrideRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData): self + { + return (new self()) + ->setName($name) + ->setIpOverrideData($ipOverrideData); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ip_override_data + * Required. IP override added to the key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * + * 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 name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * + * 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. IP override added to the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData|null + */ + public function getIpOverrideData() + { + return $this->ip_override_data; + } + + public function hasIpOverrideData() + { + return isset($this->ip_override_data); + } + + public function clearIpOverrideData() + { + unset($this->ip_override_data); + } + + /** + * Required. IP override added to the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $var + * @return $this + */ + public function setIpOverrideData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); + $this->ip_override_data = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php new file mode 100644 index 00000000000..cfbc2dff2ac --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php @@ -0,0 +1,33 @@ +google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + */ +class AddIpOverrideResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php new file mode 100644 index 00000000000..48395cbf6a8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php @@ -0,0 +1,147 @@ +google.cloud.recaptchaenterprise.v1.AndroidKeySettings + */ +class AndroidKeySettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If set to true, allowed_package_names are not enforced. + * + * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_all_package_names = false; + /** + * Optional. Android package names of apps allowed to use the key. + * Example: 'com.companyname.appname' + * + * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_package_names; + /** + * Optional. Set to true for keys that are used in an Android application that + * is available for download in app stores in addition to the Google Play + * Store. + * + * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $support_non_google_app_store_distribution = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_all_package_names + * Optional. If set to true, allowed_package_names are not enforced. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_package_names + * Optional. Android package names of apps allowed to use the key. + * Example: 'com.companyname.appname' + * @type bool $support_non_google_app_store_distribution + * Optional. Set to true for keys that are used in an Android application that + * is available for download in app stores in addition to the Google Play + * Store. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If set to true, allowed_package_names are not enforced. + * + * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowAllPackageNames() + { + return $this->allow_all_package_names; + } + + /** + * Optional. If set to true, allowed_package_names are not enforced. + * + * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowAllPackageNames($var) + { + GPBUtil::checkBool($var); + $this->allow_all_package_names = $var; + + return $this; + } + + /** + * Optional. Android package names of apps allowed to use the key. + * Example: 'com.companyname.appname' + * + * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedPackageNames() + { + return $this->allowed_package_names; + } + + /** + * Optional. Android package names of apps allowed to use the key. + * Example: 'com.companyname.appname' + * + * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedPackageNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_package_names = $arr; + + return $this; + } + + /** + * Optional. Set to true for keys that are used in an Android application that + * is available for download in app stores in addition to the Google Play + * Store. + * + * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSupportNonGoogleAppStoreDistribution() + { + return $this->support_non_google_app_store_distribution; + } + + /** + * Optional. Set to true for keys that are used in an Android application that + * is available for download in app stores in addition to the Google Play + * Store. + * + * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSupportNonGoogleAppStoreDistribution($var) + { + GPBUtil::checkBool($var); + $this->support_non_google_app_store_distribution = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php new file mode 100644 index 00000000000..e2a10ba13c8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php @@ -0,0 +1,303 @@ +google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + */ +class AnnotateAssessmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $annotation = 0; + /** + * Optional. Reasons for the annotation that are assigned to the event. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $reasons; + /** + * Optional. A stable account identifier to apply to the assessment. This is + * an alternative to setting `account_id` in `CreateAssessment`, for example + * when a stable account identifier is not yet known in the initial request. + * + * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $account_id = ''; + /** + * Optional. A stable hashed account identifier to apply to the assessment. + * This is an alternative to setting `hashed_account_id` in + * `CreateAssessment`, for example when a stable account identifier is not yet + * known in the initial request. + * + * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hashed_account_id = ''; + /** + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transaction_event = null; + + /** + * @param string $name Required. The resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. Please see + * {@see RecaptchaEnterpriseServiceClient::assessmentName()} for help formatting this field. + * @param int $annotation Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation} + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest + * + * @experimental + */ + public static function build(string $name, int $annotation): self + { + return (new self()) + ->setName($name) + ->setAnnotation($annotation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. + * @type int $annotation + * Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * @type array|\Google\Protobuf\Internal\RepeatedField $reasons + * Optional. Reasons for the annotation that are assigned to the event. + * @type string $account_id + * Optional. A stable account identifier to apply to the assessment. This is + * an alternative to setting `account_id` in `CreateAssessment`, for example + * when a stable account identifier is not yet known in the initial request. + * @type string $hashed_account_id + * Optional. A stable hashed account identifier to apply to the assessment. + * This is an alternative to setting `hashed_account_id` in + * `CreateAssessment`, for example when a stable account identifier is not yet + * known in the initial request. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $transaction_event + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. + * + * 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 resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. + * + * 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; + } + + /** + * Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAnnotation() + { + return $this->annotation; + } + + /** + * Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAnnotation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation::class); + $this->annotation = $var; + + return $this; + } + + /** + * Optional. Reasons for the annotation that are assigned to the event. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReasons() + { + return $this->reasons; + } + + /** + * Optional. Reasons for the annotation that are assigned to the event. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Reason::class); + $this->reasons = $arr; + + return $this; + } + + /** + * Optional. A stable account identifier to apply to the assessment. This is + * an alternative to setting `account_id` in `CreateAssessment`, for example + * when a stable account identifier is not yet known in the initial request. + * + * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * Optional. A stable account identifier to apply to the assessment. This is + * an alternative to setting `account_id` in `CreateAssessment`, for example + * when a stable account identifier is not yet known in the initial request. + * + * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkString($var, True); + $this->account_id = $var; + + return $this; + } + + /** + * Optional. A stable hashed account identifier to apply to the assessment. + * This is an alternative to setting `hashed_account_id` in + * `CreateAssessment`, for example when a stable account identifier is not yet + * known in the initial request. + * + * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHashedAccountId() + { + return $this->hashed_account_id; + } + + /** + * Optional. A stable hashed account identifier to apply to the assessment. + * This is an alternative to setting `hashed_account_id` in + * `CreateAssessment`, for example when a stable account identifier is not yet + * known in the initial request. + * + * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHashedAccountId($var) + { + GPBUtil::checkString($var, False); + $this->hashed_account_id = $var; + + return $this; + } + + /** + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent|null + */ + public function getTransactionEvent() + { + return $this->transaction_event; + } + + public function hasTransactionEvent() + { + return isset($this->transaction_event); + } + + public function clearTransactionEvent() + { + unset($this->transaction_event); + } + + /** + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $var + * @return $this + */ + public function setTransactionEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent::class); + $this->transaction_event = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php new file mode 100644 index 00000000000..d46aa93d147 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php @@ -0,0 +1,82 @@ +google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation + */ +class Annotation +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum ANNOTATION_UNSPECIFIED = 0; + */ + const ANNOTATION_UNSPECIFIED = 0; + /** + * Provides information that the event turned out to be legitimate. + * + * Generated from protobuf enum LEGITIMATE = 1; + */ + const LEGITIMATE = 1; + /** + * Provides information that the event turned out to be fraudulent. + * + * Generated from protobuf enum FRAUDULENT = 2; + */ + const FRAUDULENT = 2; + /** + * Provides information that the event was related to a login event in which + * the user typed the correct password. Deprecated, prefer indicating + * CORRECT_PASSWORD through the reasons field instead. + * + * Generated from protobuf enum PASSWORD_CORRECT = 3 [deprecated = true]; + */ + const PASSWORD_CORRECT = 3; + /** + * Provides information that the event was related to a login event in which + * the user typed the incorrect password. Deprecated, prefer indicating + * INCORRECT_PASSWORD through the reasons field instead. + * + * Generated from protobuf enum PASSWORD_INCORRECT = 4 [deprecated = true]; + */ + const PASSWORD_INCORRECT = 4; + + private static $valueToName = [ + self::ANNOTATION_UNSPECIFIED => 'ANNOTATION_UNSPECIFIED', + self::LEGITIMATE => 'LEGITIMATE', + self::FRAUDULENT => 'FRAUDULENT', + self::PASSWORD_CORRECT => 'PASSWORD_CORRECT', + self::PASSWORD_INCORRECT => 'PASSWORD_INCORRECT', + ]; + + 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(Annotation::class, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest_Annotation::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php new file mode 100644 index 00000000000..4b0d90d7be1 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php @@ -0,0 +1,165 @@ +google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason + */ +class Reason +{ + /** + * Default unspecified reason. + * + * Generated from protobuf enum REASON_UNSPECIFIED = 0; + */ + const REASON_UNSPECIFIED = 0; + /** + * Indicates that the transaction had a chargeback issued with no other + * details. When possible, specify the type by using CHARGEBACK_FRAUD or + * CHARGEBACK_DISPUTE instead. + * + * Generated from protobuf enum CHARGEBACK = 1; + */ + const CHARGEBACK = 1; + /** + * Indicates that the transaction had a chargeback issued related to an + * alleged unauthorized transaction from the cardholder's perspective (for + * example, the card number was stolen). + * + * Generated from protobuf enum CHARGEBACK_FRAUD = 8; + */ + const CHARGEBACK_FRAUD = 8; + /** + * Indicates that the transaction had a chargeback issued related to the + * cardholder having provided their card details but allegedly not being + * satisfied with the purchase (for example, misrepresentation, attempted + * cancellation). + * + * Generated from protobuf enum CHARGEBACK_DISPUTE = 9; + */ + const CHARGEBACK_DISPUTE = 9; + /** + * Indicates that the completed payment transaction was refunded by the + * seller. + * + * Generated from protobuf enum REFUND = 10; + */ + const REFUND = 10; + /** + * Indicates that the completed payment transaction was determined to be + * fraudulent by the seller, and was cancelled and refunded as a result. + * + * Generated from protobuf enum REFUND_FRAUD = 11; + */ + const REFUND_FRAUD = 11; + /** + * Indicates that the payment transaction was accepted, and the user was + * charged. + * + * Generated from protobuf enum TRANSACTION_ACCEPTED = 12; + */ + const TRANSACTION_ACCEPTED = 12; + /** + * Indicates that the payment transaction was declined, for example due to + * invalid card details. + * + * Generated from protobuf enum TRANSACTION_DECLINED = 13; + */ + const TRANSACTION_DECLINED = 13; + /** + * Indicates the transaction associated with the assessment is suspected of + * being fraudulent based on the payment method, billing details, shipping + * address or other transaction information. + * + * Generated from protobuf enum PAYMENT_HEURISTICS = 2; + */ + const PAYMENT_HEURISTICS = 2; + /** + * Indicates that the user was served a 2FA challenge. An old assessment + * with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + * overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + * This is equivalent to `FAILED_TWO_FACTOR`. + * + * Generated from protobuf enum INITIATED_TWO_FACTOR = 7; + */ + const INITIATED_TWO_FACTOR = 7; + /** + * Indicates that the user passed a 2FA challenge. + * + * Generated from protobuf enum PASSED_TWO_FACTOR = 3; + */ + const PASSED_TWO_FACTOR = 3; + /** + * Indicates that the user failed a 2FA challenge. + * + * Generated from protobuf enum FAILED_TWO_FACTOR = 4; + */ + const FAILED_TWO_FACTOR = 4; + /** + * Indicates the user provided the correct password. + * + * Generated from protobuf enum CORRECT_PASSWORD = 5; + */ + const CORRECT_PASSWORD = 5; + /** + * Indicates the user provided an incorrect password. + * + * Generated from protobuf enum INCORRECT_PASSWORD = 6; + */ + const INCORRECT_PASSWORD = 6; + /** + * Indicates that the user sent unwanted and abusive messages to other users + * of the platform, such as spam, scams, phishing, or social engineering. + * + * Generated from protobuf enum SOCIAL_SPAM = 14; + */ + const SOCIAL_SPAM = 14; + + private static $valueToName = [ + self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED', + self::CHARGEBACK => 'CHARGEBACK', + self::CHARGEBACK_FRAUD => 'CHARGEBACK_FRAUD', + self::CHARGEBACK_DISPUTE => 'CHARGEBACK_DISPUTE', + self::REFUND => 'REFUND', + self::REFUND_FRAUD => 'REFUND_FRAUD', + self::TRANSACTION_ACCEPTED => 'TRANSACTION_ACCEPTED', + self::TRANSACTION_DECLINED => 'TRANSACTION_DECLINED', + self::PAYMENT_HEURISTICS => 'PAYMENT_HEURISTICS', + self::INITIATED_TWO_FACTOR => 'INITIATED_TWO_FACTOR', + self::PASSED_TWO_FACTOR => 'PASSED_TWO_FACTOR', + self::FAILED_TWO_FACTOR => 'FAILED_TWO_FACTOR', + self::CORRECT_PASSWORD => 'CORRECT_PASSWORD', + self::INCORRECT_PASSWORD => 'INCORRECT_PASSWORD', + self::SOCIAL_SPAM => 'SOCIAL_SPAM', + ]; + + 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(Reason::class, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest_Reason::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php new file mode 100644 index 00000000000..f38a573bcb4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php @@ -0,0 +1,33 @@ +google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + */ +class AnnotateAssessmentResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php new file mode 100644 index 00000000000..3e68e2c4d4a --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php @@ -0,0 +1,147 @@ +google.cloud.recaptchaenterprise.v1.AppleDeveloperId + */ +class AppleDeveloperId extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Input only. A private key (downloaded as a text file with a .p8 + * file extension) generated for your Apple Developer account. Ensure that + * Apple DeviceCheck is enabled for the private key. + * + * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $private_key = ''; + /** + * Required. The Apple developer key ID (10-character string). + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_id = ''; + /** + * Required. The Apple team ID (10-character string) owning the provisioning + * profile used to build your application. + * + * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $team_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $private_key + * Required. Input only. A private key (downloaded as a text file with a .p8 + * file extension) generated for your Apple Developer account. Ensure that + * Apple DeviceCheck is enabled for the private key. + * @type string $key_id + * Required. The Apple developer key ID (10-character string). + * @type string $team_id + * Required. The Apple team ID (10-character string) owning the provisioning + * profile used to build your application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. Input only. A private key (downloaded as a text file with a .p8 + * file extension) generated for your Apple Developer account. Ensure that + * Apple DeviceCheck is enabled for the private key. + * + * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getPrivateKey() + { + return $this->private_key; + } + + /** + * Required. Input only. A private key (downloaded as a text file with a .p8 + * file extension) generated for your Apple Developer account. Ensure that + * Apple DeviceCheck is enabled for the private key. + * + * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPrivateKey($var) + { + GPBUtil::checkString($var, True); + $this->private_key = $var; + + return $this; + } + + /** + * Required. The Apple developer key ID (10-character string). + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKeyId() + { + return $this->key_id; + } + + /** + * Required. The Apple developer key ID (10-character string). + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKeyId($var) + { + GPBUtil::checkString($var, True); + $this->key_id = $var; + + return $this; + } + + /** + * Required. The Apple team ID (10-character string) owning the provisioning + * profile used to build your application. + * + * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTeamId() + { + return $this->team_id; + } + + /** + * Required. The Apple team ID (10-character string) owning the provisioning + * profile used to build your application. + * + * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTeamId($var) + { + GPBUtil::checkString($var, True); + $this->team_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php new file mode 100644 index 00000000000..841569a1b29 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php @@ -0,0 +1,599 @@ +google.cloud.recaptchaenterprise.v1.Assessment + */ +class Assessment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name for the Assessment in the format + * `projects/{project}/assessments/{assessment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event = null; + /** + * Output only. The risk analysis result for the event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $risk_analysis = null; + /** + * Output only. Properties of the provided event token. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $token_properties = null; + /** + * Optional. Account verification information for identity verification. The + * assessment event must include a token and site key to use this feature. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $account_verification = null; + /** + * Output only. Assessment returned by account defender when an account + * identifier is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $account_defender_assessment = null; + /** + * Optional. The private password leak verification field contains the + * parameters that are used to to check for leaks privately without sharing + * user credentials. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $private_password_leak_verification = null; + /** + * Output only. Assessment returned when firewall policies belonging to the + * project are evaluated using the field firewall_policy_evaluation. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $firewall_policy_assessment = null; + /** + * Output only. Assessment returned by Fraud Prevention when TransactionData + * is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $fraud_prevention_assessment = null; + /** + * Output only. Fraud Signals specific to the users involved in a payment + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $fraud_signals = null; + /** + * Output only. Assessment returned when a site key, a token, and a phone + * number as `user_id` are provided. Account defender and SMS toll fraud + * protection need to be enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_fraud_assessment = null; + /** + * Optional. The environment creating the assessment. This describes your + * environment (the system invoking CreateAssessment), NOT the environment of + * your user. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $assessment_environment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name for the Assessment in the format + * `projects/{project}/assessments/{assessment}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\Event $event + * Optional. The event being assessed. + * @type \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $risk_analysis + * Output only. The risk analysis result for the event being assessed. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $token_properties + * Output only. Properties of the provided event token. + * @type \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo $account_verification + * Optional. Account verification information for identity verification. The + * assessment event must include a token and site key to use this feature. + * @type \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $account_defender_assessment + * Output only. Assessment returned by account defender when an account + * identifier is provided. + * @type \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification $private_password_leak_verification + * Optional. The private password leak verification field contains the + * parameters that are used to to check for leaks privately without sharing + * user credentials. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment $firewall_policy_assessment + * Output only. Assessment returned when firewall policies belonging to the + * project are evaluated using the field firewall_policy_evaluation. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment $fraud_prevention_assessment + * Output only. Assessment returned by Fraud Prevention when TransactionData + * is provided. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals $fraud_signals + * Output only. Fraud Signals specific to the users involved in a payment + * transaction. + * @type \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment $phone_fraud_assessment + * Output only. Assessment returned when a site key, a token, and a phone + * number as `user_id` are provided. Account defender and SMS toll fraud + * protection need to be enabled. + * @type \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment $assessment_environment + * Optional. The environment creating the assessment. This describes your + * environment (the system invoking CreateAssessment), NOT the environment of + * your user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name for the Assessment in the format + * `projects/{project}/assessments/{assessment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name for the Assessment in the format + * `projects/{project}/assessments/{assessment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\Event|null + */ + public function getEvent() + { + return $this->event; + } + + public function hasEvent() + { + return isset($this->event); + } + + public function clearEvent() + { + unset($this->event); + } + + /** + * Optional. The event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\Event $var + * @return $this + */ + public function setEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Event::class); + $this->event = $var; + + return $this; + } + + /** + * Output only. The risk analysis result for the event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis|null + */ + public function getRiskAnalysis() + { + return $this->risk_analysis; + } + + public function hasRiskAnalysis() + { + return isset($this->risk_analysis); + } + + public function clearRiskAnalysis() + { + unset($this->risk_analysis); + } + + /** + * Output only. The risk analysis result for the event being assessed. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $var + * @return $this + */ + public function setRiskAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis::class); + $this->risk_analysis = $var; + + return $this; + } + + /** + * Output only. Properties of the provided event token. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties|null + */ + public function getTokenProperties() + { + return $this->token_properties; + } + + public function hasTokenProperties() + { + return isset($this->token_properties); + } + + public function clearTokenProperties() + { + unset($this->token_properties); + } + + /** + * Output only. Properties of the provided event token. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $var + * @return $this + */ + public function setTokenProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties::class); + $this->token_properties = $var; + + return $this; + } + + /** + * Optional. Account verification information for identity verification. The + * assessment event must include a token and site key to use this feature. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo|null + */ + public function getAccountVerification() + { + return $this->account_verification; + } + + public function hasAccountVerification() + { + return isset($this->account_verification); + } + + public function clearAccountVerification() + { + unset($this->account_verification); + } + + /** + * Optional. Account verification information for identity verification. The + * assessment event must include a token and site key to use this feature. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo $var + * @return $this + */ + public function setAccountVerification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo::class); + $this->account_verification = $var; + + return $this; + } + + /** + * Output only. Assessment returned by account defender when an account + * identifier is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment|null + */ + public function getAccountDefenderAssessment() + { + return $this->account_defender_assessment; + } + + public function hasAccountDefenderAssessment() + { + return isset($this->account_defender_assessment); + } + + public function clearAccountDefenderAssessment() + { + unset($this->account_defender_assessment); + } + + /** + * Output only. Assessment returned by account defender when an account + * identifier is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $var + * @return $this + */ + public function setAccountDefenderAssessment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment::class); + $this->account_defender_assessment = $var; + + return $this; + } + + /** + * Optional. The private password leak verification field contains the + * parameters that are used to to check for leaks privately without sharing + * user credentials. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification|null + */ + public function getPrivatePasswordLeakVerification() + { + return $this->private_password_leak_verification; + } + + public function hasPrivatePasswordLeakVerification() + { + return isset($this->private_password_leak_verification); + } + + public function clearPrivatePasswordLeakVerification() + { + unset($this->private_password_leak_verification); + } + + /** + * Optional. The private password leak verification field contains the + * parameters that are used to to check for leaks privately without sharing + * user credentials. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification $var + * @return $this + */ + public function setPrivatePasswordLeakVerification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification::class); + $this->private_password_leak_verification = $var; + + return $this; + } + + /** + * Output only. Assessment returned when firewall policies belonging to the + * project are evaluated using the field firewall_policy_evaluation. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment|null + */ + public function getFirewallPolicyAssessment() + { + return $this->firewall_policy_assessment; + } + + public function hasFirewallPolicyAssessment() + { + return isset($this->firewall_policy_assessment); + } + + public function clearFirewallPolicyAssessment() + { + unset($this->firewall_policy_assessment); + } + + /** + * Output only. Assessment returned when firewall policies belonging to the + * project are evaluated using the field firewall_policy_evaluation. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment $var + * @return $this + */ + public function setFirewallPolicyAssessment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment::class); + $this->firewall_policy_assessment = $var; + + return $this; + } + + /** + * Output only. Assessment returned by Fraud Prevention when TransactionData + * is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment|null + */ + public function getFraudPreventionAssessment() + { + return $this->fraud_prevention_assessment; + } + + public function hasFraudPreventionAssessment() + { + return isset($this->fraud_prevention_assessment); + } + + public function clearFraudPreventionAssessment() + { + unset($this->fraud_prevention_assessment); + } + + /** + * Output only. Assessment returned by Fraud Prevention when TransactionData + * is provided. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment $var + * @return $this + */ + public function setFraudPreventionAssessment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment::class); + $this->fraud_prevention_assessment = $var; + + return $this; + } + + /** + * Output only. Fraud Signals specific to the users involved in a payment + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals|null + */ + public function getFraudSignals() + { + return $this->fraud_signals; + } + + public function hasFraudSignals() + { + return isset($this->fraud_signals); + } + + public function clearFraudSignals() + { + unset($this->fraud_signals); + } + + /** + * Output only. Fraud Signals specific to the users involved in a payment + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals $var + * @return $this + */ + public function setFraudSignals($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals::class); + $this->fraud_signals = $var; + + return $this; + } + + /** + * Output only. Assessment returned when a site key, a token, and a phone + * number as `user_id` are provided. Account defender and SMS toll fraud + * protection need to be enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment|null + */ + public function getPhoneFraudAssessment() + { + return $this->phone_fraud_assessment; + } + + public function hasPhoneFraudAssessment() + { + return isset($this->phone_fraud_assessment); + } + + public function clearPhoneFraudAssessment() + { + unset($this->phone_fraud_assessment); + } + + /** + * Output only. Assessment returned when a site key, a token, and a phone + * number as `user_id` are provided. Account defender and SMS toll fraud + * protection need to be enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment $var + * @return $this + */ + public function setPhoneFraudAssessment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment::class); + $this->phone_fraud_assessment = $var; + + return $this; + } + + /** + * Optional. The environment creating the assessment. This describes your + * environment (the system invoking CreateAssessment), NOT the environment of + * your user. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment|null + */ + public function getAssessmentEnvironment() + { + return $this->assessment_environment; + } + + public function hasAssessmentEnvironment() + { + return isset($this->assessment_environment); + } + + public function clearAssessmentEnvironment() + { + unset($this->assessment_environment); + } + + /** + * Optional. The environment creating the assessment. This describes your + * environment (the system invoking CreateAssessment), NOT the environment of + * your user. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment $var + * @return $this + */ + public function setAssessmentEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment::class); + $this->assessment_environment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php new file mode 100644 index 00000000000..049d27d4354 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php @@ -0,0 +1,126 @@ +google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + */ +class AssessmentEnvironment extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Identifies the client module initiating the CreateAssessment + * request. This can be the link to the client module's project. Examples + * include: + * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" + * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" + * - "wordpress.org/plugins/recaptcha-something" + * + * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client = ''; + /** + * Optional. The version of the client module. For example, "1.0.0". + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $client + * Optional. Identifies the client module initiating the CreateAssessment + * request. This can be the link to the client module's project. Examples + * include: + * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" + * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" + * - "wordpress.org/plugins/recaptcha-something" + * @type string $version + * Optional. The version of the client module. For example, "1.0.0". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Identifies the client module initiating the CreateAssessment + * request. This can be the link to the client module's project. Examples + * include: + * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" + * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" + * - "wordpress.org/plugins/recaptcha-something" + * + * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Optional. Identifies the client module initiating the CreateAssessment + * request. This can be the link to the client module's project. Examples + * include: + * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" + * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" + * - "wordpress.org/plugins/recaptcha-something" + * + * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClient($var) + { + GPBUtil::checkString($var, True); + $this->client = $var; + + return $this; + } + + /** + * Optional. The version of the client module. For example, "1.0.0". + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. The version of the client module. For example, "1.0.0". + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php new file mode 100644 index 00000000000..a1ce9c36cfc --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php @@ -0,0 +1,185 @@ +google.cloud.recaptchaenterprise.v1.ChallengeMetrics + */ +class ChallengeMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + * to a count of pageloads for pages that include reCAPTCHA. + * + * Generated from protobuf field int64 pageload_count = 1; + */ + protected $pageload_count = 0; + /** + * Count of nocaptchas (successful verification without a challenge) issued. + * + * Generated from protobuf field int64 nocaptcha_count = 2; + */ + protected $nocaptcha_count = 0; + /** + * Count of submitted challenge solutions that were incorrect or otherwise + * deemed suspicious such that a subsequent challenge was triggered. + * + * Generated from protobuf field int64 failed_count = 3; + */ + protected $failed_count = 0; + /** + * Count of nocaptchas (successful verification without a challenge) plus + * submitted challenge solutions that were correct and resulted in + * verification. + * + * Generated from protobuf field int64 passed_count = 4; + */ + protected $passed_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $pageload_count + * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + * to a count of pageloads for pages that include reCAPTCHA. + * @type int|string $nocaptcha_count + * Count of nocaptchas (successful verification without a challenge) issued. + * @type int|string $failed_count + * Count of submitted challenge solutions that were incorrect or otherwise + * deemed suspicious such that a subsequent challenge was triggered. + * @type int|string $passed_count + * Count of nocaptchas (successful verification without a challenge) plus + * submitted challenge solutions that were correct and resulted in + * verification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + * to a count of pageloads for pages that include reCAPTCHA. + * + * Generated from protobuf field int64 pageload_count = 1; + * @return int|string + */ + public function getPageloadCount() + { + return $this->pageload_count; + } + + /** + * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + * to a count of pageloads for pages that include reCAPTCHA. + * + * Generated from protobuf field int64 pageload_count = 1; + * @param int|string $var + * @return $this + */ + public function setPageloadCount($var) + { + GPBUtil::checkInt64($var); + $this->pageload_count = $var; + + return $this; + } + + /** + * Count of nocaptchas (successful verification without a challenge) issued. + * + * Generated from protobuf field int64 nocaptcha_count = 2; + * @return int|string + */ + public function getNocaptchaCount() + { + return $this->nocaptcha_count; + } + + /** + * Count of nocaptchas (successful verification without a challenge) issued. + * + * Generated from protobuf field int64 nocaptcha_count = 2; + * @param int|string $var + * @return $this + */ + public function setNocaptchaCount($var) + { + GPBUtil::checkInt64($var); + $this->nocaptcha_count = $var; + + return $this; + } + + /** + * Count of submitted challenge solutions that were incorrect or otherwise + * deemed suspicious such that a subsequent challenge was triggered. + * + * Generated from protobuf field int64 failed_count = 3; + * @return int|string + */ + public function getFailedCount() + { + return $this->failed_count; + } + + /** + * Count of submitted challenge solutions that were incorrect or otherwise + * deemed suspicious such that a subsequent challenge was triggered. + * + * Generated from protobuf field int64 failed_count = 3; + * @param int|string $var + * @return $this + */ + public function setFailedCount($var) + { + GPBUtil::checkInt64($var); + $this->failed_count = $var; + + return $this; + } + + /** + * Count of nocaptchas (successful verification without a challenge) plus + * submitted challenge solutions that were correct and resulted in + * verification. + * + * Generated from protobuf field int64 passed_count = 4; + * @return int|string + */ + public function getPassedCount() + { + return $this->passed_count; + } + + /** + * Count of nocaptchas (successful verification without a challenge) plus + * submitted challenge solutions that were correct and resulted in + * verification. + * + * Generated from protobuf field int64 passed_count = 4; + * @param int|string $var + * @return $this + */ + public function setPassedCount($var) + { + GPBUtil::checkInt64($var); + $this->passed_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php new file mode 100644 index 00000000000..942b225a585 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php @@ -0,0 +1,132 @@ +google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + */ +class CreateAssessmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which the assessment is created, + * in the format `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The assessment details. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $assessment = null; + + /** + * @param string $parent Required. The name of the project in which the assessment is created, + * in the format `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment Required. The assessment details. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateAssessmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment): self + { + return (new self()) + ->setParent($parent) + ->setAssessment($assessment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which the assessment is created, + * in the format `projects/{project}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment + * Required. The assessment details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which the assessment is created, + * in the format `projects/{project}`. + * + * 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 name of the project in which the assessment is created, + * in the format `projects/{project}`. + * + * 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 assessment details. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\Assessment|null + */ + public function getAssessment() + { + return $this->assessment; + } + + public function hasAssessment() + { + return isset($this->assessment); + } + + public function clearAssessment() + { + unset($this->assessment); + } + + /** + * Required. The assessment details. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\Assessment $var + * @return $this + */ + public function setAssessment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Assessment::class); + $this->assessment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php new file mode 100644 index 00000000000..0ffdf73d76d --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php @@ -0,0 +1,132 @@ +google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest + */ +class CreateFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project this policy applies to, in the format + * `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Information to create the policy. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = null; + + /** + * @param string $parent Required. The name of the project this policy applies to, in the format + * `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy Required. Information to create the policy. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy): self + { + return (new self()) + ->setParent($parent) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project this policy applies to, in the format + * `projects/{project}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy + * Required. Information to create the policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project this policy applies to, in the format + * `projects/{project}`. + * + * 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 name of the project this policy applies to, in the format + * `projects/{project}`. + * + * 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. Information to create the policy. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + public function hasFirewallPolicy() + { + return isset($this->firewall_policy); + } + + public function clearFirewallPolicy() + { + unset($this->firewall_policy); + } + + /** + * Required. Information to create the policy. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); + $this->firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php new file mode 100644 index 00000000000..24d4ef5c928 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php @@ -0,0 +1,132 @@ +google.cloud.recaptchaenterprise.v1.CreateKeyRequest + */ +class CreateKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project in which the key is created, in the + * format `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Information to create a reCAPTCHA Enterprise key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = null; + + /** + * @param string $parent Required. The name of the project in which the key is created, in the + * format `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $key Required. Information to create a reCAPTCHA Enterprise key. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateKeyRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\Key $key): self + { + return (new self()) + ->setParent($parent) + ->setKey($key); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project in which the key is created, in the + * format `projects/{project}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\Key $key + * Required. Information to create a reCAPTCHA Enterprise key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project in which the key is created, in the + * format `projects/{project}`. + * + * 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 name of the project in which the key is created, in the + * format `projects/{project}`. + * + * 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. Information to create a reCAPTCHA Enterprise key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\Key|null + */ + public function getKey() + { + return $this->key; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Required. Information to create a reCAPTCHA Enterprise key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); + $this->key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php new file mode 100644 index 00000000000..8d57bd78b9b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest + */ +class DeleteFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see + * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\DeleteFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * 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 name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php new file mode 100644 index 00000000000..f949c7b62a3 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + */ +class DeleteKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\DeleteKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. + * + * 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 name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php new file mode 100644 index 00000000000..44cd0299f8f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php @@ -0,0 +1,197 @@ +google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + */ +class EndpointVerificationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Token to provide to the client to trigger endpoint + * verification. It must be used within 15 minutes. + * + * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request_token = ''; + /** + * Output only. Timestamp of the last successful verification for the + * endpoint, if any. + * + * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_verification_time = null; + protected $endpoint; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email_address + * Email address for which to trigger a verification request. + * @type string $phone_number + * Phone number for which to trigger a verification request. Should be given + * in E.164 format. + * @type string $request_token + * Output only. Token to provide to the client to trigger endpoint + * verification. It must be used within 15 minutes. + * @type \Google\Protobuf\Timestamp $last_verification_time + * Output only. Timestamp of the last successful verification for the + * endpoint, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Email address for which to trigger a verification request. + * + * Generated from protobuf field string email_address = 1; + * @return string + */ + public function getEmailAddress() + { + return $this->readOneof(1); + } + + public function hasEmailAddress() + { + return $this->hasOneof(1); + } + + /** + * Email address for which to trigger a verification request. + * + * Generated from protobuf field string email_address = 1; + * @param string $var + * @return $this + */ + public function setEmailAddress($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Phone number for which to trigger a verification request. Should be given + * in E.164 format. + * + * Generated from protobuf field string phone_number = 2; + * @return string + */ + public function getPhoneNumber() + { + return $this->readOneof(2); + } + + public function hasPhoneNumber() + { + return $this->hasOneof(2); + } + + /** + * Phone number for which to trigger a verification request. Should be given + * in E.164 format. + * + * Generated from protobuf field string phone_number = 2; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Output only. Token to provide to the client to trigger endpoint + * verification. It must be used within 15 minutes. + * + * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRequestToken() + { + return $this->request_token; + } + + /** + * Output only. Token to provide to the client to trigger endpoint + * verification. It must be used within 15 minutes. + * + * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRequestToken($var) + { + GPBUtil::checkString($var, True); + $this->request_token = $var; + + return $this; + } + + /** + * Output only. Timestamp of the last successful verification for the + * endpoint, if any. + * + * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastVerificationTime() + { + return $this->last_verification_time; + } + + public function hasLastVerificationTime() + { + return isset($this->last_verification_time); + } + + public function clearLastVerificationTime() + { + unset($this->last_verification_time); + } + + /** + * Output only. Timestamp of the last successful verification for the + * endpoint, if any. + * + * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastVerificationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_verification_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getEndpoint() + { + return $this->whichOneof("endpoint"); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php new file mode 100644 index 00000000000..bffdd6b4135 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php @@ -0,0 +1,640 @@ +google.cloud.recaptchaenterprise.v1.Event + */ +class Event extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The user response token provided by the reCAPTCHA Enterprise + * client-side integration on your site. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $token = ''; + /** + * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your + * site and generate the token. + * + * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $site_key = ''; + /** + * Optional. The user agent present in the request from the user's device + * related to this event. + * + * Generated from protobuf field string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_agent = ''; + /** + * Optional. The IP address in the request from the user's device related to + * this event. + * + * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $user_ip_address = ''; + /** + * Optional. The expected action for this type of event. This should be the + * same action provided at token generation time on client-side platforms + * already integrated with recaptcha enterprise. + * + * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expected_action = ''; + /** + * Optional. Deprecated: use `user_info.account_id` instead. + * Unique stable hashed user identifier for the request. The identifier must + * be hashed using hmac-sha256 with stable secret. + * + * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $hashed_account_id = ''; + /** + * Optional. Flag for a reCAPTCHA express request for an assessment without a + * token. If enabled, `site_key` must reference an Express site key. + * + * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $express = false; + /** + * Optional. The URI resource the user requested that triggered an assessment. + * + * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $requested_uri = ''; + /** + * Optional. Flag for running WAF token assessment. + * If enabled, the token must be specified, and have been created by a + * WAF-enabled key. + * + * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $waf_token_assessment = false; + /** + * Optional. JA3 fingerprint for SSL clients. + * + * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ja3 = ''; + /** + * Optional. HTTP header information about the request. + * + * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $headers; + /** + * Optional. Flag for enabling firewall policy config assessment. + * If this flag is enabled, the firewall policy is evaluated and a + * suggested firewall action is returned in the response. + * + * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $firewall_policy_evaluation = false; + /** + * Optional. Data describing a payment transaction to be assessed. Sending + * this data enables reCAPTCHA Enterprise Fraud Prevention and the + * FraudPreventionAssessment component in the response. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transaction_data = null; + /** + * Optional. Information about the user that generates this event, when they + * can be identified. They are often identified through the use of an account + * for logged-in requests or login/registration requests, or by providing user + * identifiers for guest actions like checkout. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_info = null; + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fraud_prevention = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * Optional. The user response token provided by the reCAPTCHA Enterprise + * client-side integration on your site. + * @type string $site_key + * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your + * site and generate the token. + * @type string $user_agent + * Optional. The user agent present in the request from the user's device + * related to this event. + * @type string $user_ip_address + * Optional. The IP address in the request from the user's device related to + * this event. + * @type string $expected_action + * Optional. The expected action for this type of event. This should be the + * same action provided at token generation time on client-side platforms + * already integrated with recaptcha enterprise. + * @type string $hashed_account_id + * Optional. Deprecated: use `user_info.account_id` instead. + * Unique stable hashed user identifier for the request. The identifier must + * be hashed using hmac-sha256 with stable secret. + * @type bool $express + * Optional. Flag for a reCAPTCHA express request for an assessment without a + * token. If enabled, `site_key` must reference an Express site key. + * @type string $requested_uri + * Optional. The URI resource the user requested that triggered an assessment. + * @type bool $waf_token_assessment + * Optional. Flag for running WAF token assessment. + * If enabled, the token must be specified, and have been created by a + * WAF-enabled key. + * @type string $ja3 + * Optional. JA3 fingerprint for SSL clients. + * @type array|\Google\Protobuf\Internal\RepeatedField $headers + * Optional. HTTP header information about the request. + * @type bool $firewall_policy_evaluation + * Optional. Flag for enabling firewall policy config assessment. + * If this flag is enabled, the firewall policy is evaluated and a + * suggested firewall action is returned in the response. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData $transaction_data + * Optional. Data describing a payment transaction to be assessed. Sending + * this data enables reCAPTCHA Enterprise Fraud Prevention and the + * FraudPreventionAssessment component in the response. + * @type \Google\Cloud\RecaptchaEnterprise\V1\UserInfo $user_info + * Optional. Information about the user that generates this event, when they + * can be identified. They are often identified through the use of an account + * for logged-in requests or login/registration requests, or by providing user + * identifiers for guest actions like checkout. + * @type int $fraud_prevention + * Optional. The Fraud Prevention setting for this assessment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The user response token provided by the reCAPTCHA Enterprise + * client-side integration on your site. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * Optional. The user response token provided by the reCAPTCHA Enterprise + * client-side integration on your site. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your + * site and generate the token. + * + * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSiteKey() + { + return $this->site_key; + } + + /** + * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your + * site and generate the token. + * + * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSiteKey($var) + { + GPBUtil::checkString($var, True); + $this->site_key = $var; + + return $this; + } + + /** + * Optional. The user agent present in the request from the user's device + * related to this event. + * + * Generated from protobuf field string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUserAgent() + { + return $this->user_agent; + } + + /** + * Optional. The user agent present in the request from the user's device + * related to this event. + * + * Generated from protobuf field string user_agent = 3 [(.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. The IP address in the request from the user's device related to + * this event. + * + * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getUserIpAddress() + { + return $this->user_ip_address; + } + + /** + * Optional. The IP address in the request from the user's device related to + * this event. + * + * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUserIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->user_ip_address = $var; + + return $this; + } + + /** + * Optional. The expected action for this type of event. This should be the + * same action provided at token generation time on client-side platforms + * already integrated with recaptcha enterprise. + * + * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExpectedAction() + { + return $this->expected_action; + } + + /** + * Optional. The expected action for this type of event. This should be the + * same action provided at token generation time on client-side platforms + * already integrated with recaptcha enterprise. + * + * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExpectedAction($var) + { + GPBUtil::checkString($var, True); + $this->expected_action = $var; + + return $this; + } + + /** + * Optional. Deprecated: use `user_info.account_id` instead. + * Unique stable hashed user identifier for the request. The identifier must + * be hashed using hmac-sha256 with stable secret. + * + * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getHashedAccountId() + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + return $this->hashed_account_id; + } + + /** + * Optional. Deprecated: use `user_info.account_id` instead. + * Unique stable hashed user identifier for the request. The identifier must + * be hashed using hmac-sha256 with stable secret. + * + * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setHashedAccountId($var) + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, False); + $this->hashed_account_id = $var; + + return $this; + } + + /** + * Optional. Flag for a reCAPTCHA express request for an assessment without a + * token. If enabled, `site_key` must reference an Express site key. + * + * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExpress() + { + return $this->express; + } + + /** + * Optional. Flag for a reCAPTCHA express request for an assessment without a + * token. If enabled, `site_key` must reference an Express site key. + * + * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExpress($var) + { + GPBUtil::checkBool($var); + $this->express = $var; + + return $this; + } + + /** + * Optional. The URI resource the user requested that triggered an assessment. + * + * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestedUri() + { + return $this->requested_uri; + } + + /** + * Optional. The URI resource the user requested that triggered an assessment. + * + * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestedUri($var) + { + GPBUtil::checkString($var, True); + $this->requested_uri = $var; + + return $this; + } + + /** + * Optional. Flag for running WAF token assessment. + * If enabled, the token must be specified, and have been created by a + * WAF-enabled key. + * + * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getWafTokenAssessment() + { + return $this->waf_token_assessment; + } + + /** + * Optional. Flag for running WAF token assessment. + * If enabled, the token must be specified, and have been created by a + * WAF-enabled key. + * + * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setWafTokenAssessment($var) + { + GPBUtil::checkBool($var); + $this->waf_token_assessment = $var; + + return $this; + } + + /** + * Optional. JA3 fingerprint for SSL clients. + * + * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getJa3() + { + return $this->ja3; + } + + /** + * Optional. JA3 fingerprint for SSL clients. + * + * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setJa3($var) + { + GPBUtil::checkString($var, True); + $this->ja3 = $var; + + return $this; + } + + /** + * Optional. HTTP header information about the request. + * + * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Optional. HTTP header information about the request. + * + * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * Optional. Flag for enabling firewall policy config assessment. + * If this flag is enabled, the firewall policy is evaluated and a + * suggested firewall action is returned in the response. + * + * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFirewallPolicyEvaluation() + { + return $this->firewall_policy_evaluation; + } + + /** + * Optional. Flag for enabling firewall policy config assessment. + * If this flag is enabled, the firewall policy is evaluated and a + * suggested firewall action is returned in the response. + * + * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFirewallPolicyEvaluation($var) + { + GPBUtil::checkBool($var); + $this->firewall_policy_evaluation = $var; + + return $this; + } + + /** + * Optional. Data describing a payment transaction to be assessed. Sending + * this data enables reCAPTCHA Enterprise Fraud Prevention and the + * FraudPreventionAssessment component in the response. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData|null + */ + public function getTransactionData() + { + return $this->transaction_data; + } + + public function hasTransactionData() + { + return isset($this->transaction_data); + } + + public function clearTransactionData() + { + unset($this->transaction_data); + } + + /** + * Optional. Data describing a payment transaction to be assessed. Sending + * this data enables reCAPTCHA Enterprise Fraud Prevention and the + * FraudPreventionAssessment component in the response. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData $var + * @return $this + */ + public function setTransactionData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData::class); + $this->transaction_data = $var; + + return $this; + } + + /** + * Optional. Information about the user that generates this event, when they + * can be identified. They are often identified through the use of an account + * for logged-in requests or login/registration requests, or by providing user + * identifiers for guest actions like checkout. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\UserInfo|null + */ + public function getUserInfo() + { + return $this->user_info; + } + + public function hasUserInfo() + { + return isset($this->user_info); + } + + public function clearUserInfo() + { + unset($this->user_info); + } + + /** + * Optional. Information about the user that generates this event, when they + * can be identified. They are often identified through the use of an account + * for logged-in requests or login/registration requests, or by providing user + * identifiers for guest actions like checkout. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\UserInfo $var + * @return $this + */ + public function setUserInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\UserInfo::class); + $this->user_info = $var; + + return $this; + } + + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFraudPrevention() + { + return $this->fraud_prevention; + } + + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFraudPrevention($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\Event\FraudPrevention::class); + $this->fraud_prevention = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php new file mode 100644 index 00000000000..5650681f23e --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php @@ -0,0 +1,70 @@ +google.cloud.recaptchaenterprise.v1.Event.FraudPrevention + */ +class FraudPrevention +{ + /** + * Default, unspecified setting. If opted in for automatic detection, + * `fraud_prevention_assessment` is returned based on the request. + * Otherwise, `fraud_prevention_assessment` is returned if + * `transaction_data` is present in the `Event` and Fraud Prevention is + * enabled in the Google Cloud console. + * + * Generated from protobuf enum FRAUD_PREVENTION_UNSPECIFIED = 0; + */ + const FRAUD_PREVENTION_UNSPECIFIED = 0; + /** + * Enable Fraud Prevention for this assessment, if Fraud Prevention is + * enabled in the Google Cloud console. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * Disable Fraud Prevention for this assessment, regardless of opt-in + * status or Google Cloud console settings. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::FRAUD_PREVENTION_UNSPECIFIED => 'FRAUD_PREVENTION_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + ]; + + 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(FraudPrevention::class, \Google\Cloud\RecaptchaEnterprise\V1\Event_FraudPrevention::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php new file mode 100644 index 00000000000..6fcd12db202 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php @@ -0,0 +1,33 @@ +google.cloud.recaptchaenterprise.v1.ExpressKeySettings + */ +class ExpressKeySettings extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php new file mode 100644 index 00000000000..b5be30f5734 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php @@ -0,0 +1,259 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction + */ +class FirewallAction extends \Google\Protobuf\Internal\Message +{ + protected $firewall_action_oneof; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction $allow + * The user request did not match any policy and should be allowed + * access to the requested resource. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction $block + * This action denies access to a given page. The user gets an HTTP + * error code. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction $include_recaptcha_script + * This action injects reCAPTCHA JavaScript code into the HTML page + * returned by the site backend. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction $redirect + * This action redirects the request to a reCAPTCHA interstitial to + * attach a token. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction $substitute + * This action transparently serves a different page to an offending + * user. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction $set_header + * This action sets a custom header but allow the request to continue + * to the customer backend. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * The user request did not match any policy and should be allowed + * access to the requested resource. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction allow = 1; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction|null + */ + public function getAllow() + { + return $this->readOneof(1); + } + + public function hasAllow() + { + return $this->hasOneof(1); + } + + /** + * The user request did not match any policy and should be allowed + * access to the requested resource. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction allow = 1; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction $var + * @return $this + */ + public function setAllow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This action denies access to a given page. The user gets an HTTP + * error code. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction block = 2; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction|null + */ + public function getBlock() + { + return $this->readOneof(2); + } + + public function hasBlock() + { + return $this->hasOneof(2); + } + + /** + * This action denies access to a given page. The user gets an HTTP + * error code. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction block = 2; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction $var + * @return $this + */ + public function setBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * This action injects reCAPTCHA JavaScript code into the HTML page + * returned by the site backend. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction include_recaptcha_script = 6; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction|null + */ + public function getIncludeRecaptchaScript() + { + return $this->readOneof(6); + } + + public function hasIncludeRecaptchaScript() + { + return $this->hasOneof(6); + } + + /** + * This action injects reCAPTCHA JavaScript code into the HTML page + * returned by the site backend. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction include_recaptcha_script = 6; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction $var + * @return $this + */ + public function setIncludeRecaptchaScript($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * This action redirects the request to a reCAPTCHA interstitial to + * attach a token. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction redirect = 5; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction|null + */ + public function getRedirect() + { + return $this->readOneof(5); + } + + public function hasRedirect() + { + return $this->hasOneof(5); + } + + /** + * This action redirects the request to a reCAPTCHA interstitial to + * attach a token. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction redirect = 5; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction $var + * @return $this + */ + public function setRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * This action transparently serves a different page to an offending + * user. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction substitute = 3; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction|null + */ + public function getSubstitute() + { + return $this->readOneof(3); + } + + public function hasSubstitute() + { + return $this->hasOneof(3); + } + + /** + * This action transparently serves a different page to an offending + * user. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction substitute = 3; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction $var + * @return $this + */ + public function setSubstitute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * This action sets a custom header but allow the request to continue + * to the customer backend. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction set_header = 4; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction|null + */ + public function getSetHeader() + { + return $this->readOneof(4); + } + + public function hasSetHeader() + { + return $this->hasOneof(4); + } + + /** + * This action sets a custom header but allow the request to continue + * to the customer backend. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction set_header = 4; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction $var + * @return $this + */ + public function setSetHeader($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getFirewallActionOneof() + { + return $this->whichOneof("firewall_action_oneof"); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php new file mode 100644 index 00000000000..20547eb88cf --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php @@ -0,0 +1,36 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction + */ +class AllowAction extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_AllowAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php new file mode 100644 index 00000000000..a8793c63387 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php @@ -0,0 +1,37 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction + */ +class BlockAction extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BlockAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_BlockAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php new file mode 100644 index 00000000000..9c2df380e9b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php @@ -0,0 +1,40 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction + */ +class IncludeRecaptchaScriptAction extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IncludeRecaptchaScriptAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_IncludeRecaptchaScriptAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php new file mode 100644 index 00000000000..308c3b4c9f5 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php @@ -0,0 +1,37 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction + */ +class RedirectAction extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RedirectAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_RedirectAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php new file mode 100644 index 00000000000..65d715f16ef --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php @@ -0,0 +1,106 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction + */ +class SetHeaderAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The header key to set in the request to the backend server. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = ''; + /** + * Optional. The header value to set in the request to the backend server. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. The header key to set in the request to the backend server. + * @type string $value + * Optional. The header value to set in the request to the backend server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The header key to set in the request to the backend server. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Optional. The header key to set in the request to the backend server. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. The header value to set in the request to the backend server. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The header value to set in the request to the backend server. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetHeaderAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_SetHeaderAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php new file mode 100644 index 00000000000..ed45d8090c8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php @@ -0,0 +1,75 @@ +google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction + */ +class SubstituteAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The address to redirect to. The target is a relative path in + * the current host. Example: "/blog/404.html". + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. The address to redirect to. The target is a relative path in + * the current host. Example: "/blog/404.html". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The address to redirect to. The target is a relative path in + * the current host. Example: "/blog/404.html". + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. The address to redirect to. The target is a relative path in + * the current host. Example: "/blog/404.html". + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SubstituteAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_SubstituteAction::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php new file mode 100644 index 00000000000..a034eab2792 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php @@ -0,0 +1,280 @@ +google.cloud.recaptchaenterprise.v1.FirewallPolicy + */ +class FirewallPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name for the FirewallPolicy in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. A description of what this policy aims to achieve, for + * convenience purposes. The description can at most include 256 UTF-8 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The path for which this policy applies, specified as a glob + * pattern. For more information on glob, see the [manual + * page](https://man7.org/linux/man-pages/man7/glob.7.html). + * A path has a max length of 200 characters. + * + * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + /** + * Optional. A CEL (Common Expression Language) conditional expression that + * specifies if this policy applies to an incoming user request. If this + * condition evaluates to true and the requested path matched the path + * pattern, the associated actions should be executed by the caller. The + * condition string is checked for CEL syntax correctness on creation. For + * more information, see the [CEL spec](https://github.com/google/cel-spec) + * and its [language + * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + * A condition has a max length of 500 characters. + * + * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition = ''; + /** + * Optional. The actions that the caller should take regarding user access. + * There should be at most one terminal action. A terminal action is any + * action that forces a response, such as `AllowAction`, + * `BlockAction` or `SubstituteAction`. + * Zero or more non-terminal actions such as `SetHeader` might be + * specified. A single policy can contain up to 16 actions. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $actions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name for the FirewallPolicy in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * @type string $description + * Optional. A description of what this policy aims to achieve, for + * convenience purposes. The description can at most include 256 UTF-8 + * characters. + * @type string $path + * Optional. The path for which this policy applies, specified as a glob + * pattern. For more information on glob, see the [manual + * page](https://man7.org/linux/man-pages/man7/glob.7.html). + * A path has a max length of 200 characters. + * @type string $condition + * Optional. A CEL (Common Expression Language) conditional expression that + * specifies if this policy applies to an incoming user request. If this + * condition evaluates to true and the requested path matched the path + * pattern, the associated actions should be executed by the caller. The + * condition string is checked for CEL syntax correctness on creation. For + * more information, see the [CEL spec](https://github.com/google/cel-spec) + * and its [language + * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + * A condition has a max length of 500 characters. + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $actions + * Optional. The actions that the caller should take regarding user access. + * There should be at most one terminal action. A terminal action is any + * action that forces a response, such as `AllowAction`, + * `BlockAction` or `SubstituteAction`. + * Zero or more non-terminal actions such as `SetHeader` might be + * specified. A single policy can contain up to 16 actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name for the FirewallPolicy in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name for the FirewallPolicy in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A description of what this policy aims to achieve, for + * convenience purposes. The description can at most include 256 UTF-8 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of what this policy aims to achieve, for + * convenience purposes. The description can at most include 256 UTF-8 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The path for which this policy applies, specified as a glob + * pattern. For more information on glob, see the [manual + * page](https://man7.org/linux/man-pages/man7/glob.7.html). + * A path has a max length of 200 characters. + * + * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. The path for which this policy applies, specified as a glob + * pattern. For more information on glob, see the [manual + * page](https://man7.org/linux/man-pages/man7/glob.7.html). + * A path has a max length of 200 characters. + * + * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Optional. A CEL (Common Expression Language) conditional expression that + * specifies if this policy applies to an incoming user request. If this + * condition evaluates to true and the requested path matched the path + * pattern, the associated actions should be executed by the caller. The + * condition string is checked for CEL syntax correctness on creation. For + * more information, see the [CEL spec](https://github.com/google/cel-spec) + * and its [language + * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + * A condition has a max length of 500 characters. + * + * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * Optional. A CEL (Common Expression Language) conditional expression that + * specifies if this policy applies to an incoming user request. If this + * condition evaluates to true and the requested path matched the path + * pattern, the associated actions should be executed by the caller. The + * condition string is checked for CEL syntax correctness on creation. For + * more information, see the [CEL spec](https://github.com/google/cel-spec) + * and its [language + * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + * A condition has a max length of 500 characters. + * + * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Optional. The actions that the caller should take regarding user access. + * There should be at most one terminal action. A terminal action is any + * action that forces a response, such as `AllowAction`, + * `BlockAction` or `SubstituteAction`. + * Zero or more non-terminal actions such as `SetHeader` might be + * specified. A single policy can contain up to 16 actions. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActions() + { + return $this->actions; + } + + /** + * Optional. The actions that the caller should take regarding user access. + * There should be at most one terminal action. A terminal action is any + * action that forces a response, such as `AllowAction`, + * `BlockAction` or `SubstituteAction`. + * Zero or more non-terminal actions such as `SetHeader` might be + * specified. A single policy can contain up to 16 actions. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction::class); + $this->actions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php new file mode 100644 index 00000000000..628b81b9959 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php @@ -0,0 +1,133 @@ +google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment + */ +class FirewallPolicyAssessment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. If the processing of a policy config fails, an error is + * populated and the firewall_policy is left empty. + * + * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + /** + * Output only. The policy that matched the request. If more than one policy + * may match, this is the first match. If no policy matches the incoming + * request, the policy field is left empty. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $firewall_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $error + * Output only. If the processing of a policy config fails, an error is + * populated and the firewall_policy is left empty. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy + * Output only. The policy that matched the request. If more than one policy + * may match, this is the first match. If no policy matches the incoming + * request, the policy field is left empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. If the processing of a policy config fails, an error is + * populated and the firewall_policy is left empty. + * + * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. If the processing of a policy config fails, an error is + * populated and the firewall_policy is left empty. + * + * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * Output only. The policy that matched the request. If more than one policy + * may match, this is the first match. If no policy matches the incoming + * request, the policy field is left empty. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + public function hasFirewallPolicy() + { + return isset($this->firewall_policy); + } + + public function clearFirewallPolicy() + { + unset($this->firewall_policy); + } + + /** + * Output only. The policy that matched the request. If more than one policy + * may match, this is the first match. If no policy matches the incoming + * request, the policy field is left empty. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); + $this->firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php new file mode 100644 index 00000000000..616799349e7 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php @@ -0,0 +1,215 @@ +google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + */ +class FraudPreventionAssessment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Probability of this transaction being fraudulent. Summarizes + * the combined risk of attack vectors below. Values are from 0.0 (lowest) + * to 1.0 (highest). + * + * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $transaction_risk = 0.0; + /** + * Output only. Assessment of this transaction for risk of a stolen + * instrument. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stolen_instrument_verdict = null; + /** + * Output only. Assessment of this transaction for risk of being part of a + * card testing attack. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $card_testing_verdict = null; + /** + * Output only. Assessment of this transaction for behavioral trust. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $behavioral_trust_verdict = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $transaction_risk + * Output only. Probability of this transaction being fraudulent. Summarizes + * the combined risk of attack vectors below. Values are from 0.0 (lowest) + * to 1.0 (highest). + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict $stolen_instrument_verdict + * Output only. Assessment of this transaction for risk of a stolen + * instrument. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict $card_testing_verdict + * Output only. Assessment of this transaction for risk of being part of a + * card testing attack. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict $behavioral_trust_verdict + * Output only. Assessment of this transaction for behavioral trust. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Probability of this transaction being fraudulent. Summarizes + * the combined risk of attack vectors below. Values are from 0.0 (lowest) + * to 1.0 (highest). + * + * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getTransactionRisk() + { + return $this->transaction_risk; + } + + /** + * Output only. Probability of this transaction being fraudulent. Summarizes + * the combined risk of attack vectors below. Values are from 0.0 (lowest) + * to 1.0 (highest). + * + * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setTransactionRisk($var) + { + GPBUtil::checkFloat($var); + $this->transaction_risk = $var; + + return $this; + } + + /** + * Output only. Assessment of this transaction for risk of a stolen + * instrument. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict|null + */ + public function getStolenInstrumentVerdict() + { + return $this->stolen_instrument_verdict; + } + + public function hasStolenInstrumentVerdict() + { + return isset($this->stolen_instrument_verdict); + } + + public function clearStolenInstrumentVerdict() + { + unset($this->stolen_instrument_verdict); + } + + /** + * Output only. Assessment of this transaction for risk of a stolen + * instrument. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict $var + * @return $this + */ + public function setStolenInstrumentVerdict($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict::class); + $this->stolen_instrument_verdict = $var; + + return $this; + } + + /** + * Output only. Assessment of this transaction for risk of being part of a + * card testing attack. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict|null + */ + public function getCardTestingVerdict() + { + return $this->card_testing_verdict; + } + + public function hasCardTestingVerdict() + { + return isset($this->card_testing_verdict); + } + + public function clearCardTestingVerdict() + { + unset($this->card_testing_verdict); + } + + /** + * Output only. Assessment of this transaction for risk of being part of a + * card testing attack. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict $var + * @return $this + */ + public function setCardTestingVerdict($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict::class); + $this->card_testing_verdict = $var; + + return $this; + } + + /** + * Output only. Assessment of this transaction for behavioral trust. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict|null + */ + public function getBehavioralTrustVerdict() + { + return $this->behavioral_trust_verdict; + } + + public function hasBehavioralTrustVerdict() + { + return isset($this->behavioral_trust_verdict); + } + + public function clearBehavioralTrustVerdict() + { + unset($this->behavioral_trust_verdict); + } + + /** + * Output only. Assessment of this transaction for behavioral trust. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict $var + * @return $this + */ + public function setBehavioralTrustVerdict($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict::class); + $this->behavioral_trust_verdict = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php new file mode 100644 index 00000000000..46e30e6ef74 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php @@ -0,0 +1,78 @@ +google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict + */ +class BehavioralTrustVerdict extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Probability of this transaction attempt being executed in a + * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 + * (highest). + * + * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $trust = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $trust + * Output only. Probability of this transaction attempt being executed in a + * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 + * (highest). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Probability of this transaction attempt being executed in a + * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 + * (highest). + * + * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getTrust() + { + return $this->trust; + } + + /** + * Output only. Probability of this transaction attempt being executed in a + * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 + * (highest). + * + * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setTrust($var) + { + GPBUtil::checkFloat($var); + $this->trust = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BehavioralTrustVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_BehavioralTrustVerdict::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php new file mode 100644 index 00000000000..1673fe7932b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php @@ -0,0 +1,75 @@ +google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + */ +class CardTestingVerdict extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Probability of this transaction attempt being part of a card + * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $risk = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $risk + * Output only. Probability of this transaction attempt being part of a card + * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Probability of this transaction attempt being part of a card + * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getRisk() + { + return $this->risk; + } + + /** + * Output only. Probability of this transaction attempt being part of a card + * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setRisk($var) + { + GPBUtil::checkFloat($var); + $this->risk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CardTestingVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_CardTestingVerdict::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php new file mode 100644 index 00000000000..b8774e74ca6 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php @@ -0,0 +1,75 @@ +google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + */ +class StolenInstrumentVerdict extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Probability of this transaction being executed with a stolen + * instrument. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $risk = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $risk + * Output only. Probability of this transaction being executed with a stolen + * instrument. Values are from 0.0 (lowest) to 1.0 (highest). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Probability of this transaction being executed with a stolen + * instrument. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getRisk() + { + return $this->risk; + } + + /** + * Output only. Probability of this transaction being executed with a stolen + * instrument. Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setRisk($var) + { + GPBUtil::checkFloat($var); + $this->risk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StolenInstrumentVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_StolenInstrumentVerdict::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php new file mode 100644 index 00000000000..aba0ccfcd4b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php @@ -0,0 +1,125 @@ +google.cloud.recaptchaenterprise.v1.FraudSignals + */ +class FraudSignals extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Signals describing the end user in this transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $user_signals = null; + /** + * Output only. Signals describing the payment card or cards used in this + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $card_signals = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals $user_signals + * Output only. Signals describing the end user in this transaction. + * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals $card_signals + * Output only. Signals describing the payment card or cards used in this + * transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Signals describing the end user in this transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals|null + */ + public function getUserSignals() + { + return $this->user_signals; + } + + public function hasUserSignals() + { + return isset($this->user_signals); + } + + public function clearUserSignals() + { + unset($this->user_signals); + } + + /** + * Output only. Signals describing the end user in this transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals $var + * @return $this + */ + public function setUserSignals($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals::class); + $this->user_signals = $var; + + return $this; + } + + /** + * Output only. Signals describing the payment card or cards used in this + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals|null + */ + public function getCardSignals() + { + return $this->card_signals; + } + + public function hasCardSignals() + { + return isset($this->card_signals); + } + + public function clearCardSignals() + { + unset($this->card_signals); + } + + /** + * Output only. Signals describing the payment card or cards used in this + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals $var + * @return $this + */ + public function setCardSignals($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals::class); + $this->card_signals = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php new file mode 100644 index 00000000000..1c6e40b18d8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php @@ -0,0 +1,70 @@ +google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals + */ +class CardSignals extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The labels for the payment card in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $card_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $card_labels + * Output only. The labels for the payment card in this transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The labels for the payment card in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCardLabels() + { + return $this->card_labels; + } + + /** + * Output only. The labels for the payment card in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCardLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals\CardLabel::class); + $this->card_labels = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CardSignals::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_CardSignals::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php new file mode 100644 index 00000000000..e3e8e94649f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php @@ -0,0 +1,74 @@ +google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel + */ +class CardLabel +{ + /** + * No label specified. + * + * Generated from protobuf enum CARD_LABEL_UNSPECIFIED = 0; + */ + const CARD_LABEL_UNSPECIFIED = 0; + /** + * This card has been detected as prepaid. + * + * Generated from protobuf enum PREPAID = 1; + */ + const PREPAID = 1; + /** + * This card has been detected as virtual, such as a card number generated + * for a single transaction or merchant. + * + * Generated from protobuf enum VIRTUAL = 2; + */ + const VIRTUAL = 2; + /** + * This card has been detected as being used in an unexpected geographic + * location. + * + * Generated from protobuf enum UNEXPECTED_LOCATION = 3; + */ + const UNEXPECTED_LOCATION = 3; + + private static $valueToName = [ + self::CARD_LABEL_UNSPECIFIED => 'CARD_LABEL_UNSPECIFIED', + self::PREPAID => 'PREPAID', + self::VIRTUAL => 'VIRTUAL', + self::UNEXPECTED_LOCATION => 'UNEXPECTED_LOCATION', + ]; + + 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(CardLabel::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_CardSignals_CardLabel::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php new file mode 100644 index 00000000000..2d8305d3bd6 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php @@ -0,0 +1,116 @@ +google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals + */ +class UserSignals extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. This user (based on email, phone, and other identifiers) has + * been seen on the internet for at least this number of days. + * + * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $active_days_lower_bound = 0; + /** + * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic + * components in their identity, such as a randomly generated email address, + * temporary phone number, or fake shipping address. + * + * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $synthetic_risk = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $active_days_lower_bound + * Output only. This user (based on email, phone, and other identifiers) has + * been seen on the internet for at least this number of days. + * @type float $synthetic_risk + * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic + * components in their identity, such as a randomly generated email address, + * temporary phone number, or fake shipping address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. This user (based on email, phone, and other identifiers) has + * been seen on the internet for at least this number of days. + * + * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getActiveDaysLowerBound() + { + return $this->active_days_lower_bound; + } + + /** + * Output only. This user (based on email, phone, and other identifiers) has + * been seen on the internet for at least this number of days. + * + * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setActiveDaysLowerBound($var) + { + GPBUtil::checkInt32($var); + $this->active_days_lower_bound = $var; + + return $this; + } + + /** + * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic + * components in their identity, such as a randomly generated email address, + * temporary phone number, or fake shipping address. + * + * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getSyntheticRisk() + { + return $this->synthetic_risk; + } + + /** + * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic + * components in their identity, such as a randomly generated email address, + * temporary phone number, or fake shipping address. + * + * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setSyntheticRisk($var) + { + GPBUtil::checkFloat($var); + $this->synthetic_risk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UserSignals::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_UserSignals::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php new file mode 100644 index 00000000000..e5a80411e06 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest + */ +class GetFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see + * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\GetFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * 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 name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php new file mode 100644 index 00000000000..741076d9355 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.GetKeyRequest + */ +class GetKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the requested key, in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the requested key, in the format + * `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\GetKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the requested key, in the format + * `projects/{project}/keys/{key}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the requested key, in the format + * `projects/{project}/keys/{key}`. + * + * 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 name of the requested key, in the format + * `projects/{project}/keys/{key}`. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php new file mode 100644 index 00000000000..495178abf20 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.GetMetricsRequest + */ +class GetMetricsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. Please see + * {@see RecaptchaEnterpriseServiceClient::metricsName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\GetMetricsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * 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 name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php new file mode 100644 index 00000000000..85d11376701 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php @@ -0,0 +1,165 @@ +google.cloud.recaptchaenterprise.v1.IOSKeySettings + */ +class IOSKeySettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If set to true, allowed_bundle_ids are not enforced. + * + * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_all_bundle_ids = false; + /** + * Optional. iOS bundle ids of apps allowed to use the key. + * Example: 'com.companyname.productname.appname' + * + * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_bundle_ids; + /** + * Optional. Apple Developer account details for the app that is protected by + * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple + * App Attest and Apple DeviceCheck to protect your app from abuse. Providing + * these fields allows reCAPTCHA to get a better assessment of the integrity + * of your app. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $apple_developer_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_all_bundle_ids + * Optional. If set to true, allowed_bundle_ids are not enforced. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_bundle_ids + * Optional. iOS bundle ids of apps allowed to use the key. + * Example: 'com.companyname.productname.appname' + * @type \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId $apple_developer_id + * Optional. Apple Developer account details for the app that is protected by + * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple + * App Attest and Apple DeviceCheck to protect your app from abuse. Providing + * these fields allows reCAPTCHA to get a better assessment of the integrity + * of your app. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If set to true, allowed_bundle_ids are not enforced. + * + * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowAllBundleIds() + { + return $this->allow_all_bundle_ids; + } + + /** + * Optional. If set to true, allowed_bundle_ids are not enforced. + * + * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowAllBundleIds($var) + { + GPBUtil::checkBool($var); + $this->allow_all_bundle_ids = $var; + + return $this; + } + + /** + * Optional. iOS bundle ids of apps allowed to use the key. + * Example: 'com.companyname.productname.appname' + * + * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedBundleIds() + { + return $this->allowed_bundle_ids; + } + + /** + * Optional. iOS bundle ids of apps allowed to use the key. + * Example: 'com.companyname.productname.appname' + * + * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedBundleIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_bundle_ids = $arr; + + return $this; + } + + /** + * Optional. Apple Developer account details for the app that is protected by + * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple + * App Attest and Apple DeviceCheck to protect your app from abuse. Providing + * these fields allows reCAPTCHA to get a better assessment of the integrity + * of your app. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId|null + */ + public function getAppleDeveloperId() + { + return $this->apple_developer_id; + } + + public function hasAppleDeveloperId() + { + return isset($this->apple_developer_id); + } + + public function clearAppleDeveloperId() + { + unset($this->apple_developer_id); + } + + /** + * Optional. Apple Developer account details for the app that is protected by + * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple + * App Attest and Apple DeviceCheck to protect your app from abuse. Providing + * these fields allows reCAPTCHA to get a better assessment of the integrity + * of your app. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId $var + * @return $this + */ + public function setAppleDeveloperId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId::class); + $this->apple_developer_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php new file mode 100644 index 00000000000..0a6c440ab29 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php @@ -0,0 +1,125 @@ +google.cloud.recaptchaenterprise.v1.IpOverrideData + */ +class IpOverrideData extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The IP address to override (can be IPv4, IPv6 or CIDR). + * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + * The IP override must be a public IP address. + * Example of IPv4: 168.192.5.6 + * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + * Example of IPv4 with CIDR: 168.192.5.0/24 + * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + * + * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $ip = ''; + /** + * Required. Describes the type of IP override. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $override_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip + * Required. The IP address to override (can be IPv4, IPv6 or CIDR). + * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + * The IP override must be a public IP address. + * Example of IPv4: 168.192.5.6 + * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + * Example of IPv4 with CIDR: 168.192.5.0/24 + * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + * @type int $override_type + * Required. Describes the type of IP override. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The IP address to override (can be IPv4, IPv6 or CIDR). + * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + * The IP override must be a public IP address. + * Example of IPv4: 168.192.5.6 + * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + * Example of IPv4 with CIDR: 168.192.5.0/24 + * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + * + * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * Required. The IP address to override (can be IPv4, IPv6 or CIDR). + * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + * The IP override must be a public IP address. + * Example of IPv4: 168.192.5.6 + * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + * Example of IPv4 with CIDR: 168.192.5.0/24 + * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + * + * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * Required. Describes the type of IP override. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOverrideType() + { + return $this->override_type; + } + + /** + * Required. Describes the type of IP override. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOverrideType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData\OverrideType::class); + $this->override_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php new file mode 100644 index 00000000000..f14e440d9c4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php @@ -0,0 +1,58 @@ +google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType + */ +class OverrideType +{ + /** + * Default override type that indicates this enum hasn't been specified. + * + * Generated from protobuf enum OVERRIDE_TYPE_UNSPECIFIED = 0; + */ + const OVERRIDE_TYPE_UNSPECIFIED = 0; + /** + * Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for + * all valid assessments. + * + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + + private static $valueToName = [ + self::OVERRIDE_TYPE_UNSPECIFIED => 'OVERRIDE_TYPE_UNSPECIFIED', + self::ALLOW => 'ALLOW', + ]; + + 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(OverrideType::class, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData_OverrideType::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php new file mode 100644 index 00000000000..0f900489ad4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php @@ -0,0 +1,417 @@ +google.cloud.recaptchaenterprise.v1.Key + */ +class Key extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name for the Key in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. Human-readable display name of this key. Modifiable by user. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/recaptcha/docs/labels). + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The timestamp corresponding to the creation of this key. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. Options for user acceptance testing. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $testing_options = null; + /** + * Optional. Settings for WAF + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $waf_settings = null; + protected $platform_settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name for the Key in the format + * `projects/{project}/keys/{key}`. + * @type string $display_name + * Required. Human-readable display name of this key. Modifiable by user. + * @type \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $web_settings + * Settings for keys that can be used by websites. + * @type \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $android_settings + * Settings for keys that can be used by Android apps. + * @type \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $ios_settings + * Settings for keys that can be used by iOS apps. + * @type \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $express_settings + * Settings for keys that can be used by reCAPTCHA Express. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/recaptcha/docs/labels). + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp corresponding to the creation of this key. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $testing_options + * Optional. Options for user acceptance testing. + * @type \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $waf_settings + * Optional. Settings for WAF + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name for the Key in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name for the Key in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human-readable display name of this key. Modifiable by user. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human-readable display name of this key. Modifiable by user. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Settings for keys that can be used by websites. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3; + * @return \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings|null + */ + public function getWebSettings() + { + return $this->readOneof(3); + } + + public function hasWebSettings() + { + return $this->hasOneof(3); + } + + /** + * Settings for keys that can be used by websites. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3; + * @param \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $var + * @return $this + */ + public function setWebSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Settings for keys that can be used by Android apps. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4; + * @return \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings|null + */ + public function getAndroidSettings() + { + return $this->readOneof(4); + } + + public function hasAndroidSettings() + { + return $this->hasOneof(4); + } + + /** + * Settings for keys that can be used by Android apps. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4; + * @param \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $var + * @return $this + */ + public function setAndroidSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Settings for keys that can be used by iOS apps. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5; + * @return \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings|null + */ + public function getIosSettings() + { + return $this->readOneof(5); + } + + public function hasIosSettings() + { + return $this->hasOneof(5); + } + + /** + * Settings for keys that can be used by iOS apps. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5; + * @param \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $var + * @return $this + */ + public function setIosSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Settings for keys that can be used by reCAPTCHA Express. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * @return \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings|null + */ + public function getExpressSettings() + { + return $this->readOneof(11); + } + + public function hasExpressSettings() + { + return $this->hasOneof(11); + } + + /** + * Settings for keys that can be used by reCAPTCHA Express. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * @param \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $var + * @return $this + */ + public function setExpressSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/recaptcha/docs/labels). + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/recaptcha/docs/labels). + * + * Generated from protobuf field map labels = 6 [(.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; + } + + /** + * Output only. The timestamp corresponding to the creation of this key. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The timestamp corresponding to the creation of this key. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. Options for user acceptance testing. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions|null + */ + public function getTestingOptions() + { + return $this->testing_options; + } + + public function hasTestingOptions() + { + return isset($this->testing_options); + } + + public function clearTestingOptions() + { + unset($this->testing_options); + } + + /** + * Optional. Options for user acceptance testing. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $var + * @return $this + */ + public function setTestingOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions::class); + $this->testing_options = $var; + + return $this; + } + + /** + * Optional. Settings for WAF + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\WafSettings|null + */ + public function getWafSettings() + { + return $this->waf_settings; + } + + public function hasWafSettings() + { + return isset($this->waf_settings); + } + + public function clearWafSettings() + { + unset($this->waf_settings); + } + + /** + * Optional. Settings for WAF + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $var + * @return $this + */ + public function setWafSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings::class); + $this->waf_settings = $var; + + return $this; + } + + /** + * @return string + */ + public function getPlatformSettings() + { + return $this->whichOneof("platform_settings"); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php new file mode 100644 index 00000000000..4fdc8e041b4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php @@ -0,0 +1,162 @@ +google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest + */ +class ListFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of policies to return. Default is 10. Max + * limit is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous. + * ListFirewallPoliciesRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the project to list the policies for, in the format + * `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ListFirewallPoliciesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * @type int $page_size + * Optional. The maximum number of policies to return. Default is 10. Max + * limit is 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous. + * ListFirewallPoliciesRequest, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * + * 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 name of the project to list the policies for, in the format + * `projects/{project}`. + * + * 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. The maximum number of policies to return. Default is 10. Max + * limit is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of policies to return. Default is 10. Max + * limit is 1000. + * + * 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 next_page_token value returned from a previous. + * ListFirewallPoliciesRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous. + * ListFirewallPoliciesRequest, if any. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php new file mode 100644 index 00000000000..0abe284f4f3 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse + */ +class ListFirewallPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Policy details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; + */ + private $firewall_policies; + /** + * Token to retrieve the next page of results. It is set to empty if no + * policies remain in results. + * + * 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\RecaptchaEnterprise\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $firewall_policies + * Policy details. + * @type string $next_page_token + * Token to retrieve the next page of results. It is set to empty if no + * policies remain in results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Policy details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewallPolicies() + { + return $this->firewall_policies; + } + + /** + * Policy details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewallPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); + $this->firewall_policies = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. It is set to empty if no + * policies remain in results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. It is set to empty if no + * policies remain in results. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php new file mode 100644 index 00000000000..52134e04752 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php @@ -0,0 +1,170 @@ +google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest + */ +class ListIpOverridesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of overrides to return. Default is 10. Max + * limit is 100. If the number of overrides is less than the page_size, all + * overrides are returned. If the page size is more than 100, it is coerced to + * 100. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous + * ListIpOverridesRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ListIpOverridesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. + * @type int $page_size + * Optional. The maximum number of overrides to return. Default is 10. Max + * limit is 100. If the number of overrides is less than the page_size, all + * overrides are returned. If the page size is more than 100, it is coerced to + * 100. + * @type string $page_token + * Optional. The next_page_token value returned from a previous + * ListIpOverridesRequest, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. + * + * 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 key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. + * + * 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. The maximum number of overrides to return. Default is 10. Max + * limit is 100. If the number of overrides is less than the page_size, all + * overrides are returned. If the page size is more than 100, it is coerced to + * 100. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of overrides to return. Default is 10. Max + * limit is 100. If the number of overrides is less than the page_size, all + * overrides are returned. If the page size is more than 100, it is coerced to + * 100. + * + * 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 next_page_token value returned from a previous + * ListIpOverridesRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListIpOverridesRequest, if any. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php new file mode 100644 index 00000000000..490069fb86c --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse + */ +class ListIpOverridesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * IP Overrides details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; + */ + private $ip_overrides; + /** + * Token to retrieve the next page of results. If this field is empty, no keys + * remain in the results. + * + * 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\RecaptchaEnterprise\V1\IpOverrideData>|\Google\Protobuf\Internal\RepeatedField $ip_overrides + * IP Overrides details. + * @type string $next_page_token + * Token to retrieve the next page of results. If this field is empty, no keys + * remain in the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * IP Overrides details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpOverrides() + { + return $this->ip_overrides; + } + + /** + * IP Overrides details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); + $this->ip_overrides = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. If this field is empty, no keys + * remain in the results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. If this field is empty, no keys + * remain in the results. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php new file mode 100644 index 00000000000..f726c8ae2c4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php @@ -0,0 +1,162 @@ +google.cloud.recaptchaenterprise.v1.ListKeysRequest + */ +class ListKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project that contains the keys that is + * listed, in the format `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the project that contains the keys that is + * listed, in the format `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ListKeysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project that contains the keys that is + * listed, in the format `projects/{project}`. + * @type int $page_size + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project that contains the keys that is + * listed, in the format `projects/{project}`. + * + * 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 name of the project that contains the keys that is + * listed, in the format `projects/{project}`. + * + * 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. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * + * 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 next_page_token value returned from a previous. + * ListKeysRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php new file mode 100644 index 00000000000..1041b3d7ebd --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.ListKeysResponse + */ +class ListKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Key details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; + */ + private $keys; + /** + * Token to retrieve the next page of results. It is set to empty if no keys + * remain in results. + * + * 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\RecaptchaEnterprise\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys + * Key details. + * @type string $next_page_token + * Token to retrieve the next page of results. It is set to empty if no keys + * remain in results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Key details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeys() + { + return $this->keys; + } + + /** + * Key details. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); + $this->keys = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. It is set to empty if no keys + * remain in results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. It is set to empty if no keys + * remain in results. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php new file mode 100644 index 00000000000..236874e5076 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php @@ -0,0 +1,178 @@ +google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + */ +class ListRelatedAccountGroupMembershipsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of accounts to return. The service might + * return fewer than this value. If unspecified, at most 50 accounts are + * returned. The maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. Please see + * {@see RecaptchaEnterpriseServiceClient::relatedAccountGroupName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupMembershipsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * @type int $page_size + * Optional. The maximum number of accounts to return. The service might + * return fewer than this value. If unspecified, at most 50 accounts are + * returned. The maximum value is 1000; values above 1000 are coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * + * 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 for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * + * 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. The maximum number of accounts to return. The service might + * return fewer than this value. If unspecified, at most 50 accounts are + * returned. The maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of accounts to return. The service might + * return fewer than this value. If unspecified, at most 50 accounts are + * returned. The maximum value is 1000; values above 1000 are coerced to 1000. + * + * 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. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * 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. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * 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; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php new file mode 100644 index 00000000000..893785ab465 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + */ +class ListRelatedAccountGroupMembershipsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The memberships listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + */ + private $related_account_group_memberships; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $related_account_group_memberships + * The memberships listed by the query. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * The memberships listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedAccountGroupMemberships() + { + return $this->related_account_group_memberships; + } + + /** + * The memberships listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedAccountGroupMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership::class); + $this->related_account_group_memberships = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php new file mode 100644 index 00000000000..b9bd3de3314 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php @@ -0,0 +1,178 @@ +google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + */ +class ListRelatedAccountGroupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to list related account groups from, in + * the format `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the project to list related account groups from, in + * the format `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project to list related account groups from, in + * the format `projects/{project}`. + * @type int $page_size + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to list related account groups from, in + * the format `projects/{project}`. + * + * 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 name of the project to list related account groups from, in + * the format `projects/{project}`. + * + * 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. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * 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. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the 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. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the 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; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php new file mode 100644 index 00000000000..eabc47329cd --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + */ +class ListRelatedAccountGroupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The groups of related accounts listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; + */ + private $related_account_groups; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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\RecaptchaEnterprise\V1\RelatedAccountGroup>|\Google\Protobuf\Internal\RepeatedField $related_account_groups + * The groups of related accounts listed by the query. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * The groups of related accounts listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedAccountGroups() + { + return $this->related_account_groups; + } + + /** + * The groups of related accounts listed by the query. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedAccountGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroup::class); + $this->related_account_groups = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php new file mode 100644 index 00000000000..c0e9c3eb5ca --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php @@ -0,0 +1,195 @@ +google.cloud.recaptchaenterprise.v1.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The name of the metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Inclusive start time aligned to a day (UTC). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. All Key types should have score-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + private $score_metrics; + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have + * challenge-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + */ + private $challenge_metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The name of the metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * @type \Google\Protobuf\Timestamp $start_time + * Inclusive start time aligned to a day (UTC). + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics>|\Google\Protobuf\Internal\RepeatedField $score_metrics + * Metrics are continuous and in order by dates, and in the granularity + * of day. All Key types should have score-based data. + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics>|\Google\Protobuf\Internal\RepeatedField $challenge_metrics + * Metrics are continuous and in order by dates, and in the granularity + * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have + * challenge-based data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The name of the metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The name of the metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Inclusive start time aligned to a day (UTC). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Inclusive start time aligned to a day (UTC). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. All Key types should have score-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScoreMetrics() + { + return $this->score_metrics; + } + + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. All Key types should have score-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScoreMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics::class); + $this->score_metrics = $arr; + + return $this; + } + + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have + * challenge-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChallengeMetrics() + { + return $this->challenge_metrics; + } + + /** + * Metrics are continuous and in order by dates, and in the granularity + * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have + * challenge-based data. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChallengeMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics::class); + $this->challenge_metrics = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php new file mode 100644 index 00000000000..3f952ea02cc --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php @@ -0,0 +1,133 @@ +google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + */ +class MigrateKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key to be migrated, in the format + * `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. If true, skips the billing check. + * A reCAPTCHA Enterprise key or migrated key behaves differently than a + * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid + * any disruption of your usage, we check that a billing account is present. + * If your usage of reCAPTCHA is under the free quota, you can safely skip the + * billing check and proceed with the migration. See + * https://cloud.google.com/recaptcha/docs/billing-information. + * + * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip_billing_check = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the key to be migrated, in the format + * `projects/{project}/keys/{key}`. + * @type bool $skip_billing_check + * Optional. If true, skips the billing check. + * A reCAPTCHA Enterprise key or migrated key behaves differently than a + * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid + * any disruption of your usage, we check that a billing account is present. + * If your usage of reCAPTCHA is under the free quota, you can safely skip the + * billing check and proceed with the migration. See + * https://cloud.google.com/recaptcha/docs/billing-information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key to be migrated, in the format + * `projects/{project}/keys/{key}`. + * + * 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 name of the key to be migrated, in the format + * `projects/{project}/keys/{key}`. + * + * 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; + } + + /** + * Optional. If true, skips the billing check. + * A reCAPTCHA Enterprise key or migrated key behaves differently than a + * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid + * any disruption of your usage, we check that a billing account is present. + * If your usage of reCAPTCHA is under the free quota, you can safely skip the + * billing check and proceed with the migration. See + * https://cloud.google.com/recaptcha/docs/billing-information. + * + * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSkipBillingCheck() + { + return $this->skip_billing_check; + } + + /** + * Optional. If true, skips the billing check. + * A reCAPTCHA Enterprise key or migrated key behaves differently than a + * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid + * any disruption of your usage, we check that a billing account is present. + * If your usage of reCAPTCHA is under the free quota, you can safely skip the + * billing check and proceed with the migration. See + * https://cloud.google.com/recaptcha/docs/billing-information. + * + * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSkipBillingCheck($var) + { + GPBUtil::checkBool($var); + $this->skip_billing_check = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php new file mode 100644 index 00000000000..40d0697b61f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php @@ -0,0 +1,77 @@ +google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + */ +class PhoneFraudAssessment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Assessment of this phone event for risk of SMS toll fraud. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sms_toll_fraud_verdict = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict $sms_toll_fraud_verdict + * Output only. Assessment of this phone event for risk of SMS toll fraud. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Assessment of this phone event for risk of SMS toll fraud. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict|null + */ + public function getSmsTollFraudVerdict() + { + return $this->sms_toll_fraud_verdict; + } + + public function hasSmsTollFraudVerdict() + { + return isset($this->sms_toll_fraud_verdict); + } + + public function clearSmsTollFraudVerdict() + { + unset($this->sms_toll_fraud_verdict); + } + + /** + * Output only. Assessment of this phone event for risk of SMS toll fraud. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict $var + * @return $this + */ + public function setSmsTollFraudVerdict($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict::class); + $this->sms_toll_fraud_verdict = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php new file mode 100644 index 00000000000..f753cd4aff2 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php @@ -0,0 +1,201 @@ +google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + */ +class PrivatePasswordLeakVerification extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + * username. It is used to look up password leaks associated with that hash + * prefix. + * + * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lookup_hash_prefix = ''; + /** + * Optional. Encrypted Scrypt hash of the canonicalized username+password. It + * is re-encrypted by the server and returned through + * `reencrypted_user_credentials_hash`. + * + * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encrypted_user_credentials_hash = ''; + /** + * Output only. List of prefixes of the encrypted potential password leaks + * that matched the given parameters. They must be compared with the + * client-side decryption prefix of `reencrypted_user_credentials_hash` + * + * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $encrypted_leak_match_prefixes; + /** + * Output only. Corresponds to the re-encryption of the + * `encrypted_user_credentials_hash` field. It is used to match potential + * password leaks within `encrypted_leak_match_prefixes`. + * + * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reencrypted_user_credentials_hash = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lookup_hash_prefix + * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + * username. It is used to look up password leaks associated with that hash + * prefix. + * @type string $encrypted_user_credentials_hash + * Optional. Encrypted Scrypt hash of the canonicalized username+password. It + * is re-encrypted by the server and returned through + * `reencrypted_user_credentials_hash`. + * @type array|\Google\Protobuf\Internal\RepeatedField $encrypted_leak_match_prefixes + * Output only. List of prefixes of the encrypted potential password leaks + * that matched the given parameters. They must be compared with the + * client-side decryption prefix of `reencrypted_user_credentials_hash` + * @type string $reencrypted_user_credentials_hash + * Output only. Corresponds to the re-encryption of the + * `encrypted_user_credentials_hash` field. It is used to match potential + * password leaks within `encrypted_leak_match_prefixes`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + * username. It is used to look up password leaks associated with that hash + * prefix. + * + * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLookupHashPrefix() + { + return $this->lookup_hash_prefix; + } + + /** + * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + * username. It is used to look up password leaks associated with that hash + * prefix. + * + * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLookupHashPrefix($var) + { + GPBUtil::checkString($var, False); + $this->lookup_hash_prefix = $var; + + return $this; + } + + /** + * Optional. Encrypted Scrypt hash of the canonicalized username+password. It + * is re-encrypted by the server and returned through + * `reencrypted_user_credentials_hash`. + * + * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEncryptedUserCredentialsHash() + { + return $this->encrypted_user_credentials_hash; + } + + /** + * Optional. Encrypted Scrypt hash of the canonicalized username+password. It + * is re-encrypted by the server and returned through + * `reencrypted_user_credentials_hash`. + * + * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEncryptedUserCredentialsHash($var) + { + GPBUtil::checkString($var, False); + $this->encrypted_user_credentials_hash = $var; + + return $this; + } + + /** + * Output only. List of prefixes of the encrypted potential password leaks + * that matched the given parameters. They must be compared with the + * client-side decryption prefix of `reencrypted_user_credentials_hash` + * + * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEncryptedLeakMatchPrefixes() + { + return $this->encrypted_leak_match_prefixes; + } + + /** + * Output only. List of prefixes of the encrypted potential password leaks + * that matched the given parameters. They must be compared with the + * client-side decryption prefix of `reencrypted_user_credentials_hash` + * + * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEncryptedLeakMatchPrefixes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->encrypted_leak_match_prefixes = $arr; + + return $this; + } + + /** + * Output only. Corresponds to the re-encryption of the + * `encrypted_user_credentials_hash` field. It is used to match potential + * password leaks within `encrypted_leak_match_prefixes`. + * + * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReencryptedUserCredentialsHash() + { + return $this->reencrypted_user_credentials_hash; + } + + /** + * Output only. Corresponds to the re-encryption of the + * `encrypted_user_credentials_hash` field. It is used to match potential + * password leaks within `encrypted_leak_match_prefixes`. + * + * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReencryptedUserCredentialsHash($var) + { + GPBUtil::checkString($var, False); + $this->reencrypted_user_credentials_hash = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php new file mode 100644 index 00000000000..29c2020bed6 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php @@ -0,0 +1,75 @@ +google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + */ +class RelatedAccountGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier. The resource name for the related account group in + * the format + * `projects/{project}/relatedaccountgroups/{related_account_group}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Identifier. The resource name for the related account group in + * the format + * `projects/{project}/relatedaccountgroups/{related_account_group}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifier. The resource name for the related account group in + * the format + * `projects/{project}/relatedaccountgroups/{related_account_group}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Identifier. The resource name for the related account group in + * the format + * `projects/{project}/relatedaccountgroups/{related_account_group}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php new file mode 100644 index 00000000000..e766bb4b5ad --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php @@ -0,0 +1,164 @@ +google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + */ +class RelatedAccountGroupMembership extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier. The resource name for this membership in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The unique stable account identifier of the member. The identifier + * corresponds to an `account_id` provided in a previous `CreateAssessment` or + * `AnnotateAssessment` call. + * + * Generated from protobuf field string account_id = 4; + */ + protected $account_id = ''; + /** + * Deprecated: use `account_id` instead. + * The unique stable hashed account identifier of the member. The identifier + * corresponds to a `hashed_account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; + * @deprecated + */ + protected $hashed_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Identifier. The resource name for this membership in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + * @type string $account_id + * The unique stable account identifier of the member. The identifier + * corresponds to an `account_id` provided in a previous `CreateAssessment` or + * `AnnotateAssessment` call. + * @type string $hashed_account_id + * Deprecated: use `account_id` instead. + * The unique stable hashed account identifier of the member. The identifier + * corresponds to a `hashed_account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifier. The resource name for this membership in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Identifier. The resource name for this membership in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The unique stable account identifier of the member. The identifier + * corresponds to an `account_id` provided in a previous `CreateAssessment` or + * `AnnotateAssessment` call. + * + * Generated from protobuf field string account_id = 4; + * @return string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * The unique stable account identifier of the member. The identifier + * corresponds to an `account_id` provided in a previous `CreateAssessment` or + * `AnnotateAssessment` call. + * + * Generated from protobuf field string account_id = 4; + * @param string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkString($var, True); + $this->account_id = $var; + + return $this; + } + + /** + * Deprecated: use `account_id` instead. + * The unique stable hashed account identifier of the member. The identifier + * corresponds to a `hashed_account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; + * @return string + * @deprecated + */ + public function getHashedAccountId() + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + return $this->hashed_account_id; + } + + /** + * Deprecated: use `account_id` instead. + * The unique stable hashed account identifier of the member. The identifier + * corresponds to a `hashed_account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setHashedAccountId($var) + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, False); + $this->hashed_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php new file mode 100644 index 00000000000..4da23b7f131 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php @@ -0,0 +1,132 @@ +google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest + */ +class RemoveIpOverrideRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. IP override to be removed from the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ip_override_data = null; + + /** + * @param string $name Required. The name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData Required. IP override to be removed from the key. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\RemoveIpOverrideRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData): self + { + return (new self()) + ->setName($name) + ->setIpOverrideData($ipOverrideData); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. + * @type \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ip_override_data + * Required. IP override to be removed from the key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. + * + * 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 name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. + * + * 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. IP override to be removed from the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData|null + */ + public function getIpOverrideData() + { + return $this->ip_override_data; + } + + public function hasIpOverrideData() + { + return isset($this->ip_override_data); + } + + public function clearIpOverrideData() + { + unset($this->ip_override_data); + } + + /** + * Required. IP override to be removed from the key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $var + * @return $this + */ + public function setIpOverrideData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); + $this->ip_override_data = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php new file mode 100644 index 00000000000..c6cb317ffd7 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php @@ -0,0 +1,33 @@ +google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse + */ +class RemoveIpOverrideResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php new file mode 100644 index 00000000000..2ac90f60a3e --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php @@ -0,0 +1,128 @@ +google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest + */ +class ReorderFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $names; + + /** + * @param string $parent Required. The name of the project to list the policies for, in the format + * `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * @param string[] $names Required. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see + * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\ReorderFirewallPoliciesRequest + * + * @experimental + */ + public static function build(string $parent, array $names): self + { + return (new self()) + ->setParent($parent) + ->setNames($names); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $names + * Required. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * + * 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 name of the project to list the policies for, in the format + * `projects/{project}`. + * + * 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. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNames() + { + return $this->names; + } + + /** + * Required. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + * + * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php new file mode 100644 index 00000000000..a03f0e590b4 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php @@ -0,0 +1,33 @@ +google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse + */ +class ReorderFirewallPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php new file mode 100644 index 00000000000..5c242d9c65b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php @@ -0,0 +1,86 @@ +google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + */ +class RetrieveLegacySecretKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $key = ''; + + /** + * @param string $key Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. Please see + * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyRequest + * + * @experimental + */ + public static function build(string $key): self + { + return (new self()) + ->setKey($key); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php new file mode 100644 index 00000000000..397a75127a0 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php @@ -0,0 +1,80 @@ +google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + */ +class RetrieveLegacySecretKeyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The secret key (also known as shared secret) authorizes communication + * between your application backend and the reCAPTCHA Enterprise server to + * create an assessment. + * The secret key needs to be kept safe for security purposes. + * + * Generated from protobuf field string legacy_secret_key = 1; + */ + protected $legacy_secret_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $legacy_secret_key + * The secret key (also known as shared secret) authorizes communication + * between your application backend and the reCAPTCHA Enterprise server to + * create an assessment. + * The secret key needs to be kept safe for security purposes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * The secret key (also known as shared secret) authorizes communication + * between your application backend and the reCAPTCHA Enterprise server to + * create an assessment. + * The secret key needs to be kept safe for security purposes. + * + * Generated from protobuf field string legacy_secret_key = 1; + * @return string + */ + public function getLegacySecretKey() + { + return $this->legacy_secret_key; + } + + /** + * The secret key (also known as shared secret) authorizes communication + * between your application backend and the reCAPTCHA Enterprise server to + * create an assessment. + * The secret key needs to be kept safe for security purposes. + * + * Generated from protobuf field string legacy_secret_key = 1; + * @param string $var + * @return $this + */ + public function setLegacySecretKey($var) + { + GPBUtil::checkString($var, True); + $this->legacy_secret_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php new file mode 100644 index 00000000000..6fa203ea294 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php @@ -0,0 +1,185 @@ +google.cloud.recaptchaenterprise.v1.RiskAnalysis + */ +class RiskAnalysis extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Legitimate event score from 0.0 to 1.0. + * (1.0 means very likely legitimate traffic while 0.0 means very likely + * non-legitimate traffic). + * + * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $score = 0.0; + /** + * Output only. Reasons contributing to the risk analysis verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $reasons; + /** + * Output only. Extended verdict reasons to be used for experimentation only. + * The set of possible reasons is subject to change. + * + * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $extended_verdict_reasons; + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE + * keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $challenge = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $score + * Output only. Legitimate event score from 0.0 to 1.0. + * (1.0 means very likely legitimate traffic while 0.0 means very likely + * non-legitimate traffic). + * @type array|\Google\Protobuf\Internal\RepeatedField $reasons + * Output only. Reasons contributing to the risk analysis verdict. + * @type array|\Google\Protobuf\Internal\RepeatedField $extended_verdict_reasons + * Output only. Extended verdict reasons to be used for experimentation only. + * The set of possible reasons is subject to change. + * @type int $challenge + * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE + * keys + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Legitimate event score from 0.0 to 1.0. + * (1.0 means very likely legitimate traffic while 0.0 means very likely + * non-legitimate traffic). + * + * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. Legitimate event score from 0.0 to 1.0. + * (1.0 means very likely legitimate traffic while 0.0 means very likely + * non-legitimate traffic). + * + * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * Output only. Reasons contributing to the risk analysis verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReasons() + { + return $this->reasons; + } + + /** + * Output only. Reasons contributing to the risk analysis verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis\ClassificationReason::class); + $this->reasons = $arr; + + return $this; + } + + /** + * Output only. Extended verdict reasons to be used for experimentation only. + * The set of possible reasons is subject to change. + * + * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtendedVerdictReasons() + { + return $this->extended_verdict_reasons; + } + + /** + * Output only. Extended verdict reasons to be used for experimentation only. + * The set of possible reasons is subject to change. + * + * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtendedVerdictReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->extended_verdict_reasons = $arr; + + return $this; + } + + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE + * keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getChallenge() + { + return $this->challenge; + } + + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE + * keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setChallenge($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis\Challenge::class); + $this->challenge = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php new file mode 100644 index 00000000000..d61a1944dd0 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php @@ -0,0 +1,72 @@ +google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge + */ +class Challenge +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum CHALLENGE_UNSPECIFIED = 0; + */ + const CHALLENGE_UNSPECIFIED = 0; + /** + * No challenge was presented for solving. + * + * Generated from protobuf enum NOCAPTCHA = 1; + */ + const NOCAPTCHA = 1; + /** + * A solution was submitted that was correct. + * + * Generated from protobuf enum PASSED = 2; + */ + const PASSED = 2; + /** + * A solution was submitted that was incorrect or otherwise + * deemed suspicious. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::CHALLENGE_UNSPECIFIED => 'CHALLENGE_UNSPECIFIED', + self::NOCAPTCHA => 'NOCAPTCHA', + self::PASSED => 'PASSED', + self::FAILED => 'FAILED', + ]; + + 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(Challenge::class, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis_Challenge::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php new file mode 100644 index 00000000000..159b1c8c8e3 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php @@ -0,0 +1,101 @@ +google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason + */ +class ClassificationReason +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum CLASSIFICATION_REASON_UNSPECIFIED = 0; + */ + const CLASSIFICATION_REASON_UNSPECIFIED = 0; + /** + * Interactions matched the behavior of an automated agent. + * + * Generated from protobuf enum AUTOMATION = 1; + */ + const AUTOMATION = 1; + /** + * The event originated from an illegitimate environment. + * + * Generated from protobuf enum UNEXPECTED_ENVIRONMENT = 2; + */ + const UNEXPECTED_ENVIRONMENT = 2; + /** + * Traffic volume from the event source is higher than normal. + * + * Generated from protobuf enum TOO_MUCH_TRAFFIC = 3; + */ + const TOO_MUCH_TRAFFIC = 3; + /** + * Interactions with the site were significantly different than expected + * patterns. + * + * Generated from protobuf enum UNEXPECTED_USAGE_PATTERNS = 4; + */ + const UNEXPECTED_USAGE_PATTERNS = 4; + /** + * Too little traffic has been received from this site thus far to generate + * quality risk analysis. + * + * Generated from protobuf enum LOW_CONFIDENCE_SCORE = 5; + */ + const LOW_CONFIDENCE_SCORE = 5; + /** + * The request matches behavioral characteristics of a carding attack. + * + * Generated from protobuf enum SUSPECTED_CARDING = 6; + */ + const SUSPECTED_CARDING = 6; + /** + * The request matches behavioral characteristics of chargebacks for fraud. + * + * Generated from protobuf enum SUSPECTED_CHARGEBACK = 7; + */ + const SUSPECTED_CHARGEBACK = 7; + + private static $valueToName = [ + self::CLASSIFICATION_REASON_UNSPECIFIED => 'CLASSIFICATION_REASON_UNSPECIFIED', + self::AUTOMATION => 'AUTOMATION', + self::UNEXPECTED_ENVIRONMENT => 'UNEXPECTED_ENVIRONMENT', + self::TOO_MUCH_TRAFFIC => 'TOO_MUCH_TRAFFIC', + self::UNEXPECTED_USAGE_PATTERNS => 'UNEXPECTED_USAGE_PATTERNS', + self::LOW_CONFIDENCE_SCORE => 'LOW_CONFIDENCE_SCORE', + self::SUSPECTED_CARDING => 'SUSPECTED_CARDING', + self::SUSPECTED_CHARGEBACK => 'SUSPECTED_CHARGEBACK', + ]; + + 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(ClassificationReason::class, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis_ClassificationReason::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php new file mode 100644 index 00000000000..0c0196f6624 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php @@ -0,0 +1,75 @@ +google.cloud.recaptchaenterprise.v1.ScoreDistribution + */ +class ScoreDistribution extends \Google\Protobuf\Internal\Message +{ + /** + * Map key is score value multiplied by 100. The scores are discrete values + * between [0, 1]. The maximum number of buckets is on order of a few dozen, + * but typically much lower (ie. 10). + * + * Generated from protobuf field map score_buckets = 1; + */ + private $score_buckets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $score_buckets + * Map key is score value multiplied by 100. The scores are discrete values + * between [0, 1]. The maximum number of buckets is on order of a few dozen, + * but typically much lower (ie. 10). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Map key is score value multiplied by 100. The scores are discrete values + * between [0, 1]. The maximum number of buckets is on order of a few dozen, + * but typically much lower (ie. 10). + * + * Generated from protobuf field map score_buckets = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getScoreBuckets() + { + return $this->score_buckets; + } + + /** + * Map key is score value multiplied by 100. The scores are discrete values + * between [0, 1]. The maximum number of buckets is on order of a few dozen, + * but typically much lower (ie. 10). + * + * Generated from protobuf field map score_buckets = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setScoreBuckets($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::INT64); + $this->score_buckets = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php new file mode 100644 index 00000000000..6b118c87689 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php @@ -0,0 +1,115 @@ +google.cloud.recaptchaenterprise.v1.ScoreMetrics + */ +class ScoreMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Aggregated score metrics for all traffic. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + protected $overall_metrics = null; + /** + * Action-based metrics. The map key is the action name which specified by the + * site owners at time of the "execute" client-side call. + * + * Generated from protobuf field map action_metrics = 2; + */ + private $action_metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution $overall_metrics + * Aggregated score metrics for all traffic. + * @type array|\Google\Protobuf\Internal\MapField $action_metrics + * Action-based metrics. The map key is the action name which specified by the + * site owners at time of the "execute" client-side call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Aggregated score metrics for all traffic. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * @return \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution|null + */ + public function getOverallMetrics() + { + return $this->overall_metrics; + } + + public function hasOverallMetrics() + { + return isset($this->overall_metrics); + } + + public function clearOverallMetrics() + { + unset($this->overall_metrics); + } + + /** + * Aggregated score metrics for all traffic. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * @param \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution $var + * @return $this + */ + public function setOverallMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution::class); + $this->overall_metrics = $var; + + return $this; + } + + /** + * Action-based metrics. The map key is the action name which specified by the + * site owners at time of the "execute" client-side call. + * + * Generated from protobuf field map action_metrics = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getActionMetrics() + { + return $this->action_metrics; + } + + /** + * Action-based metrics. The map key is the action name which specified by the + * site owners at time of the "execute" client-side call. + * + * Generated from protobuf field map action_metrics = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setActionMetrics($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution::class); + $this->action_metrics = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php new file mode 100644 index 00000000000..0c6559fc52f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php @@ -0,0 +1,294 @@ +google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + */ +class SearchRelatedAccountGroupMembershipsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $project = ''; + /** + * Optional. The unique stable account identifier used to search connections. + * The identifier should correspond to an `account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + * or account_id must be set, but not both. + * + * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $account_id = ''; + /** + * Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $hashed_account_id = ''; + /** + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $project Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. Please see + * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. + * @param string $hashedAccountId Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\SearchRelatedAccountGroupMembershipsRequest + * + * @experimental + */ + public static function build(string $project, string $hashedAccountId): self + { + return (new self()) + ->setProject($project) + ->setHashedAccountId($hashedAccountId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. + * @type string $account_id + * Optional. The unique stable account identifier used to search connections. + * The identifier should correspond to an `account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + * or account_id must be set, but not both. + * @type string $hashed_account_id + * Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * @type int $page_size + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Optional. The unique stable account identifier used to search connections. + * The identifier should correspond to an `account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + * or account_id must be set, but not both. + * + * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * Optional. The unique stable account identifier used to search connections. + * The identifier should correspond to an `account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + * or account_id must be set, but not both. + * + * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkString($var, True); + $this->account_id = $var; + + return $this; + } + + /** + * Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getHashedAccountId() + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + return $this->hashed_account_id; + } + + /** + * Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * + * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setHashedAccountId($var) + { + @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, False); + $this->hashed_account_id = $var; + + return $this; + } + + /** + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of groups to return. The service might return + * fewer than this value. If unspecified, at most 50 groups are returned. The + * maximum value is 1000; values above 1000 are coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * + * Generated from protobuf field string page_token = 4 [(.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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php new file mode 100644 index 00000000000..6099354ab5e --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + */ +class SearchRelatedAccountGroupMembershipsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The queried memberships. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + */ + private $related_account_group_memberships; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $related_account_group_memberships + * The queried memberships. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * The queried memberships. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedAccountGroupMemberships() + { + return $this->related_account_group_memberships; + } + + /** + * The queried memberships. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedAccountGroupMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership::class); + $this->related_account_group_memberships = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php new file mode 100644 index 00000000000..8f411544313 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php @@ -0,0 +1,105 @@ +google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + */ +class SmsTollFraudVerdict extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Probability of an SMS event being fraudulent. + * Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $risk = 0.0; + /** + * Output only. Reasons contributing to the SMS toll fraud verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $reasons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $risk + * Output only. Probability of an SMS event being fraudulent. + * Values are from 0.0 (lowest) to 1.0 (highest). + * @type array|\Google\Protobuf\Internal\RepeatedField $reasons + * Output only. Reasons contributing to the SMS toll fraud verdict. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Probability of an SMS event being fraudulent. + * Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getRisk() + { + return $this->risk; + } + + /** + * Output only. Probability of an SMS event being fraudulent. + * Values are from 0.0 (lowest) to 1.0 (highest). + * + * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setRisk($var) + { + GPBUtil::checkFloat($var); + $this->risk = $var; + + return $this; + } + + /** + * Output only. Reasons contributing to the SMS toll fraud verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReasons() + { + return $this->reasons; + } + + /** + * Output only. Reasons contributing to the SMS toll fraud verdict. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict\SmsTollFraudReason::class); + $this->reasons = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php new file mode 100644 index 00000000000..6e67f9b1eec --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php @@ -0,0 +1,57 @@ +google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason + */ +class SmsTollFraudReason +{ + /** + * Default unspecified reason + * + * Generated from protobuf enum SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0; + */ + const SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0; + /** + * The provided phone number was invalid + * + * Generated from protobuf enum INVALID_PHONE_NUMBER = 1; + */ + const INVALID_PHONE_NUMBER = 1; + + private static $valueToName = [ + self::SMS_TOLL_FRAUD_REASON_UNSPECIFIED => 'SMS_TOLL_FRAUD_REASON_UNSPECIFIED', + self::INVALID_PHONE_NUMBER => 'INVALID_PHONE_NUMBER', + ]; + + 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(SmsTollFraudReason::class, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict_SmsTollFraudReason::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php new file mode 100644 index 00000000000..310161e1b0e --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php @@ -0,0 +1,113 @@ +google.cloud.recaptchaenterprise.v1.TestingOptions + */ +class TestingOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. All assessments for this Key return this score. Must be between 0 + * (likely not legitimate) and 1 (likely legitimate) inclusive. + * + * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $testing_score = 0.0; + /** + * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all + * challenge requests for this site return nocaptcha if NOCAPTCHA, or an + * unsolvable challenge if CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $testing_challenge = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $testing_score + * Optional. All assessments for this Key return this score. Must be between 0 + * (likely not legitimate) and 1 (likely legitimate) inclusive. + * @type int $testing_challenge + * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all + * challenge requests for this site return nocaptcha if NOCAPTCHA, or an + * unsolvable challenge if CHALLENGE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. All assessments for this Key return this score. Must be between 0 + * (likely not legitimate) and 1 (likely legitimate) inclusive. + * + * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTestingScore() + { + return $this->testing_score; + } + + /** + * Optional. All assessments for this Key return this score. Must be between 0 + * (likely not legitimate) and 1 (likely legitimate) inclusive. + * + * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTestingScore($var) + { + GPBUtil::checkFloat($var); + $this->testing_score = $var; + + return $this; + } + + /** + * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all + * challenge requests for this site return nocaptcha if NOCAPTCHA, or an + * unsolvable challenge if CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTestingChallenge() + { + return $this->testing_challenge; + } + + /** + * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all + * challenge requests for this site return nocaptcha if NOCAPTCHA, or an + * unsolvable challenge if CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTestingChallenge($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions\TestingChallenge::class); + $this->testing_challenge = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php new file mode 100644 index 00000000000..c139614f372 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php @@ -0,0 +1,68 @@ +google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge + */ +class TestingChallenge +{ + /** + * Perform the normal risk analysis and return either nocaptcha or a + * challenge depending on risk and trust factors. + * + * Generated from protobuf enum TESTING_CHALLENGE_UNSPECIFIED = 0; + */ + const TESTING_CHALLENGE_UNSPECIFIED = 0; + /** + * Challenge requests for this key always return a nocaptcha, which + * does not require a solution. + * + * Generated from protobuf enum NOCAPTCHA = 1; + */ + const NOCAPTCHA = 1; + /** + * Challenge requests for this key always return an unsolvable + * challenge. + * + * Generated from protobuf enum UNSOLVABLE_CHALLENGE = 2; + */ + const UNSOLVABLE_CHALLENGE = 2; + + private static $valueToName = [ + self::TESTING_CHALLENGE_UNSPECIFIED => 'TESTING_CHALLENGE_UNSPECIFIED', + self::NOCAPTCHA => 'NOCAPTCHA', + self::UNSOLVABLE_CHALLENGE => 'UNSOLVABLE_CHALLENGE', + ]; + + 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(TestingChallenge::class, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions_TestingChallenge::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php new file mode 100644 index 00000000000..76d51f5b8d2 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php @@ -0,0 +1,309 @@ +google.cloud.recaptchaenterprise.v1.TokenProperties + */ +class TokenProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Whether the provided user response token is valid. When valid + * = false, the reason could be specified in invalid_reason or it could also + * be due to a user failing to solve a challenge or a sitekey mismatch (i.e + * the sitekey used to generate the token was different than the one specified + * in the assessment). + * + * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $valid = false; + /** + * Output only. Reason associated with the response when valid = false. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $invalid_reason = 0; + /** + * Output only. The timestamp corresponding to the generation of the token. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The hostname of the page on which the token was generated (Web + * keys only). + * + * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $hostname = ''; + /** + * Output only. The name of the Android package with which the token was + * generated (Android keys only). + * + * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $android_package_name = ''; + /** + * Output only. The ID of the iOS bundle with which the token was generated + * (iOS keys only). + * + * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ios_bundle_id = ''; + /** + * Output only. Action name provided at token generation. + * + * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $action = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $valid + * Output only. Whether the provided user response token is valid. When valid + * = false, the reason could be specified in invalid_reason or it could also + * be due to a user failing to solve a challenge or a sitekey mismatch (i.e + * the sitekey used to generate the token was different than the one specified + * in the assessment). + * @type int $invalid_reason + * Output only. Reason associated with the response when valid = false. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp corresponding to the generation of the token. + * @type string $hostname + * Output only. The hostname of the page on which the token was generated (Web + * keys only). + * @type string $android_package_name + * Output only. The name of the Android package with which the token was + * generated (Android keys only). + * @type string $ios_bundle_id + * Output only. The ID of the iOS bundle with which the token was generated + * (iOS keys only). + * @type string $action + * Output only. Action name provided at token generation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Whether the provided user response token is valid. When valid + * = false, the reason could be specified in invalid_reason or it could also + * be due to a user failing to solve a challenge or a sitekey mismatch (i.e + * the sitekey used to generate the token was different than the one specified + * in the assessment). + * + * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getValid() + { + return $this->valid; + } + + /** + * Output only. Whether the provided user response token is valid. When valid + * = false, the reason could be specified in invalid_reason or it could also + * be due to a user failing to solve a challenge or a sitekey mismatch (i.e + * the sitekey used to generate the token was different than the one specified + * in the assessment). + * + * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setValid($var) + { + GPBUtil::checkBool($var); + $this->valid = $var; + + return $this; + } + + /** + * Output only. Reason associated with the response when valid = false. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getInvalidReason() + { + return $this->invalid_reason; + } + + /** + * Output only. Reason associated with the response when valid = false. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setInvalidReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties\InvalidReason::class); + $this->invalid_reason = $var; + + return $this; + } + + /** + * Output only. The timestamp corresponding to the generation of the token. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The timestamp corresponding to the generation of the token. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The hostname of the page on which the token was generated (Web + * keys only). + * + * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Output only. The hostname of the page on which the token was generated (Web + * keys only). + * + * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Output only. The name of the Android package with which the token was + * generated (Android keys only). + * + * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAndroidPackageName() + { + return $this->android_package_name; + } + + /** + * Output only. The name of the Android package with which the token was + * generated (Android keys only). + * + * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAndroidPackageName($var) + { + GPBUtil::checkString($var, True); + $this->android_package_name = $var; + + return $this; + } + + /** + * Output only. The ID of the iOS bundle with which the token was generated + * (iOS keys only). + * + * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIosBundleId() + { + return $this->ios_bundle_id; + } + + /** + * Output only. The ID of the iOS bundle with which the token was generated + * (iOS keys only). + * + * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIosBundleId($var) + { + GPBUtil::checkString($var, True); + $this->ios_bundle_id = $var; + + return $this; + } + + /** + * Output only. Action name provided at token generation. + * + * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Output only. Action name provided at token generation. + * + * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php new file mode 100644 index 00000000000..94f9c48b329 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php @@ -0,0 +1,93 @@ +google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason + */ +class InvalidReason +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum INVALID_REASON_UNSPECIFIED = 0; + */ + const INVALID_REASON_UNSPECIFIED = 0; + /** + * If the failure reason was not accounted for. + * + * Generated from protobuf enum UNKNOWN_INVALID_REASON = 1; + */ + const UNKNOWN_INVALID_REASON = 1; + /** + * The provided user verification token was malformed. + * + * Generated from protobuf enum MALFORMED = 2; + */ + const MALFORMED = 2; + /** + * The user verification token had expired. + * + * Generated from protobuf enum EXPIRED = 3; + */ + const EXPIRED = 3; + /** + * The user verification had already been seen. + * + * Generated from protobuf enum DUPE = 4; + */ + const DUPE = 4; + /** + * The user verification token was not present. + * + * Generated from protobuf enum MISSING = 5; + */ + const MISSING = 5; + /** + * A retriable error (such as network failure) occurred on the browser. + * Could easily be simulated by an attacker. + * + * Generated from protobuf enum BROWSER_ERROR = 6; + */ + const BROWSER_ERROR = 6; + + private static $valueToName = [ + self::INVALID_REASON_UNSPECIFIED => 'INVALID_REASON_UNSPECIFIED', + self::UNKNOWN_INVALID_REASON => 'UNKNOWN_INVALID_REASON', + self::MALFORMED => 'MALFORMED', + self::EXPIRED => 'EXPIRED', + self::DUPE => 'DUPE', + self::MISSING => 'MISSING', + self::BROWSER_ERROR => 'BROWSER_ERROR', + ]; + + 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(InvalidReason::class, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties_InvalidReason::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php new file mode 100644 index 00000000000..4a838d95742 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php @@ -0,0 +1,581 @@ +google.cloud.recaptchaenterprise.v1.TransactionData + */ +class TransactionData extends \Google\Protobuf\Internal\Message +{ + /** + * Unique identifier for the transaction. This custom identifier can be used + * to reference this transaction in the future, for example, labeling a refund + * or chargeback event. Two attempts at the same transaction should use the + * same transaction id. + * + * Generated from protobuf field optional string transaction_id = 11; + */ + protected $transaction_id = null; + /** + * Optional. The payment method for the transaction. The allowed values are: + * * credit-card + * * debit-card + * * gift-card + * * processor-{name} (If a third-party is used, for example, + * processor-paypal) + * * custom-{name} (If an alternative method is used, for example, + * custom-crypto) + * + * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $payment_method = ''; + /** + * Optional. The Bank Identification Number - generally the first 6 or 8 + * digits of the card. + * + * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $card_bin = ''; + /** + * Optional. The last four digits of the card. + * + * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $card_last_four = ''; + /** + * Optional. The currency code in ISO-4217 format. + * + * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $currency_code = ''; + /** + * Optional. The decimal value of the transaction in the specified currency. + * + * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = 0.0; + /** + * Optional. The value of shipping in the specified currency. 0 for free or no + * shipping. + * + * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $shipping_value = 0.0; + /** + * Optional. Destination address if this transaction involves shipping a + * physical item. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $shipping_address = null; + /** + * Optional. Address associated with the payment method when applicable. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $billing_address = null; + /** + * Optional. Information about the user paying/initiating the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user = null; + /** + * Optional. Information about the user or users fulfilling the transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $merchants; + /** + * Optional. Items purchased in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $items; + /** + * Optional. Information about the payment gateway's response to the + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $gateway_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $transaction_id + * Unique identifier for the transaction. This custom identifier can be used + * to reference this transaction in the future, for example, labeling a refund + * or chargeback event. Two attempts at the same transaction should use the + * same transaction id. + * @type string $payment_method + * Optional. The payment method for the transaction. The allowed values are: + * * credit-card + * * debit-card + * * gift-card + * * processor-{name} (If a third-party is used, for example, + * processor-paypal) + * * custom-{name} (If an alternative method is used, for example, + * custom-crypto) + * @type string $card_bin + * Optional. The Bank Identification Number - generally the first 6 or 8 + * digits of the card. + * @type string $card_last_four + * Optional. The last four digits of the card. + * @type string $currency_code + * Optional. The currency code in ISO-4217 format. + * @type float $value + * Optional. The decimal value of the transaction in the specified currency. + * @type float $shipping_value + * Optional. The value of shipping in the specified currency. 0 for free or no + * shipping. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $shipping_address + * Optional. Destination address if this transaction involves shipping a + * physical item. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $billing_address + * Optional. Address associated with the payment method when applicable. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User $user + * Optional. Information about the user paying/initiating the transaction. + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User>|\Google\Protobuf\Internal\RepeatedField $merchants + * Optional. Information about the user or users fulfilling the transaction. + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item>|\Google\Protobuf\Internal\RepeatedField $items + * Optional. Items purchased in this transaction. + * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo $gateway_info + * Optional. Information about the payment gateway's response to the + * transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Unique identifier for the transaction. This custom identifier can be used + * to reference this transaction in the future, for example, labeling a refund + * or chargeback event. Two attempts at the same transaction should use the + * same transaction id. + * + * Generated from protobuf field optional string transaction_id = 11; + * @return string + */ + public function getTransactionId() + { + return isset($this->transaction_id) ? $this->transaction_id : ''; + } + + public function hasTransactionId() + { + return isset($this->transaction_id); + } + + public function clearTransactionId() + { + unset($this->transaction_id); + } + + /** + * Unique identifier for the transaction. This custom identifier can be used + * to reference this transaction in the future, for example, labeling a refund + * or chargeback event. Two attempts at the same transaction should use the + * same transaction id. + * + * Generated from protobuf field optional string transaction_id = 11; + * @param string $var + * @return $this + */ + public function setTransactionId($var) + { + GPBUtil::checkString($var, True); + $this->transaction_id = $var; + + return $this; + } + + /** + * Optional. The payment method for the transaction. The allowed values are: + * * credit-card + * * debit-card + * * gift-card + * * processor-{name} (If a third-party is used, for example, + * processor-paypal) + * * custom-{name} (If an alternative method is used, for example, + * custom-crypto) + * + * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPaymentMethod() + { + return $this->payment_method; + } + + /** + * Optional. The payment method for the transaction. The allowed values are: + * * credit-card + * * debit-card + * * gift-card + * * processor-{name} (If a third-party is used, for example, + * processor-paypal) + * * custom-{name} (If an alternative method is used, for example, + * custom-crypto) + * + * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPaymentMethod($var) + { + GPBUtil::checkString($var, True); + $this->payment_method = $var; + + return $this; + } + + /** + * Optional. The Bank Identification Number - generally the first 6 or 8 + * digits of the card. + * + * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCardBin() + { + return $this->card_bin; + } + + /** + * Optional. The Bank Identification Number - generally the first 6 or 8 + * digits of the card. + * + * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCardBin($var) + { + GPBUtil::checkString($var, True); + $this->card_bin = $var; + + return $this; + } + + /** + * Optional. The last four digits of the card. + * + * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCardLastFour() + { + return $this->card_last_four; + } + + /** + * Optional. The last four digits of the card. + * + * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCardLastFour($var) + { + GPBUtil::checkString($var, True); + $this->card_last_four = $var; + + return $this; + } + + /** + * Optional. The currency code in ISO-4217 format. + * + * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Optional. The currency code in ISO-4217 format. + * + * 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. The decimal value of the transaction in the specified currency. + * + * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The decimal value of the transaction in the specified currency. + * + * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * Optional. The value of shipping in the specified currency. 0 for free or no + * shipping. + * + * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getShippingValue() + { + return $this->shipping_value; + } + + /** + * Optional. The value of shipping in the specified currency. 0 for free or no + * shipping. + * + * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setShippingValue($var) + { + GPBUtil::checkDouble($var); + $this->shipping_value = $var; + + return $this; + } + + /** + * Optional. Destination address if this transaction involves shipping a + * physical item. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address|null + */ + public function getShippingAddress() + { + return $this->shipping_address; + } + + public function hasShippingAddress() + { + return isset($this->shipping_address); + } + + public function clearShippingAddress() + { + unset($this->shipping_address); + } + + /** + * Optional. Destination address if this transaction involves shipping a + * physical item. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $var + * @return $this + */ + public function setShippingAddress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address::class); + $this->shipping_address = $var; + + return $this; + } + + /** + * Optional. Address associated with the payment method when applicable. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address|null + */ + public function getBillingAddress() + { + return $this->billing_address; + } + + public function hasBillingAddress() + { + return isset($this->billing_address); + } + + public function clearBillingAddress() + { + unset($this->billing_address); + } + + /** + * Optional. Address associated with the payment method when applicable. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $var + * @return $this + */ + public function setBillingAddress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address::class); + $this->billing_address = $var; + + return $this; + } + + /** + * Optional. Information about the user paying/initiating the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Optional. Information about the user paying/initiating the transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User::class); + $this->user = $var; + + return $this; + } + + /** + * Optional. Information about the user or users fulfilling the transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMerchants() + { + return $this->merchants; + } + + /** + * Optional. Information about the user or users fulfilling the transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMerchants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User::class); + $this->merchants = $arr; + + return $this; + } + + /** + * Optional. Items purchased in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Optional. Items purchased in this transaction. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item::class); + $this->items = $arr; + + return $this; + } + + /** + * Optional. Information about the payment gateway's response to the + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo|null + */ + public function getGatewayInfo() + { + return $this->gateway_info; + } + + public function hasGatewayInfo() + { + return isset($this->gateway_info); + } + + public function clearGatewayInfo() + { + unset($this->gateway_info); + } + + /** + * Optional. Information about the payment gateway's response to the + * transaction. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo $var + * @return $this + */ + public function setGatewayInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo::class); + $this->gateway_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php new file mode 100644 index 00000000000..53c471921b0 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php @@ -0,0 +1,256 @@ +google.cloud.recaptchaenterprise.v1.TransactionData.Address + */ +class Address extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The recipient name, potentially including information such as + * "care of". + * + * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recipient = ''; + /** + * Optional. The first lines of the address. The first line generally + * contains the street name and number, and further lines may include + * information such as an apartment number. + * + * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $address; + /** + * Optional. The town/city of the address. + * + * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $locality = ''; + /** + * Optional. The state, province, or otherwise administrative area of the + * address. + * + * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $administrative_area = ''; + /** + * Optional. The CLDR country/region of the address. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $region_code = ''; + /** + * Optional. The postal or ZIP code of the address. + * + * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $postal_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $recipient + * Optional. The recipient name, potentially including information such as + * "care of". + * @type array|\Google\Protobuf\Internal\RepeatedField $address + * Optional. The first lines of the address. The first line generally + * contains the street name and number, and further lines may include + * information such as an apartment number. + * @type string $locality + * Optional. The town/city of the address. + * @type string $administrative_area + * Optional. The state, province, or otherwise administrative area of the + * address. + * @type string $region_code + * Optional. The CLDR country/region of the address. + * @type string $postal_code + * Optional. The postal or ZIP code of the address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The recipient name, potentially including information such as + * "care of". + * + * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRecipient() + { + return $this->recipient; + } + + /** + * Optional. The recipient name, potentially including information such as + * "care of". + * + * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRecipient($var) + { + GPBUtil::checkString($var, True); + $this->recipient = $var; + + return $this; + } + + /** + * Optional. The first lines of the address. The first line generally + * contains the street name and number, and further lines may include + * information such as an apartment number. + * + * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAddress() + { + return $this->address; + } + + /** + * Optional. The first lines of the address. The first line generally + * contains the street name and number, and further lines may include + * information such as an apartment number. + * + * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAddress($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->address = $arr; + + return $this; + } + + /** + * Optional. The town/city of the address. + * + * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocality() + { + return $this->locality; + } + + /** + * Optional. The town/city of the address. + * + * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocality($var) + { + GPBUtil::checkString($var, True); + $this->locality = $var; + + return $this; + } + + /** + * Optional. The state, province, or otherwise administrative area of the + * address. + * + * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdministrativeArea() + { + return $this->administrative_area; + } + + /** + * Optional. The state, province, or otherwise administrative area of the + * address. + * + * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdministrativeArea($var) + { + GPBUtil::checkString($var, True); + $this->administrative_area = $var; + + return $this; + } + + /** + * Optional. The CLDR country/region of the address. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Optional. The CLDR country/region of the address. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Optional. The postal or ZIP code of the address. + * + * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPostalCode() + { + return $this->postal_code; + } + + /** + * Optional. The postal or ZIP code of the address. + * + * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->postal_code = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Address::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_Address::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php new file mode 100644 index 00000000000..c80b7df3a8b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php @@ -0,0 +1,184 @@ +google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + */ +class GatewayInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the gateway service (for example, stripe, square, + * paypal). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. Gateway response code describing the state of the transaction. + * + * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $gateway_response_code = ''; + /** + * Optional. AVS response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $avs_response_code = ''; + /** + * Optional. CVV response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cvv_response_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the gateway service (for example, stripe, square, + * paypal). + * @type string $gateway_response_code + * Optional. Gateway response code describing the state of the transaction. + * @type string $avs_response_code + * Optional. AVS response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * @type string $cvv_response_code + * Optional. CVV response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the gateway service (for example, stripe, square, + * paypal). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the gateway service (for example, stripe, square, + * paypal). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Gateway response code describing the state of the transaction. + * + * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGatewayResponseCode() + { + return $this->gateway_response_code; + } + + /** + * Optional. Gateway response code describing the state of the transaction. + * + * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGatewayResponseCode($var) + { + GPBUtil::checkString($var, True); + $this->gateway_response_code = $var; + + return $this; + } + + /** + * Optional. AVS response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAvsResponseCode() + { + return $this->avs_response_code; + } + + /** + * Optional. AVS response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAvsResponseCode($var) + { + GPBUtil::checkString($var, True); + $this->avs_response_code = $var; + + return $this; + } + + /** + * Optional. CVV response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCvvResponseCode() + { + return $this->cvv_response_code; + } + + /** + * Optional. CVV response code from the gateway + * (available only when reCAPTCHA Enterprise is called after authorization). + * + * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCvvResponseCode($var) + { + GPBUtil::checkString($var, True); + $this->cvv_response_code = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GatewayInfo::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_GatewayInfo::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php new file mode 100644 index 00000000000..e9cf18afba8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php @@ -0,0 +1,180 @@ +google.cloud.recaptchaenterprise.v1.TransactionData.Item + */ +class Item extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The full name of the item. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The value per item that the user is paying, in the transaction + * currency, after discounts. + * + * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = 0.0; + /** + * Optional. The quantity of this item that is being purchased. + * + * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $quantity = 0; + /** + * Optional. When a merchant is specified, its corresponding account_id. + * Necessary to populate marketplace-style transactions. + * + * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $merchant_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The full name of the item. + * @type float $value + * Optional. The value per item that the user is paying, in the transaction + * currency, after discounts. + * @type int|string $quantity + * Optional. The quantity of this item that is being purchased. + * @type string $merchant_account_id + * Optional. When a merchant is specified, its corresponding account_id. + * Necessary to populate marketplace-style transactions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The full name of the item. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The full name of the item. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The value per item that the user is paying, in the transaction + * currency, after discounts. + * + * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The value per item that the user is paying, in the transaction + * currency, after discounts. + * + * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * Optional. The quantity of this item that is being purchased. + * + * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Optional. The quantity of this item that is being purchased. + * + * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkInt64($var); + $this->quantity = $var; + + return $this; + } + + /** + * Optional. When a merchant is specified, its corresponding account_id. + * Necessary to populate marketplace-style transactions. + * + * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMerchantAccountId() + { + return $this->merchant_account_id; + } + + /** + * Optional. When a merchant is specified, its corresponding account_id. + * Necessary to populate marketplace-style transactions. + * + * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMerchantAccountId($var) + { + GPBUtil::checkString($var, True); + $this->merchant_account_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Item::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_Item::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php new file mode 100644 index 00000000000..f5aeaedf65c --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php @@ -0,0 +1,256 @@ +google.cloud.recaptchaenterprise.v1.TransactionData.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Unique account identifier for this user. If using account + * defender, this should match the hashed_account_id field. Otherwise, a + * unique and persistent identifier for this account. + * + * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $account_id = ''; + /** + * Optional. The epoch milliseconds of the user's account creation. + * + * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $creation_ms = 0; + /** + * Optional. The email address of the user. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + /** + * Optional. Whether the email has been verified to be accessible by the + * user (OTP or similar). + * + * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email_verified = false; + /** + * Optional. The phone number of the user, with country code. + * + * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone_number = ''; + /** + * Optional. Whether the phone number has been verified to be accessible by + * the user (OTP or similar). + * + * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone_verified = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $account_id + * Optional. Unique account identifier for this user. If using account + * defender, this should match the hashed_account_id field. Otherwise, a + * unique and persistent identifier for this account. + * @type int|string $creation_ms + * Optional. The epoch milliseconds of the user's account creation. + * @type string $email + * Optional. The email address of the user. + * @type bool $email_verified + * Optional. Whether the email has been verified to be accessible by the + * user (OTP or similar). + * @type string $phone_number + * Optional. The phone number of the user, with country code. + * @type bool $phone_verified + * Optional. Whether the phone number has been verified to be accessible by + * the user (OTP or similar). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Unique account identifier for this user. If using account + * defender, this should match the hashed_account_id field. Otherwise, a + * unique and persistent identifier for this account. + * + * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * Optional. Unique account identifier for this user. If using account + * defender, this should match the hashed_account_id field. Otherwise, a + * unique and persistent identifier for this account. + * + * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkString($var, True); + $this->account_id = $var; + + return $this; + } + + /** + * Optional. The epoch milliseconds of the user's account creation. + * + * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getCreationMs() + { + return $this->creation_ms; + } + + /** + * Optional. The epoch milliseconds of the user's account creation. + * + * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setCreationMs($var) + { + GPBUtil::checkInt64($var); + $this->creation_ms = $var; + + return $this; + } + + /** + * Optional. The email address of the user. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. The email address of the user. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. Whether the email has been verified to be accessible by the + * user (OTP or similar). + * + * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEmailVerified() + { + return $this->email_verified; + } + + /** + * Optional. Whether the email has been verified to be accessible by the + * user (OTP or similar). + * + * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEmailVerified($var) + { + GPBUtil::checkBool($var); + $this->email_verified = $var; + + return $this; + } + + /** + * Optional. The phone number of the user, with country code. + * + * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + /** + * Optional. The phone number of the user, with country code. + * + * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->phone_number = $var; + + return $this; + } + + /** + * Optional. Whether the phone number has been verified to be accessible by + * the user (OTP or similar). + * + * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPhoneVerified() + { + return $this->phone_verified; + } + + /** + * Optional. Whether the phone number has been verified to be accessible by + * the user (OTP or similar). + * + * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPhoneVerified($var) + { + GPBUtil::checkBool($var); + $this->phone_verified = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(User::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_User::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php new file mode 100644 index 00000000000..982397f1d7b --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php @@ -0,0 +1,199 @@ +google.cloud.recaptchaenterprise.v1.TransactionEvent + */ +class TransactionEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The type of this transaction event. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_type = 0; + /** + * Optional. The reason or standardized code that corresponds with this + * transaction event, if one exists. For example, a CHARGEBACK event with code + * 6005. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + /** + * Optional. The value that corresponds with this transaction event, if one + * exists. For example, a refund event where $5.00 was refunded. Currency is + * obtained from the original transaction data. + * + * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = 0.0; + /** + * Optional. Timestamp when this transaction event occurred; otherwise assumed + * to be the time of the API call. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $event_type + * Optional. The type of this transaction event. + * @type string $reason + * Optional. The reason or standardized code that corresponds with this + * transaction event, if one exists. For example, a CHARGEBACK event with code + * 6005. + * @type float $value + * Optional. The value that corresponds with this transaction event, if one + * exists. For example, a refund event where $5.00 was refunded. Currency is + * obtained from the original transaction data. + * @type \Google\Protobuf\Timestamp $event_time + * Optional. Timestamp when this transaction event occurred; otherwise assumed + * to be the time of the API call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The type of this transaction event. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEventType() + { + return $this->event_type; + } + + /** + * Optional. The type of this transaction event. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEventType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent\TransactionEventType::class); + $this->event_type = $var; + + return $this; + } + + /** + * Optional. The reason or standardized code that corresponds with this + * transaction event, if one exists. For example, a CHARGEBACK event with code + * 6005. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. The reason or standardized code that corresponds with this + * transaction event, if one exists. For example, a CHARGEBACK event with code + * 6005. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Optional. The value that corresponds with this transaction event, if one + * exists. For example, a refund event where $5.00 was refunded. Currency is + * obtained from the original transaction data. + * + * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The value that corresponds with this transaction event, if one + * exists. For example, a refund event where $5.00 was refunded. Currency is + * obtained from the original transaction data. + * + * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * Optional. Timestamp when this transaction event occurred; otherwise assumed + * to be the time of the API call. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.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. Timestamp when this transaction event occurred; otherwise assumed + * to be the time of the API call. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.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; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php new file mode 100644 index 00000000000..04f38508e88 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php @@ -0,0 +1,214 @@ +google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType + */ +class TransactionEventType +{ + /** + * Default, unspecified event type. + * + * Generated from protobuf enum TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; + */ + const TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; + /** + * Indicates that the transaction is approved by the merchant. The + * accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', + * 'CYBERSOURCE', or 'MANUAL_REVIEW'. + * + * Generated from protobuf enum MERCHANT_APPROVE = 1; + */ + const MERCHANT_APPROVE = 1; + /** + * Indicates that the transaction is denied and concluded due to risks + * detected by the merchant. The accompanying reasons can include terms such + * as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. + * + * Generated from protobuf enum MERCHANT_DENY = 2; + */ + const MERCHANT_DENY = 2; + /** + * Indicates that the transaction is being evaluated by a human, due to + * suspicion or risk. + * + * Generated from protobuf enum MANUAL_REVIEW = 3; + */ + const MANUAL_REVIEW = 3; + /** + * Indicates that the authorization attempt with the card issuer succeeded. + * + * Generated from protobuf enum AUTHORIZATION = 4; + */ + const AUTHORIZATION = 4; + /** + * Indicates that the authorization attempt with the card issuer failed. + * The accompanying reasons can include Visa's '54' indicating that the card + * is expired, or '82' indicating that the CVV is incorrect. + * + * Generated from protobuf enum AUTHORIZATION_DECLINE = 5; + */ + const AUTHORIZATION_DECLINE = 5; + /** + * Indicates that the transaction is completed because the funds were + * settled. + * + * Generated from protobuf enum PAYMENT_CAPTURE = 6; + */ + const PAYMENT_CAPTURE = 6; + /** + * Indicates that the transaction could not be completed because the funds + * were not settled. + * + * Generated from protobuf enum PAYMENT_CAPTURE_DECLINE = 7; + */ + const PAYMENT_CAPTURE_DECLINE = 7; + /** + * Indicates that the transaction has been canceled. Specify the reason + * for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. + * + * Generated from protobuf enum CANCEL = 8; + */ + const CANCEL = 8; + /** + * Indicates that the merchant has received a chargeback inquiry due to + * fraud for the transaction, requesting additional information before a + * fraud chargeback is officially issued and a formal chargeback + * notification is sent. + * + * Generated from protobuf enum CHARGEBACK_INQUIRY = 9; + */ + const CHARGEBACK_INQUIRY = 9; + /** + * Indicates that the merchant has received a chargeback alert due to fraud + * for the transaction. The process of resolving the dispute without + * involving the payment network is started. + * + * Generated from protobuf enum CHARGEBACK_ALERT = 10; + */ + const CHARGEBACK_ALERT = 10; + /** + * Indicates that a fraud notification is issued for the transaction, sent + * by the payment instrument's issuing bank because the transaction appears + * to be fraudulent. We recommend including TC40 or SAFE data in the + * `reason` field for this event type. For partial chargebacks, we recommend + * that you include an amount in the `value` field. + * + * Generated from protobuf enum FRAUD_NOTIFICATION = 11; + */ + const FRAUD_NOTIFICATION = 11; + /** + * Indicates that the merchant is informed by the payment network that the + * transaction has entered the chargeback process due to fraud. Reason code + * examples include Discover's '6005' and '6041'. For partial chargebacks, + * we recommend that you include an amount in the `value` field. + * + * Generated from protobuf enum CHARGEBACK = 12; + */ + const CHARGEBACK = 12; + /** + * Indicates that the transaction has entered the chargeback process due to + * fraud, and that the merchant has chosen to enter representment. Reason + * examples include Discover's '6005' and '6041'. For partial chargebacks, + * we recommend that you include an amount in the `value` field. + * + * Generated from protobuf enum CHARGEBACK_REPRESENTMENT = 13; + */ + const CHARGEBACK_REPRESENTMENT = 13; + /** + * Indicates that the transaction has had a fraud chargeback which was + * illegitimate and was reversed as a result. For partial chargebacks, we + * recommend that you include an amount in the `value` field. + * + * Generated from protobuf enum CHARGEBACK_REVERSE = 14; + */ + const CHARGEBACK_REVERSE = 14; + /** + * Indicates that the merchant has received a refund for a completed + * transaction. For partial refunds, we recommend that you include an amount + * in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of + * exempt tax) + * + * Generated from protobuf enum REFUND_REQUEST = 15; + */ + const REFUND_REQUEST = 15; + /** + * Indicates that the merchant has received a refund request for this + * transaction, but that they have declined it. For partial refunds, we + * recommend that you include an amount in the `value` field. Reason + * example: 'TAX_EXEMPT' (partial refund of exempt tax) + * + * Generated from protobuf enum REFUND_DECLINE = 16; + */ + const REFUND_DECLINE = 16; + /** + * Indicates that the completed transaction was refunded by the merchant. + * For partial refunds, we recommend that you include an amount in the + * `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt + * tax) + * + * Generated from protobuf enum REFUND = 17; + */ + const REFUND = 17; + /** + * Indicates that the completed transaction was refunded by the merchant, + * and that this refund was reversed. For partial refunds, we recommend that + * you include an amount in the `value` field. + * + * Generated from protobuf enum REFUND_REVERSE = 18; + */ + const REFUND_REVERSE = 18; + + private static $valueToName = [ + self::TRANSACTION_EVENT_TYPE_UNSPECIFIED => 'TRANSACTION_EVENT_TYPE_UNSPECIFIED', + self::MERCHANT_APPROVE => 'MERCHANT_APPROVE', + self::MERCHANT_DENY => 'MERCHANT_DENY', + self::MANUAL_REVIEW => 'MANUAL_REVIEW', + self::AUTHORIZATION => 'AUTHORIZATION', + self::AUTHORIZATION_DECLINE => 'AUTHORIZATION_DECLINE', + self::PAYMENT_CAPTURE => 'PAYMENT_CAPTURE', + self::PAYMENT_CAPTURE_DECLINE => 'PAYMENT_CAPTURE_DECLINE', + self::CANCEL => 'CANCEL', + self::CHARGEBACK_INQUIRY => 'CHARGEBACK_INQUIRY', + self::CHARGEBACK_ALERT => 'CHARGEBACK_ALERT', + self::FRAUD_NOTIFICATION => 'FRAUD_NOTIFICATION', + self::CHARGEBACK => 'CHARGEBACK', + self::CHARGEBACK_REPRESENTMENT => 'CHARGEBACK_REPRESENTMENT', + self::CHARGEBACK_REVERSE => 'CHARGEBACK_REVERSE', + self::REFUND_REQUEST => 'REFUND_REQUEST', + self::REFUND_DECLINE => 'REFUND_DECLINE', + self::REFUND => 'REFUND', + self::REFUND_REVERSE => 'REFUND_REVERSE', + ]; + + 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(TransactionEventType::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent_TransactionEventType::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php new file mode 100644 index 00000000000..30296a309d6 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php @@ -0,0 +1,141 @@ +google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest + */ +class UpdateFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The policy to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = null; + /** + * Optional. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy Required. The policy to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\UpdateFirewallPolicyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy + * Required. The policy to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The policy to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + public function hasFirewallPolicy() + { + return isset($this->firewall_policy); + } + + public function clearFirewallPolicy() + { + unset($this->firewall_policy); + } + + /** + * Required. The policy to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); + $this->firewall_policy = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php new file mode 100644 index 00000000000..00a05f2d2d8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php @@ -0,0 +1,141 @@ +google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + */ +class UpdateKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The key to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = null; + /** + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $key Required. The key to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * + * @return \Google\Cloud\RecaptchaEnterprise\V1\UpdateKeyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\RecaptchaEnterprise\V1\Key $key, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setKey($key) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecaptchaEnterprise\V1\Key $key + * Required. The key to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The key to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecaptchaEnterprise\V1\Key|null + */ + public function getKey() + { + return $this->key; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Required. The key to update. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); + $this->key = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php new file mode 100644 index 00000000000..172fe5a75cc --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php @@ -0,0 +1,147 @@ +google.cloud.recaptchaenterprise.v1.UserId + */ +class UserId extends \Google\Protobuf\Internal\Message +{ + protected $id_oneof; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Optional. An email address. + * @type string $phone_number + * Optional. A phone number. Should use the E.164 format. + * @type string $username + * Optional. A unique username, if different from all the other identifiers + * and `account_id` that are provided. Can be a unique login handle or + * display name for a user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An email address. + * + * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->readOneof(1); + } + + public function hasEmail() + { + return $this->hasOneof(1); + } + + /** + * Optional. An email address. + * + * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. A phone number. Should use the E.164 format. + * + * Generated from protobuf field string phone_number = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPhoneNumber() + { + return $this->readOneof(2); + } + + public function hasPhoneNumber() + { + return $this->hasOneof(2); + } + + /** + * Optional. A phone number. Should use the E.164 format. + * + * Generated from protobuf field string phone_number = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. A unique username, if different from all the other identifiers + * and `account_id` that are provided. Can be a unique login handle or + * display name for a user. + * + * Generated from protobuf field string username = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUsername() + { + return $this->readOneof(3); + } + + public function hasUsername() + { + return $this->hasOneof(3); + } + + /** + * Optional. A unique username, if different from all the other identifiers + * and `account_id` that are provided. Can be a unique login handle or + * display name for a user. + * + * Generated from protobuf field string username = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getIdOneof() + { + return $this->whichOneof("id_oneof"); + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php new file mode 100644 index 00000000000..45d5c2715ce --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php @@ -0,0 +1,169 @@ +google.cloud.recaptchaenterprise.v1.UserInfo + */ +class UserInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Creation time for this account associated with this user. Leave + * blank for non logged-in actions, guest checkout, or when there is no + * account associated with the current user. + * + * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_account_time = null; + /** + * Optional. For logged-in requests or login/registration requests, the unique + * account identifier associated with this user. You can use the username if + * it is stable (meaning it is the same for every request associated with the + * same user), or any stable user ID of your choice. Leave blank for non + * logged-in actions or guest checkout. + * + * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $account_id = ''; + /** + * Optional. Identifiers associated with this user or request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $user_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_account_time + * Optional. Creation time for this account associated with this user. Leave + * blank for non logged-in actions, guest checkout, or when there is no + * account associated with the current user. + * @type string $account_id + * Optional. For logged-in requests or login/registration requests, the unique + * account identifier associated with this user. You can use the username if + * it is stable (meaning it is the same for every request associated with the + * same user), or any stable user ID of your choice. Leave blank for non + * logged-in actions or guest checkout. + * @type array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $user_ids + * Optional. Identifiers associated with this user or request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Creation time for this account associated with this user. Leave + * blank for non logged-in actions, guest checkout, or when there is no + * account associated with the current user. + * + * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateAccountTime() + { + return $this->create_account_time; + } + + public function hasCreateAccountTime() + { + return isset($this->create_account_time); + } + + public function clearCreateAccountTime() + { + unset($this->create_account_time); + } + + /** + * Optional. Creation time for this account associated with this user. Leave + * blank for non logged-in actions, guest checkout, or when there is no + * account associated with the current user. + * + * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateAccountTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_account_time = $var; + + return $this; + } + + /** + * Optional. For logged-in requests or login/registration requests, the unique + * account identifier associated with this user. You can use the username if + * it is stable (meaning it is the same for every request associated with the + * same user), or any stable user ID of your choice. Leave blank for non + * logged-in actions or guest checkout. + * + * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * Optional. For logged-in requests or login/registration requests, the unique + * account identifier associated with this user. You can use the username if + * it is stable (meaning it is the same for every request associated with the + * same user), or any stable user ID of your choice. Leave blank for non + * logged-in actions or guest checkout. + * + * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkString($var, True); + $this->account_id = $var; + + return $this; + } + + /** + * Optional. Identifiers associated with this user or request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserIds() + { + return $this->user_ids; + } + + /** + * Optional. Identifiers associated with this user or request. + * + * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\UserId::class); + $this->user_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php new file mode 100644 index 00000000000..7eb59cf1472 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php @@ -0,0 +1,102 @@ +google.cloud.recaptchaenterprise.v1.WafSettings + */ +class WafSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The WAF service that uses this key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $waf_service = 0; + /** + * Required. The WAF feature for which this key is enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $waf_feature = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $waf_service + * Required. The WAF service that uses this key. + * @type int $waf_feature + * Required. The WAF feature for which this key is enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Required. The WAF service that uses this key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getWafService() + { + return $this->waf_service; + } + + /** + * Required. The WAF service that uses this key. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setWafService($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings\WafService::class); + $this->waf_service = $var; + + return $this; + } + + /** + * Required. The WAF feature for which this key is enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getWafFeature() + { + return $this->waf_feature; + } + + /** + * Required. The WAF feature for which this key is enabled. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setWafFeature($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings\WafFeature::class); + $this->waf_feature = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php new file mode 100644 index 00000000000..33d01002105 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php @@ -0,0 +1,81 @@ +google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature + */ +class WafFeature +{ + /** + * Undefined feature. + * + * Generated from protobuf enum WAF_FEATURE_UNSPECIFIED = 0; + */ + const WAF_FEATURE_UNSPECIFIED = 0; + /** + * Redirects suspicious traffic to reCAPTCHA. + * + * Generated from protobuf enum CHALLENGE_PAGE = 1; + */ + const CHALLENGE_PAGE = 1; + /** + * Use reCAPTCHA session-tokens to protect the whole user session on the + * site's domain. + * + * Generated from protobuf enum SESSION_TOKEN = 2; + */ + const SESSION_TOKEN = 2; + /** + * Use reCAPTCHA action-tokens to protect user actions. + * + * Generated from protobuf enum ACTION_TOKEN = 3; + */ + const ACTION_TOKEN = 3; + /** + * Use reCAPTCHA WAF express protection to protect any content other than + * web pages, like APIs and IoT devices. + * + * Generated from protobuf enum EXPRESS = 5; + */ + const EXPRESS = 5; + + private static $valueToName = [ + self::WAF_FEATURE_UNSPECIFIED => 'WAF_FEATURE_UNSPECIFIED', + self::CHALLENGE_PAGE => 'CHALLENGE_PAGE', + self::SESSION_TOKEN => 'SESSION_TOKEN', + self::ACTION_TOKEN => 'ACTION_TOKEN', + self::EXPRESS => 'EXPRESS', + ]; + + 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(WafFeature::class, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings_WafFeature::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php new file mode 100644 index 00000000000..e56c885cea5 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php @@ -0,0 +1,78 @@ +google.cloud.recaptchaenterprise.v1.WafSettings.WafService + */ +class WafService +{ + /** + * Undefined WAF + * + * Generated from protobuf enum WAF_SERVICE_UNSPECIFIED = 0; + */ + const WAF_SERVICE_UNSPECIFIED = 0; + /** + * Cloud Armor + * + * Generated from protobuf enum CA = 1; + */ + const CA = 1; + /** + * Fastly + * + * Generated from protobuf enum FASTLY = 3; + */ + const FASTLY = 3; + /** + * Cloudflare + * + * Generated from protobuf enum CLOUDFLARE = 4; + */ + const CLOUDFLARE = 4; + /** + * Akamai + * + * Generated from protobuf enum AKAMAI = 5; + */ + const AKAMAI = 5; + + private static $valueToName = [ + self::WAF_SERVICE_UNSPECIFIED => 'WAF_SERVICE_UNSPECIFIED', + self::CA => 'CA', + self::FASTLY => 'FASTLY', + self::CLOUDFLARE => 'CLOUDFLARE', + self::AKAMAI => 'AKAMAI', + ]; + + 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(WafService::class, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings_WafService::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php new file mode 100644 index 00000000000..deee451420f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php @@ -0,0 +1,227 @@ +google.cloud.recaptchaenterprise.v1.WebKeySettings + */ +class WebKeySettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If set to true, it means allowed_domains are not enforced. + * + * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_all_domains = false; + /** + * Optional. Domains or subdomains of websites allowed to use the key. All + * subdomains of an allowed domain are automatically allowed. A valid domain + * requires a host and must not include any path, port, query or fragment. + * Examples: 'example.com' or 'subdomain.example.com' + * + * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_domains; + /** + * Optional. If set to true, the key can be used on AMP (Accelerated Mobile + * Pages) websites. This is supported only for the SCORE integration type. + * + * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_amp_traffic = false; + /** + * Required. Describes how this key is integrated with the website. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $integration_type = 0; + /** + * Optional. Settings for the frequency and difficulty at which this key + * triggers captcha challenges. This should only be specified for + * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $challenge_security_preference = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_all_domains + * Optional. If set to true, it means allowed_domains are not enforced. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_domains + * Optional. Domains or subdomains of websites allowed to use the key. All + * subdomains of an allowed domain are automatically allowed. A valid domain + * requires a host and must not include any path, port, query or fragment. + * Examples: 'example.com' or 'subdomain.example.com' + * @type bool $allow_amp_traffic + * Optional. If set to true, the key can be used on AMP (Accelerated Mobile + * Pages) websites. This is supported only for the SCORE integration type. + * @type int $integration_type + * Required. Describes how this key is integrated with the website. + * @type int $challenge_security_preference + * Optional. Settings for the frequency and difficulty at which this key + * triggers captcha challenges. This should only be specified for + * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If set to true, it means allowed_domains are not enforced. + * + * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowAllDomains() + { + return $this->allow_all_domains; + } + + /** + * Optional. If set to true, it means allowed_domains are not enforced. + * + * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowAllDomains($var) + { + GPBUtil::checkBool($var); + $this->allow_all_domains = $var; + + return $this; + } + + /** + * Optional. Domains or subdomains of websites allowed to use the key. All + * subdomains of an allowed domain are automatically allowed. A valid domain + * requires a host and must not include any path, port, query or fragment. + * Examples: 'example.com' or 'subdomain.example.com' + * + * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedDomains() + { + return $this->allowed_domains; + } + + /** + * Optional. Domains or subdomains of websites allowed to use the key. All + * subdomains of an allowed domain are automatically allowed. A valid domain + * requires a host and must not include any path, port, query or fragment. + * Examples: 'example.com' or 'subdomain.example.com' + * + * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedDomains($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_domains = $arr; + + return $this; + } + + /** + * Optional. If set to true, the key can be used on AMP (Accelerated Mobile + * Pages) websites. This is supported only for the SCORE integration type. + * + * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowAmpTraffic() + { + return $this->allow_amp_traffic; + } + + /** + * Optional. If set to true, the key can be used on AMP (Accelerated Mobile + * Pages) websites. This is supported only for the SCORE integration type. + * + * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowAmpTraffic($var) + { + GPBUtil::checkBool($var); + $this->allow_amp_traffic = $var; + + return $this; + } + + /** + * Required. Describes how this key is integrated with the website. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getIntegrationType() + { + return $this->integration_type; + } + + /** + * Required. Describes how this key is integrated with the website. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setIntegrationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings\IntegrationType::class); + $this->integration_type = $var; + + return $this; + } + + /** + * Optional. Settings for the frequency and difficulty at which this key + * triggers captcha challenges. This should only be specified for + * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getChallengeSecurityPreference() + { + return $this->challenge_security_preference; + } + + /** + * Optional. Settings for the frequency and difficulty at which this key + * triggers captcha challenges. This should only be specified for + * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setChallengeSecurityPreference($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings\ChallengeSecurityPreference::class); + $this->challenge_security_preference = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php new file mode 100644 index 00000000000..d88becd7d59 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php @@ -0,0 +1,72 @@ +google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference + */ +class ChallengeSecurityPreference +{ + /** + * Default type that indicates this enum hasn't been specified. + * + * Generated from protobuf enum CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + */ + const CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + /** + * Key tends to show fewer and easier challenges. + * + * Generated from protobuf enum USABILITY = 1; + */ + const USABILITY = 1; + /** + * Key tends to show balanced (in amount and difficulty) challenges. + * + * Generated from protobuf enum BALANCE = 2; + */ + const BALANCE = 2; + /** + * Key tends to show more and harder challenges. + * + * Generated from protobuf enum SECURITY = 3; + */ + const SECURITY = 3; + + private static $valueToName = [ + self::CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED => 'CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED', + self::USABILITY => 'USABILITY', + self::BALANCE => 'BALANCE', + self::SECURITY => 'SECURITY', + ]; + + 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(ChallengeSecurityPreference::class, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings_ChallengeSecurityPreference::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php new file mode 100644 index 00000000000..c254ac1621f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php @@ -0,0 +1,76 @@ +google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType + */ +class IntegrationType +{ + /** + * Default type that indicates this enum hasn't been specified. This is not + * a valid IntegrationType, one of the other types must be specified + * instead. + * + * Generated from protobuf enum INTEGRATION_TYPE_UNSPECIFIED = 0; + */ + const INTEGRATION_TYPE_UNSPECIFIED = 0; + /** + * Only used to produce scores. It doesn't display the "I'm not a robot" + * checkbox and never shows captcha challenges. + * + * Generated from protobuf enum SCORE = 1; + */ + const SCORE = 1; + /** + * Displays the "I'm not a robot" checkbox and may show captcha challenges + * after it is checked. + * + * Generated from protobuf enum CHECKBOX = 2; + */ + const CHECKBOX = 2; + /** + * Doesn't display the "I'm not a robot" checkbox, but may show captcha + * challenges after risk analysis. + * + * Generated from protobuf enum INVISIBLE = 3; + */ + const INVISIBLE = 3; + + private static $valueToName = [ + self::INTEGRATION_TYPE_UNSPECIFIED => 'INTEGRATION_TYPE_UNSPECIFIED', + self::SCORE => 'SCORE', + self::CHECKBOX => 'CHECKBOX', + self::INVISIBLE => 'INVISIBLE', + ]; + + 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(IntegrationType::class, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings_IntegrationType::class); + diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php new file mode 100644 index 00000000000..281f7b67c41 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php @@ -0,0 +1,94 @@ +setIp($ipOverrideDataIp) + ->setOverrideType($ipOverrideDataOverrideType); + $request = (new AddIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + + // Call the API and handle any network failures. + try { + /** @var AddIpOverrideResponse $response */ + $response = $recaptchaEnterpriseServiceClient->addIpOverride($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + $ipOverrideDataIp = '[IP]'; + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + + add_ip_override_sample($formattedName, $ipOverrideDataIp, $ipOverrideDataOverrideType); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php new file mode 100644 index 00000000000..795285fdc61 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php @@ -0,0 +1,79 @@ +setName($formattedName) + ->setAnnotation($annotation); + + // Call the API and handle any network failures. + try { + /** @var AnnotateAssessmentResponse $response */ + $response = $recaptchaEnterpriseServiceClient->annotateAssessment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::assessmentName('[PROJECT]', '[ASSESSMENT]'); + $annotation = Annotation::ANNOTATION_UNSPECIFIED; + + annotate_assessment_sample($formattedName, $annotation); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php new file mode 100644 index 00000000000..6f423277873 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setAssessment($assessment); + + // Call the API and handle any network failures. + try { + /** @var Assessment $response */ + $response = $recaptchaEnterpriseServiceClient->createAssessment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + create_assessment_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php new file mode 100644 index 00000000000..69aaafca3e9 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php @@ -0,0 +1,76 @@ +setParent($formattedParent) + ->setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $recaptchaEnterpriseServiceClient->createFirewallPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + create_firewall_policy_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php new file mode 100644 index 00000000000..21f9ac2c03f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php @@ -0,0 +1,77 @@ +setDisplayName($keyDisplayName); + $request = (new CreateKeyRequest()) + ->setParent($formattedParent) + ->setKey($key); + + // Call the API and handle any network failures. + try { + /** @var Key $response */ + $response = $recaptchaEnterpriseServiceClient->createKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + $keyDisplayName = '[DISPLAY_NAME]'; + + create_key_sample($formattedParent, $keyDisplayName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php new file mode 100644 index 00000000000..778dff633d9 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $recaptchaEnterpriseServiceClient->deleteFirewallPolicy($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::firewallPolicyName( + '[PROJECT]', + '[FIREWALLPOLICY]' + ); + + delete_firewall_policy_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php new file mode 100644 index 00000000000..1c638b7a752 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $recaptchaEnterpriseServiceClient->deleteKey($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + + delete_key_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php new file mode 100644 index 00000000000..ee3cd695bcc --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $recaptchaEnterpriseServiceClient->getFirewallPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::firewallPolicyName( + '[PROJECT]', + '[FIREWALLPOLICY]' + ); + + get_firewall_policy_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php new file mode 100644 index 00000000000..31763afbd0a --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Key $response */ + $response = $recaptchaEnterpriseServiceClient->getKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + + get_key_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php new file mode 100644 index 00000000000..47fd8ee6e6c --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Metrics $response */ + $response = $recaptchaEnterpriseServiceClient->getMetrics($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::metricsName('[PROJECT]', '[KEY]'); + + get_metrics_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php new file mode 100644 index 00000000000..124b5973bd8 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->listFirewallPolicies($request); + + /** @var FirewallPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + list_firewall_policies_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php new file mode 100644 index 00000000000..ca998523c26 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->listIpOverrides($request); + + /** @var IpOverrideData $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + + list_ip_overrides_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php new file mode 100644 index 00000000000..468c27c507f --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->listKeys($request); + + /** @var Key $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + list_keys_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php new file mode 100644 index 00000000000..0234cee9450 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($request); + + /** @var RelatedAccountGroupMembership $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::relatedAccountGroupName( + '[PROJECT]', + '[RELATEDACCOUNTGROUP]' + ); + + list_related_account_group_memberships_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php new file mode 100644 index 00000000000..1c3d589a0b3 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($request); + + /** @var RelatedAccountGroup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + list_related_account_groups_sample($formattedParent); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php new file mode 100644 index 00000000000..8d057ec1fd0 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Key $response */ + $response = $recaptchaEnterpriseServiceClient->migrateKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + + migrate_key_sample($formattedName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php new file mode 100644 index 00000000000..bcd40ed3b15 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php @@ -0,0 +1,95 @@ +setIp($ipOverrideDataIp) + ->setOverrideType($ipOverrideDataOverrideType); + $request = (new RemoveIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + + // Call the API and handle any network failures. + try { + /** @var RemoveIpOverrideResponse $response */ + $response = $recaptchaEnterpriseServiceClient->removeIpOverride($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + $ipOverrideDataIp = '[IP]'; + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + + remove_ip_override_sample($formattedName, $ipOverrideDataIp, $ipOverrideDataOverrideType); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php new file mode 100644 index 00000000000..2107eda2075 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php @@ -0,0 +1,83 @@ +setParent($formattedParent) + ->setNames($formattedNames); + + // Call the API and handle any network failures. + try { + /** @var ReorderFirewallPoliciesResponse $response */ + $response = $recaptchaEnterpriseServiceClient->reorderFirewallPolicies($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + $formattedNamesElement = RecaptchaEnterpriseServiceClient::firewallPolicyName( + '[PROJECT]', + '[FIREWALLPOLICY]' + ); + + reorder_firewall_policies_sample($formattedParent, $formattedNamesElement); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php new file mode 100644 index 00000000000..c74bb8267ef --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php @@ -0,0 +1,74 @@ +setKey($formattedKey); + + // Call the API and handle any network failures. + try { + /** @var RetrieveLegacySecretKeyResponse $response */ + $response = $recaptchaEnterpriseServiceClient->retrieveLegacySecretKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedKey = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); + + retrieve_legacy_secret_key_sample($formattedKey); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php new file mode 100644 index 00000000000..3b9e0e41ae2 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php @@ -0,0 +1,78 @@ +setProject($formattedProject); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($request); + + /** @var RelatedAccountGroupMembership $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProject = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); + + search_related_account_group_memberships_sample($formattedProject); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php new file mode 100644 index 00000000000..580ddd57fcf --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php @@ -0,0 +1,59 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $recaptchaEnterpriseServiceClient->updateFirewallPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php new file mode 100644 index 00000000000..590dd3e700e --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php @@ -0,0 +1,72 @@ +setDisplayName($keyDisplayName); + $request = (new UpdateKeyRequest()) + ->setKey($key); + + // Call the API and handle any network failures. + try { + /** @var Key $response */ + $response = $recaptchaEnterpriseServiceClient->updateKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $keyDisplayName = '[DISPLAY_NAME]'; + + update_key_sample($keyDisplayName); +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php new file mode 100644 index 00000000000..b72fc96ab13 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php @@ -0,0 +1,959 @@ + addIpOverrideAsync(AddIpOverrideRequest $request, array $optionalArgs = []) + * @method PromiseInterface annotateAssessmentAsync(AnnotateAssessmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createAssessmentAsync(CreateAssessmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createFirewallPolicyAsync(CreateFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface createKeyAsync(CreateKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFirewallPolicyAsync(DeleteFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteKeyAsync(DeleteKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFirewallPolicyAsync(GetFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getKeyAsync(GetKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMetricsAsync(GetMetricsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listFirewallPoliciesAsync(ListFirewallPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listIpOverridesAsync(ListIpOverridesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listKeysAsync(ListKeysRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRelatedAccountGroupMembershipsAsync(ListRelatedAccountGroupMembershipsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRelatedAccountGroupsAsync(ListRelatedAccountGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface migrateKeyAsync(MigrateKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeIpOverrideAsync(RemoveIpOverrideRequest $request, array $optionalArgs = []) + * @method PromiseInterface reorderFirewallPoliciesAsync(ReorderFirewallPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface retrieveLegacySecretKeyAsync(RetrieveLegacySecretKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchRelatedAccountGroupMembershipsAsync(SearchRelatedAccountGroupMembershipsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFirewallPolicyAsync(UpdateFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateKeyAsync(UpdateKeyRequest $request, array $optionalArgs = []) + */ +final class RecaptchaEnterpriseServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recaptchaenterprise.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recaptchaenterprise.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/recaptcha_enterprise_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a assessment + * resource. + * + * @param string $project + * @param string $assessment + * + * @return string The formatted assessment resource. + */ + public static function assessmentName(string $project, string $assessment): string + { + return self::getPathTemplate('assessment')->render([ + 'project' => $project, + 'assessment' => $assessment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * firewall_policy resource. + * + * @param string $project + * @param string $firewallpolicy + * + * @return string The formatted firewall_policy resource. + */ + public static function firewallPolicyName(string $project, string $firewallpolicy): string + { + return self::getPathTemplate('firewallPolicy')->render([ + 'project' => $project, + 'firewallpolicy' => $firewallpolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key + * resource. + * + * @param string $project + * @param string $key + * + * @return string The formatted key resource. + */ + public static function keyName(string $project, string $key): string + { + return self::getPathTemplate('key')->render([ + 'project' => $project, + 'key' => $key, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a metrics + * resource. + * + * @param string $project + * @param string $key + * + * @return string The formatted metrics resource. + */ + public static function metricsName(string $project, string $key): string + { + return self::getPathTemplate('metrics')->render([ + 'project' => $project, + 'key' => $key, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * related_account_group resource. + * + * @param string $project + * @param string $relatedaccountgroup + * + * @return string The formatted related_account_group resource. + */ + public static function relatedAccountGroupName(string $project, string $relatedaccountgroup): string + { + return self::getPathTemplate('relatedAccountGroup')->render([ + 'project' => $project, + 'relatedaccountgroup' => $relatedaccountgroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - assessment: projects/{project}/assessments/{assessment} + * - firewallPolicy: projects/{project}/firewallpolicies/{firewallpolicy} + * - key: projects/{project}/keys/{key} + * - metrics: projects/{project}/keys/{key}/metrics + * - project: projects/{project} + * - relatedAccountGroup: projects/{project}/relatedaccountgroups/{relatedaccountgroup} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recaptchaenterprise.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds an IP override to a key. The following restrictions hold: + * * The maximum number of IP overrides per key is 100. + * * For any conflict (such as IP already exists or IP part of an existing + * IP range), an error is returned. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::addIpOverrideAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php + * + * @param AddIpOverrideRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AddIpOverrideResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addIpOverride(AddIpOverrideRequest $request, array $callOptions = []): AddIpOverrideResponse + { + return $this->startApiCall('AddIpOverride', $request, $callOptions)->wait(); + } + + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fraudulent. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::annotateAssessmentAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php + * + * @param AnnotateAssessmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AnnotateAssessmentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function annotateAssessment(AnnotateAssessmentRequest $request, array $callOptions = []): AnnotateAssessmentResponse + { + return $this->startApiCall('AnnotateAssessment', $request, $callOptions)->wait(); + } + + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::createAssessmentAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php + * + * @param CreateAssessmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Assessment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAssessment(CreateAssessmentRequest $request, array $callOptions = []): Assessment + { + return $this->startApiCall('CreateAssessment', $request, $callOptions)->wait(); + } + + /** + * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA + * Enterprise actions can be executed. + * A project may have a maximum of 1000 policies. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::createFirewallPolicyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php + * + * @param CreateFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function createFirewallPolicy(CreateFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('CreateFirewallPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a new reCAPTCHA Enterprise key. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::createKeyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/create_key.php + * + * @param CreateKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Key + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKey(CreateKeyRequest $request, array $callOptions = []): Key + { + return $this->startApiCall('CreateKey', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified firewall policy. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::deleteFirewallPolicyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php + * + * @param DeleteFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteFirewallPolicy(DeleteFirewallPolicyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteFirewallPolicy', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified key. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::deleteKeyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php + * + * @param DeleteKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteKey(DeleteKeyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteKey', $request, $callOptions)->wait(); + } + + /** + * Returns the specified firewall policy. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::getFirewallPolicyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php + * + * @param GetFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFirewallPolicy(GetFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('GetFirewallPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns the specified key. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::getKeyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/get_key.php + * + * @param GetKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Key + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKey(GetKeyRequest $request, array $callOptions = []): Key + { + return $this->startApiCall('GetKey', $request, $callOptions)->wait(); + } + + /** + * Get some aggregated metrics for a Key. This data can be used to build + * dashboards. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::getMetricsAsync()} + * . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php + * + * @param GetMetricsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Metrics + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMetrics(GetMetricsRequest $request, array $callOptions = []): Metrics + { + return $this->startApiCall('GetMetrics', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all firewall policies that belong to a project. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::listFirewallPoliciesAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php + * + * @param ListFirewallPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listFirewallPolicies(ListFirewallPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListFirewallPolicies', $request, $callOptions); + } + + /** + * Lists all IP overrides for a key. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::listIpOverridesAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php + * + * @param ListIpOverridesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIpOverrides(ListIpOverridesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIpOverrides', $request, $callOptions); + } + + /** + * Returns the list of all keys that belong to a project. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::listKeysAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php + * + * @param ListKeysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKeys(ListKeysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListKeys', $request, $callOptions); + } + + /** + * Get memberships in a group of related accounts. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::listRelatedAccountGroupMembershipsAsync()} + * . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php + * + * @param ListRelatedAccountGroupMembershipsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRelatedAccountGroupMemberships', $request, $callOptions); + } + + /** + * List groups of related accounts. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::listRelatedAccountGroupsAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php + * + * @param ListRelatedAccountGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRelatedAccountGroups(ListRelatedAccountGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRelatedAccountGroups', $request, $callOptions); + } + + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + * Once a key is migrated, it can be used from either product. SiteVerify + * requests are billed as CreateAssessment calls. You must be + * authenticated as one of the current owners of the reCAPTCHA Key, and + * your user must have the reCAPTCHA Enterprise Admin IAM role in the + * destination project. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::migrateKeyAsync()} + * . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php + * + * @param MigrateKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Key + * + * @throws ApiException Thrown if the API call fails. + */ + public function migrateKey(MigrateKeyRequest $request, array $callOptions = []): Key + { + return $this->startApiCall('MigrateKey', $request, $callOptions)->wait(); + } + + /** + * Removes an IP override from a key. The following restrictions hold: + * * If the IP isn't found in an existing IP override, a `NOT_FOUND` error + * is returned. + * * If the IP is found in an existing IP override, but the + * override type does not match, a `NOT_FOUND` error is returned. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::removeIpOverrideAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php + * + * @param RemoveIpOverrideRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RemoveIpOverrideResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeIpOverride(RemoveIpOverrideRequest $request, array $callOptions = []): RemoveIpOverrideResponse + { + return $this->startApiCall('RemoveIpOverride', $request, $callOptions)->wait(); + } + + /** + * Reorders all firewall policies. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::reorderFirewallPoliciesAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php + * + * @param ReorderFirewallPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ReorderFirewallPoliciesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reorderFirewallPolicies(ReorderFirewallPoliciesRequest $request, array $callOptions = []): ReorderFirewallPoliciesResponse + { + return $this->startApiCall('ReorderFirewallPolicies', $request, $callOptions)->wait(); + } + + /** + * Returns the secret key related to the specified public key. + * You must use the legacy secret key only in a 3rd party integration with + * legacy reCAPTCHA. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::retrieveLegacySecretKeyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php + * + * @param RetrieveLegacySecretKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RetrieveLegacySecretKeyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function retrieveLegacySecretKey(RetrieveLegacySecretKeyRequest $request, array $callOptions = []): RetrieveLegacySecretKeyResponse + { + return $this->startApiCall('RetrieveLegacySecretKey', $request, $callOptions)->wait(); + } + + /** + * Search group memberships related to a given account. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::searchRelatedAccountGroupMembershipsAsync()} + * . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php + * + * @param SearchRelatedAccountGroupMembershipsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchRelatedAccountGroupMemberships', $request, $callOptions); + } + + /** + * Updates the specified firewall policy. + * + * The async variant is + * {@see RecaptchaEnterpriseServiceClient::updateFirewallPolicyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php + * + * @param UpdateFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFirewallPolicy(UpdateFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('UpdateFirewallPolicy', $request, $callOptions)->wait(); + } + + /** + * Updates the specified key. + * + * The async variant is {@see RecaptchaEnterpriseServiceClient::updateKeyAsync()} . + * + * @example samples/V1/RecaptchaEnterpriseServiceClient/update_key.php + * + * @param UpdateKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Key + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateKey(UpdateKeyRequest $request, array $callOptions = []): Key + { + return $this->startApiCall('UpdateKey', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php new file mode 100644 index 00000000000..b8e7e5dc016 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php @@ -0,0 +1,1610 @@ +keyName('[PROJECT]', '[KEY]'); + * $ipOverrideData = new IpOverrideData(); + * $response = $recaptchaEnterpriseServiceClient->addIpOverride($formattedName, $ipOverrideData); + * } finally { + * $recaptchaEnterpriseServiceClient->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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\RecaptchaEnterprise\V1\Client\RecaptchaEnterpriseServiceClient}. + */ +class RecaptchaEnterpriseServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'recaptchaenterprise.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recaptchaenterprise.UNIVERSE_DOMAIN'; + + /** 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 $assessmentNameTemplate; + + private static $firewallPolicyNameTemplate; + + private static $keyNameTemplate; + + private static $metricsNameTemplate; + + private static $projectNameTemplate; + + private static $relatedAccountGroupNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/recaptcha_enterprise_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getAssessmentNameTemplate() + { + if (self::$assessmentNameTemplate == null) { + self::$assessmentNameTemplate = new PathTemplate('projects/{project}/assessments/{assessment}'); + } + + return self::$assessmentNameTemplate; + } + + private static function getFirewallPolicyNameTemplate() + { + if (self::$firewallPolicyNameTemplate == null) { + self::$firewallPolicyNameTemplate = new PathTemplate('projects/{project}/firewallpolicies/{firewallpolicy}'); + } + + return self::$firewallPolicyNameTemplate; + } + + private static function getKeyNameTemplate() + { + if (self::$keyNameTemplate == null) { + self::$keyNameTemplate = new PathTemplate('projects/{project}/keys/{key}'); + } + + return self::$keyNameTemplate; + } + + private static function getMetricsNameTemplate() + { + if (self::$metricsNameTemplate == null) { + self::$metricsNameTemplate = new PathTemplate('projects/{project}/keys/{key}/metrics'); + } + + return self::$metricsNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getRelatedAccountGroupNameTemplate() + { + if (self::$relatedAccountGroupNameTemplate == null) { + self::$relatedAccountGroupNameTemplate = new PathTemplate('projects/{project}/relatedaccountgroups/{relatedaccountgroup}'); + } + + return self::$relatedAccountGroupNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'assessment' => self::getAssessmentNameTemplate(), + 'firewallPolicy' => self::getFirewallPolicyNameTemplate(), + 'key' => self::getKeyNameTemplate(), + 'metrics' => self::getMetricsNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'relatedAccountGroup' => self::getRelatedAccountGroupNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a assessment + * resource. + * + * @param string $project + * @param string $assessment + * + * @return string The formatted assessment resource. + */ + public static function assessmentName($project, $assessment) + { + return self::getAssessmentNameTemplate()->render([ + 'project' => $project, + 'assessment' => $assessment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * firewall_policy resource. + * + * @param string $project + * @param string $firewallpolicy + * + * @return string The formatted firewall_policy resource. + */ + public static function firewallPolicyName($project, $firewallpolicy) + { + return self::getFirewallPolicyNameTemplate()->render([ + 'project' => $project, + 'firewallpolicy' => $firewallpolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key + * resource. + * + * @param string $project + * @param string $key + * + * @return string The formatted key resource. + */ + public static function keyName($project, $key) + { + return self::getKeyNameTemplate()->render([ + 'project' => $project, + 'key' => $key, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a metrics + * resource. + * + * @param string $project + * @param string $key + * + * @return string The formatted metrics resource. + */ + public static function metricsName($project, $key) + { + return self::getMetricsNameTemplate()->render([ + 'project' => $project, + 'key' => $key, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * related_account_group resource. + * + * @param string $project + * @param string $relatedaccountgroup + * + * @return string The formatted related_account_group resource. + */ + public static function relatedAccountGroupName($project, $relatedaccountgroup) + { + return self::getRelatedAccountGroupNameTemplate()->render([ + 'project' => $project, + 'relatedaccountgroup' => $relatedaccountgroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - assessment: projects/{project}/assessments/{assessment} + * - firewallPolicy: projects/{project}/firewallpolicies/{firewallpolicy} + * - key: projects/{project}/keys/{key} + * - metrics: projects/{project}/keys/{key}/metrics + * - project: projects/{project} + * - relatedAccountGroup: projects/{project}/relatedaccountgroups/{relatedaccountgroup} + * + * 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. + */ + 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 $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recaptchaenterprise.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 + * $apiEndpoint 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 + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Adds an IP override to a key. The following restrictions hold: + * * The maximum number of IP overrides per key is 100. + * * For any conflict (such as IP already exists or IP part of an existing + * IP range), an error is returned. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $ipOverrideData = new IpOverrideData(); + * $response = $recaptchaEnterpriseServiceClient->addIpOverride($formattedName, $ipOverrideData); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * @param IpOverrideData $ipOverrideData Required. IP override added to the key. + * @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\RecaptchaEnterprise\V1\AddIpOverrideResponse + * + * @throws ApiException if the remote call fails + */ + public function addIpOverride($name, $ipOverrideData, array $optionalArgs = []) + { + $request = new AddIpOverrideRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setIpOverrideData($ipOverrideData); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AddIpOverride', AddIpOverrideResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fraudulent. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); + * $annotation = Annotation::ANNOTATION_UNSPECIFIED; + * $response = $recaptchaEnterpriseServiceClient->annotateAssessment($formattedName, $annotation); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the Assessment, in the format + * `projects/{project}/assessments/{assessment}`. + * @param int $annotation Optional. The annotation that is assigned to the Event. This field can be + * left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. + * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation} + * @param array $optionalArgs { + * Optional. + * + * @type int[] $reasons + * Optional. Reasons for the annotation that are assigned to the event. + * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Reason} + * @type string $accountId + * Optional. A stable account identifier to apply to the assessment. This is + * an alternative to setting `account_id` in `CreateAssessment`, for example + * when a stable account identifier is not yet known in the initial request. + * @type string $hashedAccountId + * Optional. A stable hashed account identifier to apply to the assessment. + * This is an alternative to setting `hashed_account_id` in + * `CreateAssessment`, for example when a stable account identifier is not yet + * known in the initial request. + * @type TransactionEvent $transactionEvent + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + * @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\RecaptchaEnterprise\V1\AnnotateAssessmentResponse + * + * @throws ApiException if the remote call fails + */ + public function annotateAssessment($name, $annotation, array $optionalArgs = []) + { + $request = new AnnotateAssessmentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setAnnotation($annotation); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['reasons'])) { + $request->setReasons($optionalArgs['reasons']); + } + + if (isset($optionalArgs['accountId'])) { + $request->setAccountId($optionalArgs['accountId']); + } + + if (isset($optionalArgs['hashedAccountId'])) { + $request->setHashedAccountId($optionalArgs['hashedAccountId']); + } + + if (isset($optionalArgs['transactionEvent'])) { + $request->setTransactionEvent($optionalArgs['transactionEvent']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AnnotateAssessment', AnnotateAssessmentResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * $assessment = new Assessment(); + * $response = $recaptchaEnterpriseServiceClient->createAssessment($formattedParent, $assessment); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project in which the assessment is created, + * in the format `projects/{project}`. + * @param Assessment $assessment Required. The assessment details. + * @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\RecaptchaEnterprise\V1\Assessment + * + * @throws ApiException if the remote call fails + */ + public function createAssessment($parent, $assessment, array $optionalArgs = []) + { + $request = new CreateAssessmentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setAssessment($assessment); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateAssessment', Assessment::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA + * Enterprise actions can be executed. + * A project may have a maximum of 1000 policies. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * $firewallPolicy = new FirewallPolicy(); + * $response = $recaptchaEnterpriseServiceClient->createFirewallPolicy($formattedParent, $firewallPolicy); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project this policy applies to, in the format + * `projects/{project}`. + * @param FirewallPolicy $firewallPolicy Required. Information to create the policy. + * @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\RecaptchaEnterprise\V1\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function createFirewallPolicy($parent, $firewallPolicy, array $optionalArgs = []) + { + $request = new CreateFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new reCAPTCHA Enterprise key. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * $key = new Key(); + * $response = $recaptchaEnterpriseServiceClient->createKey($formattedParent, $key); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project in which the key is created, in the + * format `projects/{project}`. + * @param Key $key Required. Information to create a reCAPTCHA Enterprise key. + * @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\RecaptchaEnterprise\V1\Key + * + * @throws ApiException if the remote call fails + */ + public function createKey($parent, $key, array $optionalArgs = []) + { + $request = new CreateKeyRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setKey($key); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateKey', Key::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified firewall policy. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + * $recaptchaEnterpriseServiceClient->deleteFirewallPolicy($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the policy to be deleted, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * @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 + */ + public function deleteFirewallPolicy($name, array $optionalArgs = []) + { + $request = new DeleteFirewallPolicyRequest(); + $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('DeleteFirewallPolicy', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified key. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $recaptchaEnterpriseServiceClient->deleteKey($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the key to be deleted, in the format + * `projects/{project}/keys/{key}`. + * @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 + */ + public function deleteKey($name, array $optionalArgs = []) + { + $request = new DeleteKeyRequest(); + $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('DeleteKey', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the specified firewall policy. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + * $response = $recaptchaEnterpriseServiceClient->getFirewallPolicy($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the requested policy, in the format + * `projects/{project}/firewallpolicies/{firewallpolicy}`. + * @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\RecaptchaEnterprise\V1\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function getFirewallPolicy($name, array $optionalArgs = []) + { + $request = new GetFirewallPolicyRequest(); + $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('GetFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the specified key. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $response = $recaptchaEnterpriseServiceClient->getKey($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the requested key, in the format + * `projects/{project}/keys/{key}`. + * @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\RecaptchaEnterprise\V1\Key + * + * @throws ApiException if the remote call fails + */ + public function getKey($name, array $optionalArgs = []) + { + $request = new GetKeyRequest(); + $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('GetKey', Key::class, $optionalArgs, $request)->wait(); + } + + /** + * Get some aggregated metrics for a Key. This data can be used to build + * dashboards. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->metricsName('[PROJECT]', '[KEY]'); + * $response = $recaptchaEnterpriseServiceClient->getMetrics($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the requested metrics, in the format + * `projects/{project}/keys/{key}/metrics`. + * @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\RecaptchaEnterprise\V1\Metrics + * + * @throws ApiException if the remote call fails + */ + public function getMetrics($name, array $optionalArgs = []) + { + $request = new GetMetricsRequest(); + $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('GetMetrics', Metrics::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all firewall policies that belong to a project. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listFirewallPolicies($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listFirewallPolicies($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * @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 + */ + public function listFirewallPolicies($parent, array $optionalArgs = []) + { + $request = new ListFirewallPoliciesRequest(); + $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('ListFirewallPolicies', $optionalArgs, ListFirewallPoliciesResponse::class, $request); + } + + /** + * Lists all IP overrides for a key. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listIpOverrides($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listIpOverrides($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent key for which the IP overrides are listed, in the + * format `projects/{project}/keys/{key}`. + * @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 + */ + public function listIpOverrides($parent, array $optionalArgs = []) + { + $request = new ListIpOverridesRequest(); + $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('ListIpOverrides', $optionalArgs, ListIpOverridesResponse::class, $request); + } + + /** + * Returns the list of all keys that belong to a project. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listKeys($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listKeys($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project that contains the keys that is + * listed, in the format `projects/{project}`. + * @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 + */ + public function listKeys($parent, array $optionalArgs = []) + { + $request = new ListKeysRequest(); + $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('ListKeys', $optionalArgs, ListKeysResponse::class, $request); + } + + /** + * Get memberships in a group of related accounts. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * @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 + */ + public function listRelatedAccountGroupMemberships($parent, array $optionalArgs = []) + { + $request = new ListRelatedAccountGroupMembershipsRequest(); + $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('ListRelatedAccountGroupMemberships', $optionalArgs, ListRelatedAccountGroupMembershipsResponse::class, $request); + } + + /** + * List groups of related accounts. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project to list related account groups from, in + * the format `projects/{project}`. + * @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 + */ + public function listRelatedAccountGroups($parent, array $optionalArgs = []) + { + $request = new ListRelatedAccountGroupsRequest(); + $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('ListRelatedAccountGroups', $optionalArgs, ListRelatedAccountGroupsResponse::class, $request); + } + + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + * Once a key is migrated, it can be used from either product. SiteVerify + * requests are billed as CreateAssessment calls. You must be + * authenticated as one of the current owners of the reCAPTCHA Key, and + * your user must have the reCAPTCHA Enterprise Admin IAM role in the + * destination project. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $response = $recaptchaEnterpriseServiceClient->migrateKey($formattedName); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the key to be migrated, in the format + * `projects/{project}/keys/{key}`. + * @param array $optionalArgs { + * Optional. + * + * @type bool $skipBillingCheck + * Optional. If true, skips the billing check. + * A reCAPTCHA Enterprise key or migrated key behaves differently than a + * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid + * any disruption of your usage, we check that a billing account is present. + * If your usage of reCAPTCHA is under the free quota, you can safely skip the + * billing check and proceed with the migration. See + * https://cloud.google.com/recaptcha/docs/billing-information. + * @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\RecaptchaEnterprise\V1\Key + * + * @throws ApiException if the remote call fails + */ + public function migrateKey($name, array $optionalArgs = []) + { + $request = new MigrateKeyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['skipBillingCheck'])) { + $request->setSkipBillingCheck($optionalArgs['skipBillingCheck']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('MigrateKey', Key::class, $optionalArgs, $request)->wait(); + } + + /** + * Removes an IP override from a key. The following restrictions hold: + * * If the IP isn't found in an existing IP override, a `NOT_FOUND` error + * is returned. + * * If the IP is found in an existing IP override, but the + * override type does not match, a `NOT_FOUND` error is returned. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $ipOverrideData = new IpOverrideData(); + * $response = $recaptchaEnterpriseServiceClient->removeIpOverride($formattedName, $ipOverrideData); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the key from which the IP override is removed, in the + * format `projects/{project}/keys/{key}`. + * @param IpOverrideData $ipOverrideData Required. IP override to be removed from the key. + * @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\RecaptchaEnterprise\V1\RemoveIpOverrideResponse + * + * @throws ApiException if the remote call fails + */ + public function removeIpOverride($name, $ipOverrideData, array $optionalArgs = []) + { + $request = new RemoveIpOverrideRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setIpOverrideData($ipOverrideData); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RemoveIpOverride', RemoveIpOverrideResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Reorders all firewall policies. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * $formattedNames = [ + * $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), + * ]; + * $response = $recaptchaEnterpriseServiceClient->reorderFirewallPolicies($formattedParent, $formattedNames); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project to list the policies for, in the format + * `projects/{project}`. + * @param string[] $names Required. A list containing all policy names, in the new order. Each name + * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + * @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\RecaptchaEnterprise\V1\ReorderFirewallPoliciesResponse + * + * @throws ApiException if the remote call fails + */ + public function reorderFirewallPolicies($parent, $names, array $optionalArgs = []) + { + $request = new ReorderFirewallPoliciesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setNames($names); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ReorderFirewallPolicies', ReorderFirewallPoliciesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the secret key related to the specified public key. + * You must use the legacy secret key only in a 3rd party integration with + * legacy reCAPTCHA. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedKey = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); + * $response = $recaptchaEnterpriseServiceClient->retrieveLegacySecretKey($formattedKey); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $key Required. The public key name linked to the requested secret key in the + * format `projects/{project}/keys/{key}`. + * @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\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyResponse + * + * @throws ApiException if the remote call fails + */ + public function retrieveLegacySecretKey($key, array $optionalArgs = []) + { + $request = new RetrieveLegacySecretKeyRequest(); + $requestParamHeaders = []; + $request->setKey($key); + $requestParamHeaders['key'] = $key; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RetrieveLegacySecretKey', RetrieveLegacySecretKeyResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Search group memberships related to a given account. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $formattedProject = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($formattedProject); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($formattedProject); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param string $project Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * `projects/{project}`. + * @param array $optionalArgs { + * Optional. + * + * @type string $accountId + * Optional. The unique stable account identifier used to search connections. + * The identifier should correspond to an `account_id` provided in a previous + * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + * or account_id must be set, but not both. + * @type string $hashedAccountId + * Optional. Deprecated: use `account_id` instead. + * The unique stable hashed account identifier used to search connections. The + * identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. Either + * hashed_account_id or account_id must be set, but not both. + * @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 + */ + public function searchRelatedAccountGroupMemberships($project, array $optionalArgs = []) + { + $request = new SearchRelatedAccountGroupMembershipsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['accountId'])) { + $request->setAccountId($optionalArgs['accountId']); + } + + if (isset($optionalArgs['hashedAccountId'])) { + $request->setHashedAccountId($optionalArgs['hashedAccountId']); + } + + 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('SearchRelatedAccountGroupMemberships', $optionalArgs, SearchRelatedAccountGroupMembershipsResponse::class, $request); + } + + /** + * Updates the specified firewall policy. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $firewallPolicy = new FirewallPolicy(); + * $response = $recaptchaEnterpriseServiceClient->updateFirewallPolicy($firewallPolicy); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param FirewallPolicy $firewallPolicy Required. The policy to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The mask to control which fields of the policy get updated. If + * the mask is not present, all fields are updated. + * @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\RecaptchaEnterprise\V1\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function updateFirewallPolicy($firewallPolicy, array $optionalArgs = []) + { + $request = new UpdateFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy.name'] = $firewallPolicy->getName(); + 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('UpdateFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the specified key. + * + * Sample code: + * ``` + * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + * try { + * $key = new Key(); + * $response = $recaptchaEnterpriseServiceClient->updateKey($key); + * } finally { + * $recaptchaEnterpriseServiceClient->close(); + * } + * ``` + * + * @param Key $key Required. The key to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields are updated. + * @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\RecaptchaEnterprise\V1\Key + * + * @throws ApiException if the remote call fails + */ + public function updateKey($key, array $optionalArgs = []) + { + $request = new UpdateKeyRequest(); + $requestParamHeaders = []; + $request->setKey($key); + $requestParamHeaders['key.name'] = $key->getName(); + 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('UpdateKey', Key::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php new file mode 100644 index 00000000000..062d8e69637 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' => [ + 'AddIpOverride' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\AddIpOverrideResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'AnnotateAssessment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateAssessment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Assessment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateFirewallPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteFirewallPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetFirewallPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMetrics' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Metrics', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListFirewallPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFirewallPolicies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListFirewallPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListIpOverrides' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIpOverrides', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListIpOverridesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getKeys', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListKeysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListRelatedAccountGroupMemberships' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRelatedAccountGroupMemberships', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupMembershipsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListRelatedAccountGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRelatedAccountGroups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'MigrateKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RemoveIpOverride' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\RemoveIpOverrideResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ReorderFirewallPolicies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ReorderFirewallPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RetrieveLegacySecretKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyResponse', + 'headerParams' => [ + [ + 'keyName' => 'key', + 'fieldAccessors' => [ + 'getKey', + ], + ], + ], + ], + 'SearchRelatedAccountGroupMemberships' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRelatedAccountGroupMemberships', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\SearchRelatedAccountGroupMembershipsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'UpdateFirewallPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy.name', + 'fieldAccessors' => [ + 'getFirewallPolicy', + 'getName', + ], + ], + ], + ], + 'UpdateKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', + 'headerParams' => [ + [ + 'keyName' => 'key.name', + 'fieldAccessors' => [ + 'getKey', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'assessment' => 'projects/{project}/assessments/{assessment}', + 'firewallPolicy' => 'projects/{project}/firewallpolicies/{firewallpolicy}', + 'key' => 'projects/{project}/keys/{key}', + 'metrics' => 'projects/{project}/keys/{key}/metrics', + 'project' => 'projects/{project}', + 'relatedAccountGroup' => 'projects/{project}/relatedaccountgroups/{relatedaccountgroup}', + ], + ], + ], +]; diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php new file mode 100644 index 00000000000..43261e80848 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php @@ -0,0 +1,284 @@ + [ + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' => [ + 'AddIpOverride' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/keys/*}:addIpOverride', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'AnnotateAssessment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/assessments/*}:annotate', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateAssessment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/assessments', + 'body' => 'assessment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateFirewallPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies', + 'body' => 'firewall_policy', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/keys', + 'body' => 'key', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteFirewallPolicy' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/firewallpolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteKey' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/keys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetFirewallPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/firewallpolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/keys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMetrics' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/keys/*/metrics}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListFirewallPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListIpOverrides' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/keys/*}:listIpOverrides', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/keys', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRelatedAccountGroupMemberships' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/relatedaccountgroups/*}/memberships', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRelatedAccountGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/relatedaccountgroups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'MigrateKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/keys/*}:migrate', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RemoveIpOverride' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/keys/*}:removeIpOverride', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ReorderFirewallPolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies:reorder', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RetrieveLegacySecretKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey', + 'placeholders' => [ + 'key' => [ + 'getters' => [ + 'getKey', + ], + ], + ], + ], + 'SearchRelatedAccountGroupMemberships' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{project=projects/*}/relatedaccountgroupmemberships:search', + 'body' => '*', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'UpdateFirewallPolicy' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{firewall_policy.name=projects/*/firewallpolicies/*}', + 'body' => 'firewall_policy', + 'placeholders' => [ + 'firewall_policy.name' => [ + 'getters' => [ + 'getFirewallPolicy', + 'getName', + ], + ], + ], + ], + 'UpdateKey' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{key.name=projects/*/keys/*}', + 'body' => 'key', + 'placeholders' => [ + 'key.name' => [ + 'getters' => [ + 'getKey', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php new file mode 100644 index 00000000000..b25fa206d90 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php @@ -0,0 +1,1676 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RecaptchaEnterpriseServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RecaptchaEnterpriseServiceClient($options); + } + + /** @test */ + public function addIpOverrideTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AddIpOverrideResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $request = (new AddIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + $response = $gapicClient->addIpOverride($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIpOverrideData(); + $this->assertProtobufEquals($ipOverrideData, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addIpOverrideExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $request = (new AddIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + try { + $gapicClient->addIpOverride($request); + // 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 annotateAssessmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnnotateAssessmentResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); + $annotation = Annotation::ANNOTATION_UNSPECIFIED; + $request = (new AnnotateAssessmentRequest()) + ->setName($formattedName) + ->setAnnotation($annotation); + $response = $gapicClient->annotateAssessment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AnnotateAssessment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getAnnotation(); + $this->assertProtobufEquals($annotation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function annotateAssessmentExceptionTest() + { + $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->assessmentName('[PROJECT]', '[ASSESSMENT]'); + $annotation = Annotation::ANNOTATION_UNSPECIFIED; + $request = (new AnnotateAssessmentRequest()) + ->setName($formattedName) + ->setAnnotation($annotation); + try { + $gapicClient->annotateAssessment($request); + // 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 createAssessmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Assessment(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $assessment = new Assessment(); + $request = (new CreateAssessmentRequest()) + ->setParent($formattedParent) + ->setAssessment($assessment); + $response = $gapicClient->createAssessment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateAssessment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAssessment(); + $this->assertProtobufEquals($assessment, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAssessmentExceptionTest() + { + $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->projectName('[PROJECT]'); + $assessment = new Assessment(); + $request = (new CreateAssessmentRequest()) + ->setParent($formattedParent) + ->setAssessment($assessment); + try { + $gapicClient->createAssessment($request); + // 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 createFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $firewallPolicy = new FirewallPolicy(); + $request = (new CreateFirewallPolicyRequest()) + ->setParent($formattedParent) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->createFirewallPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFirewallPolicyExceptionTest() + { + $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->projectName('[PROJECT]'); + $firewallPolicy = new FirewallPolicy(); + $request = (new CreateFirewallPolicyRequest()) + ->setParent($formattedParent) + ->setFirewallPolicy($firewallPolicy); + try { + $gapicClient->createFirewallPolicy($request); + // 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 createKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $request = (new CreateKeyRequest()) + ->setParent($formattedParent) + ->setKey($key); + $response = $gapicClient->createKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($key, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKeyExceptionTest() + { + $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->projectName('[PROJECT]'); + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $request = (new CreateKeyRequest()) + ->setParent($formattedParent) + ->setKey($key); + try { + $gapicClient->createKey($request); + // 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 deleteFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $request = (new DeleteFirewallPolicyRequest()) + ->setName($formattedName); + $gapicClient->deleteFirewallPolicy($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteFirewallPolicyExceptionTest() + { + $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $request = (new DeleteFirewallPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteFirewallPolicy($request); + // 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 deleteKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new DeleteKeyRequest()) + ->setName($formattedName); + $gapicClient->deleteKey($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $request = (new DeleteKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteKey($request); + // 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 getFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $request = (new GetFirewallPolicyRequest()) + ->setName($formattedName); + $response = $gapicClient->getFirewallPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFirewallPolicyExceptionTest() + { + $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $request = (new GetFirewallPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->getFirewallPolicy($request); + // 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 getKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new GetKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->getKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $request = (new GetKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->getKey($request); + // 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 getMetricsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Metrics(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricsName('[PROJECT]', '[KEY]'); + $request = (new GetMetricsRequest()) + ->setName($formattedName); + $response = $gapicClient->getMetrics($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetMetrics', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMetricsExceptionTest() + { + $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->metricsName('[PROJECT]', '[KEY]'); + $request = (new GetMetricsRequest()) + ->setName($formattedName); + try { + $gapicClient->getMetrics($request); + // 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 listFirewallPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $firewallPoliciesElement = new FirewallPolicy(); + $firewallPolicies = [ + $firewallPoliciesElement, + ]; + $expectedResponse = new ListFirewallPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFirewallPolicies($firewallPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListFirewallPoliciesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listFirewallPolicies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFirewallPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListFirewallPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFirewallPoliciesExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ListFirewallPoliciesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listFirewallPolicies($request); + // 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 listIpOverridesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $ipOverridesElement = new IpOverrideData(); + $ipOverrides = [ + $ipOverridesElement, + ]; + $expectedResponse = new ListIpOverridesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIpOverrides($ipOverrides); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new ListIpOverridesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listIpOverrides($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIpOverrides()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListIpOverrides', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIpOverridesExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $request = (new ListIpOverridesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listIpOverrides($request); + // 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 listKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $keysElement = new Key(); + $keys = [ + $keysElement, + ]; + $expectedResponse = new ListKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setKeys($keys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListKeysRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listKeys($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeysExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ListKeysRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listKeys($request); + // 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 listRelatedAccountGroupMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); + $relatedAccountGroupMemberships = [ + $relatedAccountGroupMembershipsElement, + ]; + $expectedResponse = new ListRelatedAccountGroupMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); + $request = (new ListRelatedAccountGroupMembershipsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRelatedAccountGroupMemberships($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroupMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRelatedAccountGroupMembershipsExceptionTest() + { + $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->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); + $request = (new ListRelatedAccountGroupMembershipsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRelatedAccountGroupMemberships($request); + // 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 listRelatedAccountGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupsElement = new RelatedAccountGroup(); + $relatedAccountGroups = [ + $relatedAccountGroupsElement, + ]; + $expectedResponse = new ListRelatedAccountGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroups($relatedAccountGroups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListRelatedAccountGroupsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRelatedAccountGroups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRelatedAccountGroupsExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new ListRelatedAccountGroupsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRelatedAccountGroups($request); + // 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 migrateKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new MigrateKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->migrateKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/MigrateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function migrateKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $request = (new MigrateKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->migrateKey($request); + // 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 removeIpOverrideTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RemoveIpOverrideResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $request = (new RemoveIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + $response = $gapicClient->removeIpOverride($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RemoveIpOverride', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIpOverrideData(); + $this->assertProtobufEquals($ipOverrideData, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeIpOverrideExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $request = (new RemoveIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + try { + $gapicClient->removeIpOverride($request); + // 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 reorderFirewallPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReorderFirewallPoliciesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $formattedNames = [ + $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), + ]; + $request = (new ReorderFirewallPoliciesRequest()) + ->setParent($formattedParent) + ->setNames($formattedNames); + $response = $gapicClient->reorderFirewallPolicies($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ReorderFirewallPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNames(); + $this->assertProtobufEquals($formattedNames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reorderFirewallPoliciesExceptionTest() + { + $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->projectName('[PROJECT]'); + $formattedNames = [ + $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), + ]; + $request = (new ReorderFirewallPoliciesRequest()) + ->setParent($formattedParent) + ->setNames($formattedNames); + try { + $gapicClient->reorderFirewallPolicies($request); + // 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 retrieveLegacySecretKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $legacySecretKey = 'legacySecretKey-1937138042'; + $expectedResponse = new RetrieveLegacySecretKeyResponse(); + $expectedResponse->setLegacySecretKey($legacySecretKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new RetrieveLegacySecretKeyRequest()) + ->setKey($formattedKey); + $response = $gapicClient->retrieveLegacySecretKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RetrieveLegacySecretKey', $actualFuncCall); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($formattedKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveLegacySecretKeyExceptionTest() + { + $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 + $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $request = (new RetrieveLegacySecretKeyRequest()) + ->setKey($formattedKey); + try { + $gapicClient->retrieveLegacySecretKey($request); + // 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 searchRelatedAccountGroupMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); + $relatedAccountGroupMemberships = [ + $relatedAccountGroupMembershipsElement, + ]; + $expectedResponse = new SearchRelatedAccountGroupMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new SearchRelatedAccountGroupMembershipsRequest()) + ->setProject($formattedProject); + $response = $gapicClient->searchRelatedAccountGroupMemberships($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/SearchRelatedAccountGroupMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($formattedProject, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchRelatedAccountGroupMembershipsExceptionTest() + { + $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 + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $request = (new SearchRelatedAccountGroupMembershipsRequest()) + ->setProject($formattedProject); + try { + $gapicClient->searchRelatedAccountGroupMemberships($request); + // 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 updateFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = new FirewallPolicy(); + $request = (new UpdateFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->updateFirewallPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFirewallPolicyExceptionTest() + { + $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 + $firewallPolicy = new FirewallPolicy(); + $request = (new UpdateFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + try { + $gapicClient->updateFirewallPolicy($request); + // 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 updateKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $request = (new UpdateKeyRequest()) + ->setKey($key); + $response = $gapicClient->updateKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($key, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateKeyExceptionTest() + { + $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 + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $request = (new UpdateKeyRequest()) + ->setKey($key); + try { + $gapicClient->updateKey($request); + // 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 addIpOverrideAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AddIpOverrideResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $request = (new AddIpOverrideRequest()) + ->setName($formattedName) + ->setIpOverrideData($ipOverrideData); + $response = $gapicClient->addIpOverrideAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIpOverrideData(); + $this->assertProtobufEquals($ipOverrideData, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php new file mode 100644 index 00000000000..0d04fa39208 --- /dev/null +++ b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php @@ -0,0 +1,1517 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RecaptchaEnterpriseServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RecaptchaEnterpriseServiceClient($options); + } + + /** @test */ + public function addIpOverrideTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AddIpOverrideResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $response = $gapicClient->addIpOverride($formattedName, $ipOverrideData); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIpOverrideData(); + $this->assertProtobufEquals($ipOverrideData, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addIpOverrideExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + try { + $gapicClient->addIpOverride($formattedName, $ipOverrideData); + // 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 annotateAssessmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnnotateAssessmentResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); + $annotation = Annotation::ANNOTATION_UNSPECIFIED; + $response = $gapicClient->annotateAssessment($formattedName, $annotation); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AnnotateAssessment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getAnnotation(); + $this->assertProtobufEquals($annotation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function annotateAssessmentExceptionTest() + { + $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->assessmentName('[PROJECT]', '[ASSESSMENT]'); + $annotation = Annotation::ANNOTATION_UNSPECIFIED; + try { + $gapicClient->annotateAssessment($formattedName, $annotation); + // 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 createAssessmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Assessment(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $assessment = new Assessment(); + $response = $gapicClient->createAssessment($formattedParent, $assessment); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateAssessment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAssessment(); + $this->assertProtobufEquals($assessment, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAssessmentExceptionTest() + { + $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->projectName('[PROJECT]'); + $assessment = new Assessment(); + try { + $gapicClient->createAssessment($formattedParent, $assessment); + // 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 createFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $firewallPolicy = new FirewallPolicy(); + $response = $gapicClient->createFirewallPolicy($formattedParent, $firewallPolicy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFirewallPolicyExceptionTest() + { + $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->projectName('[PROJECT]'); + $firewallPolicy = new FirewallPolicy(); + try { + $gapicClient->createFirewallPolicy($formattedParent, $firewallPolicy); + // 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 createKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $response = $gapicClient->createKey($formattedParent, $key); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($key, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKeyExceptionTest() + { + $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->projectName('[PROJECT]'); + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + try { + $gapicClient->createKey($formattedParent, $key); + // 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 deleteFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $gapicClient->deleteFirewallPolicy($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteFirewallPolicyExceptionTest() + { + $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + try { + $gapicClient->deleteFirewallPolicy($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 deleteKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $gapicClient->deleteKey($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + try { + $gapicClient->deleteKey($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 getFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + $response = $gapicClient->getFirewallPolicy($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFirewallPolicyExceptionTest() + { + $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); + try { + $gapicClient->getFirewallPolicy($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 getKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $response = $gapicClient->getKey($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + try { + $gapicClient->getKey($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 getMetricsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Metrics(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricsName('[PROJECT]', '[KEY]'); + $response = $gapicClient->getMetrics($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetMetrics', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMetricsExceptionTest() + { + $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->metricsName('[PROJECT]', '[KEY]'); + try { + $gapicClient->getMetrics($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 listFirewallPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $firewallPoliciesElement = new FirewallPolicy(); + $firewallPolicies = [ + $firewallPoliciesElement, + ]; + $expectedResponse = new ListFirewallPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFirewallPolicies($firewallPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listFirewallPolicies($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFirewallPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListFirewallPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFirewallPoliciesExceptionTest() + { + $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->projectName('[PROJECT]'); + try { + $gapicClient->listFirewallPolicies($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 listIpOverridesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $ipOverridesElement = new IpOverrideData(); + $ipOverrides = [ + $ipOverridesElement, + ]; + $expectedResponse = new ListIpOverridesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIpOverrides($ipOverrides); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $response = $gapicClient->listIpOverrides($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIpOverrides()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListIpOverrides', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIpOverridesExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + try { + $gapicClient->listIpOverrides($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 listKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $keysElement = new Key(); + $keys = [ + $keysElement, + ]; + $expectedResponse = new ListKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setKeys($keys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listKeys($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeysExceptionTest() + { + $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->projectName('[PROJECT]'); + try { + $gapicClient->listKeys($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 listRelatedAccountGroupMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); + $relatedAccountGroupMemberships = [ + $relatedAccountGroupMembershipsElement, + ]; + $expectedResponse = new ListRelatedAccountGroupMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); + $response = $gapicClient->listRelatedAccountGroupMemberships($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroupMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRelatedAccountGroupMembershipsExceptionTest() + { + $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->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); + try { + $gapicClient->listRelatedAccountGroupMemberships($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 listRelatedAccountGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupsElement = new RelatedAccountGroup(); + $relatedAccountGroups = [ + $relatedAccountGroupsElement, + ]; + $expectedResponse = new ListRelatedAccountGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroups($relatedAccountGroups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listRelatedAccountGroups($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRelatedAccountGroupsExceptionTest() + { + $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->projectName('[PROJECT]'); + try { + $gapicClient->listRelatedAccountGroups($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 migrateKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $response = $gapicClient->migrateKey($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/MigrateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function migrateKeyExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + try { + $gapicClient->migrateKey($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 removeIpOverrideTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RemoveIpOverrideResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + $response = $gapicClient->removeIpOverride($formattedName, $ipOverrideData); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RemoveIpOverride', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIpOverrideData(); + $this->assertProtobufEquals($ipOverrideData, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeIpOverrideExceptionTest() + { + $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->keyName('[PROJECT]', '[KEY]'); + $ipOverrideData = new IpOverrideData(); + $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; + $ipOverrideData->setIp($ipOverrideDataIp); + $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; + $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); + try { + $gapicClient->removeIpOverride($formattedName, $ipOverrideData); + // 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 reorderFirewallPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReorderFirewallPoliciesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $formattedNames = [ + $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), + ]; + $response = $gapicClient->reorderFirewallPolicies($formattedParent, $formattedNames); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ReorderFirewallPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNames(); + $this->assertProtobufEquals($formattedNames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reorderFirewallPoliciesExceptionTest() + { + $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->projectName('[PROJECT]'); + $formattedNames = [ + $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), + ]; + try { + $gapicClient->reorderFirewallPolicies($formattedParent, $formattedNames); + // 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 retrieveLegacySecretKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $legacySecretKey = 'legacySecretKey-1937138042'; + $expectedResponse = new RetrieveLegacySecretKeyResponse(); + $expectedResponse->setLegacySecretKey($legacySecretKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); + $response = $gapicClient->retrieveLegacySecretKey($formattedKey); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RetrieveLegacySecretKey', $actualFuncCall); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($formattedKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveLegacySecretKeyExceptionTest() + { + $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 + $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); + try { + $gapicClient->retrieveLegacySecretKey($formattedKey); + // 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 searchRelatedAccountGroupMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); + $relatedAccountGroupMemberships = [ + $relatedAccountGroupMembershipsElement, + ]; + $expectedResponse = new SearchRelatedAccountGroupMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProject = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->searchRelatedAccountGroupMemberships($formattedProject); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/SearchRelatedAccountGroupMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($formattedProject, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchRelatedAccountGroupMembershipsExceptionTest() + { + $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 + $formattedProject = $gapicClient->projectName('[PROJECT]'); + try { + $gapicClient->searchRelatedAccountGroupMemberships($formattedProject); + // 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 updateFirewallPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $path = 'path3433509'; + $condition = 'condition-861311717'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPath($path); + $expectedResponse->setCondition($condition); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = new FirewallPolicy(); + $response = $gapicClient->updateFirewallPolicy($firewallPolicy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateFirewallPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFirewallPolicyExceptionTest() + { + $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 + $firewallPolicy = new FirewallPolicy(); + try { + $gapicClient->updateFirewallPolicy($firewallPolicy); + // 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 updateKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Key(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + $response = $gapicClient->updateKey($key); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateKey', $actualFuncCall); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($key, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateKeyExceptionTest() + { + $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 + $key = new Key(); + $keyDisplayName = 'keyDisplayName-302940530'; + $key->setDisplayName($keyDisplayName); + try { + $gapicClient->updateKey($key); + // 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/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..e18d9a0478ce14bf0057abf5b2b737b3c7e15a97 GIT binary patch literal 2636 zcmbtWU2hvj6s^~F+FbX;-BQ(Z9~eTVI#TL1L40UKK(@0qB$>~I#un33F0ZBbZ6CSgk2(_$$@Jo5+ zNPRO;E8*xVs%wsxb&cdc;w&SJ*%4xdXDr%Nyd}WJGb>ynyb?E{Yw!Jg^}u)wB;tA!Jqfw)Borob5k#DDC;$r zS+9{>ulC6bIn?H~NjLr~LOJ(Whm(nU9}MbO3#d?EZxw%Q8s-_iCu~iEm`&X=6=#Wg z;w!Bhs8}!W9yi{ZVq+nV{H-95bHu4mWJ{6o@ z%sHc@j0;vJFloI?q*pq?Une51An53cEGJ{Grz z7FSlOFk@=89>K$_4s!W4AsfH1fq6ZJ=|h>k!Gd|hs7I6`R;%`P%!VxidlE0-fy|=t zT_z+a!c($(t9WWj7L}kc@n%^Z2TER?@>JMrRnsm>(3Vhk#F;X!vVfN{Mj~&j9kXE3 z5tLK$+?=`cDkRFD_x|q&2NG}~@w8*#2NR!T8sbq%-0w0Ri6b;swk_&_4S3|?D2}Ly zLs3ud$c)kIt+`iiSfdl+d2R0U?u!*1+K~%Ys+tWjud+N#K24JlPZw-tXi`t$Ud*U? zJ{2eFFHw)^^I(6if}!;XDWxnbUc+np0JBj&}w3f$?w9=hGb ze54@fdwsjxKd}21L*!a-HQO)s-(tgZA@q|=4wkN zt&q43zo$MQtIJT2wSG3>xoAM%y*RzX*H}Lvvx_>OYzOi3J_aXr*2-MHDs-QdjP{lf z|74WinternalAddGeneratedFile( + ' +� +?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 ( B3�A�A- ++recommendationengine.googleapis.com/CatalogQ + catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemB�A"b +GetCatalogItemRequestI +name ( B;�A�A5 +3recommendationengine.googleapis.com/CatalogItemPath"� +ListCatalogItemsRequestC +parent ( B3�A�A- ++recommendationengine.googleapis.com/Catalog + page_size (B�A + +page_token ( B�A +filter ( B�A"� +ListCatalogItemsResponseM + catalog_items ( 26.google.cloud.recommendationengine.v1beta1.CatalogItem +next_page_token ( "� +UpdateCatalogItemRequestI +name ( B;�A�A5 +3recommendationengine.googleapis.com/CatalogItemPathQ + catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemB�A/ + update_mask ( 2.google.protobuf.FieldMask"e +DeleteCatalogItemRequestI +name ( B;�A�A5 +3recommendationengine.googleapis.com/CatalogItemPath2� +CatalogService� +CreateCatalogItemC.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"l�Aparent,catalog_item���P"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems: catalog_item� +GetCatalogItem@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"P�Aname���CA/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}� +ListCatalogItemsB.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequestC.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse"X�A parent,filter���B@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems� +UpdateCatalogItemC.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"w�Aname,catalog_item,update_mask���Q2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}: catalog_item� +DeleteCatalogItemC.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.google.protobuf.Empty"P�Aname���C*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}� +ImportCatalogItemsD.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.google.longrunning.Operation"��A� +Dgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadata�A,parent,request_id,input_config,errors_config���L"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +-com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 00000000000..ecbe94f045c --- /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.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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..e84c970a097885785054eb136f352310d8f41b70 GIT binary patch literal 3672 zcmds4-EQMl5Zpxh>8=a3v6o{-(0_Q@M)Dx#G8)FHzt8V0oC z2T|H@aEb;a8uq<}MIjA`EToOIwH{5pwFVo-5l?L80wDB8RK%W7$^KF6BRqgMUUy%i zb+;v2w^M-D{dBD*(KZ46z!QSB6)JoK1b=bb3z$ztg8qGSj|rEBEMZ>2zQ%9dA_FfF z6iu(69i*WzVtm!(8Z?kT6p z2}7bM-YA~jwiEl^W8`r99Dj^5JT)7Y5-G+_7CsS)h+u2Iq zc9FboBk$$A#)TI%>;sxYTI|d3PVU{;JTZpO#_7$d}RG)i%qcsneJ_?0}>h7rhScbdWb}W3+ zpyM_WPR7zP?LNL?J<(J* zsFGrp^=b5!_YK7AL-j(OIM~Q0k;SVS`r#Du=3E(X04T$kVOB?5`=ta6npfF)X5E2> zD3%i=PD-wv;Ho#JYAoxLl4LM*Rs$+Nr#M`?vQbtw-kC=}FMF#>f3Uey83nxB;g zj9uNpti~TY$UW3InEPAc@(fXkbtJv%(5AUe-xu-uOyIJw77)HfA z4fe=vttq;3;@)QQ_OtTJzFKu`HRsx$ORLVVTAXaN>inFY?V7#l%3`EX zcX2aPd)9B|2O8RO6t?3Ofjf>l-kViYe0V<}8XxEdWNcrN(+u+qb`^C}ZxrWn4)7=8 CCFFAe 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 00000000000..1dfef8780a3 --- /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 ( B6�A�A0 +.recommendationengine.googleapis.com/EventStoreu +prediction_api_key_registration ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationB�A"� +(ListPredictionApiKeyRegistrationsRequestF +parent ( B6�A�A0 +.recommendationengine.googleapis.com/EventStore + page_size (B�A + +page_token ( B�A"� +)ListPredictionApiKeyRegistrationsResponseq + prediction_api_key_registrations ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration +next_page_token ( "� +)DeletePredictionApiKeyRegistrationRequestV +name ( BH�A�AB +@recommendationengine.googleapis.com/PredictionApiKeyRegistration2� +PredictionApiKeyRegistry� +"CreatePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequestG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration"��A&parent,prediction_api_key_registration���d"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:*� +!ListPredictionApiKeyRegistrationsS.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequestT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse"p�Aparent���a_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations� +"DeletePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest.google.protobuf.Empty"n�Aname���a*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +-com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 00000000000..68fa1988e19 --- /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 ( B5�A�A/ +-recommendationengine.googleapis.com/PlacementM + +user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventB�A + page_size (B�A + +page_token ( B�A +filter ( B�A +dry_run (B�AZ +params ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryB�AZ +labels ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryB�AE + 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"q�Aname,user_event���Y"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +-com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 00000000000..46a976fbd41 --- /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.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)Google.Cloud.RecommendationEngine.V1Beta1�)Google\\Cloud\\RecommendationEngine\\V1beta1�,Google::Cloud::RecommendationEngine::V1beta1�Ai ++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/PredictionApiKeyRegistration�projects/{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..eded66ee8391777e030f43fc1b6afb5a188cf7b9 GIT binary patch literal 3437 zcmb_f-EJF26vmsTNybSNZG$iYsnbxYiPUaXSCnc?3XbEXR-4*QoC<-_GTxmyqi%M$ zv$LiK^^!|&cm%lPQFscjxF~l#0cU>Jb{eC`w7H0^opZi(&Ub$1%;#Su#|iob@6w2J zB4~g+eJqYCPIxS0KMrvxJ368q`|(M_LdqSCw;T9zqlIhR_10BTP2-IF)WzL6?uK;3 z592J@;1m>2XcQ2^;)q6F7SWB~tqv9B)<%|6?$I8Ngrm$L6p<5}Cd8+Bx4E?kLZC<5 zy9%*gm5A;AF^KJ_x3(nWJ%s#_q$xfGivX>vpLaa4f&9tsAovjve7O?W60SadHz2p3zb37;`Ez9^F%ZOMsVyU+pmjRub0U zVKfZ3=rQTBn7i&Usv*cY)i-nBu0pE9xchD~p?Kox{E!3wTMP_By|4QQ04UPnJIBlrK8wY{!&9n})fxR!8CORRi$elx!2Ter^2oe2~bsYdUL z(NhfwmAfHw=Cr`-FBj0Q|^Z^3DDjm1<9Gk6YeB<8Z%P^9~;$G;7uRPQA9h^q!5-#mZr;vG-`HU@xG#TD7sa zR|Byn%U(kBTa{Mzfp^$^)TnGPO|AZ1K(l$uWKHx~%3#EKEEuhcWi+E}B2X2fDy1OB zS>ll(;51EDYKI3(oOEGumtZA; zb@Vntiz+%87qlC51|C=tL$Ul|0uRh=uM2wOz;6lEf52c<0Be2w379awrMpVgR4m_} zz=R3NBybVUge;YmYdRsg8J}?VLAI934}q?Rt>c)a)DxUUDN&cT%5JfIe-iTsrZq&- zWdCEK%gwWg_9C)ItGysSgHZo^YSJw9Gp tH#D^CDs0ys2kyE?ymJvIoQQ8internalAddGeneratedFile( + ' +� +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 ( B6�A�A0 +.recommendationengine.googleapis.com/EventStore +filter ( B�A +force (B�A"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 ( B6�A�A0 +.recommendationengine.googleapis.com/EventStoreM + +user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventB�A"� +CollectUserEventRequestF +parent ( B6�A�A0 +.recommendationengine.googleapis.com/EventStore + +user_event ( B�A +uri ( B�A +ets (B�A"� +ListUserEventsRequestF +parent ( B6�A�A0 +.recommendationengine.googleapis.com/EventStore + page_size (B�A + +page_token ( B�A +filter ( B�A"| +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�Aparent,user_event���`"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write: +user_event� +CollectUserEventB.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.google.api.HttpBody"x�Aparent,user_event,uri,ets���VT/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect� +ListUserEvents@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequestA.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse"d�A parent,filter���NL/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents� +PurgeUserEventsA.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.google.longrunning.Operation"��A� +Agoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponseAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata�Aparent,filter,force���W"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:*� +ImportUserEventsB.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.google.longrunning.Operation"��A~ +Bgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadata�A,parent,request_id,input_config,errors_config���X"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +-com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 00000000000..f2ad496f059 --- /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 00000000000..6e86c77983a --- /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 00000000000..560a234a76f --- /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/CollectUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php new file mode 100644 index 00000000000..7572405559b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php @@ -0,0 +1,219 @@ +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; + + /** + * @param string $parent Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see + * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. + * @param string $userEvent Required. URL encoded UserEvent proto. + * @param 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. + * @param 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. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest + * + * @experimental + */ + public static function build(string $parent, string $userEvent, string $uri, int $ets): self + { + return (new self()) + ->setParent($parent) + ->setUserEvent($userEvent) + ->setUri($uri) + ->setEts($ets); + } + + /** + * 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 00000000000..2f0d616da1a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php @@ -0,0 +1,132 @@ +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; + + /** + * @param string $parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. Please see + * {@see CatalogServiceClient::catalogName()} for help formatting this field. + * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem Required. The catalog item to create. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CreateCatalogItemRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem): self + { + return (new self()) + ->setParent($parent) + ->setCatalogItem($catalogItem); + } + + /** + * 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 00000000000..9371234e85e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php @@ -0,0 +1,132 @@ +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; + + /** + * @param string $parent Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see + * {@see PredictionApiKeyRegistryClient::eventStoreName()} for help formatting this field. + * @param \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $predictionApiKeyRegistration Required. The prediction API key registration. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CreatePredictionApiKeyRegistrationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $predictionApiKeyRegistration): self + { + return (new self()) + ->setParent($parent) + ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + } + + /** + * 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 00000000000..76f872cb059 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php @@ -0,0 +1,86 @@ +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 = ''; + + /** + * @param string $name Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. Please see + * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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 00000000000..ff36aef3416 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php @@ -0,0 +1,86 @@ +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 = ''; + + /** + * @param string $name Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * Please see {@see PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName()} for help formatting this field. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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 00000000000..25740f69bf0 --- /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 00000000000..0578372686e --- /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 00000000000..a0245cbe9b4 --- /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 00000000000..20808ae9628 --- /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/GcsSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php new file mode 100644 index 00000000000..ad47f31a44f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php @@ -0,0 +1,92 @@ +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 00000000000..91e51e1c64a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php @@ -0,0 +1,86 @@ +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 = ''; + + /** + * @param string $name Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. Please see + * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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 00000000000..5790795608f --- /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 00000000000..9f1a9b4a42c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php @@ -0,0 +1,224 @@ +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; + + /** + * @param string $parent Required. `projects/1234/locations/global/catalogs/default_catalog` + * Please see {@see CatalogServiceClient::catalogName()} for help formatting this field. + * @param 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. + * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig Required. The desired input location of the data. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig Optional. The desired location of errors incurred during the Import. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest + * + * @experimental + */ + public static function build(string $parent, string $requestId, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig): self + { + return (new self()) + ->setParent($parent) + ->setRequestId($requestId) + ->setInputConfig($inputConfig) + ->setErrorsConfig($errorsConfig); + } + + /** + * 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 00000000000..f1d250f54ae --- /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 00000000000..0a56f1f1b5a --- /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 00000000000..df36e57fb55 --- /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 00000000000..d50c931107f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php @@ -0,0 +1,239 @@ +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; + + /** + * @param string $parent Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * Please see {@see UserEventServiceClient::eventStoreName()} for help formatting this field. + * @param 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. + * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig Required. The desired input location of the data. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig Optional. The desired location of errors incurred during the Import. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest + * + * @experimental + */ + public static function build(string $parent, string $requestId, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig): self + { + return (new self()) + ->setParent($parent) + ->setRequestId($requestId) + ->setInputConfig($inputConfig) + ->setErrorsConfig($errorsConfig); + } + + /** + * 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 00000000000..a2c46b8b0d7 --- /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 00000000000..bb1e3c8486e --- /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 00000000000..782b7c3cc7b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php @@ -0,0 +1,194 @@ +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 = ''; + + /** + * @param string $parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. Please see + * {@see CatalogServiceClient::catalogName()} for help formatting this field. + * @param string $filter Optional. A filter to apply on the list results. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($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 00000000000..5e6fc92950b --- /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 00000000000..fb2ef75e9a9 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php @@ -0,0 +1,158 @@ +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 = ''; + + /** + * @param string $parent Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * Please see {@see PredictionApiKeyRegistryClient::eventStoreName()} for help formatting this field. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 00000000000..10f6cde3a76 --- /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 00000000000..1d959b454f6 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php @@ -0,0 +1,325 @@ +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 = ''; + + /** + * @param string $parent Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. Please see + * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. + * @param 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 + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($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 00000000000..dd173c6ca7a --- /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 00000000000..b437e2ee547 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php @@ -0,0 +1,598 @@ +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; + + /** + * @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 + * Please see {@see PredictionServiceClient::placementName()} for help formatting this field. + * @param \Google\Cloud\RecommendationEngine\V1beta1\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. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent): self + { + return (new self()) + ->setName($name) + ->setUserEvent($userEvent); + } + + /** + * 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 00000000000..dd9123fe4ff --- /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 00000000000..a5b769c9f33 --- /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/PredictionApiKeyRegistration.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php new file mode 100644 index 00000000000..07d4b018b1a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php @@ -0,0 +1,67 @@ +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/ProductCatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php new file mode 100644 index 00000000000..adca031c6ce --- /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 00000000000..7c89cff9e04 --- /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 00000000000..0e852c57127 --- /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 00000000000..1c3d3309882 --- /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/ProductDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php new file mode 100644 index 00000000000..4b3b83b30c8 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php @@ -0,0 +1,371 @@ +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 00000000000..d65f1cc9d8d --- /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 00000000000..871a95215d5 --- /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 00000000000..8dbccb35565 --- /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 00000000000..46a4a5f8e8b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php @@ -0,0 +1,258 @@ +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; + + /** + * @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}` + * Please see {@see UserEventServiceClient::eventStoreName()} for help formatting this field. + * @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 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. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter, bool $force): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter) + ->setForce($force); + } + + /** + * 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 00000000000..2ebd0d0f92e --- /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 00000000000..67d1426dd8b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php @@ -0,0 +1,188 @@ +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; + + /** + * @param string $name Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. Please see + * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. + * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setName($name) + ->setCatalogItem($catalogItem) + ->setUpdateMask($updateMask); + } + + /** + * 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 00000000000..1d27319722d --- /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 00000000000..32d9d868294 --- /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 00000000000..5d66aa96e6e --- /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 00000000000..65b1597982a --- /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/UserInfo.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php new file mode 100644 index 00000000000..caedbf80f65 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php @@ -0,0 +1,271 @@ +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 00000000000..0f7163b77d2 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php @@ -0,0 +1,132 @@ +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; + + /** + * @param string $parent Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see + * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent Required. User event to write. + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\WriteUserEventRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent): self + { + return (new self()) + ->setParent($parent) + ->setUserEvent($userEvent); + } + + /** + * 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/samples/V1beta1/CatalogServiceClient/create_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/create_catalog_item.php new file mode 100644 index 00000000000..e6e6e0dcdfb --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/create_catalog_item.php @@ -0,0 +1,107 @@ +setCategories($catalogItemCategoryHierarchiesCategories); + $catalogItemCategoryHierarchies = [$categoryHierarchy,]; + $catalogItem = (new CatalogItem()) + ->setId($catalogItemId) + ->setCategoryHierarchies($catalogItemCategoryHierarchies) + ->setTitle($catalogItemTitle); + $request = (new CreateCatalogItemRequest()) + ->setParent($formattedParent) + ->setCatalogItem($catalogItem); + + // Call the API and handle any network failures. + try { + /** @var CatalogItem $response */ + $response = $catalogServiceClient->createCatalogItem($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogItemId = '[ID]'; + $catalogItemCategoryHierarchiesCategoriesElement = '[CATEGORIES]'; + $catalogItemTitle = '[TITLE]'; + + create_catalog_item_sample( + $formattedParent, + $catalogItemId, + $catalogItemCategoryHierarchiesCategoriesElement, + $catalogItemTitle + ); +} +// [END recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php new file mode 100644 index 00000000000..0779c3abe47 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $catalogServiceClient->deleteCatalogItem($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CatalogServiceClient::catalogItemPathName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[CATALOG_ITEM_PATH]' + ); + + delete_catalog_item_sample($formattedName); +} +// [END recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php new file mode 100644 index 00000000000..636b3ecf635 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CatalogItem $response */ + $response = $catalogServiceClient->getCatalogItem($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CatalogServiceClient::catalogItemPathName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[CATALOG_ITEM_PATH]' + ); + + get_catalog_item_sample($formattedName); +} +// [END recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php new file mode 100644 index 00000000000..0a8bd9bd41e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php @@ -0,0 +1,91 @@ +setParent($formattedParent) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $catalogServiceClient->importCatalogItems($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportCatalogItemsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + import_catalog_items_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php new file mode 100644 index 00000000000..b05eda0fb9f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $catalogServiceClient->listCatalogItems($request); + + /** @var CatalogItem $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + list_catalog_items_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php new file mode 100644 index 00000000000..ff222aac048 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php @@ -0,0 +1,113 @@ +setCategories($catalogItemCategoryHierarchiesCategories); + $catalogItemCategoryHierarchies = [$categoryHierarchy,]; + $catalogItem = (new CatalogItem()) + ->setId($catalogItemId) + ->setCategoryHierarchies($catalogItemCategoryHierarchies) + ->setTitle($catalogItemTitle); + $request = (new UpdateCatalogItemRequest()) + ->setName($formattedName) + ->setCatalogItem($catalogItem); + + // Call the API and handle any network failures. + try { + /** @var CatalogItem $response */ + $response = $catalogServiceClient->updateCatalogItem($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CatalogServiceClient::catalogItemPathName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[CATALOG_ITEM_PATH]' + ); + $catalogItemId = '[ID]'; + $catalogItemCategoryHierarchiesCategoriesElement = '[CATEGORIES]'; + $catalogItemTitle = '[TITLE]'; + + update_catalog_item_sample( + $formattedName, + $catalogItemId, + $catalogItemCategoryHierarchiesCategoriesElement, + $catalogItemTitle + ); +} +// [END recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php new file mode 100644 index 00000000000..95a92212131 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php @@ -0,0 +1,79 @@ +setParent($formattedParent) + ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + + // Call the API and handle any network failures. + try { + /** @var PredictionApiKeyRegistration $response */ + $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PredictionApiKeyRegistryClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + + create_prediction_api_key_registration_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php new file mode 100644 index 00000000000..44ad813ff6a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php @@ -0,0 +1,76 @@ +` + * Please see {@see PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName()} for help formatting this field. + */ +function delete_prediction_api_key_registration_sample(string $formattedName): void +{ + // Create a client. + $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); + + // Prepare the request message. + $request = (new DeletePredictionApiKeyRegistrationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $predictionApiKeyRegistryClient->deletePredictionApiKeyRegistration($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]', + '[PREDICTION_API_KEY_REGISTRATION]' + ); + + delete_prediction_api_key_registration_sample($formattedName); +} +// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php new file mode 100644 index 00000000000..0b4ef207d99 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($request); + + /** @var PredictionApiKeyRegistration $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = PredictionApiKeyRegistryClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + + list_prediction_api_key_registrations_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php new file mode 100644 index 00000000000..c9da8a32c3f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php @@ -0,0 +1,151 @@ +setVisitorId($userEventUserInfoVisitorId); + $userEvent = (new UserEvent()) + ->setEventType($userEventEventType) + ->setUserInfo($userEventUserInfo); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $predictionServiceClient->predict($request); + + /** @var PredictionResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PredictionServiceClient::placementName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]', + '[PLACEMENT]' + ); + $userEventEventType = '[EVENT_TYPE]'; + $userEventUserInfoVisitorId = '[VISITOR_ID]'; + + predict_sample($formattedName, $userEventEventType, $userEventUserInfoVisitorId); +} +// [END recommendationengine_v1beta1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php new file mode 100644 index 00000000000..c8531e0c98e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php @@ -0,0 +1,84 @@ +setParent($formattedParent) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var HttpBody $response */ + $response = $userEventServiceClient->collectUserEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + $userEvent = '[USER_EVENT]'; + + collect_user_event_sample($formattedParent, $userEvent); +} +// [END recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php new file mode 100644 index 00000000000..84e90f8e9f2 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php @@ -0,0 +1,98 @@ +setParent($formattedParent) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $userEventServiceClient->importUserEvents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportUserEventsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + + import_user_events_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php new file mode 100644 index 00000000000..c81318d2fe5 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $userEventServiceClient->listUserEvents($request); + + /** @var UserEvent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + + list_user_events_sample($formattedParent); +} +// [END recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php new file mode 100644 index 00000000000..74b292d2ba3 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php @@ -0,0 +1,113 @@ + "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. + */ +function purge_user_events_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $userEventServiceClient = new UserEventServiceClient(); + + // Prepare the request message. + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $userEventServiceClient->purgeUserEvents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PurgeUserEventsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + $filter = '[FILTER]'; + + purge_user_events_sample($formattedParent, $filter); +} +// [END recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php new file mode 100644 index 00000000000..2f20bf02909 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php @@ -0,0 +1,114 @@ +setVisitorId($userEventUserInfoVisitorId); + $userEvent = (new UserEvent()) + ->setEventType($userEventEventType) + ->setUserInfo($userEventUserInfo); + $request = (new WriteUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var UserEvent $response */ + $response = $userEventServiceClient->writeUserEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::eventStoreName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[EVENT_STORE]' + ); + $userEventEventType = '[EVENT_TYPE]'; + $userEventUserInfoVisitorId = '[VISITOR_ID]'; + + write_user_event_sample($formattedParent, $userEventEventType, $userEventUserInfoVisitorId); +} +// [END recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] 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 00000000000..14c6da839b0 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php @@ -0,0 +1,36 @@ + createCatalogItemAsync(CreateCatalogItemRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteCatalogItemAsync(DeleteCatalogItemRequest $request, array $optionalArgs = []) + * @method PromiseInterface getCatalogItemAsync(GetCatalogItemRequest $request, array $optionalArgs = []) + * @method PromiseInterface importCatalogItemsAsync(ImportCatalogItemsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listCatalogItemsAsync(ListCatalogItemsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateCatalogItemAsync(UpdateCatalogItemRequest $request, array $optionalArgs = []) + */ +final class CatalogServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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; + } + + /** + * 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(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->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(string $project, string $location, string $catalog, string $catalogItemPath): string + { + return self::getPathTemplate('catalogItemPath')->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(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a catalog item. + * + * The async variant is {@see CatalogServiceClient::createCatalogItemAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/create_catalog_item.php + * + * @param CreateCatalogItemRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CatalogItem + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createCatalogItem(CreateCatalogItemRequest $request, array $callOptions = []): CatalogItem + { + return $this->startApiCall('CreateCatalogItem', $request, $callOptions)->wait(); + } + + /** + * Deletes a catalog item. + * + * The async variant is {@see CatalogServiceClient::deleteCatalogItemAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/delete_catalog_item.php + * + * @param DeleteCatalogItemRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + * + * @experimental + */ + public function deleteCatalogItem(DeleteCatalogItemRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteCatalogItem', $request, $callOptions)->wait(); + } + + /** + * Gets a specific catalog item. + * + * The async variant is {@see CatalogServiceClient::getCatalogItemAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/get_catalog_item.php + * + * @param GetCatalogItemRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CatalogItem + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getCatalogItem(GetCatalogItemRequest $request, array $callOptions = []): CatalogItem + { + return $this->startApiCall('GetCatalogItem', $request, $callOptions)->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. + * + * The async variant is {@see CatalogServiceClient::importCatalogItemsAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/import_catalog_items.php + * + * @param ImportCatalogItemsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function importCatalogItems(ImportCatalogItemsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportCatalogItems', $request, $callOptions)->wait(); + } + + /** + * Gets a list of catalog items. + * + * The async variant is {@see CatalogServiceClient::listCatalogItemsAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/list_catalog_items.php + * + * @param ListCatalogItemsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listCatalogItems(ListCatalogItemsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCatalogItems', $request, $callOptions); + } + + /** + * Updates a catalog item. Partial updating is supported. Non-existing + * items will be created. + * + * The async variant is {@see CatalogServiceClient::updateCatalogItemAsync()} . + * + * @example samples/V1beta1/CatalogServiceClient/update_catalog_item.php + * + * @param UpdateCatalogItemRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CatalogItem + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateCatalogItem(UpdateCatalogItemRequest $request, array $callOptions = []): CatalogItem + { + return $this->startApiCall('UpdateCatalogItem', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php new file mode 100644 index 00000000000..19911f5f772 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php @@ -0,0 +1,352 @@ + createPredictionApiKeyRegistrationAsync(CreatePredictionApiKeyRegistrationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPredictionApiKeyRegistrationsAsync(ListPredictionApiKeyRegistrationsRequest $request, array $optionalArgs = []) + */ +final class PredictionApiKeyRegistryClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $project, string $location, string $catalog, string $eventStore): string + { + return self::getPathTemplate('eventStore')->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(string $project, string $location, string $catalog, string $eventStore, string $predictionApiKeyRegistration): string + { + return self::getPathTemplate('predictionApiKeyRegistration')->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(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Register an API key for use with predict method. + * + * The async variant is + * {@see PredictionApiKeyRegistryClient::createPredictionApiKeyRegistrationAsync()} + * . + * + * @example samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php + * + * @param CreatePredictionApiKeyRegistrationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PredictionApiKeyRegistration + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createPredictionApiKeyRegistration(CreatePredictionApiKeyRegistrationRequest $request, array $callOptions = []): PredictionApiKeyRegistration + { + return $this->startApiCall('CreatePredictionApiKeyRegistration', $request, $callOptions)->wait(); + } + + /** + * Unregister an apiKey from using for predict method. + * + * The async variant is + * {@see PredictionApiKeyRegistryClient::deletePredictionApiKeyRegistrationAsync()} + * . + * + * @example samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php + * + * @param DeletePredictionApiKeyRegistrationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + * + * @experimental + */ + public function deletePredictionApiKeyRegistration(DeletePredictionApiKeyRegistrationRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeletePredictionApiKeyRegistration', $request, $callOptions)->wait(); + } + + /** + * List the registered apiKeys for use with predict method. + * + * The async variant is + * {@see PredictionApiKeyRegistryClient::listPredictionApiKeyRegistrationsAsync()} + * . + * + * @example samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php + * + * @param ListPredictionApiKeyRegistrationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listPredictionApiKeyRegistrations(ListPredictionApiKeyRegistrationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPredictionApiKeyRegistrations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php new file mode 100644 index 00000000000..fd42901c84c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php @@ -0,0 +1,262 @@ + predictAsync(PredictRequest $request, array $optionalArgs = []) + */ +final class PredictionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $project, string $location, string $catalog, string $eventStore, string $placement): string + { + return self::getPathTemplate('placement')->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(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * 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). + * + * The async variant is {@see PredictionServiceClient::predictAsync()} . + * + * @example samples/V1beta1/PredictionServiceClient/predict.php + * + * @param PredictRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function predict(PredictRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('Predict', $request, $callOptions); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php new file mode 100644 index 00000000000..8a6e275f2a2 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php @@ -0,0 +1,432 @@ + collectUserEventAsync(CollectUserEventRequest $request, array $optionalArgs = []) + * @method PromiseInterface importUserEventsAsync(ImportUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listUserEventsAsync(ListUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface purgeUserEventsAsync(PurgeUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface writeUserEventAsync(WriteUserEventRequest $request, array $optionalArgs = []) + */ +final class UserEventServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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; + } + + /** + * 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(string $project, string $location, string $catalog, string $eventStore): string + { + return self::getPathTemplate('eventStore')->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(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * 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. + * + * The async variant is {@see UserEventServiceClient::collectUserEventAsync()} . + * + * @example samples/V1beta1/UserEventServiceClient/collect_user_event.php + * + * @param CollectUserEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 HttpBody + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function collectUserEvent(CollectUserEventRequest $request, array $callOptions = []): HttpBody + { + return $this->startApiCall('CollectUserEvent', $request, $callOptions)->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. + * + * The async variant is {@see UserEventServiceClient::importUserEventsAsync()} . + * + * @example samples/V1beta1/UserEventServiceClient/import_user_events.php + * + * @param ImportUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function importUserEvents(ImportUserEventsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportUserEvents', $request, $callOptions)->wait(); + } + + /** + * Gets a list of user events within a time range, with potential filtering. + * + * The async variant is {@see UserEventServiceClient::listUserEventsAsync()} . + * + * @example samples/V1beta1/UserEventServiceClient/list_user_events.php + * + * @param ListUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listUserEvents(ListUserEventsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUserEvents', $request, $callOptions); + } + + /** + * 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. + * + * The async variant is {@see UserEventServiceClient::purgeUserEventsAsync()} . + * + * @example samples/V1beta1/UserEventServiceClient/purge_user_events.php + * + * @param PurgeUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function purgeUserEvents(PurgeUserEventsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PurgeUserEvents', $request, $callOptions)->wait(); + } + + /** + * Writes a single user event. + * + * The async variant is {@see UserEventServiceClient::writeUserEventAsync()} . + * + * @example samples/V1beta1/UserEventServiceClient/write_user_event.php + * + * @param WriteUserEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 UserEvent + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function writeUserEvent(WriteUserEventRequest $request, array $callOptions = []): UserEvent + { + return $this->startApiCall('WriteUserEvent', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php new file mode 100644 index 00000000000..25175d0b18f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php @@ -0,0 +1,695 @@ +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 + * + * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\CatalogServiceClient}. + */ +class CatalogServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 00000000000..642f7463549 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php @@ -0,0 +1,467 @@ +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 + * + * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\PredictionApiKeyRegistryClient}. + */ +class PredictionApiKeyRegistryGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 00000000000..f71447b5908 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php @@ -0,0 +1,451 @@ +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 + * + * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\PredictionServiceClient}. + */ +class PredictionServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 00000000000..cbaf47dd220 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php @@ -0,0 +1,724 @@ +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 + * + * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\UserEventServiceClient}. + */ +class UserEventServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 00000000000..aa0ebfce391 --- /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', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCatalogItem' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCatalogItem' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCatalogItem' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCatalogItems' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCatalogItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCatalogItem' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'catalogItemPath' => 'projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}', + ], + ], + ], +]; 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 00000000000..a1513d07669 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php @@ -0,0 +1,134 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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 00000000000..deb13af32bd --- /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 00000000000..d5590b98519 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ + 'CreatePredictionApiKeyRegistration' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeletePredictionApiKeyRegistration' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListPredictionApiKeyRegistrations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPredictionApiKeyRegistrations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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 00000000000..a0b8022f9ac --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php @@ -0,0 +1,99 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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 00000000000..3368352e1f6 --- /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 00000000000..af6dc6eacd8 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php @@ -0,0 +1,51 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ + 'Predict' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\PredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'placement' => 'projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}', + ], + ], + ], +]; 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 00000000000..00812eb2348 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php @@ -0,0 +1,77 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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 00000000000..5f920c6228a --- /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 00000000000..99ff5ec8fa9 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php @@ -0,0 +1,113 @@ + [ + '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', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CollectUserEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\HttpBody', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListUserEvents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUserEvents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'WriteUserEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\UserEvent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'eventStore' => 'projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}', + ], + ], + ], +]; 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 00000000000..071753ea18d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php @@ -0,0 +1,123 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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 00000000000..3fab48e9798 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php @@ -0,0 +1,551 @@ +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([ + 'apiEndpoint' => '', + '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([ + 'apiEndpoint' => '', + '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/Client/CatalogServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/CatalogServiceClientTest.php new file mode 100644 index 00000000000..c1184f5ee1c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/CatalogServiceClientTest.php @@ -0,0 +1,634 @@ +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); + $request = (new CreateCatalogItemRequest()) + ->setParent($formattedParent) + ->setCatalogItem($catalogItem); + $response = $gapicClient->createCatalogItem($request); + $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); + $request = (new CreateCatalogItemRequest()) + ->setParent($formattedParent) + ->setCatalogItem($catalogItem); + try { + $gapicClient->createCatalogItem($request); + // 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]'); + $request = (new DeleteCatalogItemRequest()) + ->setName($formattedName); + $gapicClient->deleteCatalogItem($request); + $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]'); + $request = (new DeleteCatalogItemRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteCatalogItem($request); + // 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]'); + $request = (new GetCatalogItemRequest()) + ->setName($formattedName); + $response = $gapicClient->getCatalogItem($request); + $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]'); + $request = (new GetCatalogItemRequest()) + ->setName($formattedName); + try { + $gapicClient->getCatalogItem($request); + // 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([ + 'apiEndpoint' => '', + '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(); + $request = (new ImportCatalogItemsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importCatalogItems($request); + $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([ + 'apiEndpoint' => '', + '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(); + $request = (new ImportCatalogItemsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importCatalogItems($request); + $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]'); + $request = (new ListCatalogItemsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCatalogItems($request); + $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]'); + $request = (new ListCatalogItemsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCatalogItems($request); + // 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); + $request = (new UpdateCatalogItemRequest()) + ->setName($formattedName) + ->setCatalogItem($catalogItem); + $response = $gapicClient->updateCatalogItem($request); + $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); + $request = (new UpdateCatalogItemRequest()) + ->setName($formattedName) + ->setCatalogItem($catalogItem); + try { + $gapicClient->updateCatalogItem($request); + // 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 createCatalogItemAsyncTest() + { + $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); + $request = (new CreateCatalogItemRequest()) + ->setParent($formattedParent) + ->setCatalogItem($catalogItem); + $response = $gapicClient->createCatalogItemAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php new file mode 100644 index 00000000000..3b00fdd0e77 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php @@ -0,0 +1,302 @@ +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(); + $request = (new CreatePredictionApiKeyRegistrationRequest()) + ->setParent($formattedParent) + ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + $response = $gapicClient->createPredictionApiKeyRegistration($request); + $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(); + $request = (new CreatePredictionApiKeyRegistrationRequest()) + ->setParent($formattedParent) + ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + try { + $gapicClient->createPredictionApiKeyRegistration($request); + // 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]'); + $request = (new DeletePredictionApiKeyRegistrationRequest()) + ->setName($formattedName); + $gapicClient->deletePredictionApiKeyRegistration($request); + $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]'); + $request = (new DeletePredictionApiKeyRegistrationRequest()) + ->setName($formattedName); + try { + $gapicClient->deletePredictionApiKeyRegistration($request); + // 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]'); + $request = (new ListPredictionApiKeyRegistrationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listPredictionApiKeyRegistrations($request); + $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]'); + $request = (new ListPredictionApiKeyRegistrationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listPredictionApiKeyRegistrations($request); + // 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 createPredictionApiKeyRegistrationAsyncTest() + { + $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(); + $request = (new CreatePredictionApiKeyRegistrationRequest()) + ->setParent($formattedParent) + ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + $response = $gapicClient->createPredictionApiKeyRegistrationAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php new file mode 100644 index 00000000000..1b161b079c5 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php @@ -0,0 +1,210 @@ +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); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setUserEvent($userEvent); + $response = $gapicClient->predict($request); + $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); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setUserEvent($userEvent); + try { + $gapicClient->predict($request); + // 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 predictAsyncTest() + { + $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); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setUserEvent($userEvent); + $response = $gapicClient->predictAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php new file mode 100644 index 00000000000..f16194b5a66 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php @@ -0,0 +1,593 @@ +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'; + $request = (new CollectUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + $response = $gapicClient->collectUserEvent($request); + $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'; + $request = (new CollectUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + try { + $gapicClient->collectUserEvent($request); + // 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([ + 'apiEndpoint' => '', + '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(); + $request = (new ImportUserEventsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importUserEvents($request); + $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([ + 'apiEndpoint' => '', + '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(); + $request = (new ImportUserEventsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importUserEvents($request); + $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]'); + $request = (new ListUserEventsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listUserEvents($request); + $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]'); + $request = (new ListUserEventsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listUserEvents($request); + // 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([ + 'apiEndpoint' => '', + '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'; + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeUserEvents($request); + $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([ + 'apiEndpoint' => '', + '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'; + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeUserEvents($request); + $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); + $request = (new WriteUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + $response = $gapicClient->writeUserEvent($request); + $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); + $request = (new WriteUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + try { + $gapicClient->writeUserEvent($request); + // 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 collectUserEventAsyncTest() + { + $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'; + $request = (new CollectUserEventRequest()) + ->setParent($formattedParent) + ->setUserEvent($userEvent); + $response = $gapicClient->collectUserEventAsync($request)->wait(); + $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()); + } +} 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 00000000000..682ef8dd758 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php @@ -0,0 +1,252 @@ +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 00000000000..04411004a7f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php @@ -0,0 +1,152 @@ +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 00000000000..5c6e639841b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php @@ -0,0 +1,525 @@ +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([ + 'apiEndpoint' => '', + '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([ + 'apiEndpoint' => '', + '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([ + 'apiEndpoint' => '', + '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([ + 'apiEndpoint' => '', + '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()); + } +} diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php new file mode 100644 index 0000000000000000000000000000000000000000..96a11af63961e521d190fba4205f707987057967 GIT binary patch literal 3007 zcmb_eOK;mo5Uw76jbdA7A7+)J*{VS!1C0bbEl|jDQ<`EF0=A`!wA&N{6pC8OY-y4p zR|b?o$Nq{Q3iQ}Z5B({<_7~*TpU_#pEI(4%sddqExZk%kv-1t-@e}XZgHK75I@C89 z9gzNnuwzO*-({}p+N3`o4yjK}_r$Yo>Q@PAw8%kACrU%rKS5~Vj(wBX$;fp_Hm#Yq zJ08@0ihvX945(i_-K<$oV2zGhHDm>Fj1wAohDk}Yy}M7DF)*0XZH5G0nGFHt(O?d4jCGDKoNU+?{Msx%yJ#V z0WHU*l?@Vc^1b&x7bD*xiA!ys3`|5!|pa{VEUHFT)&N5>-7<3X$rZevJoH4 z>8v5CL_XH*mz>-o%pcR)(+Tk@8~e_7=r<>rrmOB136nev(-mJs{Vbp}{8gwlrp6dA z9#c`jIaEW}P4*T*-NFK3#))?|Hq8ISudO)S(qND#_bC=(B~1rU&I9;!4K}V_eZt*n zYc(v?>P(?lPd7^+$2?)7;*Hk^adx88Eq!$HeGsM~etYlYTb9HbZ7Bb}1PgHq3wI#T zbs%O)rm`fw3xz>kQ+O9*HZ+P*WQLEm)$`-~4a6mq!|m&^8f&T-jQecjQ4vB&1r|&f z^X4!yhlaw|dNqzW38@<0n(!s8p`4hOoaQgxEPs5_=dDOSu zfjAf9KD>lWic63HxCAIFbm)rn;r55g_N%U<8s|ylC>24%6Ie8HJ#zhtxPSyJTh}6} z$}xx&1oRXgW)pGs1_W9R;#Y>vY9tmAyd=DU61F7Qw2*&*X^cBwn3q6Y#Cs}iJ-$we z)wJ1#*bc>pOR*=FHevk@uY?a^<@||J9hHC1z+xJ(2=B>~t~6Vn=e@%Nt*yxFQ&njc z-w_reFSj(kn8BD9HAOz`sQU9_R#=5XTj@M)b@rtLSt;g(HCV=_)KsKhb&v1K3j(ZY zhng;_2Z?Qt<2uToni%HG-y&_2HgrQ%jud{x1veHTx7Yd(y#Scs#}CTkKKg*ZJyV;{ z@No1^MwBW`d&PYH*W7FAmmHMSxbbTg)wbbTK^4$Z|W!=tI}WFDKGRi`!v+ z;rb)Pv0f%wn0>sJ6Uu*Np?FEQyD%3jKP=Fdtw+~UL@Ii0R;VuFdsqoMdMEL)fDMw% z>zlVAOXdy5Vg97_1qk60=d3~jazD{Y+?tnR?$ofyG-}HA>{pp`6Xqhv-iI|*g05Vs zYb<9;*3}~=5||{*N?S+aWrbx}YN*=2s%iL`+x;g8_posPD~#PcaZ1~K3TbD4kfL@O zw{>3jBlq0Eg>t}|YeptsfBW3iZ`r)uQRLsVcbnnNRSjpZvo?gnI@)|K{gs8!W^iv1 z8`q8?--6(T&h4v9kp8!ng#B5epeAP@Z?2pEJf@1dj~=8$%;(VrI5RNvTDQzAhQ)Aa KG}ldG3h*y7XYoV; literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php new file mode 100644 index 00000000000..c295b549cb9 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php @@ -0,0 +1,45 @@ +internalAddGeneratedFile( + ' +� +5google/cloud/recommender/v1/insight_type_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"� +InsightTypeConfig +name ( ` +insight_type_generation_config ( 28.google.cloud.recommender.v1.InsightTypeGenerationConfig +etag ( / + update_time ( 2.google.protobuf.Timestamp + revision_id ( B�A�AT + annotations ( 2?.google.cloud.recommender.v1.InsightTypeConfig.AnnotationsEntry + display_name ( 2 +AnnotationsEntry +key (  +value ( :8:��A� +,recommender.googleapis.com/InsightTypeConfigJprojects/{project}/locations/{location}/insightTypes/{insight_type}/configTorganizations/{organization}/locations/{location}/insightTypes/{insight_type}/configYbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config"F +InsightTypeGenerationConfig\' +params ( 2.google.protobuf.StructB� +com.google.cloud.recommender.v1BInsightTypeConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php new file mode 100644 index 0000000000000000000000000000000000000000..f3d0e874402d694acf945e83290e6e7f04a24a64 GIT binary patch literal 5056 zcmcIoUsL1O6<>of<`|5*WLYoUX;g2Tg-I$GXEV*1?6yW0tWvbr zkz`tu;js^W?l;I&r(dRT?Mxr?0Wx{%H|V)ne=LL7U8e~z*8TJQopaB>d$^zfdU!R2 zr@|4nsjK_6D_q_P{uLF5uH!p~V+og|UXQwh;S7eRMO{%4>J8zv(H7*o(*7AjJ!j+^ zv?}x+r*F}+VL792*`){=P`gXr^7Y<$sQad4i<}(5)(6xZ>IM~#ng=J;*Sor}caAtu zM`Apk)|jVrzPArxSi0v4@igayuRy@R;poyb4Z-tq(hxo{JmxA9kJirs2M6Rj3H zr8+*)7(WdapQ%2=FhEmO=ZC7Oy5WBhVB5qv@b$s)-LdVPA?=(vHocjS;XeDtOEdIP zt=o+qa)@EP6Pu73^cnm|fM3oVzvM}P5P8IliHH}k_qKl;((zEoU@3P)!v?{>{gb=v z9=Be&`u^QjKQd9c;ZeB3M>~`U%nrdq>FX89Pi6;Mg*3~wVoFHutdLE}b;EE)Hy0Q9 z_dL&ngiXv z(aZs6xnEr3n5PkDn%zW&ZzV5bL+^GmdmYTL2%ixaQRX}04g zasiuI3?0K{g&WB|vw!7##XL9D=W{43Dgm}dvD8znf8;$_{gdNreb*TcHM3hJOyKrY zDBRn*4$GnBAizp>$j0U?!h6k@(r78|3+?PwZOW2zsL1ug1CoJ-=JP^||9(SbMc7S*Wq2TcXnG>vF6Bv|5d%~057h9z@>k*4ZP{`RUd?bW`n(-q zM%2amgn-0Sgo;=B#4T|zP0KRve$6nPkGi03zCVmio9+oJU_8-lR=SBoNVi8MrA?sXI_u8a? zEH3hVdlbQ=f-DBtRp}V=cfeJESO*V-no0jKf=?}4F+u5HX;_IzBo7&^d#ua`wf7;c zVFl&=lEw>cP<;!Kji$M_D=g24x_`y1>mexK#!4x#<>3O~o#B(6XRvgwTO%4) ztgT4(_~hqo_01V|e=!!fxEiA>AFQsj*l`3SO6)56i)B9Z!&_7L z0*dMgZ&uURu?kPJU{1a1Ylh}jg2pE`*KtbU@d{;`_lduNCD-)c1cf1A*^f*zHCbA8 z3WeB0d>idd-uhkGDVX^eLG-Tq=D~op~?K^Ie7WvA@GmjX+L@C6OLs;j5 zfFZ(eV^;jS+>Nsf_+)fqVL63OFANSX!9_V&d8SJDg9`ax!((qESdy$g&id(W)(P}D zV3E5GTkhD?N#Z^y{$EYwlpuNap!DYyWMi{pCneR|@=>F8x0A|3T570m^ztfXRarV? z-B#e_rrbJgv`%WLl8mj@2CU&{?MSX2D93D1nh?mVXKK5qoJMm?EI3;7u@X&Wco~YF zS^8!H9!=ieA#9-C+IJHWAXAgt%DIg0$icF7TvJZ4-_5WLRL?Ny zAdK3Qp#oFP%lk9BE*d`|* zUZ^{~+>g6iHu`!YEwyCn?+Z_k_=}4uu@@IHb_>4sobP>G`^N%&n81Z<-EYFFOAf+3 z#ZEQ+n!9%-zx%-(Z1S7`w|^$b$$l75mmJQ0#LEmC$9Fz?7QaD!96b6Y-iTP}o5qy) OA-*$s%DIJGfd2wdi-vmu literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php new file mode 100644 index 00000000000..ca519f51d7a --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php @@ -0,0 +1,45 @@ +internalAddGeneratedFile( + ' +� +4google/cloud/recommender/v1/recommender_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"� +RecommenderConfig +name ( _ +recommender_generation_config ( 28.google.cloud.recommender.v1.RecommenderGenerationConfig +etag ( / + update_time ( 2.google.protobuf.Timestamp + revision_id ( B�A�AT + annotations ( 2?.google.cloud.recommender.v1.RecommenderConfig.AnnotationsEntry + display_name ( 2 +AnnotationsEntry +key (  +value ( :8:��A� +,recommender.googleapis.com/RecommenderConfigIprojects/{project}/locations/{location}/recommenders/{recommender}/configSorganizations/{organization}/locations/{location}/recommenders/{recommender}/configXbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config"F +RecommenderGenerationConfig\' +params ( 2.google.protobuf.StructB� +com.google.cloud.recommender.v1BRecommenderConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php new file mode 100644 index 00000000000..5b48a3503c1 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php @@ -0,0 +1,127 @@ +internalAddGeneratedFile( + ' +�F +5google/cloud/recommender/v1/recommender_service.protogoogle.cloud.recommender.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto)google/cloud/recommender/v1/insight.proto5google/cloud/recommender/v1/insight_type_config.proto0google/cloud/recommender/v1/recommendation.proto4google/cloud/recommender/v1/recommender_config.proto google/protobuf/field_mask.proto"� +ListInsightsRequest> +parent ( B.�A�A( +&recommender.googleapis.com/InsightType + page_size (B�A + +page_token ( B�A +filter ( B�A"g +ListInsightsResponse6 +insights ( 2$.google.cloud.recommender.v1.Insight +next_page_token ( "M +GetInsightRequest8 +name ( B*�A�A$ +"recommender.googleapis.com/Insight"� +MarkInsightAcceptedRequest8 +name ( B*�A�A$ +"recommender.googleapis.com/Insightg +state_metadata ( 2J.google.cloud.recommender.v1.MarkInsightAcceptedRequest.StateMetadataEntryB�A +etag ( B�A4 +StateMetadataEntry +key (  +value ( :8"� +ListRecommendationsRequest> +parent ( B.�A�A( +&recommender.googleapis.com/Recommender + page_size (B�A + +page_token ( B�A +filter ( "| +ListRecommendationsResponseD +recommendations ( 2+.google.cloud.recommender.v1.Recommendation +next_page_token ( "[ +GetRecommendationRequest? +name ( B1�A�A+ +)recommender.googleapis.com/Recommendation"s +"MarkRecommendationDismissedRequest? +name ( B1�A�A+ +)recommender.googleapis.com/Recommendation +etag ( "� + MarkRecommendationClaimedRequest? +name ( B1�A�A+ +)recommender.googleapis.com/Recommendationh +state_metadata ( 2P.google.cloud.recommender.v1.MarkRecommendationClaimedRequest.StateMetadataEntry +etag ( B�A4 +StateMetadataEntry +key (  +value ( :8"� +"MarkRecommendationSucceededRequest? +name ( B1�A�A+ +)recommender.googleapis.com/Recommendationj +state_metadata ( 2R.google.cloud.recommender.v1.MarkRecommendationSucceededRequest.StateMetadataEntry +etag ( B�A4 +StateMetadataEntry +key (  +value ( :8"� +MarkRecommendationFailedRequest? +name ( B1�A�A+ +)recommender.googleapis.com/Recommendationg +state_metadata ( 2O.google.cloud.recommender.v1.MarkRecommendationFailedRequest.StateMetadataEntry +etag ( B�A4 +StateMetadataEntry +key (  +value ( :8"a +GetRecommenderConfigRequestB +name ( B4�A�A. +,recommender.googleapis.com/RecommenderConfig"� +UpdateRecommenderConfigRequestO +recommender_config ( 2..google.cloud.recommender.v1.RecommenderConfigB�A/ + update_mask ( 2.google.protobuf.FieldMask + validate_only ("a +GetInsightTypeConfigRequestB +name ( B4�A�A. +,recommender.googleapis.com/InsightTypeConfig"� +UpdateInsightTypeConfigRequestP +insight_type_config ( 2..google.cloud.recommender.v1.InsightTypeConfigB�A/ + update_mask ( 2.google.protobuf.FieldMask + validate_only (2�. + Recommender� + ListInsights0.google.cloud.recommender.v1.ListInsightsRequest1.google.cloud.recommender.v1.ListInsightsResponse"��Aparent����;/v1/{parent=projects/*/locations/*/insightTypes/*}/insightsZDB/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insightsZ<:/v1/{parent=folders/*/locations/*/insightTypes/*}/insightsZB@/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights� + +GetInsight..google.cloud.recommender.v1.GetInsightRequest$.google.cloud.recommender.v1.Insight"��Aname����;/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}ZDB/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}Z<:/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}ZB@/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}� +MarkInsightAccepted7.google.cloud.recommender.v1.MarkInsightAcceptedRequest$.google.cloud.recommender.v1.Insight"��Aname,state_metadata,etag����"H/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZT"O/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZL"G/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZR"M/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted:*� +ListRecommendations7.google.cloud.recommender.v1.ListRecommendationsRequest8.google.cloud.recommender.v1.ListRecommendationsResponse"��Aparent�A parent,filter����B/v1/{parent=projects/*/locations/*/recommenders/*}/recommendationsZKI/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendationsZCA/v1/{parent=folders/*/locations/*/recommenders/*}/recommendationsZIG/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations� +GetRecommendation5.google.cloud.recommender.v1.GetRecommendationRequest+.google.cloud.recommender.v1.Recommendation"��Aname����B/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}ZKI/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}ZCA/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}ZIG/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}� +MarkRecommendationDismissed?.google.cloud.recommender.v1.MarkRecommendationDismissedRequest+.google.cloud.recommender.v1.Recommendation"�����"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*� +MarkRecommendationClaimed=.google.cloud.recommender.v1.MarkRecommendationClaimedRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"N/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZZ"U/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZR"M/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZX"S/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*� +MarkRecommendationSucceeded?.google.cloud.recommender.v1.MarkRecommendationSucceededRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*� +MarkRecommendationFailed<.google.cloud.recommender.v1.MarkRecommendationFailedRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"M/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZY"T/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZQ"L/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZW"R/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed:*� +GetRecommenderConfig8.google.cloud.recommender.v1.GetRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"��Aname����7/v1/{name=projects/*/locations/*/recommenders/*/config}Z>/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}� +UpdateRecommenderConfig;.google.cloud.recommender.v1.UpdateRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"��Arecommender_config,update_mask����2J/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}:recommender_configZe2O/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}:recommender_configZg2Q/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}:recommender_config� +GetInsightTypeConfig8.google.cloud.recommender.v1.GetInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"��Aname����7/v1/{name=projects/*/locations/*/insightTypes/*/config}Z>/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}� +UpdateInsightTypeConfig;.google.cloud.recommender.v1.UpdateInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"��Ainsight_type_config,update_mask����2K/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}:insight_type_configZg2P/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}:insight_type_configZi2R/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}:insight_type_configN�Arecommender.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.recommender.v1BRecommenderProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php new file mode 100644 index 00000000000..e981e6aba9e --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php @@ -0,0 +1,181 @@ +google.cloud.recommender.v1.CostProjection + */ +class CostProjection extends \Google\Protobuf\Internal\Message +{ + /** + * An approximate projection on amount saved or amount incurred. Negative cost + * units indicate cost savings and positive cost units indicate increase. + * See google.type.Money documentation for positive/negative units. + * A user's permissions may affect whether the cost is computed using list + * prices or custom contract prices. + * + * Generated from protobuf field .google.type.Money cost = 1; + */ + protected $cost = null; + /** + * Duration for which this cost applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + */ + protected $cost_in_local_currency = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\Money $cost + * An approximate projection on amount saved or amount incurred. Negative cost + * units indicate cost savings and positive cost units indicate increase. + * See google.type.Money documentation for positive/negative units. + * A user's permissions may affect whether the cost is computed using list + * prices or custom contract prices. + * @type \Google\Protobuf\Duration $duration + * Duration for which this cost applies. + * @type \Google\Type\Money $cost_in_local_currency + * The approximate cost savings in the billing account's local currency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * An approximate projection on amount saved or amount incurred. Negative cost + * units indicate cost savings and positive cost units indicate increase. + * See google.type.Money documentation for positive/negative units. + * A user's permissions may affect whether the cost is computed using list + * prices or custom contract prices. + * + * Generated from protobuf field .google.type.Money cost = 1; + * @return \Google\Type\Money|null + */ + public function getCost() + { + return $this->cost; + } + + public function hasCost() + { + return isset($this->cost); + } + + public function clearCost() + { + unset($this->cost); + } + + /** + * An approximate projection on amount saved or amount incurred. Negative cost + * units indicate cost savings and positive cost units indicate increase. + * See google.type.Money documentation for positive/negative units. + * A user's permissions may affect whether the cost is computed using list + * prices or custom contract prices. + * + * Generated from protobuf field .google.type.Money cost = 1; + * @param \Google\Type\Money $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->cost = $var; + + return $this; + } + + /** + * Duration for which this cost applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration for which this cost applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + * @return \Google\Type\Money|null + */ + public function getCostInLocalCurrency() + { + return $this->cost_in_local_currency; + } + + public function hasCostInLocalCurrency() + { + return isset($this->cost_in_local_currency); + } + + public function clearCostInLocalCurrency() + { + unset($this->cost_in_local_currency); + } + + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + * @param \Google\Type\Money $var + * @return $this + */ + public function setCostInLocalCurrency($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->cost_in_local_currency = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php new file mode 100644 index 00000000000..4eefd045c8d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php @@ -0,0 +1,81 @@ +google.cloud.recommender.v1.GetInsightRequest + */ +class GetInsightRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the insight. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the insight. Please see + * {@see RecommenderClient::insightName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\GetInsightRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the insight. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the insight. + * + * 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. Name of the insight. + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php new file mode 100644 index 00000000000..cf71aa698a6 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php @@ -0,0 +1,111 @@ +google.cloud.recommender.v1.GetInsightTypeConfigRequest + */ +class GetInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the InsightTypeConfig to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the InsightTypeConfig to get. + * + * Acceptable formats: + * + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * Please see {@see RecommenderClient::insightTypeConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\GetInsightTypeConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the InsightTypeConfig to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the InsightTypeConfig to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * 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. Name of the InsightTypeConfig to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php new file mode 100644 index 00000000000..b15ce7896af --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php @@ -0,0 +1,81 @@ +google.cloud.recommender.v1.GetRecommendationRequest + */ +class GetRecommendationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the recommendation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the recommendation. Please see + * {@see RecommenderClient::recommendationName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\GetRecommendationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the recommendation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the recommendation. + * + * 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. Name of the recommendation. + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php new file mode 100644 index 00000000000..ff82145c37d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php @@ -0,0 +1,111 @@ +google.cloud.recommender.v1.GetRecommenderConfigRequest + */ +class GetRecommenderConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the Recommendation Config to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the Recommendation Config to get. + * + * Acceptable formats: + * + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * Please see {@see RecommenderClient::recommenderConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\GetRecommenderConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the Recommendation Config to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the Recommendation Config to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * 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. Name of the Recommendation Config to get. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php new file mode 100644 index 00000000000..1ae4e114791 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php @@ -0,0 +1,208 @@ +google.cloud.recommender.v1.Impact + */ +class Impact extends \Google\Protobuf\Internal\Message +{ + /** + * Category that is being targeted. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; + */ + protected $category = 0; + protected $projection; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $category + * Category that is being targeted. + * @type \Google\Cloud\Recommender\V1\CostProjection $cost_projection + * Use with CategoryType.COST + * @type \Google\Cloud\Recommender\V1\SecurityProjection $security_projection + * Use with CategoryType.SECURITY + * @type \Google\Cloud\Recommender\V1\SustainabilityProjection $sustainability_projection + * Use with CategoryType.SUSTAINABILITY + * @type \Google\Cloud\Recommender\V1\ReliabilityProjection $reliability_projection + * Use with CategoryType.RELIABILITY + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Category that is being targeted. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * Category that is being targeted. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Impact\Category::class); + $this->category = $var; + + return $this; + } + + /** + * Use with CategoryType.COST + * + * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; + * @return \Google\Cloud\Recommender\V1\CostProjection|null + */ + public function getCostProjection() + { + return $this->readOneof(100); + } + + public function hasCostProjection() + { + return $this->hasOneof(100); + } + + /** + * Use with CategoryType.COST + * + * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; + * @param \Google\Cloud\Recommender\V1\CostProjection $var + * @return $this + */ + public function setCostProjection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\CostProjection::class); + $this->writeOneof(100, $var); + + return $this; + } + + /** + * Use with CategoryType.SECURITY + * + * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; + * @return \Google\Cloud\Recommender\V1\SecurityProjection|null + */ + public function getSecurityProjection() + { + return $this->readOneof(101); + } + + public function hasSecurityProjection() + { + return $this->hasOneof(101); + } + + /** + * Use with CategoryType.SECURITY + * + * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; + * @param \Google\Cloud\Recommender\V1\SecurityProjection $var + * @return $this + */ + public function setSecurityProjection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SecurityProjection::class); + $this->writeOneof(101, $var); + + return $this; + } + + /** + * Use with CategoryType.SUSTAINABILITY + * + * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; + * @return \Google\Cloud\Recommender\V1\SustainabilityProjection|null + */ + public function getSustainabilityProjection() + { + return $this->readOneof(102); + } + + public function hasSustainabilityProjection() + { + return $this->hasOneof(102); + } + + /** + * Use with CategoryType.SUSTAINABILITY + * + * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; + * @param \Google\Cloud\Recommender\V1\SustainabilityProjection $var + * @return $this + */ + public function setSustainabilityProjection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SustainabilityProjection::class); + $this->writeOneof(102, $var); + + return $this; + } + + /** + * Use with CategoryType.RELIABILITY + * + * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; + * @return \Google\Cloud\Recommender\V1\ReliabilityProjection|null + */ + public function getReliabilityProjection() + { + return $this->readOneof(103); + } + + public function hasReliabilityProjection() + { + return $this->hasOneof(103); + } + + /** + * Use with CategoryType.RELIABILITY + * + * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; + * @param \Google\Cloud\Recommender\V1\ReliabilityProjection $var + * @return $this + */ + public function setReliabilityProjection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ReliabilityProjection::class); + $this->writeOneof(103, $var); + + return $this; + } + + /** + * @return string + */ + public function getProjection() + { + return $this->whichOneof("projection"); + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php new file mode 100644 index 00000000000..3edc36ada2d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php @@ -0,0 +1,92 @@ +google.cloud.recommender.v1.Impact.Category + */ +class Category +{ + /** + * Default unspecified category. Don't use directly. + * + * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; + */ + const CATEGORY_UNSPECIFIED = 0; + /** + * Indicates a potential increase or decrease in cost. + * + * Generated from protobuf enum COST = 1; + */ + const COST = 1; + /** + * Indicates a potential increase or decrease in security. + * + * Generated from protobuf enum SECURITY = 2; + */ + const SECURITY = 2; + /** + * Indicates a potential increase or decrease in performance. + * + * Generated from protobuf enum PERFORMANCE = 3; + */ + const PERFORMANCE = 3; + /** + * Indicates a potential increase or decrease in manageability. + * + * Generated from protobuf enum MANAGEABILITY = 4; + */ + const MANAGEABILITY = 4; + /** + * Indicates a potential increase or decrease in sustainability. + * + * Generated from protobuf enum SUSTAINABILITY = 5; + */ + const SUSTAINABILITY = 5; + /** + * Indicates a potential increase or decrease in reliability. + * + * Generated from protobuf enum RELIABILITY = 6; + */ + const RELIABILITY = 6; + + private static $valueToName = [ + self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', + self::COST => 'COST', + self::SECURITY => 'SECURITY', + self::PERFORMANCE => 'PERFORMANCE', + self::MANAGEABILITY => 'MANAGEABILITY', + self::SUSTAINABILITY => 'SUSTAINABILITY', + self::RELIABILITY => 'RELIABILITY', + ]; + + 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(Category::class, \Google\Cloud\Recommender\V1\Impact_Category::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php new file mode 100644 index 00000000000..544481b24ea --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php @@ -0,0 +1,502 @@ +google.cloud.recommender.v1.Insight + */ +class Insight extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the insight. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Fully qualified resource names that this insight is targeting. + * + * Generated from protobuf field repeated string target_resources = 9; + */ + private $target_resources; + /** + * Insight subtype. Insight content schema will be stable for a given subtype. + * + * Generated from protobuf field string insight_subtype = 10; + */ + protected $insight_subtype = ''; + /** + * A struct of custom fields to explain the insight. + * Example: "grantedPermissionsCount": "1000" + * + * Generated from protobuf field .google.protobuf.Struct content = 3; + */ + protected $content = null; + /** + * Timestamp of the latest data used to generate the insight. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + */ + protected $last_refresh_time = null; + /** + * Observation period that led to the insight. The source data used to + * generate the insight ends at last_refresh_time and begins at + * (last_refresh_time - observation_period). + * + * Generated from protobuf field .google.protobuf.Duration observation_period = 5; + */ + protected $observation_period = null; + /** + * Information state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; + */ + protected $state_info = null; + /** + * Category being targeted by the insight. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; + */ + protected $category = 0; + /** + * Insight's severity. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; + */ + protected $severity = 0; + /** + * Fingerprint of the Insight. Provides optimistic locking when updating + * states. + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Recommendations derived from this insight. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; + */ + private $associated_recommendations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the insight. + * @type string $description + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_resources + * Fully qualified resource names that this insight is targeting. + * @type string $insight_subtype + * Insight subtype. Insight content schema will be stable for a given subtype. + * @type \Google\Protobuf\Struct $content + * A struct of custom fields to explain the insight. + * Example: "grantedPermissionsCount": "1000" + * @type \Google\Protobuf\Timestamp $last_refresh_time + * Timestamp of the latest data used to generate the insight. + * @type \Google\Protobuf\Duration $observation_period + * Observation period that led to the insight. The source data used to + * generate the insight ends at last_refresh_time and begins at + * (last_refresh_time - observation_period). + * @type \Google\Cloud\Recommender\V1\InsightStateInfo $state_info + * Information state and metadata. + * @type int $category + * Category being targeted by the insight. + * @type int $severity + * Insight's severity. + * @type string $etag + * Fingerprint of the Insight. Provides optimistic locking when updating + * states. + * @type array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $associated_recommendations + * Recommendations derived from this insight. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); + parent::__construct($data); + } + + /** + * Name of the insight. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the insight. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fully qualified resource names that this insight is targeting. + * + * Generated from protobuf field repeated string target_resources = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetResources() + { + return $this->target_resources; + } + + /** + * Fully qualified resource names that this insight is targeting. + * + * Generated from protobuf field repeated string target_resources = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_resources = $arr; + + return $this; + } + + /** + * Insight subtype. Insight content schema will be stable for a given subtype. + * + * Generated from protobuf field string insight_subtype = 10; + * @return string + */ + public function getInsightSubtype() + { + return $this->insight_subtype; + } + + /** + * Insight subtype. Insight content schema will be stable for a given subtype. + * + * Generated from protobuf field string insight_subtype = 10; + * @param string $var + * @return $this + */ + public function setInsightSubtype($var) + { + GPBUtil::checkString($var, True); + $this->insight_subtype = $var; + + return $this; + } + + /** + * A struct of custom fields to explain the insight. + * Example: "grantedPermissionsCount": "1000" + * + * Generated from protobuf field .google.protobuf.Struct content = 3; + * @return \Google\Protobuf\Struct|null + */ + public function getContent() + { + return $this->content; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * A struct of custom fields to explain the insight. + * Example: "grantedPermissionsCount": "1000" + * + * Generated from protobuf field .google.protobuf.Struct content = 3; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->content = $var; + + return $this; + } + + /** + * Timestamp of the latest data used to generate the insight. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastRefreshTime() + { + return $this->last_refresh_time; + } + + public function hasLastRefreshTime() + { + return isset($this->last_refresh_time); + } + + public function clearLastRefreshTime() + { + unset($this->last_refresh_time); + } + + /** + * Timestamp of the latest data used to generate the insight. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastRefreshTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_refresh_time = $var; + + return $this; + } + + /** + * Observation period that led to the insight. The source data used to + * generate the insight ends at last_refresh_time and begins at + * (last_refresh_time - observation_period). + * + * Generated from protobuf field .google.protobuf.Duration observation_period = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getObservationPeriod() + { + return $this->observation_period; + } + + public function hasObservationPeriod() + { + return isset($this->observation_period); + } + + public function clearObservationPeriod() + { + unset($this->observation_period); + } + + /** + * Observation period that led to the insight. The source data used to + * generate the insight ends at last_refresh_time and begins at + * (last_refresh_time - observation_period). + * + * Generated from protobuf field .google.protobuf.Duration observation_period = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setObservationPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->observation_period = $var; + + return $this; + } + + /** + * Information state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; + * @return \Google\Cloud\Recommender\V1\InsightStateInfo|null + */ + public function getStateInfo() + { + return $this->state_info; + } + + public function hasStateInfo() + { + return isset($this->state_info); + } + + public function clearStateInfo() + { + unset($this->state_info); + } + + /** + * Information state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; + * @param \Google\Cloud\Recommender\V1\InsightStateInfo $var + * @return $this + */ + public function setStateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightStateInfo::class); + $this->state_info = $var; + + return $this; + } + + /** + * Category being targeted by the insight. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * Category being targeted by the insight. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Category::class); + $this->category = $var; + + return $this; + } + + /** + * Insight's severity. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Insight's severity. + * + * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Fingerprint of the Insight. Provides optimistic locking when updating + * states. + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Fingerprint of the Insight. Provides optimistic locking when updating + * states. + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Recommendations derived from this insight. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociatedRecommendations() + { + return $this->associated_recommendations; + } + + /** + * Recommendations derived from this insight. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; + * @param array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociatedRecommendations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight\RecommendationReference::class); + $this->associated_recommendations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php new file mode 100644 index 00000000000..2bd1978a801 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php @@ -0,0 +1,92 @@ +google.cloud.recommender.v1.Insight.Category + */ +class Category +{ + /** + * Unspecified category. + * + * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; + */ + const CATEGORY_UNSPECIFIED = 0; + /** + * The insight is related to cost. + * + * Generated from protobuf enum COST = 1; + */ + const COST = 1; + /** + * The insight is related to security. + * + * Generated from protobuf enum SECURITY = 2; + */ + const SECURITY = 2; + /** + * The insight is related to performance. + * + * Generated from protobuf enum PERFORMANCE = 3; + */ + const PERFORMANCE = 3; + /** + * This insight is related to manageability. + * + * Generated from protobuf enum MANAGEABILITY = 4; + */ + const MANAGEABILITY = 4; + /** + * The insight is related to sustainability. + * + * Generated from protobuf enum SUSTAINABILITY = 5; + */ + const SUSTAINABILITY = 5; + /** + * This insight is related to reliability. + * + * Generated from protobuf enum RELIABILITY = 6; + */ + const RELIABILITY = 6; + + private static $valueToName = [ + self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', + self::COST => 'COST', + self::SECURITY => 'SECURITY', + self::PERFORMANCE => 'PERFORMANCE', + self::MANAGEABILITY => 'MANAGEABILITY', + self::SUSTAINABILITY => 'SUSTAINABILITY', + self::RELIABILITY => 'RELIABILITY', + ]; + + 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(Category::class, \Google\Cloud\Recommender\V1\Insight_Category::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php new file mode 100644 index 00000000000..2b8fdf78c01 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php @@ -0,0 +1,74 @@ +google.cloud.recommender.v1.Insight.RecommendationReference + */ +class RecommendationReference extends \Google\Protobuf\Internal\Message +{ + /** + * Recommendation resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + * + * Generated from protobuf field string recommendation = 1; + */ + protected $recommendation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $recommendation + * Recommendation resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); + parent::__construct($data); + } + + /** + * Recommendation resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + * + * Generated from protobuf field string recommendation = 1; + * @return string + */ + public function getRecommendation() + { + return $this->recommendation; + } + + /** + * Recommendation resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + * + * Generated from protobuf field string recommendation = 1; + * @param string $var + * @return $this + */ + public function setRecommendation($var) + { + GPBUtil::checkString($var, True); + $this->recommendation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RecommendationReference::class, \Google\Cloud\Recommender\V1\Insight_RecommendationReference::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php new file mode 100644 index 00000000000..4370e3d0118 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php @@ -0,0 +1,78 @@ +google.cloud.recommender.v1.Insight.Severity + */ +class Severity +{ + /** + * Insight has unspecified severity. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * Insight has low severity. + * + * Generated from protobuf enum LOW = 1; + */ + const LOW = 1; + /** + * Insight has medium severity. + * + * Generated from protobuf enum MEDIUM = 2; + */ + const MEDIUM = 2; + /** + * Insight has high severity. + * + * Generated from protobuf enum HIGH = 3; + */ + const HIGH = 3; + /** + * Insight has critical severity. + * + * Generated from protobuf enum CRITICAL = 4; + */ + const CRITICAL = 4; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::LOW => 'LOW', + self::MEDIUM => 'MEDIUM', + self::HIGH => 'HIGH', + self::CRITICAL => 'CRITICAL', + ]; + + 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(Severity::class, \Google\Cloud\Recommender\V1\Insight_Severity::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php new file mode 100644 index 00000000000..e34f0b84d94 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php @@ -0,0 +1,101 @@ +google.cloud.recommender.v1.InsightStateInfo + */ +class InsightStateInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Insight state. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; + */ + protected $state = 0; + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + */ + private $state_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Insight state. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * A map of metadata for the state, provided by user or automations systems. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); + parent::__construct($data); + } + + /** + * Insight state. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Insight state. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\InsightStateInfo\State::class); + $this->state = $var; + + return $this; + } + + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php new file mode 100644 index 00000000000..648ce14b459 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php @@ -0,0 +1,77 @@ +google.cloud.recommender.v1.InsightStateInfo.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Insight is active. Content for ACTIVE insights can be updated by Google. + * ACTIVE insights can be marked DISMISSED OR ACCEPTED. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Some action has been taken based on this insight. Insights become + * accepted when a recommendation derived from the insight has been marked + * CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked + * ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED + * insights can only be marked ACCEPTED (which may update state metadata). + * + * Generated from protobuf enum ACCEPTED = 2; + */ + const ACCEPTED = 2; + /** + * Insight is dismissed. Content for DISMISSED insights can be updated by + * Google. DISMISSED insights can be marked as ACTIVE. + * + * Generated from protobuf enum DISMISSED = 3; + */ + const DISMISSED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::ACCEPTED => 'ACCEPTED', + self::DISMISSED => 'DISMISSED', + ]; + + 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(State::class, \Google\Cloud\Recommender\V1\InsightStateInfo_State::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php new file mode 100644 index 00000000000..dc2cf99dabc --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php @@ -0,0 +1,347 @@ +google.cloud.recommender.v1.InsightTypeConfig + */ +class InsightTypeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Name of insight type config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * InsightTypeGenerationConfig which configures the generation of + * insights for this insight type. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; + */ + protected $insight_type_generation_config = null; + /** + * Fingerprint of the InsightTypeConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + */ + private $annotations; + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of insight type config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config + * @type \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $insight_type_generation_config + * InsightTypeGenerationConfig which configures the generation of + * insights for this insight type. + * @type string $etag + * Fingerprint of the InsightTypeConfig. Provides optimistic locking when + * updating. + * @type \Google\Protobuf\Timestamp $update_time + * Last time when the config was updated. + * @type string $revision_id + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * @type string $display_name + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Name of insight type config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of insight type config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * InsightTypeGenerationConfig which configures the generation of + * insights for this insight type. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; + * @return \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig|null + */ + public function getInsightTypeGenerationConfig() + { + return $this->insight_type_generation_config; + } + + public function hasInsightTypeGenerationConfig() + { + return isset($this->insight_type_generation_config); + } + + public function clearInsightTypeGenerationConfig() + { + unset($this->insight_type_generation_config); + } + + /** + * InsightTypeGenerationConfig which configures the generation of + * insights for this insight type. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; + * @param \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $var + * @return $this + */ + public function setInsightTypeGenerationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig::class); + $this->insight_type_generation_config = $var; + + return $this; + } + + /** + * Fingerprint of the InsightTypeConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Fingerprint of the InsightTypeConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @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); + } + + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php new file mode 100644 index 00000000000..93d2117a35c --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php @@ -0,0 +1,83 @@ +google.cloud.recommender.v1.InsightTypeGenerationConfig + */ +class InsightTypeGenerationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Parameters for this InsightTypeGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + */ + protected $params = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $params + * Parameters for this InsightTypeGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Parameters for this InsightTypeGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + * @return \Google\Protobuf\Struct|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Parameters for this InsightTypeGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php new file mode 100644 index 00000000000..d61b254dc69 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php @@ -0,0 +1,319 @@ +google.cloud.recommender.v1.ListInsightsRequest + */ +class ListInsightsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: + * * `stateInfo.state` + * * `insightSubtype` + * * `severity` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `insightSubtype = PERMISSIONS_USAGE` + * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The container resource on which to execute the request. + * Acceptable formats: + * + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * + * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types. Please see + * {@see RecommenderClient::insightTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\ListInsightsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * @type string $page_token + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * @type string $filter + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: + * * `stateInfo.state` + * * `insightSubtype` + * * `severity` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `insightSubtype = PERMISSIONS_USAGE` + * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types. + * + * 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 container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types. + * + * 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. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * 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. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * 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. Filter expression to restrict the insights returned. Supported + * filter fields: + * * `stateInfo.state` + * * `insightSubtype` + * * `severity` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `insightSubtype = PERMISSIONS_USAGE` + * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: + * * `stateInfo.state` + * * `insightSubtype` + * * `severity` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `insightSubtype = PERMISSIONS_USAGE` + * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php new file mode 100644 index 00000000000..559624b870f --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recommender.v1.ListInsightsResponse + */ +class ListInsightsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The set of insights for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; + */ + private $insights; + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * 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\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $insights + * The set of insights for the `parent` resource. + * @type string $next_page_token + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * The set of insights for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInsights() + { + return $this->insights; + } + + /** + * The set of insights for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; + * @param array<\Google\Cloud\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInsights($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight::class); + $this->insights = $arr; + + return $this; + } + + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php new file mode 100644 index 00000000000..4d1306e50f4 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php @@ -0,0 +1,378 @@ +google.cloud.recommender.v1.ListRecommendationsRequest + */ +class ListRecommendationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Filter expression to restrict the recommendations returned. Supported + * filter fields: + * * `state_info.state` + * * `recommenderSubtype` + * * `priority` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The container resource on which to execute the request. + * Acceptable formats: + * + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. Please see + * {@see RecommenderClient::recommenderName()} for help formatting this field. + * + * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * @param string $parent Required. The container resource on which to execute the request. + * Acceptable formats: + * + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. Please see + * {@see RecommenderClient::recommenderName()} for help formatting this field. + * @param string $filter Filter expression to restrict the recommendations returned. Supported + * filter fields: + * + * * `state_info.state` + * + * * `recommenderSubtype` + * + * * `priority` + * + * * `targetResources` + * + * Examples: + * + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * + * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + * + * * `priority = P1 OR priority = P2` + * + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * + * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * + * The max allowed filter length is 500 characters. + * + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest + * + * @experimental + */ + public static function buildFromParentFilter(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * @type string $page_token + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * @type string $filter + * Filter expression to restrict the recommendations returned. Supported + * filter fields: + * * `state_info.state` + * * `recommenderSubtype` + * * `priority` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * + * 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 container resource on which to execute the request. + * Acceptable formats: + * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * + * 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. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. If not specified, the server will + * determine the number of results to return. + * + * 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. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters must be identical to those in the previous call. + * + * 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; + } + + /** + * Filter expression to restrict the recommendations returned. Supported + * filter fields: + * * `state_info.state` + * * `recommenderSubtype` + * * `priority` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter expression to restrict the recommendations returned. Supported + * filter fields: + * * `state_info.state` + * * `recommenderSubtype` + * * `priority` + * * `targetResources` + * Examples: + * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. + * (These expressions are based on the filter language described at + * https://google.aip.dev/160) + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php new file mode 100644 index 00000000000..e1f49c49e2b --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recommender.v1.ListRecommendationsResponse + */ +class ListRecommendationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The set of recommendations for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; + */ + private $recommendations; + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * 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\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $recommendations + * The set of recommendations for the `parent` resource. + * @type string $next_page_token + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * The set of recommendations for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecommendations() + { + return $this->recommendations; + } + + /** + * The set of recommendations for the `parent` resource. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; + * @param array<\Google\Cloud\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecommendations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation::class); + $this->recommendations = $arr; + + return $this; + } + + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be used to request the next page of results. This field is + * empty if there are no additional results. + * + * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php new file mode 100644 index 00000000000..44812d4b120 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php @@ -0,0 +1,158 @@ +google.cloud.recommender.v1.MarkInsightAcceptedRequest + */ +class MarkInsightAcceptedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the insight. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. State properties user wish to include with this state. Full + * replace of the current state_metadata. + * + * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $state_metadata; + /** + * Required. Fingerprint of the Insight. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the insight. Please see + * {@see RecommenderClient::insightName()} for help formatting this field. + * @param array $stateMetadata Optional. State properties user wish to include with this state. Full + * replace of the current state_metadata. + * @param string $etag Required. Fingerprint of the Insight. Provides optimistic locking. + * + * @return \Google\Cloud\Recommender\V1\MarkInsightAcceptedRequest + * + * @experimental + */ + public static function build(string $name, array $stateMetadata, string $etag): self + { + return (new self()) + ->setName($name) + ->setStateMetadata($stateMetadata) + ->setEtag($etag); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the insight. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * Optional. State properties user wish to include with this state. Full + * replace of the current state_metadata. + * @type string $etag + * Required. Fingerprint of the Insight. Provides optimistic locking. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the insight. + * + * 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. Name of the insight. + * + * 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; + } + + /** + * Optional. State properties user wish to include with this state. Full + * replace of the current state_metadata. + * + * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * Optional. State properties user wish to include with this state. Full + * replace of the current state_metadata. + * + * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + + /** + * Required. Fingerprint of the Insight. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Required. Fingerprint of the Insight. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php new file mode 100644 index 00000000000..a95547ef0f1 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php @@ -0,0 +1,168 @@ +google.cloud.recommender.v1.MarkRecommendationClaimedRequest + */ +class MarkRecommendationClaimedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the recommendation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + */ + private $state_metadata; + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the recommendation. Please see + * {@see RecommenderClient::recommendationName()} for help formatting this field. + * @param array $stateMetadata State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * @return \Google\Cloud\Recommender\V1\MarkRecommendationClaimedRequest + * + * @experimental + */ + public static function build(string $name, array $stateMetadata, string $etag): self + { + return (new self()) + ->setName($name) + ->setStateMetadata($stateMetadata) + ->setEtag($etag); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the recommendation. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @type string $etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the recommendation. + * + * 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. Name of the recommendation. + * + * 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; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php new file mode 100644 index 00000000000..41cc6032bab --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php @@ -0,0 +1,101 @@ +google.cloud.recommender.v1.MarkRecommendationDismissedRequest + */ +class MarkRecommendationDismissedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the recommendation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 2; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the recommendation. + * @type string $etag + * Fingerprint of the Recommendation. Provides optimistic locking. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the recommendation. + * + * 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. Name of the recommendation. + * + * 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; + } + + /** + * Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 2; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 2; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php new file mode 100644 index 00000000000..9130a402746 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php @@ -0,0 +1,168 @@ +google.cloud.recommender.v1.MarkRecommendationFailedRequest + */ +class MarkRecommendationFailedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the recommendation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + */ + private $state_metadata; + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the recommendation. Please see + * {@see RecommenderClient::recommendationName()} for help formatting this field. + * @param array $stateMetadata State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * @return \Google\Cloud\Recommender\V1\MarkRecommendationFailedRequest + * + * @experimental + */ + public static function build(string $name, array $stateMetadata, string $etag): self + { + return (new self()) + ->setName($name) + ->setStateMetadata($stateMetadata) + ->setEtag($etag); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the recommendation. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @type string $etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the recommendation. + * + * 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. Name of the recommendation. + * + * 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; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php new file mode 100644 index 00000000000..5d95a39fbe7 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php @@ -0,0 +1,168 @@ +google.cloud.recommender.v1.MarkRecommendationSucceededRequest + */ +class MarkRecommendationSucceededRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the recommendation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + */ + private $state_metadata; + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the recommendation. Please see + * {@see RecommenderClient::recommendationName()} for help formatting this field. + * @param array $stateMetadata State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * @return \Google\Cloud\Recommender\V1\MarkRecommendationSucceededRequest + * + * @experimental + */ + public static function build(string $name, array $stateMetadata, string $etag): self + { + return (new self()) + ->setName($name) + ->setStateMetadata($stateMetadata) + ->setEtag($etag); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the recommendation. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * @type string $etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the recommendation. + * + * 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. Name of the recommendation. + * + * 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; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + * + * Generated from protobuf field map state_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php new file mode 100644 index 00000000000..096085bea6f --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php @@ -0,0 +1,564 @@ +google.cloud.recommender.v1.Operation + */ +class Operation extends \Google\Protobuf\Internal\Message +{ + /** + * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', + * 'copy', 'test' and custom operations. This field is case-insensitive and + * always populated. + * + * Generated from protobuf field string action = 1; + */ + protected $action = ''; + /** + * Type of GCP resource being modified/tested. This field is always populated. + * Example: cloudresourcemanager.googleapis.com/Project, + * compute.googleapis.com/Instance + * + * Generated from protobuf field string resource_type = 2; + */ + protected $resource_type = ''; + /** + * Contains the fully qualified resource name. This field is always populated. + * ex: //cloudresourcemanager.googleapis.com/projects/foo. + * + * Generated from protobuf field string resource = 3; + */ + protected $resource = ''; + /** + * Path to the target field being operated on. If the operation is at the + * resource level, then path should be "/". This field is always populated. + * + * Generated from protobuf field string path = 4; + */ + protected $path = ''; + /** + * Can be set with action 'copy' to copy resource configuration across + * different resources of the same type. Example: A resource clone can be + * done via action = 'copy', path = "/", from = "/", + * source_resource = and resource_name = . + * This field is empty for all other values of `action`. + * + * Generated from protobuf field string source_resource = 5; + */ + protected $source_resource = ''; + /** + * Can be set with action 'copy' or 'move' to indicate the source field within + * resource or source_resource, ignored if provided for other operation types. + * + * Generated from protobuf field string source_path = 6; + */ + protected $source_path = ''; + /** + * Set of filters to apply if `path` refers to array elements or nested array + * elements in order to narrow down to a single unique element that is being + * tested/modified. + * This is intended to be an exact match per filter. To perform advanced + * matching, use path_value_matchers. + * * Example: + * ``` + * { + * "/versions/*/name" : "it-123" + * "/versions/*/targetSize/percent": 20 + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/condition" : null + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + * } + * ``` + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_filters = 8; + */ + private $path_filters; + /** + * Similar to path_filters, this contains set of filters to apply if `path` + * field refers to array elements. This is meant to support value matching + * beyond exact match. To perform exact match, use path_filters. + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_value_matchers = 11; + */ + private $path_value_matchers; + protected $path_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action + * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', + * 'copy', 'test' and custom operations. This field is case-insensitive and + * always populated. + * @type string $resource_type + * Type of GCP resource being modified/tested. This field is always populated. + * Example: cloudresourcemanager.googleapis.com/Project, + * compute.googleapis.com/Instance + * @type string $resource + * Contains the fully qualified resource name. This field is always populated. + * ex: //cloudresourcemanager.googleapis.com/projects/foo. + * @type string $path + * Path to the target field being operated on. If the operation is at the + * resource level, then path should be "/". This field is always populated. + * @type string $source_resource + * Can be set with action 'copy' to copy resource configuration across + * different resources of the same type. Example: A resource clone can be + * done via action = 'copy', path = "/", from = "/", + * source_resource = and resource_name = . + * This field is empty for all other values of `action`. + * @type string $source_path + * Can be set with action 'copy' or 'move' to indicate the source field within + * resource or source_resource, ignored if provided for other operation types. + * @type \Google\Protobuf\Value $value + * Value for the `path` field. Will be set for actions:'add'/'replace'. + * Maybe set for action: 'test'. Either this or `value_matcher` will be set + * for 'test' operation. An exact match must be performed. + * @type \Google\Cloud\Recommender\V1\ValueMatcher $value_matcher + * Can be set for action 'test' for advanced matching for the value of + * 'path' field. Either this or `value` will be set for 'test' operation. + * @type array|\Google\Protobuf\Internal\MapField $path_filters + * Set of filters to apply if `path` refers to array elements or nested array + * elements in order to narrow down to a single unique element that is being + * tested/modified. + * This is intended to be an exact match per filter. To perform advanced + * matching, use path_value_matchers. + * * Example: + * ``` + * { + * "/versions/*/name" : "it-123" + * "/versions/*/targetSize/percent": 20 + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/condition" : null + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + * } + * ``` + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * @type array|\Google\Protobuf\Internal\MapField $path_value_matchers + * Similar to path_filters, this contains set of filters to apply if `path` + * field refers to array elements. This is meant to support value matching + * beyond exact match. To perform exact match, use path_filters. + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', + * 'copy', 'test' and custom operations. This field is case-insensitive and + * always populated. + * + * Generated from protobuf field string action = 1; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', + * 'copy', 'test' and custom operations. This field is case-insensitive and + * always populated. + * + * Generated from protobuf field string action = 1; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * Type of GCP resource being modified/tested. This field is always populated. + * Example: cloudresourcemanager.googleapis.com/Project, + * compute.googleapis.com/Instance + * + * Generated from protobuf field string resource_type = 2; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Type of GCP resource being modified/tested. This field is always populated. + * Example: cloudresourcemanager.googleapis.com/Project, + * compute.googleapis.com/Instance + * + * Generated from protobuf field string resource_type = 2; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Contains the fully qualified resource name. This field is always populated. + * ex: //cloudresourcemanager.googleapis.com/projects/foo. + * + * Generated from protobuf field string resource = 3; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Contains the fully qualified resource name. This field is always populated. + * ex: //cloudresourcemanager.googleapis.com/projects/foo. + * + * Generated from protobuf field string resource = 3; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Path to the target field being operated on. If the operation is at the + * resource level, then path should be "/". This field is always populated. + * + * Generated from protobuf field string path = 4; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Path to the target field being operated on. If the operation is at the + * resource level, then path should be "/". This field is always populated. + * + * Generated from protobuf field string path = 4; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Can be set with action 'copy' to copy resource configuration across + * different resources of the same type. Example: A resource clone can be + * done via action = 'copy', path = "/", from = "/", + * source_resource = and resource_name = . + * This field is empty for all other values of `action`. + * + * Generated from protobuf field string source_resource = 5; + * @return string + */ + public function getSourceResource() + { + return $this->source_resource; + } + + /** + * Can be set with action 'copy' to copy resource configuration across + * different resources of the same type. Example: A resource clone can be + * done via action = 'copy', path = "/", from = "/", + * source_resource = and resource_name = . + * This field is empty for all other values of `action`. + * + * Generated from protobuf field string source_resource = 5; + * @param string $var + * @return $this + */ + public function setSourceResource($var) + { + GPBUtil::checkString($var, True); + $this->source_resource = $var; + + return $this; + } + + /** + * Can be set with action 'copy' or 'move' to indicate the source field within + * resource or source_resource, ignored if provided for other operation types. + * + * Generated from protobuf field string source_path = 6; + * @return string + */ + public function getSourcePath() + { + return $this->source_path; + } + + /** + * Can be set with action 'copy' or 'move' to indicate the source field within + * resource or source_resource, ignored if provided for other operation types. + * + * Generated from protobuf field string source_path = 6; + * @param string $var + * @return $this + */ + public function setSourcePath($var) + { + GPBUtil::checkString($var, True); + $this->source_path = $var; + + return $this; + } + + /** + * Value for the `path` field. Will be set for actions:'add'/'replace'. + * Maybe set for action: 'test'. Either this or `value_matcher` will be set + * for 'test' operation. An exact match must be performed. + * + * Generated from protobuf field .google.protobuf.Value value = 7; + * @return \Google\Protobuf\Value|null + */ + public function getValue() + { + return $this->readOneof(7); + } + + public function hasValue() + { + return $this->hasOneof(7); + } + + /** + * Value for the `path` field. Will be set for actions:'add'/'replace'. + * Maybe set for action: 'test'. Either this or `value_matcher` will be set + * for 'test' operation. An exact match must be performed. + * + * Generated from protobuf field .google.protobuf.Value value = 7; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Can be set for action 'test' for advanced matching for the value of + * 'path' field. Either this or `value` will be set for 'test' operation. + * + * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; + * @return \Google\Cloud\Recommender\V1\ValueMatcher|null + */ + public function getValueMatcher() + { + return $this->readOneof(10); + } + + public function hasValueMatcher() + { + return $this->hasOneof(10); + } + + /** + * Can be set for action 'test' for advanced matching for the value of + * 'path' field. Either this or `value` will be set for 'test' operation. + * + * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; + * @param \Google\Cloud\Recommender\V1\ValueMatcher $var + * @return $this + */ + public function setValueMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ValueMatcher::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Set of filters to apply if `path` refers to array elements or nested array + * elements in order to narrow down to a single unique element that is being + * tested/modified. + * This is intended to be an exact match per filter. To perform advanced + * matching, use path_value_matchers. + * * Example: + * ``` + * { + * "/versions/*/name" : "it-123" + * "/versions/*/targetSize/percent": 20 + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/condition" : null + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + * } + * ``` + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_filters = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPathFilters() + { + return $this->path_filters; + } + + /** + * Set of filters to apply if `path` refers to array elements or nested array + * elements in order to narrow down to a single unique element that is being + * tested/modified. + * This is intended to be an exact match per filter. To perform advanced + * matching, use path_value_matchers. + * * Example: + * ``` + * { + * "/versions/*/name" : "it-123" + * "/versions/*/targetSize/percent": 20 + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/condition" : null + * } + * ``` + * * Example: + * ``` + * { + * "/bindings/*/role": "roles/owner" + * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + * } + * ``` + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_filters = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPathFilters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->path_filters = $arr; + + return $this; + } + + /** + * Similar to path_filters, this contains set of filters to apply if `path` + * field refers to array elements. This is meant to support value matching + * beyond exact match. To perform exact match, use path_filters. + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_value_matchers = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPathValueMatchers() + { + return $this->path_value_matchers; + } + + /** + * Similar to path_filters, this contains set of filters to apply if `path` + * field refers to array elements. This is meant to support value matching + * beyond exact match. To perform exact match, use path_filters. + * When both path_filters and path_value_matchers are set, an implicit AND + * must be performed. + * + * Generated from protobuf field map path_value_matchers = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPathValueMatchers($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\ValueMatcher::class); + $this->path_value_matchers = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPathValue() + { + return $this->whichOneof("path_value"); + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php new file mode 100644 index 00000000000..f074d103714 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php @@ -0,0 +1,71 @@ +google.cloud.recommender.v1.OperationGroup + */ +class OperationGroup extends \Google\Protobuf\Internal\Message +{ + /** + * List of operations across one or more resources that belong to this group. + * Loosely based on RFC6902 and should be performed in the order they appear. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; + */ + private $operations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $operations + * List of operations across one or more resources that belong to this group. + * Loosely based on RFC6902 and should be performed in the order they appear. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * List of operations across one or more resources that belong to this group. + * Loosely based on RFC6902 and should be performed in the order they appear. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOperations() + { + return $this->operations; + } + + /** + * List of operations across one or more resources that belong to this group. + * Loosely based on RFC6902 and should be performed in the order they appear. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; + * @param array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOperations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Operation::class); + $this->operations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php new file mode 100644 index 00000000000..0883027776d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php @@ -0,0 +1,546 @@ +google.cloud.recommender.v1.Recommendation + */ +class Recommendation extends \Google\Protobuf\Internal\Message +{ + /** + * Name of recommendation. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Contains an identifier for a subtype of recommendations produced for the + * same recommender. Subtype is a function of content and impact, meaning a + * new subtype might be added when significant changes to `content` or + * `primary_impact.category` are introduced. See the Recommenders section + * to see a list of subtypes for a given Recommender. + * Examples: + * For recommender = "google.iam.policy.Recommender", + * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + * + * Generated from protobuf field string recommender_subtype = 12; + */ + protected $recommender_subtype = ''; + /** + * Last time this recommendation was refreshed by the system that created it + * in the first place. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + */ + protected $last_refresh_time = null; + /** + * The primary impact that this recommendation can have while trying to + * optimize for one category. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; + */ + protected $primary_impact = null; + /** + * Optional set of additional impact that this recommendation may have when + * trying to optimize for the primary category. These may be positive + * or negative. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; + */ + private $additional_impact; + /** + * Recommendation's priority. + * + * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; + */ + protected $priority = 0; + /** + * Content of the recommendation describing recommended changes to resources. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; + */ + protected $content = null; + /** + * Information for state. Contains state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; + */ + protected $state_info = null; + /** + * Fingerprint of the Recommendation. Provides optimistic locking when + * updating states. + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Insights that led to this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; + */ + private $associated_insights; + /** + * Corresponds to a mutually exclusive group ID within a recommender. + * A non-empty ID indicates that the recommendation belongs to a mutually + * exclusive group. This means that only one recommendation within the group + * is suggested to be applied. + * + * Generated from protobuf field string xor_group_id = 18; + */ + protected $xor_group_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of recommendation. + * @type string $description + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * @type string $recommender_subtype + * Contains an identifier for a subtype of recommendations produced for the + * same recommender. Subtype is a function of content and impact, meaning a + * new subtype might be added when significant changes to `content` or + * `primary_impact.category` are introduced. See the Recommenders section + * to see a list of subtypes for a given Recommender. + * Examples: + * For recommender = "google.iam.policy.Recommender", + * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + * @type \Google\Protobuf\Timestamp $last_refresh_time + * Last time this recommendation was refreshed by the system that created it + * in the first place. + * @type \Google\Cloud\Recommender\V1\Impact $primary_impact + * The primary impact that this recommendation can have while trying to + * optimize for one category. + * @type array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $additional_impact + * Optional set of additional impact that this recommendation may have when + * trying to optimize for the primary category. These may be positive + * or negative. + * @type int $priority + * Recommendation's priority. + * @type \Google\Cloud\Recommender\V1\RecommendationContent $content + * Content of the recommendation describing recommended changes to resources. + * @type \Google\Cloud\Recommender\V1\RecommendationStateInfo $state_info + * Information for state. Contains state and metadata. + * @type string $etag + * Fingerprint of the Recommendation. Provides optimistic locking when + * updating states. + * @type array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $associated_insights + * Insights that led to this recommendation. + * @type string $xor_group_id + * Corresponds to a mutually exclusive group ID within a recommender. + * A non-empty ID indicates that the recommendation belongs to a mutually + * exclusive group. This means that only one recommendation within the group + * is suggested to be applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Name of recommendation. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of recommendation. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Free-form human readable summary in English. The maximum length is 500 + * characters. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Contains an identifier for a subtype of recommendations produced for the + * same recommender. Subtype is a function of content and impact, meaning a + * new subtype might be added when significant changes to `content` or + * `primary_impact.category` are introduced. See the Recommenders section + * to see a list of subtypes for a given Recommender. + * Examples: + * For recommender = "google.iam.policy.Recommender", + * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + * + * Generated from protobuf field string recommender_subtype = 12; + * @return string + */ + public function getRecommenderSubtype() + { + return $this->recommender_subtype; + } + + /** + * Contains an identifier for a subtype of recommendations produced for the + * same recommender. Subtype is a function of content and impact, meaning a + * new subtype might be added when significant changes to `content` or + * `primary_impact.category` are introduced. See the Recommenders section + * to see a list of subtypes for a given Recommender. + * Examples: + * For recommender = "google.iam.policy.Recommender", + * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + * + * Generated from protobuf field string recommender_subtype = 12; + * @param string $var + * @return $this + */ + public function setRecommenderSubtype($var) + { + GPBUtil::checkString($var, True); + $this->recommender_subtype = $var; + + return $this; + } + + /** + * Last time this recommendation was refreshed by the system that created it + * in the first place. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastRefreshTime() + { + return $this->last_refresh_time; + } + + public function hasLastRefreshTime() + { + return isset($this->last_refresh_time); + } + + public function clearLastRefreshTime() + { + unset($this->last_refresh_time); + } + + /** + * Last time this recommendation was refreshed by the system that created it + * in the first place. + * + * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastRefreshTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_refresh_time = $var; + + return $this; + } + + /** + * The primary impact that this recommendation can have while trying to + * optimize for one category. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; + * @return \Google\Cloud\Recommender\V1\Impact|null + */ + public function getPrimaryImpact() + { + return $this->primary_impact; + } + + public function hasPrimaryImpact() + { + return isset($this->primary_impact); + } + + public function clearPrimaryImpact() + { + unset($this->primary_impact); + } + + /** + * The primary impact that this recommendation can have while trying to + * optimize for one category. + * + * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; + * @param \Google\Cloud\Recommender\V1\Impact $var + * @return $this + */ + public function setPrimaryImpact($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\Impact::class); + $this->primary_impact = $var; + + return $this; + } + + /** + * Optional set of additional impact that this recommendation may have when + * trying to optimize for the primary category. These may be positive + * or negative. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalImpact() + { + return $this->additional_impact; + } + + /** + * Optional set of additional impact that this recommendation may have when + * trying to optimize for the primary category. These may be positive + * or negative. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; + * @param array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalImpact($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Impact::class); + $this->additional_impact = $arr; + + return $this; + } + + /** + * Recommendation's priority. + * + * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; + * @return int + */ + public function getPriority() + { + return $this->priority; + } + + /** + * Recommendation's priority. + * + * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Recommendation\Priority::class); + $this->priority = $var; + + return $this; + } + + /** + * Content of the recommendation describing recommended changes to resources. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; + * @return \Google\Cloud\Recommender\V1\RecommendationContent|null + */ + public function getContent() + { + return $this->content; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * Content of the recommendation describing recommended changes to resources. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; + * @param \Google\Cloud\Recommender\V1\RecommendationContent $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationContent::class); + $this->content = $var; + + return $this; + } + + /** + * Information for state. Contains state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; + * @return \Google\Cloud\Recommender\V1\RecommendationStateInfo|null + */ + public function getStateInfo() + { + return $this->state_info; + } + + public function hasStateInfo() + { + return isset($this->state_info); + } + + public function clearStateInfo() + { + unset($this->state_info); + } + + /** + * Information for state. Contains state and metadata. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; + * @param \Google\Cloud\Recommender\V1\RecommendationStateInfo $var + * @return $this + */ + public function setStateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo::class); + $this->state_info = $var; + + return $this; + } + + /** + * Fingerprint of the Recommendation. Provides optimistic locking when + * updating states. + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Fingerprint of the Recommendation. Provides optimistic locking when + * updating states. + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Insights that led to this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociatedInsights() + { + return $this->associated_insights; + } + + /** + * Insights that led to this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; + * @param array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociatedInsights($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation\InsightReference::class); + $this->associated_insights = $arr; + + return $this; + } + + /** + * Corresponds to a mutually exclusive group ID within a recommender. + * A non-empty ID indicates that the recommendation belongs to a mutually + * exclusive group. This means that only one recommendation within the group + * is suggested to be applied. + * + * Generated from protobuf field string xor_group_id = 18; + * @return string + */ + public function getXorGroupId() + { + return $this->xor_group_id; + } + + /** + * Corresponds to a mutually exclusive group ID within a recommender. + * A non-empty ID indicates that the recommendation belongs to a mutually + * exclusive group. This means that only one recommendation within the group + * is suggested to be applied. + * + * Generated from protobuf field string xor_group_id = 18; + * @param string $var + * @return $this + */ + public function setXorGroupId($var) + { + GPBUtil::checkString($var, True); + $this->xor_group_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php new file mode 100644 index 00000000000..bbf72313b89 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php @@ -0,0 +1,74 @@ +google.cloud.recommender.v1.Recommendation.InsightReference + */ +class InsightReference extends \Google\Protobuf\Internal\Message +{ + /** + * Insight resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + * + * Generated from protobuf field string insight = 1; + */ + protected $insight = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $insight + * Insight resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Insight resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + * + * Generated from protobuf field string insight = 1; + * @return string + */ + public function getInsight() + { + return $this->insight; + } + + /** + * Insight resource name, e.g. + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + * + * Generated from protobuf field string insight = 1; + * @param string $var + * @return $this + */ + public function setInsight($var) + { + GPBUtil::checkString($var, True); + $this->insight = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InsightReference::class, \Google\Cloud\Recommender\V1\Recommendation_InsightReference::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php new file mode 100644 index 00000000000..0077380a565 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php @@ -0,0 +1,78 @@ +google.cloud.recommender.v1.Recommendation.Priority + */ +class Priority +{ + /** + * Recommendation has unspecified priority. + * + * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; + */ + const PRIORITY_UNSPECIFIED = 0; + /** + * Recommendation has P4 priority (lowest priority). + * + * Generated from protobuf enum P4 = 1; + */ + const P4 = 1; + /** + * Recommendation has P3 priority (second lowest priority). + * + * Generated from protobuf enum P3 = 2; + */ + const P3 = 2; + /** + * Recommendation has P2 priority (second highest priority). + * + * Generated from protobuf enum P2 = 3; + */ + const P2 = 3; + /** + * Recommendation has P1 priority (highest priority). + * + * Generated from protobuf enum P1 = 4; + */ + const P1 = 4; + + private static $valueToName = [ + self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', + self::P4 => 'P4', + self::P3 => 'P3', + self::P2 => 'P2', + self::P1 => 'P1', + ]; + + 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(Priority::class, \Google\Cloud\Recommender\V1\Recommendation_Priority::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php new file mode 100644 index 00000000000..8f9bc53a3a9 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php @@ -0,0 +1,119 @@ +google.cloud.recommender.v1.RecommendationContent + */ +class RecommendationContent extends \Google\Protobuf\Internal\Message +{ + /** + * Operations to one or more Google Cloud resources grouped in such a way + * that, all operations within one group are expected to be performed + * atomically and in an order. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; + */ + private $operation_groups; + /** + * Condensed overview information about the recommendation. + * + * Generated from protobuf field .google.protobuf.Struct overview = 3; + */ + protected $overview = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $operation_groups + * Operations to one or more Google Cloud resources grouped in such a way + * that, all operations within one group are expected to be performed + * atomically and in an order. + * @type \Google\Protobuf\Struct $overview + * Condensed overview information about the recommendation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Operations to one or more Google Cloud resources grouped in such a way + * that, all operations within one group are expected to be performed + * atomically and in an order. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOperationGroups() + { + return $this->operation_groups; + } + + /** + * Operations to one or more Google Cloud resources grouped in such a way + * that, all operations within one group are expected to be performed + * atomically and in an order. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; + * @param array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOperationGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\OperationGroup::class); + $this->operation_groups = $arr; + + return $this; + } + + /** + * Condensed overview information about the recommendation. + * + * Generated from protobuf field .google.protobuf.Struct overview = 3; + * @return \Google\Protobuf\Struct|null + */ + public function getOverview() + { + return $this->overview; + } + + public function hasOverview() + { + return isset($this->overview); + } + + public function clearOverview() + { + unset($this->overview); + } + + /** + * Condensed overview information about the recommendation. + * + * Generated from protobuf field .google.protobuf.Struct overview = 3; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setOverview($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->overview = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php new file mode 100644 index 00000000000..af3d2fa1cc7 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php @@ -0,0 +1,101 @@ +google.cloud.recommender.v1.RecommendationStateInfo + */ +class RecommendationStateInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; + */ + protected $state = 0; + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + */ + private $state_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + * @type array|\Google\Protobuf\Internal\MapField $state_metadata + * A map of metadata for the state, provided by user or automations systems. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo\State::class); + $this->state = $var; + + return $this; + } + + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStateMetadata() + { + return $this->state_metadata; + } + + /** + * A map of metadata for the state, provided by user or automations systems. + * + * Generated from protobuf field map state_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStateMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->state_metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php new file mode 100644 index 00000000000..4813573e86d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php @@ -0,0 +1,95 @@ +google.cloud.recommender.v1.RecommendationStateInfo.State + */ +class State +{ + /** + * Default state. Don't use directly. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Recommendation is active and can be applied. Recommendations content can + * be updated by Google. + * ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Recommendation is in claimed state. Recommendations content is + * immutable and cannot be updated by Google. + * CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + * + * Generated from protobuf enum CLAIMED = 6; + */ + const CLAIMED = 6; + /** + * Recommendation is in succeeded state. Recommendations content is + * immutable and cannot be updated by Google. + * SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * Recommendation is in failed state. Recommendations content is immutable + * and cannot be updated by Google. + * FAILED recommendations can be marked as SUCCEEDED, or FAILED. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * Recommendation is in dismissed state. Recommendation content can be + * updated by Google. + * DISMISSED recommendations can be marked as ACTIVE. + * + * Generated from protobuf enum DISMISSED = 5; + */ + const DISMISSED = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::CLAIMED => 'CLAIMED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::DISMISSED => 'DISMISSED', + ]; + + 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(State::class, \Google\Cloud\Recommender\V1\RecommendationStateInfo_State::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php new file mode 100644 index 00000000000..8e6b676d255 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php @@ -0,0 +1,347 @@ +google.cloud.recommender.v1.RecommenderConfig + */ +class RecommenderConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Name of recommender config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * RecommenderGenerationConfig which configures the Generation of + * recommendations for this recommender. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; + */ + protected $recommender_generation_config = null; + /** + * Fingerprint of the RecommenderConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + */ + private $annotations; + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of recommender config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config + * @type \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $recommender_generation_config + * RecommenderGenerationConfig which configures the Generation of + * recommendations for this recommender. + * @type string $etag + * Fingerprint of the RecommenderConfig. Provides optimistic locking when + * updating. + * @type \Google\Protobuf\Timestamp $update_time + * Last time when the config was updated. + * @type string $revision_id + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * @type string $display_name + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); + parent::__construct($data); + } + + /** + * Name of recommender config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of recommender config. + * Eg, + * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * RecommenderGenerationConfig which configures the Generation of + * recommendations for this recommender. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; + * @return \Google\Cloud\Recommender\V1\RecommenderGenerationConfig|null + */ + public function getRecommenderGenerationConfig() + { + return $this->recommender_generation_config; + } + + public function hasRecommenderGenerationConfig() + { + return isset($this->recommender_generation_config); + } + + public function clearRecommenderGenerationConfig() + { + unset($this->recommender_generation_config); + } + + /** + * RecommenderGenerationConfig which configures the Generation of + * recommendations for this recommender. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; + * @param \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $var + * @return $this + */ + public function setRecommenderGenerationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderGenerationConfig::class); + $this->recommender_generation_config = $var; + + return $this; + } + + /** + * Fingerprint of the RecommenderConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Fingerprint of the RecommenderConfig. Provides optimistic locking when + * updating. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @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); + } + + /** + * Last time when the config was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. Immutable. The revision ID of the config. + * A new revision is committed whenever the config is changed in any way. + * The format is an 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Allows clients to store small amounts of arbitrary data. Annotations must + * follow the Kubernetes syntax. + * The total size of all keys and values combined is limited to 256k. + * Key can have 2 segments: prefix (optional) and name (required), + * separated by a slash (/). + * Prefix must be a DNS subdomain. + * Name must be 63 characters or less, begin and end with alphanumerics, + * with dashes (-), underscores (_), dots (.), and alphanumerics between. + * + * Generated from protobuf field map annotations = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A user-settable field to provide a human-readable name to be used in user + * interfaces. + * + * Generated from protobuf field string display_name = 7; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php new file mode 100644 index 00000000000..7c2e642c0a8 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php @@ -0,0 +1,83 @@ +google.cloud.recommender.v1.RecommenderGenerationConfig + */ +class RecommenderGenerationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Parameters for this RecommenderGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + */ + protected $params = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $params + * Parameters for this RecommenderGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); + parent::__construct($data); + } + + /** + * Parameters for this RecommenderGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + * @return \Google\Protobuf\Struct|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Parameters for this RecommenderGenerationConfig. These configs can be used + * by or are applied to all subtypes. + * + * Generated from protobuf field .google.protobuf.Struct params = 1; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php new file mode 100644 index 00000000000..10f00f46f49 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php @@ -0,0 +1,111 @@ +google.cloud.recommender.v1.ReliabilityProjection + */ +class ReliabilityProjection extends \Google\Protobuf\Internal\Message +{ + /** + * Reliability risks mitigated by this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; + */ + private $risks; + /** + * Per-recommender projection. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + */ + protected $details = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $risks + * Reliability risks mitigated by this recommendation. + * @type \Google\Protobuf\Struct $details + * Per-recommender projection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Reliability risks mitigated by this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRisks() + { + return $this->risks; + } + + /** + * Reliability risks mitigated by this recommendation. + * + * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Recommender\V1\ReliabilityProjection\RiskType::class); + $this->risks = $arr; + + return $this; + } + + /** + * Per-recommender projection. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getDetails() + { + return $this->details; + } + + public function hasDetails() + { + return isset($this->details); + } + + public function clearDetails() + { + unset($this->details); + } + + /** + * Per-recommender projection. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDetails($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->details = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php new file mode 100644 index 00000000000..3f37986fd3a --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php @@ -0,0 +1,72 @@ +google.cloud.recommender.v1.ReliabilityProjection.RiskType + */ +class RiskType +{ + /** + * Default unspecified risk. Don't use directly. + * + * Generated from protobuf enum RISK_TYPE_UNSPECIFIED = 0; + */ + const RISK_TYPE_UNSPECIFIED = 0; + /** + * Potential service downtime. + * + * Generated from protobuf enum SERVICE_DISRUPTION = 1; + */ + const SERVICE_DISRUPTION = 1; + /** + * Potential data loss. + * + * Generated from protobuf enum DATA_LOSS = 2; + */ + const DATA_LOSS = 2; + /** + * Potential access denial. The service is still up but some or all clients + * can't access it. + * + * Generated from protobuf enum ACCESS_DENY = 3; + */ + const ACCESS_DENY = 3; + + private static $valueToName = [ + self::RISK_TYPE_UNSPECIFIED => 'RISK_TYPE_UNSPECIFIED', + self::SERVICE_DISRUPTION => 'SERVICE_DISRUPTION', + self::DATA_LOSS => 'DATA_LOSS', + self::ACCESS_DENY => 'ACCESS_DENY', + ]; + + 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(RiskType::class, \Google\Cloud\Recommender\V1\ReliabilityProjection_RiskType::class); + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php new file mode 100644 index 00000000000..dffe739191c --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php @@ -0,0 +1,77 @@ +google.cloud.recommender.v1.SecurityProjection + */ +class SecurityProjection extends \Google\Protobuf\Internal\Message +{ + /** + * Additional security impact details that is provided by the recommender. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + */ + protected $details = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $details + * Additional security impact details that is provided by the recommender. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Additional security impact details that is provided by the recommender. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getDetails() + { + return $this->details; + } + + public function hasDetails() + { + return isset($this->details); + } + + public function clearDetails() + { + unset($this->details); + } + + /** + * Additional security impact details that is provided by the recommender. + * + * Generated from protobuf field .google.protobuf.Struct details = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDetails($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->details = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php new file mode 100644 index 00000000000..a1d4678563e --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php @@ -0,0 +1,116 @@ +google.cloud.recommender.v1.SustainabilityProjection + */ +class SustainabilityProjection extends \Google\Protobuf\Internal\Message +{ + /** + * Carbon Footprint generated in kg of CO2 equivalent. + * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). + * + * Generated from protobuf field double kg_c_o2e = 1; + */ + protected $kg_c_o2e = 0.0; + /** + * Duration for which this sustainability applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $kg_c_o2e + * Carbon Footprint generated in kg of CO2 equivalent. + * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). + * @type \Google\Protobuf\Duration $duration + * Duration for which this sustainability applies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * Carbon Footprint generated in kg of CO2 equivalent. + * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). + * + * Generated from protobuf field double kg_c_o2e = 1; + * @return float + */ + public function getKgCO2E() + { + return $this->kg_c_o2e; + } + + /** + * Carbon Footprint generated in kg of CO2 equivalent. + * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). + * + * Generated from protobuf field double kg_c_o2e = 1; + * @param float $var + * @return $this + */ + public function setKgCO2E($var) + { + GPBUtil::checkDouble($var); + $this->kg_c_o2e = $var; + + return $this; + } + + /** + * Duration for which this sustainability applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration for which this sustainability applies. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php new file mode 100644 index 00000000000..6c402f186c4 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php @@ -0,0 +1,174 @@ +google.cloud.recommender.v1.UpdateInsightTypeConfigRequest + */ +class UpdateInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The InsightTypeConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $insight_type_config = null; + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig Required. The InsightTypeConfig to update. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. + * + * @return \Google\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInsightTypeConfig($insightTypeConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Recommender\V1\InsightTypeConfig $insight_type_config + * Required. The InsightTypeConfig to update. + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to be updated. + * @type bool $validate_only + * If true, validate the request and preview the change, but do not actually + * update it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The InsightTypeConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Recommender\V1\InsightTypeConfig|null + */ + public function getInsightTypeConfig() + { + return $this->insight_type_config; + } + + public function hasInsightTypeConfig() + { + return isset($this->insight_type_config); + } + + public function clearInsightTypeConfig() + { + unset($this->insight_type_config); + } + + /** + * Required. The InsightTypeConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $var + * @return $this + */ + public function setInsightTypeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeConfig::class); + $this->insight_type_config = $var; + + return $this; + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php new file mode 100644 index 00000000000..9977e4f6fef --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php @@ -0,0 +1,174 @@ +google.cloud.recommender.v1.UpdateRecommenderConfigRequest + */ +class UpdateRecommenderConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The RecommenderConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $recommender_config = null; + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig Required. The RecommenderConfig to update. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. + * + * @return \Google\Cloud\Recommender\V1\UpdateRecommenderConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRecommenderConfig($recommenderConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Recommender\V1\RecommenderConfig $recommender_config + * Required. The RecommenderConfig to update. + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to be updated. + * @type bool $validate_only + * If true, validate the request and preview the change, but do not actually + * update it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The RecommenderConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Recommender\V1\RecommenderConfig|null + */ + public function getRecommenderConfig() + { + return $this->recommender_config; + } + + public function hasRecommenderConfig() + { + return isset($this->recommender_config); + } + + public function clearRecommenderConfig() + { + unset($this->recommender_config); + } + + /** + * Required. The RecommenderConfig to update. + * + * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Recommender\V1\RecommenderConfig $var + * @return $this + */ + public function setRecommenderConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderConfig::class); + $this->recommender_config = $var; + + return $this; + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * If true, validate the request and preview the change, but do not actually + * update it. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php new file mode 100644 index 00000000000..eac350eddd6 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php @@ -0,0 +1,81 @@ +google.cloud.recommender.v1.ValueMatcher + */ +class ValueMatcher extends \Google\Protobuf\Internal\Message +{ + protected $match_variant; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $matches_pattern + * To be used for full regex matching. The regular expression is using the + * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be + * used with RE2::FullMatch + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); + parent::__construct($data); + } + + /** + * To be used for full regex matching. The regular expression is using the + * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be + * used with RE2::FullMatch + * + * Generated from protobuf field string matches_pattern = 1; + * @return string + */ + public function getMatchesPattern() + { + return $this->readOneof(1); + } + + public function hasMatchesPattern() + { + return $this->hasOneof(1); + } + + /** + * To be used for full regex matching. The regular expression is using the + * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be + * used with RE2::FullMatch + * + * Generated from protobuf field string matches_pattern = 1; + * @param string $var + * @return $this + */ + public function setMatchesPattern($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getMatchVariant() + { + return $this->whichOneof("match_variant"); + } + +} + diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php new file mode 100644 index 00000000000..ca0fcc05602 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Insight $response */ + $response = $recommenderClient->getInsight($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::insightName( + '[PROJECT]', + '[LOCATION]', + '[INSIGHT_TYPE]', + '[INSIGHT]' + ); + + get_insight_sample($formattedName); +} +// [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php new file mode 100644 index 00000000000..3f12da7b22e --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var InsightTypeConfig $response */ + $response = $recommenderClient->getInsightTypeConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::insightTypeConfigName( + '[PROJECT]', + '[LOCATION]', + '[INSIGHT_TYPE]' + ); + + get_insight_type_config_sample($formattedName); +} +// [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php new file mode 100644 index 00000000000..6df89a5b303 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Recommendation $response */ + $response = $recommenderClient->getRecommendation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommendationName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]', + '[RECOMMENDATION]' + ); + + get_recommendation_sample($formattedName); +} +// [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php new file mode 100644 index 00000000000..510d1a8a891 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var RecommenderConfig $response */ + $response = $recommenderClient->getRecommenderConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommenderConfigName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]' + ); + + get_recommender_config_sample($formattedName); +} +// [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php new file mode 100644 index 00000000000..55fbe9d1904 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php @@ -0,0 +1,93 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recommenderClient->listInsights($request); + + /** @var Insight $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecommenderClient::insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); + + list_insights_sample($formattedParent); +} +// [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php new file mode 100644 index 00000000000..a71ddddb6f9 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php @@ -0,0 +1,93 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $recommenderClient->listRecommendations($request); + + /** @var Recommendation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RecommenderClient::recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); + + list_recommendations_sample($formattedParent); +} +// [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php new file mode 100644 index 00000000000..8625b5b6fb1 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php @@ -0,0 +1,84 @@ +setName($formattedName) + ->setEtag($etag); + + // Call the API and handle any network failures. + try { + /** @var Insight $response */ + $response = $recommenderClient->markInsightAccepted($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::insightName( + '[PROJECT]', + '[LOCATION]', + '[INSIGHT_TYPE]', + '[INSIGHT]' + ); + $etag = '[ETAG]'; + + mark_insight_accepted_sample($formattedName, $etag); +} +// [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php new file mode 100644 index 00000000000..2f91137f186 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php @@ -0,0 +1,88 @@ +setName($formattedName) + ->setEtag($etag); + + // Call the API and handle any network failures. + try { + /** @var Recommendation $response */ + $response = $recommenderClient->markRecommendationClaimed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommendationName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]', + '[RECOMMENDATION]' + ); + $etag = '[ETAG]'; + + mark_recommendation_claimed_sample($formattedName, $etag); +} +// [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php new file mode 100644 index 00000000000..a460f17bf4b --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Recommendation $response */ + $response = $recommenderClient->markRecommendationDismissed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommendationName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]', + '[RECOMMENDATION]' + ); + + mark_recommendation_dismissed_sample($formattedName); +} +// [END recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php new file mode 100644 index 00000000000..6925598514b --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php @@ -0,0 +1,89 @@ +setName($formattedName) + ->setEtag($etag); + + // Call the API and handle any network failures. + try { + /** @var Recommendation $response */ + $response = $recommenderClient->markRecommendationFailed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommendationName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]', + '[RECOMMENDATION]' + ); + $etag = '[ETAG]'; + + mark_recommendation_failed_sample($formattedName, $etag); +} +// [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php new file mode 100644 index 00000000000..703d529ce5d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php @@ -0,0 +1,89 @@ +setName($formattedName) + ->setEtag($etag); + + // Call the API and handle any network failures. + try { + /** @var Recommendation $response */ + $response = $recommenderClient->markRecommendationSucceeded($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RecommenderClient::recommendationName( + '[PROJECT]', + '[LOCATION]', + '[RECOMMENDER]', + '[RECOMMENDATION]' + ); + $etag = '[ETAG]'; + + mark_recommendation_succeeded_sample($formattedName, $etag); +} +// [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php new file mode 100644 index 00000000000..c8e079d7313 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php @@ -0,0 +1,60 @@ +setInsightTypeConfig($insightTypeConfig); + + // Call the API and handle any network failures. + try { + /** @var InsightTypeConfig $response */ + $response = $recommenderClient->updateInsightTypeConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php new file mode 100644 index 00000000000..bc4ef170eeb --- /dev/null +++ b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php @@ -0,0 +1,60 @@ +setRecommenderConfig($recommenderConfig); + + // Call the API and handle any network failures. + try { + /** @var RecommenderConfig $response */ + $response = $recommenderClient->updateRecommenderConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php b/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php new file mode 100644 index 00000000000..0064262f694 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php @@ -0,0 +1,1199 @@ + getInsightAsync(GetInsightRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInsightTypeConfigAsync(GetInsightTypeConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRecommendationAsync(GetRecommendationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRecommenderConfigAsync(GetRecommenderConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInsightsAsync(ListInsightsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRecommendationsAsync(ListRecommendationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface markInsightAcceptedAsync(MarkInsightAcceptedRequest $request, array $optionalArgs = []) + * @method PromiseInterface markRecommendationClaimedAsync(MarkRecommendationClaimedRequest $request, array $optionalArgs = []) + * @method PromiseInterface markRecommendationDismissedAsync(MarkRecommendationDismissedRequest $request, array $optionalArgs = []) + * @method PromiseInterface markRecommendationFailedAsync(MarkRecommendationFailedRequest $request, array $optionalArgs = []) + * @method PromiseInterface markRecommendationSucceededAsync(MarkRecommendationSucceededRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateInsightTypeConfigAsync(UpdateInsightTypeConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateRecommenderConfigAsync(UpdateRecommenderConfigRequest $request, array $optionalArgs = []) + */ +final class RecommenderClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.recommender.v1.Recommender'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'recommender.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'recommender.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/recommender_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/recommender_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/recommender_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/recommender_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_insight_type resource. + * + * @param string $billingAccount + * @param string $location + * @param string $insightType + * + * @return string The formatted billing_account_location_insight_type resource. + */ + public static function billingAccountLocationInsightTypeName(string $billingAccount, string $location, string $insightType): string + { + return self::getPathTemplate('billingAccountLocationInsightType')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_insight_type_config resource. + * + * @param string $billingAccount + * @param string $location + * @param string $insightType + * + * @return string The formatted billing_account_location_insight_type_config resource. + */ + public static function billingAccountLocationInsightTypeConfigName(string $billingAccount, string $location, string $insightType): string + { + return self::getPathTemplate('billingAccountLocationInsightTypeConfig')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_insight_type_insight resource. + * + * @param string $billingAccount + * @param string $location + * @param string $insightType + * @param string $insight + * + * @return string The formatted billing_account_location_insight_type_insight resource. + */ + public static function billingAccountLocationInsightTypeInsightName(string $billingAccount, string $location, string $insightType, string $insight): string + { + return self::getPathTemplate('billingAccountLocationInsightTypeInsight')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'insight_type' => $insightType, + 'insight' => $insight, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_recommender resource. + * + * @param string $billingAccount + * @param string $location + * @param string $recommender + * + * @return string The formatted billing_account_location_recommender resource. + */ + public static function billingAccountLocationRecommenderName(string $billingAccount, string $location, string $recommender): string + { + return self::getPathTemplate('billingAccountLocationRecommender')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_recommender_config resource. + * + * @param string $billingAccount + * @param string $location + * @param string $recommender + * + * @return string The formatted billing_account_location_recommender_config resource. + */ + public static function billingAccountLocationRecommenderConfigName(string $billingAccount, string $location, string $recommender): string + { + return self::getPathTemplate('billingAccountLocationRecommenderConfig')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_recommender_recommendation resource. + * + * @param string $billingAccount + * @param string $location + * @param string $recommender + * @param string $recommendation + * + * @return string The formatted billing_account_location_recommender_recommendation resource. + */ + public static function billingAccountLocationRecommenderRecommendationName(string $billingAccount, string $location, string $recommender, string $recommendation): string + { + return self::getPathTemplate('billingAccountLocationRecommenderRecommendation')->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'recommender' => $recommender, + 'recommendation' => $recommendation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_insight_type resource. + * + * @param string $folder + * @param string $location + * @param string $insightType + * + * @return string The formatted folder_location_insight_type resource. + */ + public static function folderLocationInsightTypeName(string $folder, string $location, string $insightType): string + { + return self::getPathTemplate('folderLocationInsightType')->render([ + 'folder' => $folder, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_insight_type_insight resource. + * + * @param string $folder + * @param string $location + * @param string $insightType + * @param string $insight + * + * @return string The formatted folder_location_insight_type_insight resource. + */ + public static function folderLocationInsightTypeInsightName(string $folder, string $location, string $insightType, string $insight): string + { + return self::getPathTemplate('folderLocationInsightTypeInsight')->render([ + 'folder' => $folder, + 'location' => $location, + 'insight_type' => $insightType, + 'insight' => $insight, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_recommender resource. + * + * @param string $folder + * @param string $location + * @param string $recommender + * + * @return string The formatted folder_location_recommender resource. + */ + public static function folderLocationRecommenderName(string $folder, string $location, string $recommender): string + { + return self::getPathTemplate('folderLocationRecommender')->render([ + 'folder' => $folder, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_recommender_recommendation resource. + * + * @param string $folder + * @param string $location + * @param string $recommender + * @param string $recommendation + * + * @return string The formatted folder_location_recommender_recommendation resource. + */ + public static function folderLocationRecommenderRecommendationName(string $folder, string $location, string $recommender, string $recommendation): string + { + return self::getPathTemplate('folderLocationRecommenderRecommendation')->render([ + 'folder' => $folder, + 'location' => $location, + 'recommender' => $recommender, + 'recommendation' => $recommendation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a insight + * resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * @param string $insight + * + * @return string The formatted insight resource. + */ + public static function insightName(string $project, string $location, string $insightType, string $insight): string + { + return self::getPathTemplate('insight')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + 'insight' => $insight, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a insight_type + * resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * + * @return string The formatted insight_type resource. + */ + public static function insightTypeName(string $project, string $location, string $insightType): string + { + return self::getPathTemplate('insightType')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * insight_type_config resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * + * @return string The formatted insight_type_config resource. + */ + public static function insightTypeConfigName(string $project, string $location, string $insightType): string + { + return self::getPathTemplate('insightTypeConfig')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_insight_type resource. + * + * @param string $organization + * @param string $location + * @param string $insightType + * + * @return string The formatted organization_location_insight_type resource. + */ + public static function organizationLocationInsightTypeName(string $organization, string $location, string $insightType): string + { + return self::getPathTemplate('organizationLocationInsightType')->render([ + 'organization' => $organization, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_insight_type_config resource. + * + * @param string $organization + * @param string $location + * @param string $insightType + * + * @return string The formatted organization_location_insight_type_config resource. + */ + public static function organizationLocationInsightTypeConfigName(string $organization, string $location, string $insightType): string + { + return self::getPathTemplate('organizationLocationInsightTypeConfig')->render([ + 'organization' => $organization, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_insight_type_insight resource. + * + * @param string $organization + * @param string $location + * @param string $insightType + * @param string $insight + * + * @return string The formatted organization_location_insight_type_insight resource. + */ + public static function organizationLocationInsightTypeInsightName(string $organization, string $location, string $insightType, string $insight): string + { + return self::getPathTemplate('organizationLocationInsightTypeInsight')->render([ + 'organization' => $organization, + 'location' => $location, + 'insight_type' => $insightType, + 'insight' => $insight, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_recommender resource. + * + * @param string $organization + * @param string $location + * @param string $recommender + * + * @return string The formatted organization_location_recommender resource. + */ + public static function organizationLocationRecommenderName(string $organization, string $location, string $recommender): string + { + return self::getPathTemplate('organizationLocationRecommender')->render([ + 'organization' => $organization, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_recommender_config resource. + * + * @param string $organization + * @param string $location + * @param string $recommender + * + * @return string The formatted organization_location_recommender_config resource. + */ + public static function organizationLocationRecommenderConfigName(string $organization, string $location, string $recommender): string + { + return self::getPathTemplate('organizationLocationRecommenderConfig')->render([ + 'organization' => $organization, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_recommender_recommendation resource. + * + * @param string $organization + * @param string $location + * @param string $recommender + * @param string $recommendation + * + * @return string The formatted organization_location_recommender_recommendation resource. + */ + public static function organizationLocationRecommenderRecommendationName(string $organization, string $location, string $recommender, string $recommendation): string + { + return self::getPathTemplate('organizationLocationRecommenderRecommendation')->render([ + 'organization' => $organization, + 'location' => $location, + 'recommender' => $recommender, + 'recommendation' => $recommendation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_insight_type resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * + * @return string The formatted project_location_insight_type resource. + */ + public static function projectLocationInsightTypeName(string $project, string $location, string $insightType): string + { + return self::getPathTemplate('projectLocationInsightType')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_insight_type_config resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * + * @return string The formatted project_location_insight_type_config resource. + */ + public static function projectLocationInsightTypeConfigName(string $project, string $location, string $insightType): string + { + return self::getPathTemplate('projectLocationInsightTypeConfig')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_insight_type_insight resource. + * + * @param string $project + * @param string $location + * @param string $insightType + * @param string $insight + * + * @return string The formatted project_location_insight_type_insight resource. + */ + public static function projectLocationInsightTypeInsightName(string $project, string $location, string $insightType, string $insight): string + { + return self::getPathTemplate('projectLocationInsightTypeInsight')->render([ + 'project' => $project, + 'location' => $location, + 'insight_type' => $insightType, + 'insight' => $insight, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_recommender resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * + * @return string The formatted project_location_recommender resource. + */ + public static function projectLocationRecommenderName(string $project, string $location, string $recommender): string + { + return self::getPathTemplate('projectLocationRecommender')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_recommender_config resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * + * @return string The formatted project_location_recommender_config resource. + */ + public static function projectLocationRecommenderConfigName(string $project, string $location, string $recommender): string + { + return self::getPathTemplate('projectLocationRecommenderConfig')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_recommender_recommendation resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * @param string $recommendation + * + * @return string The formatted project_location_recommender_recommendation resource. + */ + public static function projectLocationRecommenderRecommendationName(string $project, string $location, string $recommender, string $recommendation): string + { + return self::getPathTemplate('projectLocationRecommenderRecommendation')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + 'recommendation' => $recommendation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * recommendation resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * @param string $recommendation + * + * @return string The formatted recommendation resource. + */ + public static function recommendationName(string $project, string $location, string $recommender, string $recommendation): string + { + return self::getPathTemplate('recommendation')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + 'recommendation' => $recommendation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a recommender + * resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * + * @return string The formatted recommender resource. + */ + public static function recommenderName(string $project, string $location, string $recommender): string + { + return self::getPathTemplate('recommender')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * recommender_config resource. + * + * @param string $project + * @param string $location + * @param string $recommender + * + * @return string The formatted recommender_config resource. + */ + public static function recommenderConfigName(string $project, string $location, string $recommender): string + { + return self::getPathTemplate('recommenderConfig')->render([ + 'project' => $project, + 'location' => $location, + 'recommender' => $recommender, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - billingAccountLocationInsightType: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type} + * - billingAccountLocationInsightTypeConfig: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config + * - billingAccountLocationInsightTypeInsight: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight} + * - billingAccountLocationRecommender: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender} + * - billingAccountLocationRecommenderConfig: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config + * - billingAccountLocationRecommenderRecommendation: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} + * - folderLocationInsightType: folders/{folder}/locations/{location}/insightTypes/{insight_type} + * - folderLocationInsightTypeInsight: folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight} + * - folderLocationRecommender: folders/{folder}/locations/{location}/recommenders/{recommender} + * - folderLocationRecommenderRecommendation: folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} + * - insight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} + * - insightType: projects/{project}/locations/{location}/insightTypes/{insight_type} + * - insightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config + * - organizationLocationInsightType: organizations/{organization}/locations/{location}/insightTypes/{insight_type} + * - organizationLocationInsightTypeConfig: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config + * - organizationLocationInsightTypeInsight: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight} + * - organizationLocationRecommender: organizations/{organization}/locations/{location}/recommenders/{recommender} + * - organizationLocationRecommenderConfig: organizations/{organization}/locations/{location}/recommenders/{recommender}/config + * - organizationLocationRecommenderRecommendation: organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} + * - projectLocationInsightType: projects/{project}/locations/{location}/insightTypes/{insight_type} + * - projectLocationInsightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config + * - projectLocationInsightTypeInsight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} + * - projectLocationRecommender: projects/{project}/locations/{location}/recommenders/{recommender} + * - projectLocationRecommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config + * - projectLocationRecommenderRecommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} + * - recommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} + * - recommender: projects/{project}/locations/{location}/recommenders/{recommender} + * - recommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recommender.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets the requested insight. Requires the recommender.*.get IAM permission + * for the specified insight type. + * + * The async variant is {@see RecommenderClient::getInsightAsync()} . + * + * @example samples/V1/RecommenderClient/get_insight.php + * + * @param GetInsightRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Insight + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInsight(GetInsightRequest $request, array $callOptions = []): Insight + { + return $this->startApiCall('GetInsight', $request, $callOptions)->wait(); + } + + /** + * Gets the requested InsightTypeConfig. There is only one instance of the + * config for each InsightType. + * + * The async variant is {@see RecommenderClient::getInsightTypeConfigAsync()} . + * + * @example samples/V1/RecommenderClient/get_insight_type_config.php + * + * @param GetInsightTypeConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 InsightTypeConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInsightTypeConfig(GetInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig + { + return $this->startApiCall('GetInsightTypeConfig', $request, $callOptions)->wait(); + } + + /** + * Gets the requested recommendation. Requires the recommender.*.get + * IAM permission for the specified recommender. + * + * The async variant is {@see RecommenderClient::getRecommendationAsync()} . + * + * @example samples/V1/RecommenderClient/get_recommendation.php + * + * @param GetRecommendationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Recommendation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRecommendation(GetRecommendationRequest $request, array $callOptions = []): Recommendation + { + return $this->startApiCall('GetRecommendation', $request, $callOptions)->wait(); + } + + /** + * Gets the requested Recommender Config. There is only one instance of the + * config for each Recommender. + * + * The async variant is {@see RecommenderClient::getRecommenderConfigAsync()} . + * + * @example samples/V1/RecommenderClient/get_recommender_config.php + * + * @param GetRecommenderConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RecommenderConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRecommenderConfig(GetRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig + { + return $this->startApiCall('GetRecommenderConfig', $request, $callOptions)->wait(); + } + + /** + * Lists insights for the specified Cloud Resource. Requires the + * recommender.*.list IAM permission for the specified insight type. + * + * The async variant is {@see RecommenderClient::listInsightsAsync()} . + * + * @example samples/V1/RecommenderClient/list_insights.php + * + * @param ListInsightsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInsights(ListInsightsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInsights', $request, $callOptions); + } + + /** + * Lists recommendations for the specified Cloud Resource. Requires the + * recommender.*.list IAM permission for the specified recommender. + * + * The async variant is {@see RecommenderClient::listRecommendationsAsync()} . + * + * @example samples/V1/RecommenderClient/list_recommendations.php + * + * @param ListRecommendationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRecommendations(ListRecommendationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRecommendations', $request, $callOptions); + } + + /** + * Marks the Insight State as Accepted. Users can use this method to + * indicate to the Recommender API that they have applied some action based + * on the insight. This stops the insight content from being updated. + * + * MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + * the recommender.*.update IAM permission for the specified insight. + * + * The async variant is {@see RecommenderClient::markInsightAcceptedAsync()} . + * + * @example samples/V1/RecommenderClient/mark_insight_accepted.php + * + * @param MarkInsightAcceptedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Insight + * + * @throws ApiException Thrown if the API call fails. + */ + public function markInsightAccepted(MarkInsightAcceptedRequest $request, array $callOptions = []): Insight + { + return $this->startApiCall('MarkInsightAccepted', $request, $callOptions)->wait(); + } + + /** + * Marks the Recommendation State as Claimed. Users can use this method to + * indicate to the Recommender API that they are starting to apply the + * recommendation themselves. This stops the recommendation content from being + * updated. Associated insights are frozen and placed in the ACCEPTED state. + * + * MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + * SUCCEEDED, FAILED, or ACTIVE state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * The async variant is {@see RecommenderClient::markRecommendationClaimedAsync()} + * . + * + * @example samples/V1/RecommenderClient/mark_recommendation_claimed.php + * + * @param MarkRecommendationClaimedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Recommendation + * + * @throws ApiException Thrown if the API call fails. + */ + public function markRecommendationClaimed(MarkRecommendationClaimedRequest $request, array $callOptions = []): Recommendation + { + return $this->startApiCall('MarkRecommendationClaimed', $request, $callOptions)->wait(); + } + + /** + * Mark the Recommendation State as Dismissed. Users can use this method to + * indicate to the Recommender API that an ACTIVE recommendation has to + * be marked back as DISMISSED. + * + * MarkRecommendationDismissed can be applied to recommendations in ACTIVE + * state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * The async variant is + * {@see RecommenderClient::markRecommendationDismissedAsync()} . + * + * @example samples/V1/RecommenderClient/mark_recommendation_dismissed.php + * + * @param MarkRecommendationDismissedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Recommendation + * + * @throws ApiException Thrown if the API call fails. + */ + public function markRecommendationDismissed(MarkRecommendationDismissedRequest $request, array $callOptions = []): Recommendation + { + return $this->startApiCall('MarkRecommendationDismissed', $request, $callOptions)->wait(); + } + + /** + * Marks the Recommendation State as Failed. Users can use this method to + * indicate to the Recommender API that they have applied the recommendation + * themselves, and the operation failed. This stops the recommendation content + * from being updated. Associated insights are frozen and placed in the + * ACCEPTED state. + * + * MarkRecommendationFailed can be applied to recommendations in ACTIVE, + * CLAIMED, SUCCEEDED, or FAILED state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * The async variant is {@see RecommenderClient::markRecommendationFailedAsync()} . + * + * @example samples/V1/RecommenderClient/mark_recommendation_failed.php + * + * @param MarkRecommendationFailedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Recommendation + * + * @throws ApiException Thrown if the API call fails. + */ + public function markRecommendationFailed(MarkRecommendationFailedRequest $request, array $callOptions = []): Recommendation + { + return $this->startApiCall('MarkRecommendationFailed', $request, $callOptions)->wait(); + } + + /** + * Marks the Recommendation State as Succeeded. Users can use this method to + * indicate to the Recommender API that they have applied the recommendation + * themselves, and the operation was successful. This stops the recommendation + * content from being updated. Associated insights are frozen and placed in + * the ACCEPTED state. + * + * MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + * CLAIMED, SUCCEEDED, or FAILED state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * The async variant is + * {@see RecommenderClient::markRecommendationSucceededAsync()} . + * + * @example samples/V1/RecommenderClient/mark_recommendation_succeeded.php + * + * @param MarkRecommendationSucceededRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Recommendation + * + * @throws ApiException Thrown if the API call fails. + */ + public function markRecommendationSucceeded(MarkRecommendationSucceededRequest $request, array $callOptions = []): Recommendation + { + return $this->startApiCall('MarkRecommendationSucceeded', $request, $callOptions)->wait(); + } + + /** + * Updates an InsightTypeConfig change. This will create a new revision of the + * config. + * + * The async variant is {@see RecommenderClient::updateInsightTypeConfigAsync()} . + * + * @example samples/V1/RecommenderClient/update_insight_type_config.php + * + * @param UpdateInsightTypeConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 InsightTypeConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInsightTypeConfig(UpdateInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig + { + return $this->startApiCall('UpdateInsightTypeConfig', $request, $callOptions)->wait(); + } + + /** + * Updates a Recommender Config. This will create a new revision of the + * config. + * + * The async variant is {@see RecommenderClient::updateRecommenderConfigAsync()} . + * + * @example samples/V1/RecommenderClient/update_recommender_config.php + * + * @param UpdateRecommenderConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RecommenderConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateRecommenderConfig(UpdateRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig + { + return $this->startApiCall('UpdateRecommenderConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..61d8a5fabcf --- /dev/null +++ b/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.recommender.v1", + "libraryPackage": "Google\\Cloud\\Recommender\\V1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "RecommenderGapicClient", + "rpcs": { + "GetInsight": { + "methods": [ + "getInsight" + ] + }, + "GetInsightTypeConfig": { + "methods": [ + "getInsightTypeConfig" + ] + }, + "GetRecommendation": { + "methods": [ + "getRecommendation" + ] + }, + "GetRecommenderConfig": { + "methods": [ + "getRecommenderConfig" + ] + }, + "ListInsights": { + "methods": [ + "listInsights" + ] + }, + "ListRecommendations": { + "methods": [ + "listRecommendations" + ] + }, + "MarkInsightAccepted": { + "methods": [ + "markInsightAccepted" + ] + }, + "MarkRecommendationClaimed": { + "methods": [ + "markRecommendationClaimed" + ] + }, + "MarkRecommendationDismissed": { + "methods": [ + "markRecommendationDismissed" + ] + }, + "MarkRecommendationFailed": { + "methods": [ + "markRecommendationFailed" + ] + }, + "MarkRecommendationSucceeded": { + "methods": [ + "markRecommendationSucceeded" + ] + }, + "UpdateInsightTypeConfig": { + "methods": [ + "updateInsightTypeConfig" + ] + }, + "UpdateRecommenderConfig": { + "methods": [ + "updateRecommenderConfig" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json new file mode 100644 index 00000000000..4b79a146a7c --- /dev/null +++ b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json @@ -0,0 +1,110 @@ +{ + "interfaces": { + "google.cloud.recommender.v1.Recommender": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetInsight": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInsightTypeConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetRecommendation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRecommenderConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListInsights": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListRecommendations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "MarkInsightAccepted": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MarkRecommendationClaimed": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MarkRecommendationDismissed": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "MarkRecommendationFailed": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MarkRecommendationSucceeded": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInsightTypeConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateRecommenderConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php new file mode 100644 index 00000000000..f3a5d812aa4 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php @@ -0,0 +1,232 @@ + [ + 'google.cloud.recommender.v1.Recommender' => [ + 'GetInsight' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Insight', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInsightTypeConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetRecommendation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetRecommenderConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInsights' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInsights', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\ListInsightsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListRecommendations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRecommendations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\ListRecommendationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'MarkInsightAccepted' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Insight', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationClaimed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationDismissed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationFailed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationSucceeded' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInsightTypeConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', + 'headerParams' => [ + [ + 'keyName' => 'insight_type_config.name', + 'fieldAccessors' => [ + 'getInsightTypeConfig', + 'getName', + ], + ], + ], + ], + 'UpdateRecommenderConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', + 'headerParams' => [ + [ + 'keyName' => 'recommender_config.name', + 'fieldAccessors' => [ + 'getRecommenderConfig', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'billingAccountLocationInsightType' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}', + 'billingAccountLocationInsightTypeConfig' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config', + 'billingAccountLocationInsightTypeInsight' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', + 'billingAccountLocationRecommender' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}', + 'billingAccountLocationRecommenderConfig' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config', + 'billingAccountLocationRecommenderRecommendation' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', + 'folderLocationInsightType' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}', + 'folderLocationInsightTypeInsight' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', + 'folderLocationRecommender' => 'folders/{folder}/locations/{location}/recommenders/{recommender}', + 'folderLocationRecommenderRecommendation' => 'folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', + 'insight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', + 'insightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', + 'insightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', + 'organizationLocationInsightType' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}', + 'organizationLocationInsightTypeConfig' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config', + 'organizationLocationInsightTypeInsight' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', + 'organizationLocationRecommender' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}', + 'organizationLocationRecommenderConfig' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/config', + 'organizationLocationRecommenderRecommendation' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', + 'projectLocationInsightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', + 'projectLocationInsightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', + 'projectLocationInsightTypeInsight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', + 'projectLocationRecommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', + 'projectLocationRecommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', + 'projectLocationRecommenderRecommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', + 'recommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', + 'recommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', + 'recommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', + ], + ], + ], +]; diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php new file mode 100644 index 00000000000..ee41be2d932 --- /dev/null +++ b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php @@ -0,0 +1,366 @@ + [ + 'google.cloud.recommender.v1.Recommender' => [ + 'GetInsight' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInsightTypeConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/config}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/config}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRecommendation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRecommenderConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/config}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/config}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInsights' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/insightTypes/*}/insights', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/insightTypes/*}/insights', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRecommendations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*/recommenders/*}/recommendations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'MarkInsightAccepted' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationClaimed' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationDismissed' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationFailed' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'MarkRecommendationSucceeded' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInsightTypeConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}', + 'body' => 'insight_type_config', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}', + 'body' => 'insight_type_config', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}', + 'body' => 'insight_type_config', + ], + ], + 'placeholders' => [ + 'insight_type_config.name' => [ + 'getters' => [ + 'getInsightTypeConfig', + 'getName', + ], + ], + ], + ], + 'UpdateRecommenderConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}', + 'body' => 'recommender_config', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}', + 'body' => 'recommender_config', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}', + 'body' => 'recommender_config', + ], + ], + 'placeholders' => [ + 'recommender_config.name' => [ + 'getters' => [ + 'getRecommenderConfig', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php b/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php new file mode 100644 index 00000000000..c30e9b51c1d --- /dev/null +++ b/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php @@ -0,0 +1,1062 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RecommenderClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RecommenderClient($options); + } + + /** @test */ + public function getInsightTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $insightSubtype = 'insightSubtype-1491142701'; + $etag = 'etag3123477'; + $expectedResponse = new Insight(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setInsightSubtype($insightSubtype); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); + $request = (new GetInsightRequest()) + ->setName($formattedName); + $response = $gapicClient->getInsight($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInsightExceptionTest() + { + $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->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); + $request = (new GetInsightRequest()) + ->setName($formattedName); + try { + $gapicClient->getInsight($request); + // 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 getInsightTypeConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $revisionId = 'revisionId513861631'; + $displayName = 'displayName1615086568'; + $expectedResponse = new InsightTypeConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); + $request = (new GetInsightTypeConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getInsightTypeConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsightTypeConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInsightTypeConfigExceptionTest() + { + $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->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); + $request = (new GetInsightTypeConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getInsightTypeConfig($request); + // 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 getRecommendationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $recommenderSubtype = 'recommenderSubtype-1488504412'; + $etag = 'etag3123477'; + $xorGroupId = 'xorGroupId381095487'; + $expectedResponse = new Recommendation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRecommenderSubtype($recommenderSubtype); + $expectedResponse->setEtag($etag); + $expectedResponse->setXorGroupId($xorGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $request = (new GetRecommendationRequest()) + ->setName($formattedName); + $response = $gapicClient->getRecommendation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommendation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRecommendationExceptionTest() + { + $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $request = (new GetRecommendationRequest()) + ->setName($formattedName); + try { + $gapicClient->getRecommendation($request); + // 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 getRecommenderConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $revisionId = 'revisionId513861631'; + $displayName = 'displayName1615086568'; + $expectedResponse = new RecommenderConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); + $request = (new GetRecommenderConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getRecommenderConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommenderConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRecommenderConfigExceptionTest() + { + $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->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); + $request = (new GetRecommenderConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getRecommenderConfig($request); + // 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 listInsightsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $insightsElement = new Insight(); + $insights = [ + $insightsElement, + ]; + $expectedResponse = new ListInsightsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInsights($insights); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); + $request = (new ListInsightsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInsights($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInsights()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/ListInsights', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInsightsExceptionTest() + { + $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->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); + $request = (new ListInsightsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInsights($request); + // 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 listRecommendationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $recommendationsElement = new Recommendation(); + $recommendations = [ + $recommendationsElement, + ]; + $expectedResponse = new ListRecommendationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRecommendations($recommendations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); + $request = (new ListRecommendationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRecommendations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRecommendations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/ListRecommendations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRecommendationsExceptionTest() + { + $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->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); + $request = (new ListRecommendationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRecommendations($request); + // 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 markInsightAcceptedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $insightSubtype = 'insightSubtype-1491142701'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Insight(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setInsightSubtype($insightSubtype); + $expectedResponse->setEtag($etag2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); + $etag = 'etag3123477'; + $request = (new MarkInsightAcceptedRequest()) + ->setName($formattedName) + ->setEtag($etag); + $response = $gapicClient->markInsightAccepted($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkInsightAccepted', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getEtag(); + $this->assertProtobufEquals($etag, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function markInsightAcceptedExceptionTest() + { + $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->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); + $etag = 'etag3123477'; + $request = (new MarkInsightAcceptedRequest()) + ->setName($formattedName) + ->setEtag($etag); + try { + $gapicClient->markInsightAccepted($request); + // 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 markRecommendationClaimedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $recommenderSubtype = 'recommenderSubtype-1488504412'; + $etag2 = 'etag2-1293302904'; + $xorGroupId = 'xorGroupId381095487'; + $expectedResponse = new Recommendation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRecommenderSubtype($recommenderSubtype); + $expectedResponse->setEtag($etag2); + $expectedResponse->setXorGroupId($xorGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationClaimedRequest()) + ->setName($formattedName) + ->setEtag($etag); + $response = $gapicClient->markRecommendationClaimed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getEtag(); + $this->assertProtobufEquals($etag, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function markRecommendationClaimedExceptionTest() + { + $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationClaimedRequest()) + ->setName($formattedName) + ->setEtag($etag); + try { + $gapicClient->markRecommendationClaimed($request); + // 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 markRecommendationDismissedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $recommenderSubtype = 'recommenderSubtype-1488504412'; + $etag2 = 'etag2-1293302904'; + $xorGroupId = 'xorGroupId381095487'; + $expectedResponse = new Recommendation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRecommenderSubtype($recommenderSubtype); + $expectedResponse->setEtag($etag2); + $expectedResponse->setXorGroupId($xorGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $request = (new MarkRecommendationDismissedRequest()) + ->setName($formattedName); + $response = $gapicClient->markRecommendationDismissed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationDismissed', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function markRecommendationDismissedExceptionTest() + { + $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $request = (new MarkRecommendationDismissedRequest()) + ->setName($formattedName); + try { + $gapicClient->markRecommendationDismissed($request); + // 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 markRecommendationFailedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $recommenderSubtype = 'recommenderSubtype-1488504412'; + $etag2 = 'etag2-1293302904'; + $xorGroupId = 'xorGroupId381095487'; + $expectedResponse = new Recommendation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRecommenderSubtype($recommenderSubtype); + $expectedResponse->setEtag($etag2); + $expectedResponse->setXorGroupId($xorGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationFailedRequest()) + ->setName($formattedName) + ->setEtag($etag); + $response = $gapicClient->markRecommendationFailed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getEtag(); + $this->assertProtobufEquals($etag, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function markRecommendationFailedExceptionTest() + { + $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationFailedRequest()) + ->setName($formattedName) + ->setEtag($etag); + try { + $gapicClient->markRecommendationFailed($request); + // 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 markRecommendationSucceededTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $recommenderSubtype = 'recommenderSubtype-1488504412'; + $etag2 = 'etag2-1293302904'; + $xorGroupId = 'xorGroupId381095487'; + $expectedResponse = new Recommendation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRecommenderSubtype($recommenderSubtype); + $expectedResponse->setEtag($etag2); + $expectedResponse->setXorGroupId($xorGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationSucceededRequest()) + ->setName($formattedName) + ->setEtag($etag); + $response = $gapicClient->markRecommendationSucceeded($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getEtag(); + $this->assertProtobufEquals($etag, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function markRecommendationSucceededExceptionTest() + { + $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); + $etag = 'etag3123477'; + $request = (new MarkRecommendationSucceededRequest()) + ->setName($formattedName) + ->setEtag($etag); + try { + $gapicClient->markRecommendationSucceeded($request); + // 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 updateInsightTypeConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $revisionId = 'revisionId513861631'; + $displayName = 'displayName1615086568'; + $expectedResponse = new InsightTypeConfig(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $insightTypeConfig = new InsightTypeConfig(); + $request = (new UpdateInsightTypeConfigRequest()) + ->setInsightTypeConfig($insightTypeConfig); + $response = $gapicClient->updateInsightTypeConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateInsightTypeConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getInsightTypeConfig(); + $this->assertProtobufEquals($insightTypeConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateInsightTypeConfigExceptionTest() + { + $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 + $insightTypeConfig = new InsightTypeConfig(); + $request = (new UpdateInsightTypeConfigRequest()) + ->setInsightTypeConfig($insightTypeConfig); + try { + $gapicClient->updateInsightTypeConfig($request); + // 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 updateRecommenderConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $revisionId = 'revisionId513861631'; + $displayName = 'displayName1615086568'; + $expectedResponse = new RecommenderConfig(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $recommenderConfig = new RecommenderConfig(); + $request = (new UpdateRecommenderConfigRequest()) + ->setRecommenderConfig($recommenderConfig); + $response = $gapicClient->updateRecommenderConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateRecommenderConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getRecommenderConfig(); + $this->assertProtobufEquals($recommenderConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRecommenderConfigExceptionTest() + { + $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 + $recommenderConfig = new RecommenderConfig(); + $request = (new UpdateRecommenderConfigRequest()) + ->setRecommenderConfig($recommenderConfig); + try { + $gapicClient->updateRecommenderConfig($request); + // 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 getInsightAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $insightSubtype = 'insightSubtype-1491142701'; + $etag = 'etag3123477'; + $expectedResponse = new Insight(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setInsightSubtype($insightSubtype); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); + $request = (new GetInsightRequest()) + ->setName($formattedName); + $response = $gapicClient->getInsightAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php b/owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php new file mode 100644 index 0000000000000000000000000000000000000000..c307098716a6d9ddff1ee39b9c234797ae9f59ec GIT binary patch literal 10724 zcmb^%&2Jl7eQhV%3($6?e0$ONis`f8{0{@yFs%P`#BkE z&kQr;q}f#k0__1I!~rBONPvV89|!&bIKYuTg2bT`hyy2XT)DvSz4>-L#Obz|#`Au^ z-}`-k&Ak1tv2UO&*)^gOQ?W@iyL*(i_es_;bz5)f?d)#1)gorLp?3_mP0U<2TP$Zw z<$6{uO7+WtYUy3GL6)<7y1v&Y`9@psHuENFs#gBsj`LGyKXZ&GLYmScmZ3CAcCE6q zNo=L5*viftL*FS-^qne2-`T!%AE8EDv8*h6%$}l8Q5OCg-QBj@$Xd2y!+%#*OI9`2 zR+YB;2?+5Z+fv#V0rcart*+LvRb9(cgtFEki#M_kO$vL}&_U=2S&yFz)dT2YN78I! zYD#;jNUVmb8n$j$0CahIkJ!HU=##}8?zNPh+R83EJT5OEWAZ`PHoGKzdp2tlyK8Fq z8Q+w^Q~$4>KH3rtbw|)NooYeXtmWlErhr5oVxg@P%|0E@s!H0;6|%1!sJeMN)GBd3 zWnd;ZbZyVlJn~L@LIdJPL#E7kQ zjKOj1M+Vs`Do1+jkdRZ{$?)iXdaJ3#$jPGO_B*N@146UuyZkC-g+<>JA+0g z4g3tUAU&sl1kC@gB-L$!Jcr@%NGKsov!4vOpfl>FqU6GQLzrX=wk=WO9*!qnyfV%*|MQSt8~Pj1G?i&i!pRJ1B42L zcZA(UGhtFzW1lp;ZNi;r#BQEUtma}+aw*Kh*8p}vb9z^^xl2HYxj+KnMZ+5C-{P`N zo0no}dl@c7P-%h^n}!Y|bC-djoAJP>APR#sPy|FW@7amr;V4bihJ5kA91AutzR07v` zBGR!A2w-(BgMc4__kge#bb;KLKz{=WQ1dZC6hL%HLUs!q+)J}N*8>4wK^K(+MTH{J zCLmA_Z|=p3Zz zucEjiGO!`wZmcR+1gT1~hM}O2ZwgYWE|!E+LClQMb7`|ut}^gZoIw+-g0um^a(P>< zX2$q?XozM%D5IIWBvyNP0xnjBnp6OWfHZJjDhk!2ye?!?{6}a!l#%dx#1+b=l31wA zo8@A!a2TbFQk5Q7M3FI@fH*r_sY=^a6E(5AEfqvrC=|q6EtBL`G+XbNJMhkRbfsPu zN;Ro2i={&KQKc@GOZ~2#N3)bH$Rupl*Tqs@Du52lC6I;cP^t+l8=&|k-$9w)IKe!+ zNYyWcayJ04*6#w~KMLd1OklV?dIlD8uiHYIUa!WN(S_O;I0J|U!T@Fs{)@WDMYK@Z zs@2PzAkd~z64u0`{AKZxEY)gTVkWWt@xO$xq6hwC$m0CHNiSu4Mz;8oY{~DAK zEB~qc*VDY$!@x7|&!>6SZMfi}_vcgo`$K5@Sd8O`C=<>UEIZN2NiW@t$xg>;su+6SIUA;G_orh25tS#-W4R%=oX!WUwpPZWjyHi2J8scLZr9QY8W zqf$bra;{bqDz)`84Y;aQF7|j6P%4*1dA+<<&7^3Ss7W8NU$x8-%@Xy8;>NafUW2>> zDGQ#I>W}1Az;FRa_`fC5c^H}9>KUreRr2*Nw2e?M!~Oa-=&=4HTsp~1KSoo~BD+Lo zI$^j*Ux_jL|6?H+9MU0@+CPckK$8J|+Wn>mGn$6dQF2t#Rk2oB7mHgPqFjGe=}mkr z0dK+{3ep^89>@zN@q@Z7Y(pBR89{z1m5Swukmje+q+1ROa$VXKA;tbXfu=)Rb$TA$ z)49`NJJI1%6sv2%7R&AT>6kPC7K}pB?XX=E9b~AUoSKQZ(L9~u+eeY=dZ=nm{SZbb zI&|e??Ddf0g#>%Zuvl#Jzeu3D7y!J8QZQ?>!kk_@>rtm3l7po}xkd3D3+E9E#iS!_ z6oC#l&?t0=P6ip! zGz%!*P-sKtxiaH>bS23pFeEtdsoaDfu&rvY-3LlfDgFtX*?=*|s~naW&~Kp;L!o1( zJA&U}A$%|S27L({uPe3?CwpC^a$ zHFQ2iN`NV?W}C1h{6a);AnZvNP^6-;DbQjUICkNGoe|ek_CyWN;Lq%t| zj6GAKd#R|pp2zym1PNOye*qMzir+x9Mbak64f8xV@fXn8TEnWb*Bel`Q(aSaBa;?7 zzKq5t&FI?BJO*_S?KLdf*>Sr%&3b9BXNBXFU4Ln16pc7Iv@e%BbVTjdQ=iS;12m!1 z%VCP9I~~_C_?Y`bd^*0tqcrdUZ!&CEW4pLM^2unT+_eJ%-$PSWKqy%rk}GB0+9P@c zh&ss%o`=mpMzi9R0p)!cP3nx9sK8fZ1P(LqNc`g@np=gLRfie1SHI8W9k_{R=zA-f zRxoJ${p}5P$MljA!&nRpP-1PR;#2Y)b-so0@grE3W?^O(?lDiSxA@j+N-a*K5$NsV{TXxL zF&G_(z&g9mQW*N;Nk|uTr`d#egld~(TVPlqXP`7UNE@m%YlLArHv&2zWy#u5{k*^y z!~CBTDC3n$U#>@JDp+99rMOr0?#Gy|mqJeP_8%WoY=1kNTKEv1>2ns{U@V2#9^*@K zPE1LAEYsZxpGFhmXZ-IHC>`A`GNr*VrnF_P+u4OJEwvfbEL~JOWu>>t9jHNPO)hz2 zsHWTO3^>h!xvYKVj@*I*O-uvowCxyj>6fzz1+R7SuM=o8(wyM9rELVtExil3;w%^K zw48p2f9ILt_FCWi%RhgR%;VeiUG=9<`}M$`->v-3&;)-oG`Zs+CD3@N2f;UDZV$nD zjGk09`L~}5Y_N-PMqj_g@D*Ap++oe;1Sy?c!pU5d|Ai8NYea%9wE{VcJ?o zwXm}E2J;C|O}RmxBczURC(%?-H;He1=I-gTdf*0B$j@H1LNFEcR^+86bBbmD^;3n& za@XmimlHSfe!>fn1xly@cq<$Hgw-MQgLS@ey3`QR3~2?NVqyJr zVW!`^n?DP=ecLvy<$V6|@X#$H{%(ynB+l21x8VaAyQQ0*m3=f1?|k}~n-wl-W^3>b zirOICcj!o`R}vpOgnUGJZ?vbo-$=rR(0VfdjNSY0|GOj1x$a)~Kdidtd@C6Gw2%%* TYNO9*g$&a9{O>7xiqQW6Lz|}O literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php new file mode 100644 index 00000000000..93b3257476c --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php @@ -0,0 +1,205 @@ +google.cloud.redis.v1.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The logical name of the Redis instance in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. A Redis [Instance] resource + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + + /** + * @param string $parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::locationName()} for help formatting this field. + * @param string $instanceId Required. The logical name of the Redis instance in the customer project + * with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @param \Google\Cloud\Redis\V1\Instance $instance Required. A Redis [Instance] resource + * + * @return \Google\Cloud\Redis\V1\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, string $instanceId, \Google\Cloud\Redis\V1\Instance $instance): self + { + return (new self()) + ->setParent($parent) + ->setInstanceId($instanceId) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type string $instance_id + * Required. The logical name of the Redis instance in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Redis\V1\Instance $instance + * Required. A Redis [Instance] resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 logical name of the Redis instance in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. The logical name of the Redis instance in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. A Redis [Instance] resource + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. A Redis [Instance] resource + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\Instance::class); + $this->instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php new file mode 100644 index 00000000000..76460853e35 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php @@ -0,0 +1,92 @@ +google.cloud.redis.v1.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\V1\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php new file mode 100644 index 00000000000..5c28a058dd4 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php @@ -0,0 +1,136 @@ +google.cloud.redis.v1.ExportInstanceRequest + */ +class ExportInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Specify data to be exported. + * + * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @param \Google\Cloud\Redis\V1\OutputConfig $outputConfig Required. Specify data to be exported. + * + * @return \Google\Cloud\Redis\V1\ExportInstanceRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Redis\V1\OutputConfig $outputConfig): self + { + return (new self()) + ->setName($name) + ->setOutputConfig($outputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @type \Google\Cloud\Redis\V1\OutputConfig $output_config + * Required. Specify data to be exported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Specify data to be exported. + * + * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. Specify data to be exported. + * + * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php new file mode 100644 index 00000000000..b819dcbb3ed --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php @@ -0,0 +1,133 @@ +google.cloud.redis.v1.FailoverInstanceRequest + */ +class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Available data protection modes that the user can choose. If it's + * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * + * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_protection_mode = 0; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * @param int $dataProtectionMode Optional. Available data protection modes that the user can choose. If it's + * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * For allowed values, use constants defined on {@see \Google\Cloud\Redis\V1\FailoverInstanceRequest\DataProtectionMode} + * + * @return \Google\Cloud\Redis\V1\FailoverInstanceRequest + * + * @experimental + */ + public static function build(string $name, int $dataProtectionMode): self + { + return (new self()) + ->setName($name) + ->setDataProtectionMode($dataProtectionMode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @type int $data_protection_mode + * Optional. Available data protection modes that the user can choose. If it's + * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * Optional. Available data protection modes that the user can choose. If it's + * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * + * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDataProtectionMode() + { + return $this->data_protection_mode; + } + + /** + * Optional. Available data protection modes that the user can choose. If it's + * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * + * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDataProtectionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\FailoverInstanceRequest\DataProtectionMode::class); + $this->data_protection_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php new file mode 100644 index 00000000000..1bbce71617b --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php @@ -0,0 +1,68 @@ +google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode + */ +class DataProtectionMode +{ + /** + * Defaults to LIMITED_DATA_LOSS if a data protection mode is not + * specified. + * + * Generated from protobuf enum DATA_PROTECTION_MODE_UNSPECIFIED = 0; + */ + const DATA_PROTECTION_MODE_UNSPECIFIED = 0; + /** + * Instance failover will be protected with data loss control. More + * specifically, the failover will only be performed if the current + * replication offset diff between primary and replica is under a certain + * threshold. + * + * Generated from protobuf enum LIMITED_DATA_LOSS = 1; + */ + const LIMITED_DATA_LOSS = 1; + /** + * Instance failover will be performed without data loss control. + * + * Generated from protobuf enum FORCE_DATA_LOSS = 2; + */ + const FORCE_DATA_LOSS = 2; + + private static $valueToName = [ + self::DATA_PROTECTION_MODE_UNSPECIFIED => 'DATA_PROTECTION_MODE_UNSPECIFIED', + self::LIMITED_DATA_LOSS => 'LIMITED_DATA_LOSS', + self::FORCE_DATA_LOSS => 'FORCE_DATA_LOSS', + ]; + + 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(DataProtectionMode::class, \Google\Cloud\Redis\V1\FailoverInstanceRequest_DataProtectionMode::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php new file mode 100644 index 00000000000..c1f41c40102 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php @@ -0,0 +1,71 @@ +google.cloud.redis.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Data destination URI (e.g. + * 'gs://my_bucket/my_object'). Existing files will be overwritten. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. Data destination URI (e.g. + * 'gs://my_bucket/my_object'). Existing files will be overwritten. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Data destination URI (e.g. + * 'gs://my_bucket/my_object'). Existing files will be overwritten. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. Data destination URI (e.g. + * 'gs://my_bucket/my_object'). Existing files will be overwritten. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php new file mode 100644 index 00000000000..23c862a97ff --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php @@ -0,0 +1,67 @@ +google.cloud.redis.v1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + * + * 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; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php new file mode 100644 index 00000000000..d277b7575cb --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php @@ -0,0 +1,92 @@ +google.cloud.redis.v1.GetInstanceAuthStringRequest + */ +class GetInstanceAuthStringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\V1\GetInstanceAuthStringRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php new file mode 100644 index 00000000000..8ba7a6130d0 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php @@ -0,0 +1,91 @@ +google.cloud.redis.v1.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\V1\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php new file mode 100644 index 00000000000..aeb65492a87 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php @@ -0,0 +1,136 @@ +google.cloud.redis.v1.ImportInstanceRequest + */ +class ImportInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Specify data to be imported. + * + * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @param \Google\Cloud\Redis\V1\InputConfig $inputConfig Required. Specify data to be imported. + * + * @return \Google\Cloud\Redis\V1\ImportInstanceRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Redis\V1\InputConfig $inputConfig): self + { + return (new self()) + ->setName($name) + ->setInputConfig($inputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @type \Google\Cloud\Redis\V1\InputConfig $input_config + * Required. Specify data to be imported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Specify data to be imported. + * + * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\V1\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. Specify data to be imported. + * + * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php new file mode 100644 index 00000000000..6a8c0ce00c1 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php @@ -0,0 +1,75 @@ +google.cloud.redis.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\V1\GcsSource $gcs_source + * Google Cloud Storage location where input content is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage location where input content is located. + * + * Generated from protobuf field .google.cloud.redis.v1.GcsSource gcs_source = 1; + * @return \Google\Cloud\Redis\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * Google Cloud Storage location where input content is located. + * + * Generated from protobuf field .google.cloud.redis.v1.GcsSource gcs_source = 1; + * @param \Google\Cloud\Redis\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php new file mode 100644 index 00000000000..c1b99c5ed02 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php @@ -0,0 +1,1567 @@ +google.cloud.redis.v1.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * Note: Redis instances are managed and addressed at regional level so + * location_id here refers to a GCP region; however, users may choose which + * specific zone (or collection of zones for cross-zone instances) an instance + * should be provisioned in. Refer to + * [location_id][google.cloud.redis.v1.Instance.location_id] and + * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] + * fields for more details. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * An arbitrary and optional user-provided name for the instance. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Resource labels to represent user provided metadata + * + * Generated from protobuf field map labels = 3; + */ + private $labels; + /** + * Optional. The zone where the instance will be provisioned. If not provided, + * the service will choose a zone from the specified region for the instance. + * For standard tier, additional nodes will be added across multiple zones for + * protection against zonal failures. If specified, at least one node will be + * provisioned in this zone. + * + * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location_id = ''; + /** + * Optional. If specified, at least one node will be provisioned in this zone + * in addition to the zone specified in location_id. Only applicable to + * standard tier. If provided, it must be a different zone from the one + * provided in [location_id]. Additional nodes beyond the first 2 will be + * placed in zones selected by the service. + * + * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alternative_location_id = ''; + /** + * Optional. The version of Redis software. + * If not provided, latest supported version will be used. Currently, the + * supported values are: + * * `REDIS_3_2` for Redis 3.2 compatibility + * * `REDIS_4_0` for Redis 4.0 compatibility (default) + * * `REDIS_5_0` for Redis 5.0 compatibility + * * `REDIS_6_X` for Redis 6.x compatibility + * + * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $redis_version = ''; + /** + * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + * that are reserved for this instance. Range must + * be unique and non-overlapping with existing subnets in an authorized + * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + * address ranges associated with this private service access connection. + * If not provided, the service will choose an unused /29 block, for + * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + * the default block size is /28. + * + * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reserved_ip_range = ''; + /** + * Optional. Additional IP range for node placement. Required when enabling + * read replicas on an existing instance. For DIRECT_PEERING mode value must + * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode + * value must be the name of an allocated address range associated with the + * private service access connection, or "auto". + * + * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $secondary_ip_range = ''; + /** + * Output only. Hostname or IP address of the exposed Redis endpoint used by + * clients to connect to the service. + * + * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $host = ''; + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $port = 0; + /** + * Output only. The current zone where the Redis primary node is located. In + * basic tier, this will always be the same as [location_id]. In + * standard tier, this can be the zone of any node in the instance. + * + * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_location_id = ''; + /** + * Output only. The time the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The current state of this instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Additional information about the current status of this + * instance, if available. + * + * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Optional. Redis configuration parameters, according to + * http://redis.io/topics/config. Currently, the only supported parameters + * are: + * Redis version 3.2 and newer: + * * maxmemory-policy + * * notify-keyspace-events + * Redis version 4.0 and newer: + * * activedefrag + * * lfu-decay-time + * * lfu-log-factor + * * maxmemory-gb + * Redis version 5.0 and newer: + * * stream-node-max-bytes + * * stream-node-max-entries + * + * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $redis_configs; + /** + * Required. The service tier of the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tier = 0; + /** + * Required. Redis memory size in GiB. + * + * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $memory_size_gb = 0; + /** + * Optional. The full name of the Google Compute Engine + * [network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. If left unspecified, the `default` network + * will be used. + * + * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authorized_network = ''; + /** + * Output only. Cloud IAM identity used by import / export operations to + * transfer data to/from Cloud Storage. Format is + * "serviceAccount:". The value may change over time + * for a given instance so should be checked before each import/export + * operation. + * + * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $persistence_iam_identity = ''; + /** + * Optional. The network connect mode of the Redis instance. + * If not provided, the connect mode defaults to DIRECT_PEERING. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $connect_mode = 0; + /** + * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If + * set to "true" AUTH is enabled on the instance. Default value is "false" + * meaning AUTH is disabled. + * + * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auth_enabled = false; + /** + * Output only. List of server CA certificates for the instance. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $server_ca_certs; + /** + * Optional. The TLS mode of the Redis instance. + * If not provided, TLS is disabled for the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transit_encryption_mode = 0; + /** + * Optional. The maintenance policy for the instance. If not provided, + * maintenance events can be performed at any time. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $maintenance_policy = null; + /** + * Output only. Date and time of upcoming maintenance events which have been + * scheduled. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $maintenance_schedule = null; + /** + * Optional. The number of replica nodes. The valid range for the Standard + * Tier with read replicas enabled is [1-5] and defaults to 2. If read + * replicas are not enabled for a Standard Tier instance, the only valid value + * is 1 and the default is 1. The valid value for basic tier is 0 and the + * default is also 0. + * + * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $replica_count = 0; + /** + * Output only. Info per node. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodes; + /** + * Output only. Hostname or IP address of the exposed readonly Redis + * endpoint. Standard tier only. Targets all healthy replica nodes in + * instance. Replication is asynchronous and replica nodes will exhibit some + * lag behind the primary. Write requests must target 'host'. + * + * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $read_endpoint = ''; + /** + * Output only. The port number of the exposed readonly redis + * endpoint. Standard tier only. Write requests should target 'port'. + * + * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $read_endpoint_port = 0; + /** + * Optional. Read replicas mode for the instance. Defaults to + * READ_REPLICAS_DISABLED. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_replicas_mode = 0; + /** + * Optional. The KMS key reference that the customer provides when trying to + * create the instance. + * + * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $customer_managed_key = ''; + /** + * Optional. Persistence configuration parameters + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $persistence_config = null; + /** + * Optional. reasons that causes instance in "SUSPENDED" state. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $suspension_reasons; + /** + * Optional. The self service update maintenance version. + * The version is date based such as "20210712_00_00". + * + * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $maintenance_version = ''; + /** + * Optional. The available maintenance versions that an instance could update + * to. + * + * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $available_maintenance_versions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * Note: Redis instances are managed and addressed at regional level so + * location_id here refers to a GCP region; however, users may choose which + * specific zone (or collection of zones for cross-zone instances) an instance + * should be provisioned in. Refer to + * [location_id][google.cloud.redis.v1.Instance.location_id] and + * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] + * fields for more details. + * @type string $display_name + * An arbitrary and optional user-provided name for the instance. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Resource labels to represent user provided metadata + * @type string $location_id + * Optional. The zone where the instance will be provisioned. If not provided, + * the service will choose a zone from the specified region for the instance. + * For standard tier, additional nodes will be added across multiple zones for + * protection against zonal failures. If specified, at least one node will be + * provisioned in this zone. + * @type string $alternative_location_id + * Optional. If specified, at least one node will be provisioned in this zone + * in addition to the zone specified in location_id. Only applicable to + * standard tier. If provided, it must be a different zone from the one + * provided in [location_id]. Additional nodes beyond the first 2 will be + * placed in zones selected by the service. + * @type string $redis_version + * Optional. The version of Redis software. + * If not provided, latest supported version will be used. Currently, the + * supported values are: + * * `REDIS_3_2` for Redis 3.2 compatibility + * * `REDIS_4_0` for Redis 4.0 compatibility (default) + * * `REDIS_5_0` for Redis 5.0 compatibility + * * `REDIS_6_X` for Redis 6.x compatibility + * @type string $reserved_ip_range + * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + * that are reserved for this instance. Range must + * be unique and non-overlapping with existing subnets in an authorized + * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + * address ranges associated with this private service access connection. + * If not provided, the service will choose an unused /29 block, for + * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + * the default block size is /28. + * @type string $secondary_ip_range + * Optional. Additional IP range for node placement. Required when enabling + * read replicas on an existing instance. For DIRECT_PEERING mode value must + * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode + * value must be the name of an allocated address range associated with the + * private service access connection, or "auto". + * @type string $host + * Output only. Hostname or IP address of the exposed Redis endpoint used by + * clients to connect to the service. + * @type int $port + * Output only. The port number of the exposed Redis endpoint. + * @type string $current_location_id + * Output only. The current zone where the Redis primary node is located. In + * basic tier, this will always be the same as [location_id]. In + * standard tier, this can be the zone of any node in the instance. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the instance was created. + * @type int $state + * Output only. The current state of this instance. + * @type string $status_message + * Output only. Additional information about the current status of this + * instance, if available. + * @type array|\Google\Protobuf\Internal\MapField $redis_configs + * Optional. Redis configuration parameters, according to + * http://redis.io/topics/config. Currently, the only supported parameters + * are: + * Redis version 3.2 and newer: + * * maxmemory-policy + * * notify-keyspace-events + * Redis version 4.0 and newer: + * * activedefrag + * * lfu-decay-time + * * lfu-log-factor + * * maxmemory-gb + * Redis version 5.0 and newer: + * * stream-node-max-bytes + * * stream-node-max-entries + * @type int $tier + * Required. The service tier of the instance. + * @type int $memory_size_gb + * Required. Redis memory size in GiB. + * @type string $authorized_network + * Optional. The full name of the Google Compute Engine + * [network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. If left unspecified, the `default` network + * will be used. + * @type string $persistence_iam_identity + * Output only. Cloud IAM identity used by import / export operations to + * transfer data to/from Cloud Storage. Format is + * "serviceAccount:". The value may change over time + * for a given instance so should be checked before each import/export + * operation. + * @type int $connect_mode + * Optional. The network connect mode of the Redis instance. + * If not provided, the connect mode defaults to DIRECT_PEERING. + * @type bool $auth_enabled + * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If + * set to "true" AUTH is enabled on the instance. Default value is "false" + * meaning AUTH is disabled. + * @type array<\Google\Cloud\Redis\V1\TlsCertificate>|\Google\Protobuf\Internal\RepeatedField $server_ca_certs + * Output only. List of server CA certificates for the instance. + * @type int $transit_encryption_mode + * Optional. The TLS mode of the Redis instance. + * If not provided, TLS is disabled for the instance. + * @type \Google\Cloud\Redis\V1\MaintenancePolicy $maintenance_policy + * Optional. The maintenance policy for the instance. If not provided, + * maintenance events can be performed at any time. + * @type \Google\Cloud\Redis\V1\MaintenanceSchedule $maintenance_schedule + * Output only. Date and time of upcoming maintenance events which have been + * scheduled. + * @type int $replica_count + * Optional. The number of replica nodes. The valid range for the Standard + * Tier with read replicas enabled is [1-5] and defaults to 2. If read + * replicas are not enabled for a Standard Tier instance, the only valid value + * is 1 and the default is 1. The valid value for basic tier is 0 and the + * default is also 0. + * @type array<\Google\Cloud\Redis\V1\NodeInfo>|\Google\Protobuf\Internal\RepeatedField $nodes + * Output only. Info per node. + * @type string $read_endpoint + * Output only. Hostname or IP address of the exposed readonly Redis + * endpoint. Standard tier only. Targets all healthy replica nodes in + * instance. Replication is asynchronous and replica nodes will exhibit some + * lag behind the primary. Write requests must target 'host'. + * @type int $read_endpoint_port + * Output only. The port number of the exposed readonly redis + * endpoint. Standard tier only. Write requests should target 'port'. + * @type int $read_replicas_mode + * Optional. Read replicas mode for the instance. Defaults to + * READ_REPLICAS_DISABLED. + * @type string $customer_managed_key + * Optional. The KMS key reference that the customer provides when trying to + * create the instance. + * @type \Google\Cloud\Redis\V1\PersistenceConfig $persistence_config + * Optional. Persistence configuration parameters + * @type array|\Google\Protobuf\Internal\RepeatedField $suspension_reasons + * Optional. reasons that causes instance in "SUSPENDED" state. + * @type string $maintenance_version + * Optional. The self service update maintenance version. + * The version is date based such as "20210712_00_00". + * @type array|\Google\Protobuf\Internal\RepeatedField $available_maintenance_versions + * Optional. The available maintenance versions that an instance could update + * to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * Note: Redis instances are managed and addressed at regional level so + * location_id here refers to a GCP region; however, users may choose which + * specific zone (or collection of zones for cross-zone instances) an instance + * should be provisioned in. Refer to + * [location_id][google.cloud.redis.v1.Instance.location_id] and + * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] + * fields for more details. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * Note: Redis instances are managed and addressed at regional level so + * location_id here refers to a GCP region; however, users may choose which + * specific zone (or collection of zones for cross-zone instances) an instance + * should be provisioned in. Refer to + * [location_id][google.cloud.redis.v1.Instance.location_id] and + * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] + * fields for more details. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An arbitrary and optional user-provided name for the instance. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * An arbitrary and optional user-provided name for the instance. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Resource labels to represent user provided metadata + * + * Generated from protobuf field map labels = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Resource labels to represent user provided metadata + * + * Generated from protobuf field map labels = 3; + * @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; + } + + /** + * Optional. The zone where the instance will be provisioned. If not provided, + * the service will choose a zone from the specified region for the instance. + * For standard tier, additional nodes will be added across multiple zones for + * protection against zonal failures. If specified, at least one node will be + * provisioned in this zone. + * + * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * Optional. The zone where the instance will be provisioned. If not provided, + * the service will choose a zone from the specified region for the instance. + * For standard tier, additional nodes will be added across multiple zones for + * protection against zonal failures. If specified, at least one node will be + * provisioned in this zone. + * + * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + + /** + * Optional. If specified, at least one node will be provisioned in this zone + * in addition to the zone specified in location_id. Only applicable to + * standard tier. If provided, it must be a different zone from the one + * provided in [location_id]. Additional nodes beyond the first 2 will be + * placed in zones selected by the service. + * + * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlternativeLocationId() + { + return $this->alternative_location_id; + } + + /** + * Optional. If specified, at least one node will be provisioned in this zone + * in addition to the zone specified in location_id. Only applicable to + * standard tier. If provided, it must be a different zone from the one + * provided in [location_id]. Additional nodes beyond the first 2 will be + * placed in zones selected by the service. + * + * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlternativeLocationId($var) + { + GPBUtil::checkString($var, True); + $this->alternative_location_id = $var; + + return $this; + } + + /** + * Optional. The version of Redis software. + * If not provided, latest supported version will be used. Currently, the + * supported values are: + * * `REDIS_3_2` for Redis 3.2 compatibility + * * `REDIS_4_0` for Redis 4.0 compatibility (default) + * * `REDIS_5_0` for Redis 5.0 compatibility + * * `REDIS_6_X` for Redis 6.x compatibility + * + * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRedisVersion() + { + return $this->redis_version; + } + + /** + * Optional. The version of Redis software. + * If not provided, latest supported version will be used. Currently, the + * supported values are: + * * `REDIS_3_2` for Redis 3.2 compatibility + * * `REDIS_4_0` for Redis 4.0 compatibility (default) + * * `REDIS_5_0` for Redis 5.0 compatibility + * * `REDIS_6_X` for Redis 6.x compatibility + * + * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRedisVersion($var) + { + GPBUtil::checkString($var, True); + $this->redis_version = $var; + + return $this; + } + + /** + * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + * that are reserved for this instance. Range must + * be unique and non-overlapping with existing subnets in an authorized + * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + * address ranges associated with this private service access connection. + * If not provided, the service will choose an unused /29 block, for + * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + * the default block size is /28. + * + * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReservedIpRange() + { + return $this->reserved_ip_range; + } + + /** + * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + * that are reserved for this instance. Range must + * be unique and non-overlapping with existing subnets in an authorized + * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + * address ranges associated with this private service access connection. + * If not provided, the service will choose an unused /29 block, for + * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + * the default block size is /28. + * + * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_ip_range = $var; + + return $this; + } + + /** + * Optional. Additional IP range for node placement. Required when enabling + * read replicas on an existing instance. For DIRECT_PEERING mode value must + * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode + * value must be the name of an allocated address range associated with the + * private service access connection, or "auto". + * + * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSecondaryIpRange() + { + return $this->secondary_ip_range; + } + + /** + * Optional. Additional IP range for node placement. Required when enabling + * read replicas on an existing instance. For DIRECT_PEERING mode value must + * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode + * value must be the name of an allocated address range associated with the + * private service access connection, or "auto". + * + * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSecondaryIpRange($var) + { + GPBUtil::checkString($var, True); + $this->secondary_ip_range = $var; + + return $this; + } + + /** + * Output only. Hostname or IP address of the exposed Redis endpoint used by + * clients to connect to the service. + * + * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Output only. Hostname or IP address of the exposed Redis endpoint used by + * clients to connect to the service. + * + * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Output only. The current zone where the Redis primary node is located. In + * basic tier, this will always be the same as [location_id]. In + * standard tier, this can be the zone of any node in the instance. + * + * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCurrentLocationId() + { + return $this->current_location_id; + } + + /** + * Output only. The current zone where the Redis primary node is located. In + * basic tier, this will always be the same as [location_id]. In + * standard tier, this can be the zone of any node in the instance. + * + * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCurrentLocationId($var) + { + GPBUtil::checkString($var, True); + $this->current_location_id = $var; + + return $this; + } + + /** + * Output only. The time the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The current state of this instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of this instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Additional information about the current status of this + * instance, if available. + * + * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Additional information about the current status of this + * instance, if available. + * + * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Optional. Redis configuration parameters, according to + * http://redis.io/topics/config. Currently, the only supported parameters + * are: + * Redis version 3.2 and newer: + * * maxmemory-policy + * * notify-keyspace-events + * Redis version 4.0 and newer: + * * activedefrag + * * lfu-decay-time + * * lfu-log-factor + * * maxmemory-gb + * Redis version 5.0 and newer: + * * stream-node-max-bytes + * * stream-node-max-entries + * + * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRedisConfigs() + { + return $this->redis_configs; + } + + /** + * Optional. Redis configuration parameters, according to + * http://redis.io/topics/config. Currently, the only supported parameters + * are: + * Redis version 3.2 and newer: + * * maxmemory-policy + * * notify-keyspace-events + * Redis version 4.0 and newer: + * * activedefrag + * * lfu-decay-time + * * lfu-log-factor + * * maxmemory-gb + * Redis version 5.0 and newer: + * * stream-node-max-bytes + * * stream-node-max-entries + * + * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRedisConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->redis_configs = $arr; + + return $this; + } + + /** + * Required. The service tier of the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getTier() + { + return $this->tier; + } + + /** + * Required. The service tier of the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\Tier::class); + $this->tier = $var; + + return $this; + } + + /** + * Required. Redis memory size in GiB. + * + * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMemorySizeGb() + { + return $this->memory_size_gb; + } + + /** + * Required. Redis memory size in GiB. + * + * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMemorySizeGb($var) + { + GPBUtil::checkInt32($var); + $this->memory_size_gb = $var; + + return $this; + } + + /** + * Optional. The full name of the Google Compute Engine + * [network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. If left unspecified, the `default` network + * will be used. + * + * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAuthorizedNetwork() + { + return $this->authorized_network; + } + + /** + * Optional. The full name of the Google Compute Engine + * [network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. If left unspecified, the `default` network + * will be used. + * + * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAuthorizedNetwork($var) + { + GPBUtil::checkString($var, True); + $this->authorized_network = $var; + + return $this; + } + + /** + * Output only. Cloud IAM identity used by import / export operations to + * transfer data to/from Cloud Storage. Format is + * "serviceAccount:". The value may change over time + * for a given instance so should be checked before each import/export + * operation. + * + * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPersistenceIamIdentity() + { + return $this->persistence_iam_identity; + } + + /** + * Output only. Cloud IAM identity used by import / export operations to + * transfer data to/from Cloud Storage. Format is + * "serviceAccount:". The value may change over time + * for a given instance so should be checked before each import/export + * operation. + * + * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPersistenceIamIdentity($var) + { + GPBUtil::checkString($var, True); + $this->persistence_iam_identity = $var; + + return $this; + } + + /** + * Optional. The network connect mode of the Redis instance. + * If not provided, the connect mode defaults to DIRECT_PEERING. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConnectMode() + { + return $this->connect_mode; + } + + /** + * Optional. The network connect mode of the Redis instance. + * If not provided, the connect mode defaults to DIRECT_PEERING. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConnectMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\ConnectMode::class); + $this->connect_mode = $var; + + return $this; + } + + /** + * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If + * set to "true" AUTH is enabled on the instance. Default value is "false" + * meaning AUTH is disabled. + * + * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAuthEnabled() + { + return $this->auth_enabled; + } + + /** + * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If + * set to "true" AUTH is enabled on the instance. Default value is "false" + * meaning AUTH is disabled. + * + * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAuthEnabled($var) + { + GPBUtil::checkBool($var); + $this->auth_enabled = $var; + + return $this; + } + + /** + * Output only. List of server CA certificates for the instance. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServerCaCerts() + { + return $this->server_ca_certs; + } + + /** + * Output only. List of server CA certificates for the instance. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\V1\TlsCertificate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServerCaCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\TlsCertificate::class); + $this->server_ca_certs = $arr; + + return $this; + } + + /** + * Optional. The TLS mode of the Redis instance. + * If not provided, TLS is disabled for the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTransitEncryptionMode() + { + return $this->transit_encryption_mode; + } + + /** + * Optional. The TLS mode of the Redis instance. + * If not provided, TLS is disabled for the instance. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTransitEncryptionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\TransitEncryptionMode::class); + $this->transit_encryption_mode = $var; + + return $this; + } + + /** + * Optional. The maintenance policy for the instance. If not provided, + * maintenance events can be performed at any time. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\V1\MaintenancePolicy|null + */ + public function getMaintenancePolicy() + { + return $this->maintenance_policy; + } + + public function hasMaintenancePolicy() + { + return isset($this->maintenance_policy); + } + + public function clearMaintenancePolicy() + { + unset($this->maintenance_policy); + } + + /** + * Optional. The maintenance policy for the instance. If not provided, + * maintenance events can be performed at any time. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\V1\MaintenancePolicy $var + * @return $this + */ + public function setMaintenancePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\MaintenancePolicy::class); + $this->maintenance_policy = $var; + + return $this; + } + + /** + * Output only. Date and time of upcoming maintenance events which have been + * scheduled. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Redis\V1\MaintenanceSchedule|null + */ + public function getMaintenanceSchedule() + { + return $this->maintenance_schedule; + } + + public function hasMaintenanceSchedule() + { + return isset($this->maintenance_schedule); + } + + public function clearMaintenanceSchedule() + { + unset($this->maintenance_schedule); + } + + /** + * Output only. Date and time of upcoming maintenance events which have been + * scheduled. + * + * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Redis\V1\MaintenanceSchedule $var + * @return $this + */ + public function setMaintenanceSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\MaintenanceSchedule::class); + $this->maintenance_schedule = $var; + + return $this; + } + + /** + * Optional. The number of replica nodes. The valid range for the Standard + * Tier with read replicas enabled is [1-5] and defaults to 2. If read + * replicas are not enabled for a Standard Tier instance, the only valid value + * is 1 and the default is 1. The valid value for basic tier is 0 and the + * default is also 0. + * + * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getReplicaCount() + { + return $this->replica_count; + } + + /** + * Optional. The number of replica nodes. The valid range for the Standard + * Tier with read replicas enabled is [1-5] and defaults to 2. If read + * replicas are not enabled for a Standard Tier instance, the only valid value + * is 1 and the default is 1. The valid value for basic tier is 0 and the + * default is also 0. + * + * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setReplicaCount($var) + { + GPBUtil::checkInt32($var); + $this->replica_count = $var; + + return $this; + } + + /** + * Output only. Info per node. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Output only. Info per node. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\V1\NodeInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\NodeInfo::class); + $this->nodes = $arr; + + return $this; + } + + /** + * Output only. Hostname or IP address of the exposed readonly Redis + * endpoint. Standard tier only. Targets all healthy replica nodes in + * instance. Replication is asynchronous and replica nodes will exhibit some + * lag behind the primary. Write requests must target 'host'. + * + * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReadEndpoint() + { + return $this->read_endpoint; + } + + /** + * Output only. Hostname or IP address of the exposed readonly Redis + * endpoint. Standard tier only. Targets all healthy replica nodes in + * instance. Replication is asynchronous and replica nodes will exhibit some + * lag behind the primary. Write requests must target 'host'. + * + * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReadEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->read_endpoint = $var; + + return $this; + } + + /** + * Output only. The port number of the exposed readonly redis + * endpoint. Standard tier only. Write requests should target 'port'. + * + * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReadEndpointPort() + { + return $this->read_endpoint_port; + } + + /** + * Output only. The port number of the exposed readonly redis + * endpoint. Standard tier only. Write requests should target 'port'. + * + * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReadEndpointPort($var) + { + GPBUtil::checkInt32($var); + $this->read_endpoint_port = $var; + + return $this; + } + + /** + * Optional. Read replicas mode for the instance. Defaults to + * READ_REPLICAS_DISABLED. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getReadReplicasMode() + { + return $this->read_replicas_mode; + } + + /** + * Optional. Read replicas mode for the instance. Defaults to + * READ_REPLICAS_DISABLED. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setReadReplicasMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\ReadReplicasMode::class); + $this->read_replicas_mode = $var; + + return $this; + } + + /** + * Optional. The KMS key reference that the customer provides when trying to + * create the instance. + * + * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomerManagedKey() + { + return $this->customer_managed_key; + } + + /** + * Optional. The KMS key reference that the customer provides when trying to + * create the instance. + * + * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomerManagedKey($var) + { + GPBUtil::checkString($var, True); + $this->customer_managed_key = $var; + + return $this; + } + + /** + * Optional. Persistence configuration parameters + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\V1\PersistenceConfig|null + */ + public function getPersistenceConfig() + { + return $this->persistence_config; + } + + public function hasPersistenceConfig() + { + return isset($this->persistence_config); + } + + public function clearPersistenceConfig() + { + unset($this->persistence_config); + } + + /** + * Optional. Persistence configuration parameters + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\V1\PersistenceConfig $var + * @return $this + */ + public function setPersistenceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\PersistenceConfig::class); + $this->persistence_config = $var; + + return $this; + } + + /** + * Optional. reasons that causes instance in "SUSPENDED" state. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuspensionReasons() + { + return $this->suspension_reasons; + } + + /** + * Optional. reasons that causes instance in "SUSPENDED" state. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuspensionReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Redis\V1\Instance\SuspensionReason::class); + $this->suspension_reasons = $arr; + + return $this; + } + + /** + * Optional. The self service update maintenance version. + * The version is date based such as "20210712_00_00". + * + * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMaintenanceVersion() + { + return $this->maintenance_version; + } + + /** + * Optional. The self service update maintenance version. + * The version is date based such as "20210712_00_00". + * + * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMaintenanceVersion($var) + { + GPBUtil::checkString($var, True); + $this->maintenance_version = $var; + + return $this; + } + + /** + * Optional. The available maintenance versions that an instance could update + * to. + * + * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableMaintenanceVersions() + { + return $this->available_maintenance_versions; + } + + /** + * Optional. The available maintenance versions that an instance could update + * to. + * + * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableMaintenanceVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->available_maintenance_versions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php new file mode 100644 index 00000000000..73de1e2672a --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php @@ -0,0 +1,66 @@ +google.cloud.redis.v1.Instance.ConnectMode + */ +class ConnectMode +{ + /** + * Not set. + * + * Generated from protobuf enum CONNECT_MODE_UNSPECIFIED = 0; + */ + const CONNECT_MODE_UNSPECIFIED = 0; + /** + * Connect via direct peering to the Memorystore for Redis hosted service. + * + * Generated from protobuf enum DIRECT_PEERING = 1; + */ + const DIRECT_PEERING = 1; + /** + * Connect your Memorystore for Redis instance using Private Service + * Access. Private services access provides an IP address range for multiple + * Google Cloud services, including Memorystore. + * + * Generated from protobuf enum PRIVATE_SERVICE_ACCESS = 2; + */ + const PRIVATE_SERVICE_ACCESS = 2; + + private static $valueToName = [ + self::CONNECT_MODE_UNSPECIFIED => 'CONNECT_MODE_UNSPECIFIED', + self::DIRECT_PEERING => 'DIRECT_PEERING', + self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS', + ]; + + 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(ConnectMode::class, \Google\Cloud\Redis\V1\Instance_ConnectMode::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php new file mode 100644 index 00000000000..c965b023cc5 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php @@ -0,0 +1,67 @@ +google.cloud.redis.v1.Instance.ReadReplicasMode + */ +class ReadReplicasMode +{ + /** + * If not set, Memorystore Redis backend will default to + * READ_REPLICAS_DISABLED. + * + * Generated from protobuf enum READ_REPLICAS_MODE_UNSPECIFIED = 0; + */ + const READ_REPLICAS_MODE_UNSPECIFIED = 0; + /** + * If disabled, read endpoint will not be provided and the instance cannot + * scale up or down the number of replicas. + * + * Generated from protobuf enum READ_REPLICAS_DISABLED = 1; + */ + const READ_REPLICAS_DISABLED = 1; + /** + * If enabled, read endpoint will be provided and the instance can scale + * up and down the number of replicas. Not valid for basic tier. + * + * Generated from protobuf enum READ_REPLICAS_ENABLED = 2; + */ + const READ_REPLICAS_ENABLED = 2; + + private static $valueToName = [ + self::READ_REPLICAS_MODE_UNSPECIFIED => 'READ_REPLICAS_MODE_UNSPECIFIED', + self::READ_REPLICAS_DISABLED => 'READ_REPLICAS_DISABLED', + self::READ_REPLICAS_ENABLED => 'READ_REPLICAS_ENABLED', + ]; + + 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(ReadReplicasMode::class, \Google\Cloud\Redis\V1\Instance_ReadReplicasMode::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php new file mode 100644 index 00000000000..937abb39ac8 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php @@ -0,0 +1,108 @@ +google.cloud.redis.v1.Instance.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Redis instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Redis instance has been created and is fully usable. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * Redis instance configuration is being updated. Certain kinds of updates + * may cause the instance to become unusable while the update is in + * progress. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * Redis instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * Redis instance is being repaired and may be unusable. + * + * Generated from protobuf enum REPAIRING = 5; + */ + const REPAIRING = 5; + /** + * Maintenance is being performed on this Redis instance. + * + * Generated from protobuf enum MAINTENANCE = 6; + */ + const MAINTENANCE = 6; + /** + * Redis instance is importing data (availability may be affected). + * + * Generated from protobuf enum IMPORTING = 8; + */ + const IMPORTING = 8; + /** + * Redis instance is failing over (availability may be affected). + * + * Generated from protobuf enum FAILING_OVER = 9; + */ + const FAILING_OVER = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::REPAIRING => 'REPAIRING', + self::MAINTENANCE => 'MAINTENANCE', + self::IMPORTING => 'IMPORTING', + self::FAILING_OVER => 'FAILING_OVER', + ]; + + 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(State::class, \Google\Cloud\Redis\V1\Instance_State::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php new file mode 100644 index 00000000000..88c2c61370c --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php @@ -0,0 +1,57 @@ +google.cloud.redis.v1.Instance.SuspensionReason + */ +class SuspensionReason +{ + /** + * Not set. + * + * Generated from protobuf enum SUSPENSION_REASON_UNSPECIFIED = 0; + */ + const SUSPENSION_REASON_UNSPECIFIED = 0; + /** + * Something wrong with the CMEK key provided by customer. + * + * Generated from protobuf enum CUSTOMER_MANAGED_KEY_ISSUE = 1; + */ + const CUSTOMER_MANAGED_KEY_ISSUE = 1; + + private static $valueToName = [ + self::SUSPENSION_REASON_UNSPECIFIED => 'SUSPENSION_REASON_UNSPECIFIED', + self::CUSTOMER_MANAGED_KEY_ISSUE => 'CUSTOMER_MANAGED_KEY_ISSUE', + ]; + + 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(SuspensionReason::class, \Google\Cloud\Redis\V1\Instance_SuspensionReason::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php new file mode 100644 index 00000000000..3ee1210c014 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php @@ -0,0 +1,64 @@ +google.cloud.redis.v1.Instance.Tier + */ +class Tier +{ + /** + * Not set. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * BASIC tier: standalone instance + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * STANDARD_HA tier: highly available primary/replica instances + * + * Generated from protobuf enum STANDARD_HA = 3; + */ + const STANDARD_HA = 3; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::BASIC => 'BASIC', + self::STANDARD_HA => 'STANDARD_HA', + ]; + + 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(Tier::class, \Google\Cloud\Redis\V1\Instance_Tier::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php new file mode 100644 index 00000000000..01e5a5abcd7 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php @@ -0,0 +1,64 @@ +google.cloud.redis.v1.Instance.TransitEncryptionMode + */ +class TransitEncryptionMode +{ + /** + * Not set. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + /** + * Client to Server traffic encryption enabled with server authentication. + * + * Generated from protobuf enum SERVER_AUTHENTICATION = 1; + */ + const SERVER_AUTHENTICATION = 1; + /** + * TLS is disabled for the instance. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', + self::SERVER_AUTHENTICATION => 'SERVER_AUTHENTICATION', + self::DISABLED => 'DISABLED', + ]; + + 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(TransitEncryptionMode::class, \Google\Cloud\Redis\V1\Instance_TransitEncryptionMode::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php new file mode 100644 index 00000000000..9fd5e9c5dce --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php @@ -0,0 +1,67 @@ +google.cloud.redis.v1.InstanceAuthString + */ +class InstanceAuthString extends \Google\Protobuf\Internal\Message +{ + /** + * AUTH string set on the instance. + * + * Generated from protobuf field string auth_string = 1; + */ + protected $auth_string = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auth_string + * AUTH string set on the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * AUTH string set on the instance. + * + * Generated from protobuf field string auth_string = 1; + * @return string + */ + public function getAuthString() + { + return $this->auth_string; + } + + /** + * AUTH string set on the instance. + * + * Generated from protobuf field string auth_string = 1; + * @param string $var + * @return $this + */ + public function setAuthString($var) + { + GPBUtil::checkString($var, True); + $this->auth_string = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php new file mode 100644 index 00000000000..86d5cb38230 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php @@ -0,0 +1,187 @@ +google.cloud.redis.v1.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The `next_page_token` value returned from a previous + * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if + * any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\V1\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type int $page_size + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] + * to determine if there are more instances left to be queried. + * @type string $page_token + * The `next_page_token` value returned from a previous + * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if + * any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The `next_page_token` value returned from a previous + * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if + * any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `next_page_token` value returned from a previous + * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if + * any. + * + * Generated from protobuf field string page_token = 3; + * @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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php new file mode 100644 index 00000000000..05758cf987b --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php @@ -0,0 +1,175 @@ +google.cloud.redis.v1.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of Redis instances in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/instances/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListInstances". + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; + */ + private $instances; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * A list of Redis instances in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/instances/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListInstances". + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * A list of Redis instances in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/instances/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListInstances". + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * A list of Redis instances in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/instances/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListInstances". + * + * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; + * @param array<\Google\Cloud\Redis\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php new file mode 100644 index 00000000000..5b5e9b78592 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php @@ -0,0 +1,82 @@ +google.cloud.redis.v1.LocationMetadata + */ +class LocationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The set of available zones in the location. The map is keyed + * by the lowercase ID of each zone, as defined by GCE. These keys can be + * specified in `location_id` or `alternative_location_id` fields when + * creating a Redis instance. + * + * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $available_zones; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $available_zones + * Output only. The set of available zones in the location. The map is keyed + * by the lowercase ID of each zone, as defined by GCE. These keys can be + * specified in `location_id` or `alternative_location_id` fields when + * creating a Redis instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The set of available zones in the location. The map is keyed + * by the lowercase ID of each zone, as defined by GCE. These keys can be + * specified in `location_id` or `alternative_location_id` fields when + * creating a Redis instance. + * + * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAvailableZones() + { + return $this->available_zones; + } + + /** + * Output only. The set of available zones in the location. The map is keyed + * by the lowercase ID of each zone, as defined by GCE. These keys can be + * specified in `location_id` or `alternative_location_id` fields when + * creating a Redis instance. + * + * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAvailableZones($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\ZoneMetadata::class); + $this->available_zones = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php new file mode 100644 index 00000000000..87f04daa9b8 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php @@ -0,0 +1,201 @@ +google.cloud.redis.v1.MaintenancePolicy + */ +class MaintenancePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time when the policy was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the policy was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Description of what this policy is for. Create/Update methods + * return INVALID_ARGUMENT if the length is greater than 512. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Maintenance window that is applied to resources covered by this + * policy. Minimum 1. For the current version, the maximum number of + * weekly_window is expected to be one. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $weekly_maintenance_window; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the policy was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the policy was last updated. + * @type string $description + * Optional. Description of what this policy is for. Create/Update methods + * return INVALID_ARGUMENT if the length is greater than 512. + * @type array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $weekly_maintenance_window + * Optional. Maintenance window that is applied to resources covered by this + * policy. Minimum 1. For the current version, the maximum number of + * weekly_window is expected to be one. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time when the policy was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the policy was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the policy was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the policy was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Description of what this policy is for. Create/Update methods + * return INVALID_ARGUMENT if the length is greater than 512. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of what this policy is for. Create/Update methods + * return INVALID_ARGUMENT if the length is greater than 512. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Maintenance window that is applied to resources covered by this + * policy. Minimum 1. For the current version, the maximum number of + * weekly_window is expected to be one. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWeeklyMaintenanceWindow() + { + return $this->weekly_maintenance_window; + } + + /** + * Optional. Maintenance window that is applied to resources covered by this + * policy. Minimum 1. For the current version, the maximum number of + * weekly_window is expected to be one. + * + * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWeeklyMaintenanceWindow($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\WeeklyMaintenanceWindow::class); + $this->weekly_maintenance_window = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php new file mode 100644 index 00000000000..d94661e6262 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php @@ -0,0 +1,217 @@ +google.cloud.redis.v1.MaintenanceSchedule + */ +class MaintenanceSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The start time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The end time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * If the scheduled maintenance can be rescheduled, default is true. + * + * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; + * @deprecated + */ + protected $can_reschedule = false; + /** + * Output only. The deadline that the maintenance schedule start time can not + * go beyond, including reschedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $schedule_deadline_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The start time of any upcoming scheduled maintenance for this + * instance. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The end time of any upcoming scheduled maintenance for this + * instance. + * @type bool $can_reschedule + * If the scheduled maintenance can be rescheduled, default is true. + * @type \Google\Protobuf\Timestamp $schedule_deadline_time + * Output only. The deadline that the maintenance schedule start time can not + * go beyond, including reschedule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The start time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The start time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The end time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The end time of any upcoming scheduled maintenance for this + * instance. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * If the scheduled maintenance can be rescheduled, default is true. + * + * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getCanReschedule() + { + @trigger_error('can_reschedule is deprecated.', E_USER_DEPRECATED); + return $this->can_reschedule; + } + + /** + * If the scheduled maintenance can be rescheduled, default is true. + * + * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setCanReschedule($var) + { + @trigger_error('can_reschedule is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->can_reschedule = $var; + + return $this; + } + + /** + * Output only. The deadline that the maintenance schedule start time can not + * go beyond, including reschedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleDeadlineTime() + { + return $this->schedule_deadline_time; + } + + public function hasScheduleDeadlineTime() + { + return isset($this->schedule_deadline_time); + } + + public function clearScheduleDeadlineTime() + { + unset($this->schedule_deadline_time); + } + + /** + * Output only. The deadline that the maintenance schedule start time can not + * go beyond, including reschedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleDeadlineTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_deadline_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php new file mode 100644 index 00000000000..227e48aa4f6 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php @@ -0,0 +1,101 @@ +google.cloud.redis.v1.NodeInfo + */ +class NodeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Node identifying string. e.g. 'node-0', 'node-1' + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. Location of the node. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Output only. Node identifying string. e.g. 'node-0', 'node-1' + * @type string $zone + * Output only. Location of the node. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Node identifying string. e.g. 'node-0', 'node-1' + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. Node identifying string. e.g. 'node-0', 'node-1' + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. Location of the node. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Output only. Location of the node. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php new file mode 100644 index 00000000000..713790d8885 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php @@ -0,0 +1,291 @@ +google.cloud.redis.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * End timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * Operation target. + * + * Generated from protobuf field string target = 3; + */ + protected $target = ''; + /** + * Operation verb. + * + * Generated from protobuf field string verb = 4; + */ + protected $verb = ''; + /** + * Operation status details. + * + * Generated from protobuf field string status_detail = 5; + */ + protected $status_detail = ''; + /** + * Specifies if cancellation was requested for the operation. + * + * Generated from protobuf field bool cancel_requested = 6; + */ + protected $cancel_requested = false; + /** + * API version. + * + * Generated from protobuf field string api_version = 7; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Creation timestamp. + * @type \Google\Protobuf\Timestamp $end_time + * End timestamp. + * @type string $target + * Operation target. + * @type string $verb + * Operation verb. + * @type string $status_detail + * Operation status details. + * @type bool $cancel_requested + * Specifies if cancellation was requested for the operation. + * @type string $api_version + * API version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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); + } + + /** + * Creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * End timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Operation target. + * + * Generated from protobuf field string target = 3; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Operation target. + * + * Generated from protobuf field string target = 3; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Operation verb. + * + * Generated from protobuf field string verb = 4; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Operation verb. + * + * Generated from protobuf field string verb = 4; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Operation status details. + * + * Generated from protobuf field string status_detail = 5; + * @return string + */ + public function getStatusDetail() + { + return $this->status_detail; + } + + /** + * Operation status details. + * + * Generated from protobuf field string status_detail = 5; + * @param string $var + * @return $this + */ + public function setStatusDetail($var) + { + GPBUtil::checkString($var, True); + $this->status_detail = $var; + + return $this; + } + + /** + * Specifies if cancellation was requested for the operation. + * + * Generated from protobuf field bool cancel_requested = 6; + * @return bool + */ + public function getCancelRequested() + { + return $this->cancel_requested; + } + + /** + * Specifies if cancellation was requested for the operation. + * + * Generated from protobuf field bool cancel_requested = 6; + * @param bool $var + * @return $this + */ + public function setCancelRequested($var) + { + GPBUtil::checkBool($var); + $this->cancel_requested = $var; + + return $this; + } + + /** + * API version. + * + * Generated from protobuf field string api_version = 7; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * API version. + * + * Generated from protobuf field string api_version = 7; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php new file mode 100644 index 00000000000..c275fbabc10 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php @@ -0,0 +1,75 @@ +google.cloud.redis.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\V1\GcsDestination $gcs_destination + * Google Cloud Storage destination for output content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage destination for output content. + * + * Generated from protobuf field .google.cloud.redis.v1.GcsDestination gcs_destination = 1; + * @return \Google\Cloud\Redis\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Google Cloud Storage destination for output content. + * + * Generated from protobuf field .google.cloud.redis.v1.GcsDestination gcs_destination = 1; + * @param \Google\Cloud\Redis\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php new file mode 100644 index 00000000000..66c5e6bd4da --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php @@ -0,0 +1,221 @@ +google.cloud.redis.v1.PersistenceConfig + */ +class PersistenceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Controls whether Persistence features are enabled. + * If not provided, the existing value will be used. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $persistence_mode = 0; + /** + * Optional. Period between RDB snapshots. Snapshots will be attempted every + * period starting from the provided snapshot start time. For example, a start + * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing + * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, + * 18:45, and 00:45 the next day, and so on. If not provided, + * TWENTY_FOUR_HOURS will be used as default. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_period = 0; + /** + * Output only. The next time that a snapshot attempt is scheduled to occur. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $rdb_next_snapshot_time = null; + /** + * Optional. Date and time that the first snapshot was/will be attempted, and + * to which future snapshots will be aligned. If not provided, the current + * time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $persistence_mode + * Optional. Controls whether Persistence features are enabled. + * If not provided, the existing value will be used. + * @type int $rdb_snapshot_period + * Optional. Period between RDB snapshots. Snapshots will be attempted every + * period starting from the provided snapshot start time. For example, a start + * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing + * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, + * 18:45, and 00:45 the next day, and so on. If not provided, + * TWENTY_FOUR_HOURS will be used as default. + * @type \Google\Protobuf\Timestamp $rdb_next_snapshot_time + * Output only. The next time that a snapshot attempt is scheduled to occur. + * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time + * Optional. Date and time that the first snapshot was/will be attempted, and + * to which future snapshots will be aligned. If not provided, the current + * time will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Controls whether Persistence features are enabled. + * If not provided, the existing value will be used. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPersistenceMode() + { + return $this->persistence_mode; + } + + /** + * Optional. Controls whether Persistence features are enabled. + * If not provided, the existing value will be used. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPersistenceMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\PersistenceConfig\PersistenceMode::class); + $this->persistence_mode = $var; + + return $this; + } + + /** + * Optional. Period between RDB snapshots. Snapshots will be attempted every + * period starting from the provided snapshot start time. For example, a start + * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing + * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, + * 18:45, and 00:45 the next day, and so on. If not provided, + * TWENTY_FOUR_HOURS will be used as default. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRdbSnapshotPeriod() + { + return $this->rdb_snapshot_period; + } + + /** + * Optional. Period between RDB snapshots. Snapshots will be attempted every + * period starting from the provided snapshot start time. For example, a start + * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing + * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, + * 18:45, and 00:45 the next day, and so on. If not provided, + * TWENTY_FOUR_HOURS will be used as default. + * + * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRdbSnapshotPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\PersistenceConfig\SnapshotPeriod::class); + $this->rdb_snapshot_period = $var; + + return $this; + } + + /** + * Output only. The next time that a snapshot attempt is scheduled to occur. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRdbNextSnapshotTime() + { + return $this->rdb_next_snapshot_time; + } + + public function hasRdbNextSnapshotTime() + { + return isset($this->rdb_next_snapshot_time); + } + + public function clearRdbNextSnapshotTime() + { + unset($this->rdb_next_snapshot_time); + } + + /** + * Output only. The next time that a snapshot attempt is scheduled to occur. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRdbNextSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->rdb_next_snapshot_time = $var; + + return $this; + } + + /** + * Optional. Date and time that the first snapshot was/will be attempted, and + * to which future snapshots will be aligned. If not provided, the current + * time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRdbSnapshotStartTime() + { + return $this->rdb_snapshot_start_time; + } + + public function hasRdbSnapshotStartTime() + { + return isset($this->rdb_snapshot_start_time); + } + + public function clearRdbSnapshotStartTime() + { + unset($this->rdb_snapshot_start_time); + } + + /** + * Optional. Date and time that the first snapshot was/will be attempted, and + * to which future snapshots will be aligned. If not provided, the current + * time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRdbSnapshotStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->rdb_snapshot_start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php new file mode 100644 index 00000000000..0a752391e7d --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php @@ -0,0 +1,65 @@ +google.cloud.redis.v1.PersistenceConfig.PersistenceMode + */ +class PersistenceMode +{ + /** + * Not set. + * + * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + const PERSISTENCE_MODE_UNSPECIFIED = 0; + /** + * Persistence is disabled for the instance, + * and any existing snapshots are deleted. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * RDB based Persistence is enabled. + * + * Generated from protobuf enum RDB = 2; + */ + const RDB = 2; + + private static $valueToName = [ + self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::RDB => 'RDB', + ]; + + 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(PersistenceMode::class, \Google\Cloud\Redis\V1\PersistenceConfig_PersistenceMode::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php new file mode 100644 index 00000000000..43807bc8a3c --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php @@ -0,0 +1,78 @@ +google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod + */ +class SnapshotPeriod +{ + /** + * Not set. + * + * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + const SNAPSHOT_PERIOD_UNSPECIFIED = 0; + /** + * Snapshot every 1 hour. + * + * Generated from protobuf enum ONE_HOUR = 3; + */ + const ONE_HOUR = 3; + /** + * Snapshot every 6 hours. + * + * Generated from protobuf enum SIX_HOURS = 4; + */ + const SIX_HOURS = 4; + /** + * Snapshot every 12 hours. + * + * Generated from protobuf enum TWELVE_HOURS = 5; + */ + const TWELVE_HOURS = 5; + /** + * Snapshot every 24 hours. + * + * Generated from protobuf enum TWENTY_FOUR_HOURS = 6; + */ + const TWENTY_FOUR_HOURS = 6; + + private static $valueToName = [ + self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', + self::ONE_HOUR => 'ONE_HOUR', + self::SIX_HOURS => 'SIX_HOURS', + self::TWELVE_HOURS => 'TWELVE_HOURS', + self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', + ]; + + 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(SnapshotPeriod::class, \Google\Cloud\Redis\V1\PersistenceConfig_SnapshotPeriod::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php new file mode 100644 index 00000000000..bbffe6f4526 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php @@ -0,0 +1,190 @@ +google.cloud.redis.v1.RescheduleMaintenanceRequest + */ +class RescheduleMaintenanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + * well. + * + * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reschedule_type = 0; + /** + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schedule_time = null; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * @param int $rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + * well. + * For allowed values, use constants defined on {@see \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest\RescheduleType} + * @param \Google\Protobuf\Timestamp $scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * + * @return \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest + * + * @experimental + */ + public static function build(string $name, int $rescheduleType, \Google\Protobuf\Timestamp $scheduleTime): self + { + return (new self()) + ->setName($name) + ->setRescheduleType($rescheduleType) + ->setScheduleTime($scheduleTime); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @type int $reschedule_type + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + * well. + * @type \Google\Protobuf\Timestamp $schedule_time + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + * well. + * + * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRescheduleType() + { + return $this->reschedule_type; + } + + /** + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + * well. + * + * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRescheduleType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest\RescheduleType::class); + $this->reschedule_type = $var; + + return $this; + } + + /** + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php new file mode 100644 index 00000000000..3840b66fdee --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php @@ -0,0 +1,72 @@ +google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType + */ +class RescheduleType +{ + /** + * Not set. + * + * Generated from protobuf enum RESCHEDULE_TYPE_UNSPECIFIED = 0; + */ + const RESCHEDULE_TYPE_UNSPECIFIED = 0; + /** + * If the user wants to schedule the maintenance to happen now. + * + * Generated from protobuf enum IMMEDIATE = 1; + */ + const IMMEDIATE = 1; + /** + * If the user wants to use the existing maintenance policy to find the + * next available window. + * + * Generated from protobuf enum NEXT_AVAILABLE_WINDOW = 2; + */ + const NEXT_AVAILABLE_WINDOW = 2; + /** + * If the user wants to reschedule the maintenance to a specific time. + * + * Generated from protobuf enum SPECIFIC_TIME = 3; + */ + const SPECIFIC_TIME = 3; + + private static $valueToName = [ + self::RESCHEDULE_TYPE_UNSPECIFIED => 'RESCHEDULE_TYPE_UNSPECIFIED', + self::IMMEDIATE => 'IMMEDIATE', + self::NEXT_AVAILABLE_WINDOW => 'NEXT_AVAILABLE_WINDOW', + self::SPECIFIC_TIME => 'SPECIFIC_TIME', + ]; + + 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(RescheduleType::class, \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest_RescheduleType::class); + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php new file mode 100644 index 00000000000..69e8f18cf28 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php @@ -0,0 +1,239 @@ +google.cloud.redis.v1.TlsCertificate + */ +class TlsCertificate extends \Google\Protobuf\Internal\Message +{ + /** + * Serial number, as extracted from the certificate. + * + * Generated from protobuf field string serial_number = 1; + */ + protected $serial_number = ''; + /** + * PEM representation. + * + * Generated from protobuf field string cert = 2; + */ + protected $cert = ''; + /** + * Output only. The time when the certificate was created in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the certificate expires in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Sha1 Fingerprint of the certificate. + * + * Generated from protobuf field string sha1_fingerprint = 5; + */ + protected $sha1_fingerprint = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serial_number + * Serial number, as extracted from the certificate. + * @type string $cert + * PEM representation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the certificate was created in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. The time when the certificate expires in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * @type string $sha1_fingerprint + * Sha1 Fingerprint of the certificate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Serial number, as extracted from the certificate. + * + * Generated from protobuf field string serial_number = 1; + * @return string + */ + public function getSerialNumber() + { + return $this->serial_number; + } + + /** + * Serial number, as extracted from the certificate. + * + * Generated from protobuf field string serial_number = 1; + * @param string $var + * @return $this + */ + public function setSerialNumber($var) + { + GPBUtil::checkString($var, True); + $this->serial_number = $var; + + return $this; + } + + /** + * PEM representation. + * + * Generated from protobuf field string cert = 2; + * @return string + */ + public function getCert() + { + return $this->cert; + } + + /** + * PEM representation. + * + * Generated from protobuf field string cert = 2; + * @param string $var + * @return $this + */ + public function setCert($var) + { + GPBUtil::checkString($var, True); + $this->cert = $var; + + return $this; + } + + /** + * Output only. The time when the certificate was created in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time when the certificate was created in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the certificate expires in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. The time when the certificate expires in [RFC + * 3339](https://tools.ietf.org/html/rfc3339) format, for example + * `2020-05-18T00:00:00.094Z`. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Sha1 Fingerprint of the certificate. + * + * Generated from protobuf field string sha1_fingerprint = 5; + * @return string + */ + public function getSha1Fingerprint() + { + return $this->sha1_fingerprint; + } + + /** + * Sha1 Fingerprint of the certificate. + * + * Generated from protobuf field string sha1_fingerprint = 5; + * @param string $var + * @return $this + */ + public function setSha1Fingerprint($var) + { + GPBUtil::checkString($var, True); + $this->sha1_fingerprint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php new file mode 100644 index 00000000000..2f63235ec8b --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php @@ -0,0 +1,178 @@ +google.cloud.redis.v1.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Instance][google.cloud.redis.v1.Instance]: + * * `displayName` + * * `labels` + * * `memorySizeGb` + * * `redisConfig` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + + /** + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Instance][google.cloud.redis.v1.Instance]: + * + * * `displayName` + * * `labels` + * * `memorySizeGb` + * * `redisConfig` + * * `replica_count` + * @param \Google\Cloud\Redis\V1\Instance $instance Required. Update description. + * Only fields specified in update_mask are updated. + * + * @return \Google\Cloud\Redis\V1\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Redis\V1\Instance $instance): self + { + return (new self()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Instance][google.cloud.redis.v1.Instance]: + * * `displayName` + * * `labels` + * * `memorySizeGb` + * * `redisConfig` + * * `replica_count` + * @type \Google\Cloud\Redis\V1\Instance $instance + * Required. Update description. + * Only fields specified in update_mask are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Instance][google.cloud.redis.v1.Instance]: + * * `displayName` + * * `labels` + * * `memorySizeGb` + * * `redisConfig` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Instance][google.cloud.redis.v1.Instance]: + * * `displayName` + * * `labels` + * * `memorySizeGb` + * * `redisConfig` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\Instance::class); + $this->instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php new file mode 100644 index 00000000000..9d09acc837f --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php @@ -0,0 +1,128 @@ +google.cloud.redis.v1.UpgradeInstanceRequest + */ +class UpgradeInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Specifies the target version of Redis software to upgrade to. + * + * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $redis_version = ''; + + /** + * @param string $name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClient::instanceName()} for help formatting this field. + * @param string $redisVersion Required. Specifies the target version of Redis software to upgrade to. + * + * @return \Google\Cloud\Redis\V1\UpgradeInstanceRequest + * + * @experimental + */ + public static function build(string $name, string $redisVersion): self + { + return (new self()) + ->setName($name) + ->setRedisVersion($redisVersion); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * @type string $redis_version + * Required. Specifies the target version of Redis software to upgrade to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + * + * 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. Specifies the target version of Redis software to upgrade to. + * + * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRedisVersion() + { + return $this->redis_version; + } + + /** + * Required. Specifies the target version of Redis software to upgrade to. + * + * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRedisVersion($var) + { + GPBUtil::checkString($var, True); + $this->redis_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php new file mode 100644 index 00000000000..c30f75038ba --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php @@ -0,0 +1,160 @@ +google.cloud.redis.v1.WeeklyMaintenanceWindow + */ +class WeeklyMaintenanceWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The day of week that maintenance updates occur. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $day = 0; + /** + * Required. Start time of the window in UTC time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Output only. Duration of the maintenance window. The current window is + * fixed at 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $day + * Required. The day of week that maintenance updates occur. + * @type \Google\Type\TimeOfDay $start_time + * Required. Start time of the window in UTC time. + * @type \Google\Protobuf\Duration $duration + * Output only. Duration of the maintenance window. The current window is + * fixed at 1 hour. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + + /** + * Required. The day of week that maintenance updates occur. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDay() + { + return $this->day; + } + + /** + * Required. The day of week that maintenance updates occur. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day = $var; + + return $this; + } + + /** + * Required. Start time of the window in UTC time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\TimeOfDay|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. Start time of the window in UTC time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Duration of the maintenance window. The current window is + * fixed at 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Output only. Duration of the maintenance window. The current window is + * fixed at 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php new file mode 100644 index 00000000000..5044198e104 --- /dev/null +++ b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php @@ -0,0 +1,34 @@ +google.cloud.redis.v1.ZoneMetadata + */ +class ZoneMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php new file mode 100644 index 00000000000..3f0b2760910 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php @@ -0,0 +1,139 @@ +setName($instanceName) + ->setTier($instanceTier) + ->setMemorySizeGb($instanceMemorySizeGb); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); + $instanceId = '[INSTANCE_ID]'; + $instanceName = '[NAME]'; + $instanceTier = Tier::TIER_UNSPECIFIED; + $instanceMemorySizeGb = 0; + + create_instance_sample( + $formattedParent, + $instanceId, + $instanceName, + $instanceTier, + $instanceMemorySizeGb + ); +} +// [END redis_v1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php new file mode 100644 index 00000000000..353af566e15 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->deleteInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + delete_instance_sample($formattedName); +} +// [END redis_v1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php new file mode 100644 index 00000000000..9d69ccd1647 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php @@ -0,0 +1,92 @@ +setName($name) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->exportInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + export_instance_sample($name); +} +// [END redis_v1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php new file mode 100644 index 00000000000..b963dfebc84 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->failoverInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + failover_instance_sample($formattedName); +} +// [END redis_v1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php new file mode 100644 index 00000000000..5d8663d459d --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $cloudRedisClient->getInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END redis_v1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php new file mode 100644 index 00000000000..7f765809d70 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var InstanceAuthString $response */ + $response = $cloudRedisClient->getInstanceAuthString($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_auth_string_sample($formattedName); +} +// [END redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php new file mode 100644 index 00000000000..0152cf8a497 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END redis_v1_generated_CloudRedis_GetLocation_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php new file mode 100644 index 00000000000..9b070b04bac --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php @@ -0,0 +1,94 @@ +setName($name) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->importInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + import_instance_sample($name); +} +// [END redis_v1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php new file mode 100644 index 00000000000..b460ce81ced --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudRedisClient->listInstances($request); + + /** @var Instance $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); + + list_instances_sample($formattedParent); +} +// [END redis_v1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php new file mode 100644 index 00000000000..d477ab8f231 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END redis_v1_generated_CloudRedis_ListLocations_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php new file mode 100644 index 00000000000..412a8b3ab27 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php @@ -0,0 +1,91 @@ +setName($formattedName) + ->setRescheduleType($rescheduleType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->rescheduleMaintenance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; + + reschedule_maintenance_sample($formattedName, $rescheduleType); +} +// [END redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php new file mode 100644 index 00000000000..835331e01e6 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php @@ -0,0 +1,111 @@ +setName($instanceName) + ->setTier($instanceTier) + ->setMemorySizeGb($instanceMemorySizeGb); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceName = '[NAME]'; + $instanceTier = Tier::TIER_UNSPECIFIED; + $instanceMemorySizeGb = 0; + + update_instance_sample($instanceName, $instanceTier, $instanceMemorySizeGb); +} +// [END redis_v1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php new file mode 100644 index 00000000000..e99f0ce1f63 --- /dev/null +++ b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php @@ -0,0 +1,89 @@ +setName($formattedName) + ->setRedisVersion($redisVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClient->upgradeInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $redisVersion = '[REDIS_VERSION]'; + + upgrade_instance_sample($formattedName, $redisVersion); +} +// [END redis_v1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php b/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php new file mode 100644 index 00000000000..15bab8ef620 --- /dev/null +++ b/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php @@ -0,0 +1,709 @@ + createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportInstanceAsync(ExportInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface failoverInstanceAsync(FailoverInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAuthStringAsync(GetInstanceAuthStringRequest $request, array $optionalArgs = []) + * @method PromiseInterface importInstanceAsync(ImportInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface rescheduleMaintenanceAsync(RescheduleMaintenanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface upgradeInstanceAsync(UpgradeInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class CloudRedisClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.redis.v1.CloudRedis'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'redis.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'redis.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_redis_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - location: projects/{project}/locations/{location} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'redis.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Redis instance based on the specified tier and memory size. + * + * By default, the instance is accessible from the project's + * [default network](https://cloud.google.com/vpc/docs/vpc). + * + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. Once the operation is completed the Redis + * instance will be fully functional. Completed longrunning.Operation will + * contain the new instance object in the response field. + * + * The returned operation is automatically deleted after a few hours, so there + * is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClient::createInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/create_instance.php + * + * @param CreateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes a specific Redis instance. Instance stops serving and data is + * deleted. + * + * The async variant is {@see CloudRedisClient::deleteInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/delete_instance.php + * + * @param DeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Export Redis instance data into a Redis RDB format file in Cloud Storage. + * + * Redis will continue serving during this operation. + * + * The returned operation is automatically deleted after a few hours, so + * there is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClient::exportInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/export_instance.php + * + * @param ExportInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportInstance(ExportInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportInstance', $request, $callOptions)->wait(); + } + + /** + * Initiates a failover of the primary node to current replica node for a + * specific STANDARD tier Cloud Memorystore for Redis instance. + * + * The async variant is {@see CloudRedisClient::failoverInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/failover_instance.php + * + * @param FailoverInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function failoverInstance(FailoverInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('FailoverInstance', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a specific Redis instance. + * + * The async variant is {@see CloudRedisClient::getInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/get_instance.php + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + * instance the response will be empty. This information is not included in + * the details returned to GetInstance. + * + * The async variant is {@see CloudRedisClient::getInstanceAuthStringAsync()} . + * + * @example samples/V1/CloudRedisClient/get_instance_auth_string.php + * + * @param GetInstanceAuthStringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 InstanceAuthString + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstanceAuthString(GetInstanceAuthStringRequest $request, array $callOptions = []): InstanceAuthString + { + return $this->startApiCall('GetInstanceAuthString', $request, $callOptions)->wait(); + } + + /** + * Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + * + * Redis may stop serving during this operation. Instance state will be + * IMPORTING for entire operation. When complete, the instance will contain + * only data from the imported file. + * + * The returned operation is automatically deleted after a few hours, so + * there is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClient::importInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/import_instance.php + * + * @param ImportInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importInstance(ImportInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportInstance', $request, $callOptions)->wait(); + } + + /** + * Lists all Redis instances owned by a project in either the specified + * location (region) or all locations. + * + * The location should have the following format: + * + * * `projects/{project_id}/locations/{location_id}` + * + * If `location_id` is specified as `-` (wildcard), then all regions + * available to the project are queried, and the results are aggregated. + * + * The async variant is {@see CloudRedisClient::listInstancesAsync()} . + * + * @example samples/V1/CloudRedisClient/list_instances.php + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Reschedule maintenance for a given instance in a given project and + * location. + * + * The async variant is {@see CloudRedisClient::rescheduleMaintenanceAsync()} . + * + * @example samples/V1/CloudRedisClient/reschedule_maintenance.php + * + * @param RescheduleMaintenanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rescheduleMaintenance(RescheduleMaintenanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RescheduleMaintenance', $request, $callOptions)->wait(); + } + + /** + * Updates the metadata and configuration of a specific Redis instance. + * + * Completed longrunning.Operation will contain the new instance object + * in the response field. The returned operation is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClient::updateInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/update_instance.php + * + * @param UpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Upgrades Redis instance to the newer Redis version specified in the + * request. + * + * The async variant is {@see CloudRedisClient::upgradeInstanceAsync()} . + * + * @example samples/V1/CloudRedisClient/upgrade_instance.php + * + * @param UpgradeInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function upgradeInstance(UpgradeInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpgradeInstance', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see CloudRedisClient::getLocationAsync()} . + * + * @example samples/V1/CloudRedisClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see CloudRedisClient::listLocationsAsync()} . + * + * @example samples/V1/CloudRedisClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..66b8e98718c --- /dev/null +++ b/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.redis.v1", + "libraryPackage": "Google\\Cloud\\Redis\\V1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisGapicClient", + "rpcs": { + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ExportInstance": { + "methods": [ + "exportInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetInstanceAuthString": { + "methods": [ + "getInstanceAuthString" + ] + }, + "ImportInstance": { + "methods": [ + "importInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgradeInstance" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json new file mode 100644 index 00000000000..364a78c114b --- /dev/null +++ b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json @@ -0,0 +1,97 @@ +{ + "interfaces": { + "google.cloud.redis.v1.CloudRedis": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "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 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "FailoverInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetInstanceAuthString": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ImportInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RescheduleMaintenance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpgradeInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php new file mode 100644 index 00000000000..17c14a91b86 --- /dev/null +++ b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php @@ -0,0 +1,263 @@ + [ + 'google.cloud.redis.v1.CloudRedis' => [ + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RescheduleMaintenance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpgradeInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\V1\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInstanceAuthString' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\V1\InstanceAuthString', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Redis\V1\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php new file mode 100644 index 00000000000..2eb88bbbd4f --- /dev/null +++ b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php @@ -0,0 +1,234 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.redis.v1.CloudRedis' => [ + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:export', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:failover', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstanceAuthString' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}/authString', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:import', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RescheduleMaintenance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpgradeInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:upgrade', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php b/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php new file mode 100644 index 00000000000..7f0c89d1fd5 --- /dev/null +++ b/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php @@ -0,0 +1,1882 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudRedisClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudRedisClient($options); + } + + /** @test */ + public function createInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceTier = Tier::TIER_UNSPECIFIED; + $instance->setTier($instanceTier); + $instanceMemorySizeGb = 193936814; + $instance->setMemorySizeGb($instanceMemorySizeGb); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $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.redis.v1.CloudRedis/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceTier = Tier::TIER_UNSPECIFIED; + $instance->setTier($instanceTier); + $instanceMemorySizeGb = 193936814; + $instance->setMemorySizeGb($instanceMemorySizeGb); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 deleteInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $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.redis.v1.CloudRedis/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteInstanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 exportInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $outputConfig = new OutputConfig(); + $request = (new ExportInstanceRequest()) + ->setName($name) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportInstance($request); + $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.redis.v1.CloudRedis/ExportInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportInstanceTest'); + $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 exportInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportInstanceTest'); + $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 + $name = 'name3373707'; + $outputConfig = new OutputConfig(); + $request = (new ExportInstanceRequest()) + ->setName($name) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportInstanceTest'); + 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 failoverInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/failoverInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/failoverInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new FailoverInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->failoverInstance($request); + $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.redis.v1.CloudRedis/FailoverInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + $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 failoverInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/failoverInstanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new FailoverInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->failoverInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.v1.CloudRedis/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($request); + // 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 getInstanceAuthStringTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $authString = 'authString-554020216'; + $expectedResponse = new InstanceAuthString(); + $expectedResponse->setAuthString($authString); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceAuthStringRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstanceAuthString($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.v1.CloudRedis/GetInstanceAuthString', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceAuthStringExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceAuthStringRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstanceAuthString($request); + // 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 importInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $inputConfig = new InputConfig(); + $request = (new ImportInstanceRequest()) + ->setName($name) + ->setInputConfig($inputConfig); + $response = $gapicClient->importInstance($request); + $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.redis.v1.CloudRedis/ImportInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importInstanceTest'); + $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 importInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importInstanceTest'); + $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 + $name = 'name3373707'; + $inputConfig = new InputConfig(); + $request = (new ImportInstanceRequest()) + ->setName($name) + ->setInputConfig($inputConfig); + $response = $gapicClient->importInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importInstanceTest'); + 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.v1.CloudRedis/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($request); + // 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 rescheduleMaintenanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/rescheduleMaintenanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/rescheduleMaintenanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; + $request = (new RescheduleMaintenanceRequest()) + ->setName($formattedName) + ->setRescheduleType($rescheduleType); + $response = $gapicClient->rescheduleMaintenance($request); + $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.redis.v1.CloudRedis/RescheduleMaintenance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getRescheduleType(); + $this->assertProtobufEquals($rescheduleType, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/rescheduleMaintenanceTest'); + $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 rescheduleMaintenanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/rescheduleMaintenanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; + $request = (new RescheduleMaintenanceRequest()) + ->setName($formattedName) + ->setRescheduleType($rescheduleType); + $response = $gapicClient->rescheduleMaintenance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/rescheduleMaintenanceTest'); + 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 updateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceTier = Tier::TIER_UNSPECIFIED; + $instance->setTier($instanceTier); + $instanceMemorySizeGb = 193936814; + $instance->setMemorySizeGb($instanceMemorySizeGb); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $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.redis.v1.CloudRedis/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateInstanceTest'); + $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 + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceTier = Tier::TIER_UNSPECIFIED; + $instance->setTier($instanceTier); + $instanceMemorySizeGb = 193936814; + $instance->setMemorySizeGb($instanceMemorySizeGb); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 upgradeInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/upgradeInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion2 = 'redisVersion2-1453337401'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion2); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/upgradeInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $redisVersion = 'redisVersion-685310444'; + $request = (new UpgradeInstanceRequest()) + ->setName($formattedName) + ->setRedisVersion($redisVersion); + $response = $gapicClient->upgradeInstance($request); + $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.redis.v1.CloudRedis/UpgradeInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getRedisVersion(); + $this->assertProtobufEquals($redisVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); + $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 upgradeInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/upgradeInstanceTest'); + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $redisVersion = 'redisVersion-685310444'; + $request = (new UpgradeInstanceRequest()) + ->setName($formattedName) + ->setRedisVersion($redisVersion); + $response = $gapicClient->upgradeInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createInstanceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $locationId = 'locationId552319461'; + $alternativeLocationId = 'alternativeLocationId-718920621'; + $redisVersion = 'redisVersion-685310444'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $secondaryIpRange = 'secondaryIpRange-1484975472'; + $host = 'host3208616'; + $port = 3446913; + $currentLocationId = 'currentLocationId1312712735'; + $statusMessage = 'statusMessage-239442758'; + $memorySizeGb = 34199707; + $authorizedNetwork = 'authorizedNetwork-1733809270'; + $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; + $authEnabled = true; + $replicaCount = 564075208; + $readEndpoint = 'readEndpoint-2081202658'; + $readEndpointPort = 1676143102; + $customerManagedKey = 'customerManagedKey-1392642338'; + $maintenanceVersion = 'maintenanceVersion-588975188'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setAlternativeLocationId($alternativeLocationId); + $expectedResponse->setRedisVersion($redisVersion); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setSecondaryIpRange($secondaryIpRange); + $expectedResponse->setHost($host); + $expectedResponse->setPort($port); + $expectedResponse->setCurrentLocationId($currentLocationId); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setMemorySizeGb($memorySizeGb); + $expectedResponse->setAuthorizedNetwork($authorizedNetwork); + $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); + $expectedResponse->setAuthEnabled($authEnabled); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setReadEndpoint($readEndpoint); + $expectedResponse->setReadEndpointPort($readEndpointPort); + $expectedResponse->setCustomerManagedKey($customerManagedKey); + $expectedResponse->setMaintenanceVersion($maintenanceVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceTier = Tier::TIER_UNSPECIFIED; + $instance->setTier($instanceTier); + $instanceMemorySizeGb = 193936814; + $instance->setMemorySizeGb($instanceMemorySizeGb); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstanceAsync($request)->wait(); + $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.redis.v1.CloudRedis/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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()); + } +} diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php new file mode 100644 index 0000000000000000000000000000000000000000..ca7ebc33312f87bc11e52448e82a5a795f30bf79 GIT binary patch literal 8132 zcmb^$O>^7U(IEA?l=bl>*|h995begcYEu=HHYpv~1wSM*BYu>moXEoj1Cfw~m;z7$ zv@1JmGQFgiP7gix(o4_1cBY*kbIPSN?evmM+nJu+=^x0c`#u1YB4tWSbP@R8?!Nur zef!>hXz$x_L*CF$-O)U~DeoN0-o7r|j^$Ymt0nKWcXxG1ZdeDl(bAo`EN4n`u~d_@ znS5;-QC+L;H1wprXIXnKeYMfD+Rar*ZyGLsw_Q(nR-dl%WtAMt{ny1w_7`b|ylB-uJIs9hi>W|j$12kHi>&k4K?TSr!0W$vC?VXma*=Mgz z)r2al=S>vU)LQk7?lv65_AIB2pvmN(?gh%FE4S~6V<|afSH8`8OeXu7d?0&HTkk$y zmL1(|JLY}HHzjZseANdiPqB@wkXO$E(;a*ktb z21bjg9oU0$nSe$@(We+-}H7Yxo- z%{&xaR|S5srBf4%O+SSNo1D7?G?akwSq~sQ-x?es_7@2j(vFUqROF+I{?j(vi~JDA zY|TL>L?v0eJ(;@mFD3M~as!rIR)afkoU?}Na^sk7S2x85xlEHCQ>$t;qalVKMs)Hn zjEjwE7*`{SHw29nOcED7r5H8=a5!_6>Ob?;uA`Xh$UH>aCYq?R zukEySJU@(r{|@c8WnAJNo? z)y5PsfqSELPs&~Rr6iG`0MWR5p0iw_9#~C18bPS(#P^19AoR)+3y8<)lE-k_b2QU6 zJXJRv&Y?|4--Ui2ji=Oil0YY=hwHK!>Ao%Xjw zxe(n>LBw_&xM}Vhdv0`wMfB|QLwHI-A|C+3>gZxlM=#KY;-d?Usketv5=@ml_#HDy zq(+?@4G|b~ktyt*(-DnVC@!bxW=+pImx)JGEchj7zp{5Y>flw$6}(q|GtXMwy9#M2zSRjA#8 zMo${$$z&N81VC@nq3L;)MQLgg=GA^8smrkFFZZCP#$bfXv-Bp+_1TR?ApAr>wVX}o*YnxT>;*Cf6X{A;spX3svl3R6 zF(qBgKg!OA=+0I-!*{~;S0=leWpE?O4__*eUtQ@)63zE9n$KN*A-;}QgKlf}h5vbk z-6`v?5Kep@rDkCoFRNWSI|VSonizD+)HF)mJ!DY#Anl#6}ii z+|<2imh+^mzl(hebLgc!)A{*|f@;ksw#Bp|3Q7#tKihIV-eIv|AquuxL9P|$?@XyS z9Q&077ke@sxejxJsK|M=ckJS$i#yg1a8|Ct%&z4;!@7WXHPvaewkzNr`&(h3pb_P0 zGaaq4Y8v}21arYn&z}^KV}+gv-Oxh61`}93cyGXaw4o^TFvg>XH?5pW)I3(A9o|6m zrK>PaD?r;-@v7!x_uJhJ+<;4>XVS4sYM7N5xfVeNZ7?Z6dex? z9s5TZFBk*5A<}}m1I@(4nyRZih>66RWg>~vumm)KUcA7G4LU1#A?UXPBTp>-L4vEV zKq61DmB$7M&+=RO?QfZ{IAu1yuNmeNMpy6yLuQH|D;iOL`egFcm&zw+Xg5je{OM%1 z>-eA#PDNlcuvF~xafqH&aIu*iVI3iL?dinEFtzb?)>pUVT`Qet?lJc8%^klp;E|x5 z_k>C&)m=-Gwr1`6wD}$N+_aU_dKc}bKZjs4IF2|lPo;28&35-Ky!GjhVe!l~ohW}} zapF}$7*&XLX_!lRRk+-9CdRzuogtw}c-@}vC5+YmYPG18tGQB5EoUqFQl`IJmWo+5 zSK6vzwY-SUNB#r$tBM747N%MVt!!7bX_S#R2%GOK+bCVE3Ny!in#gbs^;XSSYuREts}@R`0sTfMUsY0@*nLQ3 z9Kz^DNEbhlaU}X*2`&w85Xpx*g0i_eJF@ay2^I%lZb|(X z+^AKQVl`h=(R(V}<&)HU6XcTs1KB0A2KP>as%9(b(oA_6o%u92xuxQ4DDefrT;H1p z`J)6=-QzKm7~*=}z+&FA^yZmx`1~#Q;44MUEr0R%|NJHtCwJ*%&I>-ud=ON`m9EBm zrPEN8-{ak-GYulcZs#3PpXpOhG-LO_QrIZ0hf6veJAube&%bg+{*7&J&+v~7(^U_& z&+BWxg1d&(@t|Feee$Jpy)&?y=i@m(HpUrs93LURQs%`40MxXWrQ+_z3C8u=$m)H7-yDp3#g zDJ6P-3aee=;c(YCp7@Wq8D_h;V`mDQj?Mlj!Szl^(0=y#ER|$@pF3eb`D%1u2gBTb z(9yAScgUrQ!u<1e#v9lVA1&p+R2Bw}fB&Y$_dU;cldG%Go;?#12k#_wa*E-M&&2m^ zyh-6j^B{%e{AGMYd9`vgoogle.cloud.redis.cluster.v1.AuthorizationMode + */ +class AuthorizationMode +{ + /** + * Not set. + * + * Generated from protobuf enum AUTH_MODE_UNSPECIFIED = 0; + */ + const AUTH_MODE_UNSPECIFIED = 0; + /** + * IAM basic authorization mode + * + * Generated from protobuf enum AUTH_MODE_IAM_AUTH = 1; + */ + const AUTH_MODE_IAM_AUTH = 1; + /** + * Authorization disabled mode + * + * Generated from protobuf enum AUTH_MODE_DISABLED = 2; + */ + const AUTH_MODE_DISABLED = 2; + + private static $valueToName = [ + self::AUTH_MODE_UNSPECIFIED => 'AUTH_MODE_UNSPECIFIED', + self::AUTH_MODE_IAM_AUTH => 'AUTH_MODE_IAM_AUTH', + self::AUTH_MODE_DISABLED => 'AUTH_MODE_DISABLED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php new file mode 100644 index 00000000000..65adb51a42b --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php @@ -0,0 +1,112 @@ +google.cloud.redis.cluster.v1.CertificateAuthority + */ +class CertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + protected $server_ca; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $managed_server_ca + * @type string $name + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @return \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority|null + */ + public function getManagedServerCa() + { + return $this->readOneof(1); + } + + public function hasManagedServerCa() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @param \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $var + * @return $this + */ + public function setManagedServerCa($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getServerCa() + { + return $this->whichOneof("server_ca"); + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php new file mode 100644 index 00000000000..e5e61afb262 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php @@ -0,0 +1,72 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority + */ +class ManagedCertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + */ + private $ca_certs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $ca_certs + * The PEM encoded CA certificate chains for redis managed + * server authentication + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCaCerts() + { + return $this->ca_certs; + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @param array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCaCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain::class); + $this->ca_certs = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagedCertificateAuthority::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php new file mode 100644 index 00000000000..6aa46fd7e72 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php @@ -0,0 +1,68 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + */ +class CertChain extends \Google\Protobuf\Internal\Message +{ + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + */ + private $certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $certificates + * The certificates that form the CA chain, from leaf to root order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCertificates() + { + return $this->certificates; + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->certificates = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CertChain::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority_CertChain::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php new file mode 100644 index 00000000000..58b6ccfa3e6 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php @@ -0,0 +1,821 @@ +google.cloud.redis.cluster.v1.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $replica_count = null; + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authorization_mode = 0; + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transit_encryption_mode = 0; + /** + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gb = null; + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shard_count = null; + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + */ + private $psc_configs; + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $discovery_endpoints; + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $psc_connections; + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_info = null; + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_type = 0; + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $persistence_config = null; + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $redis_configs; + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $precise_size_gb = null; + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone_distribution_config = null; + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deletion_protection_enabled = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp associated with the cluster creation request. + * @type int $state + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * @type string $uid + * Output only. System assigned, unique identifier for the cluster. + * @type int $replica_count + * Optional. The number of replica nodes per shard. + * @type int $authorization_mode + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * @type int $transit_encryption_mode + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * @type int $size_gb + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. + * @type int $shard_count + * Required. Number of shards for the Redis cluster. + * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * @type array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $discovery_endpoints + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * @type array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $psc_connections + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info + * Output only. Additional information about the current state of the cluster. + * @type int $node_type + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $persistence_config + * Optional. Persistence config (RDB, AOF) for the cluster. + * @type array|\Google\Protobuf\Internal\MapField $redis_configs + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * @type float $precise_size_gb + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * @type \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $zone_distribution_config + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * @type bool $deletion_protection_enabled + * Optional. The delete operation will fail when the value is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getReplicaCount() + { + return isset($this->replica_count) ? $this->replica_count : 0; + } + + public function hasReplicaCount() + { + return isset($this->replica_count); + } + + public function clearReplicaCount() + { + unset($this->replica_count); + } + + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setReplicaCount($var) + { + GPBUtil::checkInt32($var); + $this->replica_count = $var; + + return $this; + } + + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAuthorizationMode() + { + return $this->authorization_mode; + } + + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAuthorizationMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\AuthorizationMode::class); + $this->authorization_mode = $var; + + return $this; + } + + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTransitEncryptionMode() + { + return $this->transit_encryption_mode; + } + + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTransitEncryptionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\TransitEncryptionMode::class); + $this->transit_encryption_mode = $var; + + return $this; + } + + /** + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getShardCount() + { + return isset($this->shard_count) ? $this->shard_count : 0; + } + + public function hasShardCount() + { + return isset($this->shard_count); + } + + public function clearShardCount() + { + unset($this->shard_count); + } + + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setShardCount($var) + { + GPBUtil::checkInt32($var); + $this->shard_count = $var; + + return $this; + } + + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPscConfigs() + { + return $this->psc_configs; + } + + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPscConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); + $this->psc_configs = $arr; + + return $this; + } + + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiscoveryEndpoints() + { + return $this->discovery_endpoints; + } + + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiscoveryEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint::class); + $this->discovery_endpoints = $arr; + + return $this; + } + + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPscConnections() + { + return $this->psc_connections; + } + + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPscConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConnection::class); + $this->psc_connections = $arr; + + return $this; + } + + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo|null + */ + public function getStateInfo() + { + return $this->state_info; + } + + public function hasStateInfo() + { + return isset($this->state_info); + } + + public function clearStateInfo() + { + unset($this->state_info); + } + + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $var + * @return $this + */ + public function setStateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo::class); + $this->state_info = $var; + + return $this; + } + + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNodeType() + { + return $this->node_type; + } + + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\NodeType::class); + $this->node_type = $var; + + return $this; + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig|null + */ + public function getPersistenceConfig() + { + return $this->persistence_config; + } + + public function hasPersistenceConfig() + { + return isset($this->persistence_config); + } + + public function clearPersistenceConfig() + { + unset($this->persistence_config); + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $var + * @return $this + */ + public function setPersistenceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig::class); + $this->persistence_config = $var; + + return $this; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRedisConfigs() + { + return $this->redis_configs; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRedisConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->redis_configs = $arr; + + return $this; + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getPreciseSizeGb() + { + return isset($this->precise_size_gb) ? $this->precise_size_gb : 0.0; + } + + public function hasPreciseSizeGb() + { + return isset($this->precise_size_gb); + } + + public function clearPreciseSizeGb() + { + unset($this->precise_size_gb); + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setPreciseSizeGb($var) + { + GPBUtil::checkDouble($var); + $this->precise_size_gb = $var; + + return $this; + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig|null + */ + public function getZoneDistributionConfig() + { + return $this->zone_distribution_config; + } + + public function hasZoneDistributionConfig() + { + return isset($this->zone_distribution_config); + } + + public function clearZoneDistributionConfig() + { + unset($this->zone_distribution_config); + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $var + * @return $this + */ + public function setZoneDistributionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig::class); + $this->zone_distribution_config = $var; + + return $this; + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled) ? $this->deletion_protection_enabled : false; + } + + public function hasDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled); + } + + public function clearDeletionProtectionEnabled() + { + unset($this->deletion_protection_enabled); + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDeletionProtectionEnabled($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection_enabled = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php new file mode 100644 index 00000000000..3cd28633110 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php @@ -0,0 +1,78 @@ +google.cloud.redis.cluster.v1.Cluster.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Redis cluster is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Redis cluster has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * Redis cluster configuration is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * Redis cluster is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + ]; + + 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(State::class, \Google\Cloud\Redis\Cluster\V1\Cluster_State::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php new file mode 100644 index 00000000000..05eb2f09fd6 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php @@ -0,0 +1,78 @@ +google.cloud.redis.cluster.v1.Cluster.StateInfo + */ +class StateInfo extends \Google\Protobuf\Internal\Message +{ + protected $info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $update_info + * Describes ongoing update on the cluster when cluster state is UPDATING. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Describes ongoing update on the cluster when cluster state is UPDATING. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo|null + */ + public function getUpdateInfo() + { + return $this->readOneof(1); + } + + public function hasUpdateInfo() + { + return $this->hasOneof(1); + } + + /** + * Describes ongoing update on the cluster when cluster state is UPDATING. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $var + * @return $this + */ + public function setUpdateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getInfo() + { + return $this->whichOneof("info"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php new file mode 100644 index 00000000000..ad999e1fee0 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php @@ -0,0 +1,124 @@ +google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + */ +class UpdateInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + */ + protected $target_shard_count = null; + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + */ + protected $target_replica_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $target_shard_count + * Target number of shards for redis cluster + * @type int $target_replica_count + * Target number of replica nodes per shard. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + * @return int + */ + public function getTargetShardCount() + { + return isset($this->target_shard_count) ? $this->target_shard_count : 0; + } + + public function hasTargetShardCount() + { + return isset($this->target_shard_count); + } + + public function clearTargetShardCount() + { + unset($this->target_shard_count); + } + + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + * @param int $var + * @return $this + */ + public function setTargetShardCount($var) + { + GPBUtil::checkInt32($var); + $this->target_shard_count = $var; + + return $this; + } + + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + * @return int + */ + public function getTargetReplicaCount() + { + return isset($this->target_replica_count) ? $this->target_replica_count : 0; + } + + public function hasTargetReplicaCount() + { + return isset($this->target_replica_count); + } + + public function clearTargetReplicaCount() + { + unset($this->target_replica_count); + } + + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + * @param int $var + * @return $this + */ + public function setTargetReplicaCount($var) + { + GPBUtil::checkInt32($var); + $this->target_replica_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UpdateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo_UpdateInfo::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php new file mode 100644 index 00000000000..b17af3046ed --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php @@ -0,0 +1,155 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig + */ +class ClusterPersistenceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_config = null; + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $aof_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of persistence. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $rdb_config + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $aof_config + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\PersistenceMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig|null + */ + public function getRdbConfig() + { + return $this->rdb_config; + } + + public function hasRdbConfig() + { + return isset($this->rdb_config); + } + + public function clearRdbConfig() + { + unset($this->rdb_config); + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $var + * @return $this + */ + public function setRdbConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig::class); + $this->rdb_config = $var; + + return $this; + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig|null + */ + public function getAofConfig() + { + return $this->aof_config; + } + + public function hasAofConfig() + { + return isset($this->aof_config); + } + + public function clearAofConfig() + { + unset($this->aof_config); + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $var + * @return $this + */ + public function setAofConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig::class); + $this->aof_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php new file mode 100644 index 00000000000..8aab049465e --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php @@ -0,0 +1,70 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig + */ +class AOFConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $append_fsync = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $append_fsync + * Optional. fsync configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAppendFsync() + { + return $this->append_fsync; + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAppendFsync($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig\AppendFsync::class); + $this->append_fsync = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AOFConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php new file mode 100644 index 00000000000..ec1a3a6654a --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php @@ -0,0 +1,74 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync + */ +class AppendFsync +{ + /** + * Not set. Default: EVERYSEC + * + * Generated from protobuf enum APPEND_FSYNC_UNSPECIFIED = 0; + */ + const APPEND_FSYNC_UNSPECIFIED = 0; + /** + * Never fsync. Normally Linux will flush data every 30 seconds with this + * configuration, but it's up to the kernel's exact tuning. + * + * Generated from protobuf enum NO = 1; + */ + const NO = 1; + /** + * fsync every second. Fast enough, and you may lose 1 second of data if + * there is a disaster + * + * Generated from protobuf enum EVERYSEC = 2; + */ + const EVERYSEC = 2; + /** + * fsync every time new commands are appended to the AOF. It has the best + * data loss protection at the cost of performance + * + * Generated from protobuf enum ALWAYS = 3; + */ + const ALWAYS = 3; + + private static $valueToName = [ + self::APPEND_FSYNC_UNSPECIFIED => 'APPEND_FSYNC_UNSPECIFIED', + self::NO => 'NO', + self::EVERYSEC => 'EVERYSEC', + self::ALWAYS => 'ALWAYS', + ]; + + 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(AppendFsync::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig_AppendFsync::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php new file mode 100644 index 00000000000..0b99ded98eb --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php @@ -0,0 +1,71 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode + */ +class PersistenceMode +{ + /** + * Not set. + * + * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + const PERSISTENCE_MODE_UNSPECIFIED = 0; + /** + * Persistence is disabled, and any snapshot data is deleted. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * RDB based persistence is enabled. + * + * Generated from protobuf enum RDB = 2; + */ + const RDB = 2; + /** + * AOF based persistence is enabled. + * + * Generated from protobuf enum AOF = 3; + */ + const AOF = 3; + + private static $valueToName = [ + self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::RDB => 'RDB', + self::AOF => 'AOF', + ]; + + 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(PersistenceMode::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_PersistenceMode::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php new file mode 100644 index 00000000000..2d16c395c5e --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php @@ -0,0 +1,122 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig + */ +class RDBConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_period = 0; + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $rdb_snapshot_period + * Optional. Period between RDB snapshots. + * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRdbSnapshotPeriod() + { + return $this->rdb_snapshot_period; + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRdbSnapshotPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig\SnapshotPeriod::class); + $this->rdb_snapshot_period = $var; + + return $this; + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRdbSnapshotStartTime() + { + return $this->rdb_snapshot_start_time; + } + + public function hasRdbSnapshotStartTime() + { + return isset($this->rdb_snapshot_start_time); + } + + public function clearRdbSnapshotStartTime() + { + unset($this->rdb_snapshot_start_time); + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRdbSnapshotStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->rdb_snapshot_start_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RDBConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php new file mode 100644 index 00000000000..21d491f77fd --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php @@ -0,0 +1,78 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod + */ +class SnapshotPeriod +{ + /** + * Not set. + * + * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + const SNAPSHOT_PERIOD_UNSPECIFIED = 0; + /** + * One hour. + * + * Generated from protobuf enum ONE_HOUR = 1; + */ + const ONE_HOUR = 1; + /** + * Six hours. + * + * Generated from protobuf enum SIX_HOURS = 2; + */ + const SIX_HOURS = 2; + /** + * Twelve hours. + * + * Generated from protobuf enum TWELVE_HOURS = 3; + */ + const TWELVE_HOURS = 3; + /** + * Twenty four hours. + * + * Generated from protobuf enum TWENTY_FOUR_HOURS = 4; + */ + const TWENTY_FOUR_HOURS = 4; + + private static $valueToName = [ + self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', + self::ONE_HOUR => 'ONE_HOUR', + self::SIX_HOURS => 'SIX_HOURS', + self::TWELVE_HOURS => 'TWELVE_HOURS', + self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', + ]; + + 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(SnapshotPeriod::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig_SnapshotPeriod::class); + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php new file mode 100644 index 00000000000..a4ec433911f --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php @@ -0,0 +1,238 @@ +google.cloud.redis.cluster.v1.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. The cluster that is to be created. + * @param string $clusterId Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * @return \Google\Cloud\Redis\Cluster\V1\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Redis\Cluster\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type string $cluster_id + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster + * Required. The cluster that is to be created. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php new file mode 100644 index 00000000000..c8eb432dad7 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php @@ -0,0 +1,125 @@ +google.cloud.redis.cluster.v1.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php new file mode 100644 index 00000000000..fc450c18b9c --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php @@ -0,0 +1,153 @@ +google.cloud.redis.cluster.v1.DiscoveryEndpoint + */ +class DiscoveryEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $address = ''; + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $port = 0; + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $psc_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * @type int $port + * Output only. The port number of the exposed Redis endpoint. + * @type \Google\Cloud\Redis\Cluster\V1\PscConfig $psc_config + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Redis\Cluster\V1\PscConfig|null + */ + public function getPscConfig() + { + return $this->psc_config; + } + + public function hasPscConfig() + { + return isset($this->psc_config); + } + + public function clearPscConfig() + { + unset($this->psc_config); + } + + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Redis\Cluster\V1\PscConfig $var + * @return $this + */ + public function setPscConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); + $this->psc_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php new file mode 100644 index 00000000000..5a8f0feed58 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php @@ -0,0 +1,92 @@ +google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest + */ +class GetClusterCertificateAuthorityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::certificateAuthorityName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * 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. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * 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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php new file mode 100644 index 00000000000..e457cb50362 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php @@ -0,0 +1,91 @@ +google.cloud.redis.cluster.v1.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\GetClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php new file mode 100644 index 00000000000..7d993d799de --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php @@ -0,0 +1,183 @@ +google.cloud.redis.cluster.v1.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\ListClustersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type int $page_size + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * @type string $page_token + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * Generated from protobuf field string page_token = 3; + * @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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php new file mode 100644 index 00000000000..efc059d380c --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php @@ -0,0 +1,175 @@ +google.cloud.redis.cluster.v1.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + private $clusters; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + * @param array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->clusters = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php new file mode 100644 index 00000000000..3fe082e637c --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php @@ -0,0 +1,73 @@ +google.cloud.redis.cluster.v1.NodeType + */ +class NodeType +{ + /** + * Generated from protobuf enum NODE_TYPE_UNSPECIFIED = 0; + */ + const NODE_TYPE_UNSPECIFIED = 0; + /** + * Redis shared core nano node_type. + * + * Generated from protobuf enum REDIS_SHARED_CORE_NANO = 1; + */ + const REDIS_SHARED_CORE_NANO = 1; + /** + * Redis highmem medium node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_MEDIUM = 2; + */ + const REDIS_HIGHMEM_MEDIUM = 2; + /** + * Redis highmem xlarge node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_XLARGE = 3; + */ + const REDIS_HIGHMEM_XLARGE = 3; + /** + * Redis standard small node_type. + * + * Generated from protobuf enum REDIS_STANDARD_SMALL = 4; + */ + const REDIS_STANDARD_SMALL = 4; + + private static $valueToName = [ + self::NODE_TYPE_UNSPECIFIED => 'NODE_TYPE_UNSPECIFIED', + self::REDIS_SHARED_CORE_NANO => 'REDIS_SHARED_CORE_NANO', + self::REDIS_HIGHMEM_MEDIUM => 'REDIS_HIGHMEM_MEDIUM', + self::REDIS_HIGHMEM_XLARGE => 'REDIS_HIGHMEM_XLARGE', + self::REDIS_STANDARD_SMALL => 'REDIS_STANDARD_SMALL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php new file mode 100644 index 00000000000..9abe7ef897e --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.redis.cluster.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php new file mode 100644 index 00000000000..ee2fe513f10 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php @@ -0,0 +1,73 @@ +google.cloud.redis.cluster.v1.PscConfig + */ +class PscConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php new file mode 100644 index 00000000000..318d11f6936 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php @@ -0,0 +1,227 @@ +google.cloud.redis.cluster.v1.PscConnection + */ +class PscConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $psc_connection_id = ''; + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $address = ''; + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $forwarding_rule = ''; + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $project_id = ''; + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $psc_connection_id + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * @type string $address + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * @type string $forwarding_rule + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * @type string $project_id + * Output only. The consumer project_id where the forwarding rule is created + * from. + * @type string $network + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPscConnectionId() + { + return $this->psc_connection_id; + } + + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPscConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->psc_connection_id = $var; + + return $this; + } + + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php new file mode 100644 index 00000000000..70baeb4693b --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php @@ -0,0 +1,61 @@ +google.cloud.redis.cluster.v1.TransitEncryptionMode + */ +class TransitEncryptionMode +{ + /** + * In-transit encryption not set. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + /** + * In-transit encryption disabled. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + const TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + /** + * Use server managed encryption for in-transit encryption. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + const TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + + private static $valueToName = [ + self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', + self::TRANSIT_ENCRYPTION_MODE_DISABLED => 'TRANSIT_ENCRYPTION_MODE_DISABLED', + self::TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION => 'TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php new file mode 100644 index 00000000000..0f67d0fe41e --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php @@ -0,0 +1,196 @@ +google.cloud.redis.cluster.v1.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. Update description. + * Only fields specified in update_mask are updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * + * * `size_gb` + * * `replica_count` + * + * @return \Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Redis\Cluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster + * Required. Update description. + * Only fields specified in update_mask are updated. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * 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; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php new file mode 100644 index 00000000000..1645d3cf3f6 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php @@ -0,0 +1,113 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig + */ +class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * @type string $zone + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig\ZoneDistributionMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php new file mode 100644 index 00000000000..a1d1598e503 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php @@ -0,0 +1,69 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode + */ +class ZoneDistributionMode +{ + /** + * Not Set. Default: MULTI_ZONE + * + * Generated from protobuf enum ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + const ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + /** + * Distribute all resources across 3 zones picked at random, within the + * region. + * + * Generated from protobuf enum MULTI_ZONE = 1; + */ + const MULTI_ZONE = 1; + /** + * Distribute all resources in a single zone. The zone field must be + * specified, when this mode is selected. + * + * Generated from protobuf enum SINGLE_ZONE = 2; + */ + const SINGLE_ZONE = 2; + + private static $valueToName = [ + self::ZONE_DISTRIBUTION_MODE_UNSPECIFIED => 'ZONE_DISTRIBUTION_MODE_UNSPECIFIED', + self::MULTI_ZONE => 'MULTI_ZONE', + self::SINGLE_ZONE => 'SINGLE_ZONE', + ]; + + 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(ZoneDistributionMode::class, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig_ZoneDistributionMode::class); + diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php new file mode 100644 index 00000000000..54dd9d7d736 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php @@ -0,0 +1,132 @@ +setNetwork($clusterPscConfigsNetwork); + $clusterPscConfigs = [$pscConfig,]; + $cluster = (new Cluster()) + ->setName($clusterName) + ->setShardCount($clusterShardCount) + ->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $clusterName = '[NAME]'; + $clusterShardCount = 0; + $clusterPscConfigsNetwork = '[NETWORK]'; + + create_cluster_sample( + $formattedParent, + $clusterId, + $clusterName, + $clusterShardCount, + $clusterPscConfigsNetwork + ); +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php new file mode 100644 index 00000000000..ee3e020173b --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->deleteCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php new file mode 100644 index 00000000000..6fb81f5b64b --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $cloudRedisClusterClient->getCluster($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php new file mode 100644 index 00000000000..b23b63cb2e2 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CertificateAuthority $response */ + $response = $cloudRedisClusterClient->getClusterCertificateAuthority($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudRedisClusterClient::certificateAuthorityName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + get_cluster_certificate_authority_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php new file mode 100644 index 00000000000..a92286bb407 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END redis_v1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php new file mode 100644 index 00000000000..8c213fe52b8 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudRedisClusterClient->listClusters($request); + + /** @var Cluster $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php new file mode 100644 index 00000000000..484811919b9 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END redis_v1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php new file mode 100644 index 00000000000..da166dd875d --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php @@ -0,0 +1,108 @@ +setNetwork($clusterPscConfigsNetwork); + $clusterPscConfigs = [$pscConfig,]; + $cluster = (new Cluster()) + ->setName($clusterName) + ->setShardCount($clusterShardCount) + ->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $clusterName = '[NAME]'; + $clusterShardCount = 0; + $clusterPscConfigsNetwork = '[NETWORK]'; + + update_cluster_sample($clusterName, $clusterShardCount, $clusterPscConfigsNetwork); +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php b/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php new file mode 100644 index 00000000000..1b1d8df65b7 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php @@ -0,0 +1,576 @@ + createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = []) + * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class CloudRedisClusterClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.redis.cluster.v1.CloudRedisCluster'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'redis.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'redis.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_redis_cluster_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * certificate_authority resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted certificate_authority resource. + */ + public static function certificateAuthorityName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('certificateAuthority')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - location: projects/{project}/locations/{location} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'redis.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Redis cluster based on the specified properties. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. Once the operation is completed the Redis + * cluster will be fully functional. The completed longrunning.Operation will + * contain the new cluster object in the response field. + * + * The returned operation is automatically deleted after a few hours, so there + * is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClusterClient::createClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/create_cluster.php + * + * @param CreateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is + * deleted. + * + * The async variant is {@see CloudRedisClusterClient::deleteClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/delete_cluster.php + * + * @param DeleteClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a specific Redis cluster. + * + * The async variant is {@see CloudRedisClusterClient::getClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_cluster.php + * + * @param GetClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Gets the details of certificate authority information for Redis cluster. + * + * The async variant is + * {@see CloudRedisClusterClient::getClusterCertificateAuthorityAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php + * + * @param GetClusterCertificateAuthorityRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CertificateAuthority + * + * @throws ApiException Thrown if the API call fails. + */ + public function getClusterCertificateAuthority(GetClusterCertificateAuthorityRequest $request, array $callOptions = []): CertificateAuthority + { + return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait(); + } + + /** + * Lists all Redis clusters owned by a project in either the specified + * location (region) or all locations. + * + * The location should have the following format: + * + * * `projects/{project_id}/locations/{location_id}` + * + * If `location_id` is specified as `-` (wildcard), then all regions + * available to the project are queried, and the results are aggregated. + * + * The async variant is {@see CloudRedisClusterClient::listClustersAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/list_clusters.php + * + * @param ListClustersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions); + } + + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + * Completed longrunning.Operation will contain the new cluster object + * in the response field. The returned operation is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClusterClient::updateClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/update_cluster.php + * + * @param UpdateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see CloudRedisClusterClient::getLocationAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see CloudRedisClusterClient::listLocationsAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json b/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..3c75e8b0b86 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.redis.cluster.v1", + "libraryPackage": "Google\\Cloud\\Redis\\Cluster\\V1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClusterGapicClient", + "rpcs": { + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetClusterCertificateAuthority": { + "methods": [ + "getClusterCertificateAuthority" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json new file mode 100644 index 00000000000..11c25ca9ac4 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json @@ -0,0 +1,72 @@ +{ + "interfaces": { + "google.cloud.redis.cluster.v1.CloudRedisCluster": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "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 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetClusterCertificateAuthority": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListClusters": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php new file mode 100644 index 00000000000..686a9576bac --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php @@ -0,0 +1,169 @@ + [ + 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetClusterCertificateAuthority' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\CertificateAuthority', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'certificateAuthority' => 'projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority', + 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php new file mode 100644 index 00000000000..69fe4ba287c --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php @@ -0,0 +1,174 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetClusterCertificateAuthority' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php new file mode 100644 index 00000000000..de2b3c0055d --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php @@ -0,0 +1,940 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudRedisClusterClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudRedisClusterClient($options); + } + + /** @test */ + public function createClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $preciseSizeGb = 1.3422684E8; + $deletionProtectionEnabled = true; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $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.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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 createClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createClusterTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + 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 deleteClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $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.redis.cluster.v1.CloudRedisCluster/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $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 deleteClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteClusterTest'); + $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 + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + 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 getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $preciseSizeGb = 1.3422684E8; + $deletionProtectionEnabled = true; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->getCluster($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + try { + $gapicClient->getCluster($request); + // 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 getClusterCertificateAuthorityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new CertificateAuthority(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest()) + ->setName($formattedName); + $response = $gapicClient->getClusterCertificateAuthority($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterCertificateAuthorityExceptionTest() + { + $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->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest()) + ->setName($formattedName); + try { + $gapicClient->getClusterCertificateAuthority($request); + // 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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClusters($request); + // 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 updateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $preciseSizeGb = 1.3422684E8; + $deletionProtectionEnabled = true; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $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.redis.cluster.v1.CloudRedisCluster/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $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 updateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateClusterTest'); + $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 + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createClusterAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $preciseSizeGb = 1.3422684E8; + $deletionProtectionEnabled = true; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createClusterAsync($request)->wait(); + $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.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php new file mode 100644 index 0000000000000000000000000000000000000000..3bcfe86bbbf41822c6380029e18cfe855b68980d GIT binary patch literal 5416 zcmcIoOHUhD6z-Tn!i6N{@(9p8CPShS3gZH4RSludfDJ+lfr6oG>&P1HYkQjU%yec9 zrIbwEckj6m z-gCs~ zM!^V->?$>qT_#4dTX7@V-T4Io@|NNI@(MEsj)07R-0GfX=4C%H0{rW?>E}$_3{1l^ zKgS*|%0);41$^zCV2?`EKcFhiuXB$>F zh5Wo{x`E?uVo^;ip&$$;`7(KrZ%fRXMR}58)U*bWi*n#qQFM1%_E1pu>;;OO7&s39 z$~Fm_?wVQMwjB}$$M!X??o-`FE5&8YM0U`b&Weew!V)SQ`=;Y{rYcg~zSf#i$?nc( z@vlt>C;PBt%}&)GId;jb+O}zzvKubxj?SVQ77Gp2y5T=#j!M#XKeOAB=7 zU6YriUMPgsw}QKMGOQO;J$J!hx4=wCZ3=HPag}zpdaA3{{rT~$+@9f@xb;a5u?8RK znn|)yB!!aOvFB0wzUe#LPG0&ds;X|nBq&L7qB=Bk@669Qy1VcxU!wm zGwIyU&aCaG2P7Q1fmHfY8p~{@-``1ZXRt&IB0DycN9>Q|ElE-`U|k1-hh^!C-82-^J$vg71LyJOH>FpA4I`Ygyr zpwPlrJ_bYE$nf%I7QoQcm^;MTrtXBzAwdYbaqPXrh>OZ6VEB~r|Iw3eFt|*cC|(K= zKo1KVO-ctbBdJIz55Q2=s<`MhZ~?6ccqyz87TvEUFt|f|v=u0#*C{B7`GR*oVLa|w zBVU9E7jtC<3`MaBSClWnm33zy#S#AJ4uW?8EZ|-=ZF=zH%8Srxy>FB!0M>UGm|BE) z7+hr6(wH?k-gGD0YRU&-Fh%L^6}zY4XhsbSf1;p~|V5z2Cs8*iIcl!=;7PtGrY|MUCA2pl3~!Vx(d7mJ*zr;gzd66lMt z8Js^8QAAo`y5E@+qZ#E|P3OlrMR*bRMFtu8qXaI-=n1}c<}NXL0q*Ti)i^w*rZdi@ z=!PJSpwoQH%J7*4`lAE{&yGY?TtK`oAV#iLYIrMF(kJ?j@H*6#@NgtqPAS%5B^pVM zFTv*+Y?NZ!02>u=6RZ&f8#N&Mp{7FycDl+gNQ5RS@H=y_(;{Wd>Zw`{9r;xPpw3Eg zPDHQeFqtd81_zg9d;Y`uKO!i9XTBT=JVlaL5WDkt2h*nQ!tMM^5s7_OYSX}2j&m!@@1rd^cG)G3M7#0)S>11Pa$JVP22J3cU;F|xe2HOP{X z)(LLN1+E;J;V*FFCve~g^a!_{dZ3qH87`dIU42CU$RzHNi{pL2o_*eref{(kr{jP{ zRKON?HG-R{(MP0%k>lFL)@>6tdaV|Ak#2V#!^EzHP;L)B+pC~_u2^}OntFE6)v;?e3sd*mSi@OBJ0MS3E*Dwtod4vYi(URfS4a*>gW*X1w?KV+M zGd)Z_jOw;}md?N-X0T`JIJ1m=pG8d%9~l#CA(m zRZ-fQM6|M#%yJNxxieZQ<6~5m5s;gRxIG+?j*yE<&$Tuy>C-XM9LrBAK}o31W>f(?w0km9&R7N?fqx*#zCqi-hrW@-drcbZHR&*$ zz884a9D_C_%ckFO>A+HEf)-0zy%FRrP`Dqn3>^oe2Z6}Yy7J+gOh4)lr$3OV2jv5@ zFfMO<+BGr>iS&)dAEv=o%?g|9ps=8e%R`YWLyaVQP`OouIXFvbNLB3p}8VRNP zS}lVoyz0W*2nKv`by`-QM4t*dP8?jY<8xX*j(Q6CeahiqGwz)tMlE2i_SQ!gJ^(#xMtN#tHCfoGDs8t6}w=*VF^WNDv-T&48P6fd_vPz^$R2zz;9PI%E;>o1W~F;_|7= zhrsuL{`GTW0jAj+am-qObAUnl@d^A*0B?_B9d29*b&ORA_vxD%`-v7ar>b8Z9DW+6 zMz$cuNHEPBtN7zU<8Rytgh;=&Nz{E&|SritpQdM#{D9{7p)9_KAQ9N~^F zDp6=fc+BCHV`n39;==zQju#8f;QTHCSfMk3VZ?6N@I1ECz|7G7M^!>-%a_m$a#lW7 z?}S9HIA_r~lOKp{7cfaiVA2bue-d7(i87AHS8dDeZ~ZNRMLMTLV$Pd6TX0|)@HMC;e7WoEhp#7{_icM*<)^@D zyM|;2?}XFX7&-Yh@vy)bercO6{L+4~@bCJ+9i(dZMW|5=eiKAL3Id%P{Z;TfA^L6< sh5J#IAxDZ*%{H#`$2t2b+Qe4;T|2g#vlYS6$E@XC(_f!YzzG2V0e@7Ad;kCd literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php new file mode 100644 index 0000000000000000000000000000000000000000..69919eb3a5c5ce55acb67262352dc1663d86047f GIT binary patch literal 5620 zcmcIo%WvF77{^JICX+tWNw#@NZH-fC+9qBlTOM+of|K1wK}i$xl7N*~&hBJm;Iquy!1gP4HiEn#lTmYX@qQ}LVVXK5_xfL zeuV@^$q0=6BD0cTpjPthNh|s7%zcE4mf`#I8n=d?AQ}GL>W*a=Wj`U{7=Mu3`BEluygB26pl)?@#6)rFq(-emJ(sjOM8kO|HOd5U)F3UP!A5X3))+YFxRnK4AiSow{ z2)=T8M{|S~$P$+j@FR&pq#_hh{y2xuL!KzB;VbAICA3jVmL~h>yPxUZcnI~nh6mvo z?Ghg)Jc1C|qbdcnG}I zV0wgk3Ex8lMUQ}Ff$n0o7gh#l$AuHIMK!9n&>(14UEpP|b-rz_60wNT>T6F6A_#{- zd9+`E?#4@~*D`j9<&Pq{8}Qx}c+aZEC@9NJEoTSb5#5P2K8*%q-|ztH-X}+4w(v#N zb6{9i66Q(kdQ(!~Mm;R9IEAikZ0ei2!q(%BwcNteqorJS@Fk2;ufDLkw4EE2@Gu(8 z=9Y6Hvz~i*E4Q%;5?$Kjb3KdhGN7Wg`C-U60bSv%aIB_931MCse)36O+%nJfuD|u^j@&7qqM>Ee7lwUdc`T~hu$23m?QSgHVYLgVc_DE2 zi5)NMtEk_l3qG8-tfqTd&@t4bzvmnl!fGh7((YqR%03!SdiPy8u?W^sp9lkFhbDcp z-J}D)%QpEqC@?HBkV-y}QX9nZihDea(QYy7fq;6v5<=9pMLXH1QbAW6t^c39*+#<) ztd$#T;vqWEL&xg6gUHc+cPS=HCG3hj8BQm;gVx2rat9tneQ*s5j2$cNsXp3b0J(I; zs-sW&QbNO9j96am9w^Om!lFdZYP1>D=s*sOaRj9jXvEHy&k$a54oCyY|K5D~6@*LB z$EMBh6i~6TbE4jHN(v3d{710fL&I4{urC~#0-;Elj(mQAu5Q_3BfogBV`!woxbQps z6pD#E^zl~`LUl64vn{EiF3kCDylpyBZq{^mrhoqXpI>*4;1qqtJfY|6oXZ~{={v{x z8wp*AGZ}7uNX5kktk+s@C8-q>jB>4}^GgOpc?n;LKeh0;61tS6Cj5F!M@a<%@Qsf3 zIK+vX9&#*0n8HJGgqqK28UG-miwW|j;EtaACf+E~H$ z4gDgaff(K3jELo#*R7azo0~CC^y~EmG-J1#K1v}@$)^dD?dOIv-n0|73NW<>*Oc!e zF9{B7BQFX0Hn*~v%uB*VJufi|xpM}E{4Al%4fKaww_Afoo1nK&bfq5uvsgFId=tv` z=JBrb?us*RZQQfV+0%> zL_9*LMFhIr4RLBF$;o!Lrl(?v>+Trr8D;A1KnABE0{HQ-q!WFjjaSTXdU-DhTwhD4 z4-XGH;OL2CRD->6GB^#d(_q)}DpQ?_!{EUvO*^)AH2;@`Cg9y9f^rr)&0iGP2KWt} zHR=78P&Awlu%}nqIW?&S%y7<&81g5ZyL124m+!i6EV5yxxN+1*u7o2`bvtt+ zB=UTo84WbKOdckh&%2b+jHWR=n$}=Q)3!4^y};gqlera*bEd*!VQjWYrw3-S$y||1 LhV#E;bd1nHW>tFi literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php new file mode 100644 index 00000000000..0ebffddc7ed --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php @@ -0,0 +1,81 @@ +internalAddGeneratedFile( + ' +� +2google/cloud/resourcemanager/v3/tag_bindings.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto"� + +TagBinding +name ( B�A +parent (  + tag_value ( ! +tag_value_namespaced_name ( :N�AK +.cloudresourcemanager.googleapis.com/TagBindingtagBindings/{tag_binding}" +CreateTagBindingMetadata"| +CreateTagBindingRequestE + tag_binding ( 2+.google.cloud.resourcemanager.v3.TagBindingB�A + validate_only (B�A" +DeleteTagBindingMetadata"_ +DeleteTagBindingRequestD +name ( B6�A�A0 +.cloudresourcemanager.googleapis.com/TagBinding"d +ListTagBindingsRequest +parent ( B �A�A* + page_size (B�A + +page_token ( B�A"u +ListTagBindingsResponseA + tag_bindings ( 2+.google.cloud.resourcemanager.v3.TagBinding +next_page_token ( "` +ListEffectiveTagsRequest +parent ( B�A + page_size (B�A + +page_token ( B�A"{ +ListEffectiveTagsResponseE +effective_tags ( 2-.google.cloud.resourcemanager.v3.EffectiveTag +next_page_token ( "� + EffectiveTagD + tag_value ( B1�A. +,cloudresourcemanager.googleapis.com/TagValue +namespaced_tag_value ( @ +tag_key ( B/�A, +*cloudresourcemanager.googleapis.com/TagKey +namespaced_tag_key (  +tag_key_parent_name (  + inherited (2� + TagBindings� +ListTagBindings7.google.cloud.resourcemanager.v3.ListTagBindingsRequest8.google.cloud.resourcemanager.v3.ListTagBindingsResponse" �Aparent���/v3/tagBindings� +CreateTagBinding8.google.cloud.resourcemanager.v3.CreateTagBindingRequest.google.longrunning.Operation"[�A& + +TagBindingCreateTagBindingMetadata�A tag_binding���"/v3/tagBindings: tag_binding� +DeleteTagBinding8.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.google.longrunning.Operation"\\�A1 +google.protobuf.EmptyDeleteTagBindingMetadata�Aname���*/v3/{name=tagBindings/**}� +ListEffectiveTags9.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse""�Aparent���/v3/effectiveTags��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� +#com.google.cloud.resourcemanager.v3BTagBindingsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php new file mode 100644 index 00000000000..c1adf3076f1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php @@ -0,0 +1,66 @@ +internalAddGeneratedFile( + ' +� +/google/cloud/resourcemanager/v3/tag_holds.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"� +TagHold +name ( B�A +holder ( B�A +origin ( B�A + help_link ( B�A4 + create_time ( 2.google.protobuf.TimestampB�A:[�AX ++cloudresourcemanager.googleapis.com/TagHold)tagValues/{tag_value}/tagHolds/{tag_hold}"� +CreateTagHoldRequestC +parent ( B3�A�A-+cloudresourcemanager.googleapis.com/TagHold? +tag_hold ( 2(.google.cloud.resourcemanager.v3.TagHoldB�A + validate_only (B�A" +CreateTagHoldMetadata"u +DeleteTagHoldRequestA +name ( B3�A�A- ++cloudresourcemanager.googleapis.com/TagHold + validate_only (B�A" +DeleteTagHoldMetadata"� +ListTagHoldsRequestC +parent ( B3�A�A-+cloudresourcemanager.googleapis.com/TagHold + page_size (B�A + +page_token ( B�A +filter ( B�A"l +ListTagHoldsResponse; + tag_holds ( 2(.google.cloud.resourcemanager.v3.TagHold +next_page_token ( 2� +TagHolds� + CreateTagHold5.google.cloud.resourcemanager.v3.CreateTagHoldRequest.google.longrunning.Operation"h�A +TagHoldCreateTagHoldMetadata�Aparent,tag_hold���-"!/v3/{parent=tagValues/*}/tagHolds:tag_hold� + DeleteTagHold5.google.cloud.resourcemanager.v3.DeleteTagHoldRequest.google.longrunning.Operation"a�A. +google.protobuf.EmptyDeleteTagHoldMetadata�Aname���#*!/v3/{name=tagValues/*/tagHolds/*}� + ListTagHolds4.google.cloud.resourcemanager.v3.ListTagHoldsRequest5.google.cloud.resourcemanager.v3.ListTagHoldsResponse"2�Aparent���#!/v3/{parent=tagValues/*}/tagHolds��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� +#com.google.cloud.resourcemanager.v3B TagHoldsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php new file mode 100644 index 0000000000000000000000000000000000000000..85b35f549341b97fe9306587862a565cb1d3896d GIT binary patch literal 4764 zcmb_gOK;p%6vj#Ox|z~&)27o=X^qn=X-GXJ>7qEK;AAFIMAD3sG)Tx|aAxjIta@x? zds0G`4GUHvAt80eiXDg_z+a$C*hNC>qN_^$0al#*@_6zfGosl{RU6shnRG|=w@9nESrVc#;O>tw&Nn1-=E7}6$b6Vf#jzo;u)S3 znt8fVqf9C93aSW!Ybi}>SS;NTOOD;h@6Y7nryQ`Ti}hUldfVE#SaVzP%lk?EgaKKu zSTTZ(76=;g$SNlC17feTWAS$6Csm$*CyqTnr*5&C7?1F{*l7x3Rd*9dpMv{eArq8En;%xG>FjfhQ>1w4#;p#$+K z;fttm-*%gX$H(ZouNcKw<|3M6pd}wg0~1()%8?GOFfZc{o}g_g{}leA-R*EwQMAty zUUQt=|0gKik zif<_;)M0>qh@=5;Es>P6;mi0;Z!B>uhr;Hk;xYO_w+}{B10&z)9 z+HwEy;QyBwX(?s(CB=3Cn8qOiPTfNTBE^BdqoqfirH!p(`O(9zQgLZ@d9_#=c>|B2 z%*s-+yu7+u{KQ;a8&PIoX3zjXP=uc;XgHNfc<$V6Nl6Q`=I(W;#B)`k0l=K|@K_;hA%HNMt3bjuT%SKQdYKVlc+=WeVdd?L-TZDXh3n9payW z3#a5Op6>+N8Cjm|9OLaY#w;F7xhmgkn)p`*Wzs2#&ks#nT>9>9d8pI`p(hidw({J( zk#zo3Q~t=5RfaoNOUKrbYxsA7o6fur;HJepgj;Qcn>HX5>Bt;~P}BA`-Q)uSEhr4S zH8Fdg5kd&)$B5B7%+GL`be48-n6!9@hbgojCT*Z~m=v3*PG>VzwhXX2xk_M7MjQrB zeSbzzFG^%rj>+)rgf@R<4$5JHxok?i%{(SQrqYPs4wFp{X#C#+kge3W6F}07=Kxte zGB3$Jr};p9E}kg0H^uXtg77vBD-5{XC;l+$-N9@v9Qa)YhlKdLO#?88a;zb1@L!p)q z6k}?zJAdNKFFiL`*rSTRL?2c3P4TF*&Yx!Vow?^y!V>Q;$-|3~vEb$9RgcEa7zVRr m7{?45#?IVsKf5i>O(gfuY5uB_dIUN10fb5Nhl)dVh|s^Gp-XoF literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php new file mode 100644 index 00000000000..c29cec5332a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php @@ -0,0 +1,90 @@ +internalAddGeneratedFile( + ' +� +0google/cloud/resourcemanager/v3/tag_values.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� +TagValue +name ( B�A +parent ( B�A + +short_name ( B�A�A +namespaced_name ( B�A + description ( B�A4 + create_time ( 2.google.protobuf.TimestampB�A4 + update_time ( 2.google.protobuf.TimestampB�A +etag ( B�A:K�AH +,cloudresourcemanager.googleapis.com/TagValuetagValues/{tag_value}R"b +ListTagValuesRequest +parent ( B �A�A* + page_size (B�A + +page_token ( B�A"o +ListTagValuesResponse= + +tag_values ( 2).google.cloud.resourcemanager.v3.TagValue +next_page_token ( "X +GetTagValueRequestB +name ( B4�A�A. +,cloudresourcemanager.googleapis.com/TagValue"b +GetNamespacedTagValueRequestB +name ( B4�A�A. +,cloudresourcemanager.googleapis.com/TagValue"v +CreateTagValueRequestA + tag_value ( 2).google.cloud.resourcemanager.v3.TagValueB�A + validate_only (B�A" +CreateTagValueMetadata"� +UpdateTagValueRequestA + tag_value ( 2).google.cloud.resourcemanager.v3.TagValueB�A4 + update_mask ( 2.google.protobuf.FieldMaskB�A + validate_only (B�A" +UpdateTagValueMetadata"� +DeleteTagValueRequestB +name ( B4�A�A. +,cloudresourcemanager.googleapis.com/TagValue + validate_only (B�A +etag ( B�A" +DeleteTagValueMetadata2� + TagValues� + ListTagValues5.google.cloud.resourcemanager.v3.ListTagValuesRequest6.google.cloud.resourcemanager.v3.ListTagValuesResponse"�Aparent��� /v3/tagValues� + GetTagValue3.google.cloud.resourcemanager.v3.GetTagValueRequest).google.cloud.resourcemanager.v3.TagValue"%�Aname���/v3/{name=tagValues/*}� +GetNamespacedTagValue=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest).google.cloud.resourcemanager.v3.TagValue"\'�Aname���/v3/tagValues/namespaced� +CreateTagValue6.google.cloud.resourcemanager.v3.CreateTagValueRequest.google.longrunning.Operation"Q�A" +TagValueCreateTagValueMetadata�A tag_value���" /v3/tagValues: tag_value� +UpdateTagValue6.google.cloud.resourcemanager.v3.UpdateTagValueRequest.google.longrunning.Operation"p�A" +TagValueUpdateTagValueMetadata�Atag_value,update_mask���-2 /v3/{tag_value.name=tagValues/*}: tag_value� +DeleteTagValue6.google.cloud.resourcemanager.v3.DeleteTagValueRequest.google.longrunning.Operation"J�A" +TagValueDeleteTagValueMetadata�Aname���*/v3/{name=tagValues/*}� + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"=�Aresource���,"\'/v3/{resource=tagValues/*}:getIamPolicy:*� + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"D�Aresource,policy���,"\'/v3/{resource=tagValues/*}:setIamPolicy:*� +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"O�Aresource,permissions���2"-/v3/{resource=tagValues/*}:testIamPermissions:*��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� +#com.google.cloud.resourcemanager.v3BTagValuesProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php new file mode 100644 index 00000000000..965bede9e76 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php @@ -0,0 +1,105 @@ +google.cloud.resourcemanager.v3.CreateFolderMetadata + */ +class CreateFolderMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the folder. + * @type string $parent + * The resource name of the folder or organization we are creating the folder + * under. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php new file mode 100644 index 00000000000..492c53088fb --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php @@ -0,0 +1,95 @@ +google.cloud.resourcemanager.v3.CreateFolderRequest + */ +class CreateFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $folder = null; + + /** + * @param \Google\Cloud\ResourceManager\V3\Folder $folder Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * @return \Google\Cloud\ResourceManager\V3\CreateFolderRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\Folder $folder): self + { + return (new self()) + ->setFolder($folder); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Folder $folder + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Folder|null + */ + public function getFolder() + { + return $this->folder; + } + + public function hasFolder() + { + return isset($this->folder); + } + + public function clearFolder() + { + unset($this->folder); + } + + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Folder $var + * @return $this + */ + public function setFolder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folder = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php new file mode 100644 index 00000000000..64d5f69ff7b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php @@ -0,0 +1,155 @@ +google.cloud.resourcemanager.v3.CreateProjectMetadata + */ +class CreateProjectMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + */ + protected $gettable = false; + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + */ + protected $ready = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Creation time of the project creation workflow. + * @type bool $gettable + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * @type bool $ready + * True if the project creation process is complete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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); + } + + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + * @return bool + */ + public function getGettable() + { + return $this->gettable; + } + + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + * @param bool $var + * @return $this + */ + public function setGettable($var) + { + GPBUtil::checkBool($var); + $this->gettable = $var; + + return $this; + } + + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + * @return bool + */ + public function getReady() + { + return $this->ready; + } + + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + * @param bool $var + * @return $this + */ + public function setReady($var) + { + GPBUtil::checkBool($var); + $this->ready = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php new file mode 100644 index 00000000000..3abfa5c1a38 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php @@ -0,0 +1,124 @@ +google.cloud.resourcemanager.v3.CreateProjectRequest + */ +class CreateProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = null; + + /** + * @param \Google\Cloud\ResourceManager\V3\Project $project Required. The Project to create. + * + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * @return \Google\Cloud\ResourceManager\V3\CreateProjectRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\Project $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Project $project + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Project|null + */ + public function getProject() + { + return $this->project; + } + + public function hasProject() + { + return isset($this->project); + } + + public function clearProject() + { + unset($this->project); + } + + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Project $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); + $this->project = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php new file mode 100644 index 00000000000..417b98c428c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagBindingMetadata + */ +class CreateTagBindingMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php new file mode 100644 index 00000000000..46cd126d333 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php @@ -0,0 +1,128 @@ +google.cloud.resourcemanager.v3.CreateTagBindingRequest + */ +class CreateTagBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_binding = null; + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\ResourceManager\V3\TagBinding $tagBinding Required. The TagBinding to be created. + * + * @return \Google\Cloud\ResourceManager\V3\CreateTagBindingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\TagBinding $tagBinding): self + { + return (new self()) + ->setTagBinding($tagBinding); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagBinding $tag_binding + * Required. The TagBinding to be created. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagBinding|null + */ + public function getTagBinding() + { + return $this->tag_binding; + } + + public function hasTagBinding() + { + return isset($this->tag_binding); + } + + public function clearTagBinding() + { + unset($this->tag_binding); + } + + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagBinding $var + * @return $this + */ + public function setTagBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagBinding::class); + $this->tag_binding = $var; + + return $this; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php new file mode 100644 index 00000000000..ad0b4f18f9b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php @@ -0,0 +1,35 @@ +google.cloud.resourcemanager.v3.CreateTagHoldMetadata + */ +class CreateTagHoldMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php new file mode 100644 index 00000000000..9570f169d0a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php @@ -0,0 +1,170 @@ +google.cloud.resourcemanager.v3.CreateTagHoldRequest + */ +class CreateTagHoldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_hold = null; + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. Please see + * {@see TagHoldsClient::tagValueName()} for help formatting this field. + * @param \Google\Cloud\ResourceManager\V3\TagHold $tagHold Required. The TagHold to be created. + * + * @return \Google\Cloud\ResourceManager\V3\CreateTagHoldRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ResourceManager\V3\TagHold $tagHold): self + { + return (new self()) + ->setParent($parent) + ->setTagHold($tagHold); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * @type \Google\Cloud\ResourceManager\V3\TagHold $tag_hold + * Required. The TagHold to be created. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * 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 TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * 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 TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagHold|null + */ + public function getTagHold() + { + return $this->tag_hold; + } + + public function hasTagHold() + { + return isset($this->tag_hold); + } + + public function clearTagHold() + { + unset($this->tag_hold); + } + + /** + * Required. The TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagHold $var + * @return $this + */ + public function setTagHold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagHold::class); + $this->tag_hold = $var; + + return $this; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php new file mode 100644 index 00000000000..6dcfd2f3e91 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagKeyMetadata + */ +class CreateTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php new file mode 100644 index 00000000000..1fefbae7ed7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php @@ -0,0 +1,133 @@ +google.cloud.resourcemanager.v3.CreateTagKeyRequest + */ +class CreateTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_key = null; + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\ResourceManager\V3\TagKey $tagKey Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * @return \Google\Cloud\ResourceManager\V3\CreateTagKeyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\TagKey $tagKey): self + { + return (new self()) + ->setTagKey($tagKey); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @type bool $validate_only + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagKey|null + */ + public function getTagKey() + { + return $this->tag_key; + } + + public function hasTagKey() + { + return isset($this->tag_key); + } + + public function clearTagKey() + { + unset($this->tag_key); + } + + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagKey $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_key = $var; + + return $this; + } + + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php new file mode 100644 index 00000000000..4783b3262ba --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagValueMetadata + */ +class CreateTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php new file mode 100644 index 00000000000..11be5a0d290 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php @@ -0,0 +1,133 @@ +google.cloud.resourcemanager.v3.CreateTagValueRequest + */ +class CreateTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_value = null; + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\ResourceManager\V3\TagValue $tagValue Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * @return \Google\Cloud\ResourceManager\V3\CreateTagValueRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\TagValue $tagValue): self + { + return (new self()) + ->setTagValue($tagValue); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @type bool $validate_only + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagValue|null + */ + public function getTagValue() + { + return $this->tag_value; + } + + public function hasTagValue() + { + return isset($this->tag_value); + } + + public function clearTagValue() + { + unset($this->tag_value); + } + + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagValue $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_value = $var; + + return $this; + } + + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php new file mode 100644 index 00000000000..218142421f9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteFolderMetadata + */ +class DeleteFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php new file mode 100644 index 00000000000..dabb2171694 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php @@ -0,0 +1,86 @@ +google.cloud.resourcemanager.v3.DeleteFolderRequest + */ +class DeleteFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. Please see + * {@see FoldersClient::folderName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteFolderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_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. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php new file mode 100644 index 00000000000..e1f9c485620 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + */ +class DeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php new file mode 100644 index 00000000000..ccb5bc729ca --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteProjectMetadata + */ +class DeleteProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php new file mode 100644 index 00000000000..dc03f91ecc5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php @@ -0,0 +1,82 @@ +google.cloud.resourcemanager.v3.DeleteProjectRequest + */ +class DeleteProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Project (for example, `projects/415104041262`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the Project (for example, `projects/415104041262`). Please see + * {@see ProjectsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteProjectRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Project (for example, `projects/415104041262`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Project (for example, `projects/415104041262`). + * + * 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 name of the Project (for example, `projects/415104041262`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php new file mode 100644 index 00000000000..ceaecd1073f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + */ +class DeleteTagBindingMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php new file mode 100644 index 00000000000..3d3141e6ba2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php @@ -0,0 +1,91 @@ +google.cloud.resourcemanager.v3.DeleteTagBindingRequest + */ +class DeleteTagBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). Please see + * {@see TagBindingsClient::tagBindingName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * 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 name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php new file mode 100644 index 00000000000..dc16e59f2a7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php @@ -0,0 +1,35 @@ +google.cloud.resourcemanager.v3.DeleteTagHoldMetadata + */ +class DeleteTagHoldMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php new file mode 100644 index 00000000000..10b92c6d1a7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php @@ -0,0 +1,124 @@ +google.cloud.resourcemanager.v3.DeleteTagHoldRequest + */ +class DeleteTagHoldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. Please see + * {@see TagHoldsClient::tagHoldName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-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. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-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; + } + + /** + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php new file mode 100644 index 00000000000..f4c10627911 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + */ +class DeleteTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php new file mode 100644 index 00000000000..7c44199f39b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php @@ -0,0 +1,167 @@ +google.cloud.resourcemanager.v3.DeleteTagKeyRequest + */ +class DeleteTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. Please see + * {@see TagKeysClient::tagKeyName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * @type bool $validate_only + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * 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 resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * 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; + } + + /** + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php new file mode 100644 index 00000000000..0b447cb8bcd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagValueMetadata + */ +class DeleteTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php new file mode 100644 index 00000000000..49144e5ddee --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php @@ -0,0 +1,162 @@ +google.cloud.resourcemanager.v3.DeleteTagValueRequest + */ +class DeleteTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Resource name for TagValue to be deleted in the format + * tagValues/456. Please see + * {@see TagValuesClient::tagValueName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\DeleteTagValueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * @type bool $validate_only + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * 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. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * 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; + } + + /** + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php new file mode 100644 index 00000000000..321ccbdb024 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php @@ -0,0 +1,289 @@ +google.cloud.resourcemanager.v3.EffectiveTag + */ +class EffectiveTag extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + */ + protected $tag_value = ''; + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + */ + protected $namespaced_tag_value = ''; + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + */ + protected $tag_key = ''; + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + */ + protected $namespaced_tag_key = ''; + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + */ + protected $tag_key_parent_name = ''; + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + */ + protected $inherited = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag_value + * Resource name for TagValue in the format `tagValues/456`. + * @type string $namespaced_tag_value + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * @type string $tag_key + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * @type string $namespaced_tag_key + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * @type string $tag_key_parent_name + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * @type bool $inherited + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTagValue() + { + return $this->tag_value; + } + + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + * @return string + */ + public function getNamespacedTagValue() + { + return $this->namespaced_tag_value; + } + + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + * @param string $var + * @return $this + */ + public function setNamespacedTagValue($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_value = $var; + + return $this; + } + + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getTagKey() + { + return $this->tag_key; + } + + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkString($var, True); + $this->tag_key = $var; + + return $this; + } + + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + * @return string + */ + public function getNamespacedTagKey() + { + return $this->namespaced_tag_key; + } + + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + * @param string $var + * @return $this + */ + public function setNamespacedTagKey($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_key = $var; + + return $this; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @return string + */ + public function getTagKeyParentName() + { + return $this->tag_key_parent_name; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @param string $var + * @return $this + */ + public function setTagKeyParentName($var) + { + GPBUtil::checkString($var, True); + $this->tag_key_parent_name = $var; + + return $this; + } + + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + * @return bool + */ + public function getInherited() + { + return $this->inherited; + } + + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + * @param bool $var + * @return $this + */ + public function setInherited($var) + { + GPBUtil::checkBool($var); + $this->inherited = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php new file mode 100644 index 00000000000..a2a3f4bc7eb --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php @@ -0,0 +1,392 @@ +google.cloud.resourcemanager.v3.Folder + */ +class Folder extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * @type string $parent + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * @type string $display_name + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * @type int $state + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the folder was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the folder was last modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Timestamp when the folder was requested to be deleted. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Folder\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php new file mode 100644 index 00000000000..1758cdf0f34 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php @@ -0,0 +1,64 @@ +google.cloud.resourcemanager.v3.Folder.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The folder has been marked for deletion by the user. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + 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(State::class, \Google\Cloud\ResourceManager\V3\Folder_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php new file mode 100644 index 00000000000..e24bc7bd945 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php @@ -0,0 +1,86 @@ +google.cloud.resourcemanager.v3.GetFolderRequest + */ +class GetFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. Please see + * {@see FoldersClient::folderName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetFolderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_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. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php new file mode 100644 index 00000000000..075ebc7bea6 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php @@ -0,0 +1,96 @@ +google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest + */ +class GetNamespacedTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. Please see + * {@see TagKeysClient::tagKeyName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * 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. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php new file mode 100644 index 00000000000..b7850628639 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php @@ -0,0 +1,113 @@ +google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest + */ +class GetNamespacedTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A namespaced tag value name in the following format: + * + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * Please see {@see TagValuesClient::tagValueName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * 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. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php new file mode 100644 index 00000000000..cb606425175 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php @@ -0,0 +1,92 @@ +google.cloud.resourcemanager.v3.GetOrganizationRequest + */ +class GetOrganizationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". Please see + * {@see OrganizationsClient::organizationName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetOrganizationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * 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 resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php new file mode 100644 index 00000000000..c4a9092bbc8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php @@ -0,0 +1,83 @@ +google.cloud.resourcemanager.v3.GetProjectRequest + */ +class GetProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project (for example, `projects/415104041262`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the project (for example, `projects/415104041262`). Please see + * {@see ProjectsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetProjectRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project (for example, `projects/415104041262`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project (for example, `projects/415104041262`). + * + * 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 name of the project (for example, `projects/415104041262`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php new file mode 100644 index 00000000000..ded215b74f7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php @@ -0,0 +1,86 @@ +google.cloud.resourcemanager.v3.GetTagKeyRequest + */ +class GetTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. Please see + * {@see TagKeysClient::tagKeyName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetTagKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * 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. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php new file mode 100644 index 00000000000..b20eae9c9e8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php @@ -0,0 +1,86 @@ +google.cloud.resourcemanager.v3.GetTagValueRequest + */ +class GetTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. Please see + * {@see TagValuesClient::tagValueName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\GetTagValueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * 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. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php new file mode 100644 index 00000000000..545b9e85568 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php @@ -0,0 +1,170 @@ +google.cloud.resourcemanager.v3.ListEffectiveTagsRequest + */ +class ListEffectiveTagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * @return \Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @type int $page_size + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the 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. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php new file mode 100644 index 00000000000..8c970dbe1d0 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListEffectiveTagsResponse + */ +class ListEffectiveTagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + */ + private $effective_tags; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * A possibly paginated list of effective tags for the specified resource. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + * @param array<\Google\Cloud\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\EffectiveTag::class); + $this->effective_tags = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php new file mode 100644 index 00000000000..8c6ebb0b7e9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php @@ -0,0 +1,234 @@ +google.cloud.resourcemanager.v3.ListFoldersRequest + */ +class ListFoldersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * @return \Google\Cloud\ResourceManager\V3\ListFoldersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @type int $page_size + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * @type bool $show_deleted + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * 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 name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * 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. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate 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. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * 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. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php new file mode 100644 index 00000000000..72d6127db51 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php @@ -0,0 +1,109 @@ +google.cloud.resourcemanager.v3.ListFoldersResponse + */ +class ListFoldersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + private $folders; + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folders = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php new file mode 100644 index 00000000000..fc0eeb55b49 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php @@ -0,0 +1,225 @@ +google.cloud.resourcemanager.v3.ListProjectsRequest + */ +class ListProjectsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * @return \Google\Cloud\ResourceManager\V3\ListProjectsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * @type int $page_size + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @type bool $show_deleted + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * 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 name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * 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. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php new file mode 100644 index 00000000000..4714956716e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php @@ -0,0 +1,136 @@ +google.cloud.resourcemanager.v3.ListProjectsResponse + */ +class ListProjectsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + private $projects; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects + * The list of Projects under the parent. This list can be paginated. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProjects() + { + return $this->projects; + } + + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); + $this->projects = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php new file mode 100644 index 00000000000..c11d2e2b258 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php @@ -0,0 +1,170 @@ +google.cloud.resourcemanager.v3.ListTagBindingsRequest + */ +class ListTagBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * @return \Google\Cloud\ResourceManager\V3\ListTagBindingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @type int $page_size + * Optional. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * 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 full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * 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. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the 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. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php new file mode 100644 index 00000000000..f71e67a1f32 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListTagBindingsResponse + */ +class ListTagBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + private $tag_bindings; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $tag_bindings + * A possibly paginated list of TagBindings for the specified resource. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagBindings() + { + return $this->tag_bindings; + } + + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagBinding::class); + $this->tag_bindings = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php new file mode 100644 index 00000000000..c1f0e4ac519 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php @@ -0,0 +1,236 @@ +google.cloud.resourcemanager.v3.ListTagHoldsRequest + */ +class ListTagHoldsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. Please see + * {@see TagHoldsClient::tagValueName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\ListTagHoldsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * @type int $page_size + * Optional. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * @type string $filter + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * 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 parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * 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. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the 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. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * 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. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php new file mode 100644 index 00000000000..8d12cbcf049 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListTagHoldsResponse + */ +class ListTagHoldsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + */ + private $tag_holds; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $tag_holds + * A possibly paginated list of TagHolds. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagHolds() + { + return $this->tag_holds; + } + + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagHolds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagHold::class); + $this->tag_holds = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php new file mode 100644 index 00000000000..09ad5cd4499 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php @@ -0,0 +1,170 @@ +google.cloud.resourcemanager.v3.ListTagKeysRequest + */ +class ListTagKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * @return \Google\Cloud\ResourceManager\V3\ListTagKeysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * @type int $page_size + * Optional. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * 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 TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * 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. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the 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. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php new file mode 100644 index 00000000000..ff989a9f578 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php @@ -0,0 +1,105 @@ +google.cloud.resourcemanager.v3.ListTagKeysResponse + */ +class ListTagKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + private $tag_keys; + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * 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\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $tag_keys + * List of TagKeys that live under the specified parent in the request. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagKeys() + { + return $this->tag_keys; + } + + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_keys = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php new file mode 100644 index 00000000000..dd1ef80c869 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php @@ -0,0 +1,162 @@ +google.cloud.resourcemanager.v3.ListTagValuesRequest + */ +class ListTagValuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. + * + * @return \Google\Cloud\ResourceManager\V3\ListTagValuesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. + * @type int $page_size + * Optional. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. + * + * 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. + * + * 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. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the 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. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php new file mode 100644 index 00000000000..ff490de7417 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php @@ -0,0 +1,113 @@ +google.cloud.resourcemanager.v3.ListTagValuesResponse + */ +class ListTagValuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + private $tag_values; + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid 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\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $tag_values + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagValues() + { + return $this->tag_values; + } + + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_values = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php new file mode 100644 index 00000000000..da8f8448b18 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php @@ -0,0 +1,135 @@ +google.cloud.resourcemanager.v3.MoveFolderMetadata + */ +class MoveFolderMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + */ + protected $source_parent = ''; + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + */ + protected $destination_parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the folder. + * @type string $source_parent + * The resource name of the folder's parent. + * @type string $destination_parent + * The resource name of the folder or organization to move the folder to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + * @return string + */ + public function getSourceParent() + { + return $this->source_parent; + } + + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + * @param string $var + * @return $this + */ + public function setSourceParent($var) + { + GPBUtil::checkString($var, True); + $this->source_parent = $var; + + return $this; + } + + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php new file mode 100644 index 00000000000..61aa48a22f2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php @@ -0,0 +1,132 @@ +google.cloud.resourcemanager.v3.MoveFolderRequest + */ +class MoveFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination_parent = ''; + + /** + * @param string $name Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * Please see {@see FoldersClient::folderName()} for help formatting this field. + * @param string $destinationParent Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * @return \Google\Cloud\ResourceManager\V3\MoveFolderRequest + * + * @experimental + */ + public static function build(string $name, string $destinationParent): self + { + return (new self()) + ->setName($name) + ->setDestinationParent($destinationParent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * @type string $destination_parent + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_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. The resource name of the Folder to move. + * Must be of the form folders/{folder_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 resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php new file mode 100644 index 00000000000..4dc990631f4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.MoveProjectMetadata + */ +class MoveProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php new file mode 100644 index 00000000000..86b27336455 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php @@ -0,0 +1,119 @@ +google.cloud.resourcemanager.v3.MoveProjectRequest + */ +class MoveProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to move. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination_parent = ''; + + /** + * @param string $name Required. The name of the project to move. Please see + * {@see ProjectsClient::projectName()} for help formatting this field. + * @param string $destinationParent Required. The new parent to move the Project under. + * + * @return \Google\Cloud\ResourceManager\V3\MoveProjectRequest + * + * @experimental + */ + public static function build(string $name, string $destinationParent): self + { + return (new self()) + ->setName($name) + ->setDestinationParent($destinationParent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project to move. + * @type string $destination_parent + * Required. The new parent to move the Project under. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to move. + * + * 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 name of the project to move. + * + * 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 new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * Required. The new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php new file mode 100644 index 00000000000..d641338f6e8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php @@ -0,0 +1,372 @@ +google.cloud.resourcemanager.v3.Organization + */ +class Organization extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + protected $owner; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * @type string $display_name + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * @type string $directory_customer_id + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * @type int $state + * Output only. The organization's current lifecycle state. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the Organization was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the Organization was last modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Timestamp when the Organization was requested for deletion. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * + * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDirectoryCustomerId() + { + return $this->readOneof(3); + } + + public function hasDirectoryCustomerId() + { + return $this->hasOneof(3); + } + + /** + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * + * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDirectoryCustomerId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Organization\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * @return string + */ + public function getOwner() + { + return $this->whichOneof("owner"); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php new file mode 100644 index 00000000000..afee81887ea --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php @@ -0,0 +1,64 @@ +google.cloud.resourcemanager.v3.Organization.State + */ +class State +{ + /** + * Unspecified state. This is only useful for distinguishing unset values. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The organization has been marked for deletion by the user. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + 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(State::class, \Google\Cloud\ResourceManager\V3\Organization_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php new file mode 100644 index 00000000000..066d475cb2f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php @@ -0,0 +1,489 @@ +google.cloud.resourcemanager.v3.Project + */ +class Project extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parent = ''; + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $project_id = ''; + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The most recent time this resource was modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * @type string $parent + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * @type string $project_id + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * @type int $state + * Output only. The project lifecycle state. + * @type string $display_name + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The most recent time this resource was modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The time at which this resource was requested for deletion. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Project\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The most recent time this resource was modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The most recent time this resource was modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php new file mode 100644 index 00000000000..ce98594b31e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php @@ -0,0 +1,70 @@ +google.cloud.resourcemanager.v3.Project.State + */ +class State +{ + /** + * Unspecified state. This is only used/useful for distinguishing + * unset values. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The project has been marked for deletion by the user + * (by invoking + * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]) + * or by the system (Google Cloud Platform). + * This can generally be reversed by invoking [UndeleteProject] + * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + 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(State::class, \Google\Cloud\ResourceManager\V3\Project_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php new file mode 100644 index 00000000000..77092359f1d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php @@ -0,0 +1,66 @@ +google.cloud.resourcemanager.v3.Purpose + */ +class Purpose +{ + /** + * Unspecified purpose. + * + * Generated from protobuf enum PURPOSE_UNSPECIFIED = 0; + */ + const PURPOSE_UNSPECIFIED = 0; + /** + * Purpose for Compute Engine firewalls. + * A corresponding `purpose_data` should be set for the network the tag is + * intended for. The key should be `network` and the value should be in + * either of these two formats: + * - + * `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` + * - `{project_id}/{network_name}` + * Examples: + * - + * `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` + * - `fail-closed-load-testing/load-testing-network` + * + * Generated from protobuf enum GCE_FIREWALL = 1; + */ + const GCE_FIREWALL = 1; + + private static $valueToName = [ + self::PURPOSE_UNSPECIFIED => 'PURPOSE_UNSPECIFIED', + self::GCE_FIREWALL => 'GCE_FIREWALL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php new file mode 100644 index 00000000000..c4fe151d856 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php @@ -0,0 +1,290 @@ +google.cloud.resourcemanager.v3.SearchFoldersRequest + */ +class SearchFoldersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + + /** + * @param string $query Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * + * Some example queries are: + * + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * @return \Google\Cloud\ResourceManager\V3\SearchFoldersRequest + * + * @experimental + */ + public static function build(string $query): self + { + return (new self()) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * @type string $query + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php new file mode 100644 index 00000000000..39fe82fe371 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php @@ -0,0 +1,109 @@ +google.cloud.resourcemanager.v3.SearchFoldersResponse + */ +class SearchFoldersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + private $folders; + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders + * A possibly paginated folder search results. + * the specified parent resource. + * @type string $next_page_token + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folders = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php new file mode 100644 index 00000000000..5304f599c05 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php @@ -0,0 +1,234 @@ +google.cloud.resourcemanager.v3.SearchOrganizationsRequest + */ +class SearchOrganizationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + + /** + * @param string $query Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * + * + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * @return \Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest + * + * @experimental + */ + public static function build(string $query): self + { + return (new self()) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * @type string $query + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php new file mode 100644 index 00000000000..74823ebb56d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php @@ -0,0 +1,121 @@ +google.cloud.resourcemanager.v3.SearchOrganizationsResponse + */ +class SearchOrganizationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + private $organizations; + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * 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\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $organizations + * The list of Organizations that matched the search query, possibly + * paginated. + * @type string $next_page_token + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrganizations() + { + return $this->organizations; + } + + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrganizations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Organization::class); + $this->organizations = $arr; + + return $this; + } + + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php new file mode 100644 index 00000000000..d84f0d7330b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php @@ -0,0 +1,302 @@ +google.cloud.resourcemanager.v3.SearchProjectsRequest + */ +class SearchProjectsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * @param string $query Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * + * Search expressions are case insensitive. + * + * Some examples queries: + * + * + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * @return \Google\Cloud\ResourceManager\V3\SearchProjectsRequest + * + * @experimental + */ + public static function build(string $query): self + { + return (new self()) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * @type int $page_size + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php new file mode 100644 index 00000000000..3e3f0aaddf9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php @@ -0,0 +1,138 @@ +google.cloud.resourcemanager.v3.SearchProjectsResponse + */ +class SearchProjectsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + private $projects; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects + * The list of Projects that matched the list filter query. This list can + * be paginated. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProjects() + { + return $this->projects; + } + + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); + $this->projects = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php new file mode 100644 index 00000000000..217deee78cb --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php @@ -0,0 +1,207 @@ +google.cloud.resourcemanager.v3.TagBinding + */ +class TagBinding extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + */ + protected $tag_value = ''; + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + */ + protected $tag_value_namespaced_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * @type string $parent + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * @type string $tag_value + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * @type string $tag_value_namespaced_name + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + * @return string + */ + public function getTagValue() + { + return $this->tag_value; + } + + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + * @return string + */ + public function getTagValueNamespacedName() + { + return $this->tag_value_namespaced_name; + } + + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + * @param string $var + * @return $this + */ + public function setTagValueNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->tag_value_namespaced_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php new file mode 100644 index 00000000000..7e2ee136616 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php @@ -0,0 +1,256 @@ +google.cloud.resourcemanager.v3.TagHold + */ +class TagHold extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $holder = ''; + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $origin = ''; + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $help_link = ''; + /** + * Output only. The time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * @type string $holder + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * @type string $origin + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * @type string $help_link + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time this TagHold was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHolder() + { + return $this->holder; + } + + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHolder($var) + { + GPBUtil::checkString($var, True); + $this->holder = $var; + + return $this; + } + + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrigin() + { + return $this->origin; + } + + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrigin($var) + { + GPBUtil::checkString($var, True); + $this->origin = $var; + + return $this; + } + + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHelpLink() + { + return $this->help_link; + } + + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHelpLink($var) + { + GPBUtil::checkString($var, True); + $this->help_link = $var; + + return $this; + } + + /** + * Output only. The time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php new file mode 100644 index 00000000000..a329b18ef1d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php @@ -0,0 +1,477 @@ +google.cloud.resourcemanager.v3.TagKey + */ +class TagKey extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $parent = ''; + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $short_name = ''; + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $namespaced_name = ''; + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $purpose = 0; + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $purpose_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * @type string $parent + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * @type string $short_name + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * @type string $namespaced_name + * Output only. Immutable. Namespaced name of the TagKey. + * @type string $description + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time. + * @type string $etag + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * @type int $purpose + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * @type array|\Google\Protobuf\Internal\MapField $purpose_data + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getShortName() + { + return $this->short_name; + } + + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getNamespacedName() + { + return $this->namespaced_name; + } + + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_name = $var; + + return $this; + } + + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPurpose() + { + return $this->purpose; + } + + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Purpose::class); + $this->purpose = $var; + + return $this; + } + + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPurposeData() + { + return $this->purpose_data; + } + + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPurposeData($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->purpose_data = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php new file mode 100644 index 00000000000..6a2d8efaf8b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php @@ -0,0 +1,374 @@ +google.cloud.resourcemanager.v3.TagValue + */ +class TagValue extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $parent = ''; + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $short_name = ''; + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $namespaced_name = ''; + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * @type string $parent + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * @type string $short_name + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * @type string $namespaced_name + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * @type string $description + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time. + * @type string $etag + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getShortName() + { + return $this->short_name; + } + + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNamespacedName() + { + return $this->namespaced_name; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_name = $var; + + return $this; + } + + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php new file mode 100644 index 00000000000..25c40d3462a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteFolderMetadata + */ +class UndeleteFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php new file mode 100644 index 00000000000..e1308f1bd4e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php @@ -0,0 +1,86 @@ +google.cloud.resourcemanager.v3.UndeleteFolderRequest + */ +class UndeleteFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. Please see + * {@see FoldersClient::folderName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\UndeleteFolderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_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. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php new file mode 100644 index 00000000000..4652f9473a9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + */ +class UndeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php new file mode 100644 index 00000000000..2dcdba313d1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteProjectMetadata + */ +class UndeleteProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php new file mode 100644 index 00000000000..080d2b97982 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php @@ -0,0 +1,89 @@ +google.cloud.resourcemanager.v3.UndeleteProjectRequest + */ +class UndeleteProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the project (for example, `projects/415104041262`). + * + * Required. Please see + * {@see ProjectsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceManager\V3\UndeleteProjectRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + * + * 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 name of the project (for example, `projects/415104041262`). + * Required. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php new file mode 100644 index 00000000000..4048d4d5bc3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UpdateFolderMetadata + */ +class UpdateFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php new file mode 100644 index 00000000000..51fcccc6af2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php @@ -0,0 +1,152 @@ +google.cloud.resourcemanager.v3.UpdateFolderRequest + */ +class UpdateFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $folder = null; + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ResourceManager\V3\Folder $folder Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * @param \Google\Protobuf\FieldMask $updateMask Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * @return \Google\Cloud\ResourceManager\V3\UpdateFolderRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\Folder $folder, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFolder($folder) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Folder $folder + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Folder|null + */ + public function getFolder() + { + return $this->folder; + } + + public function hasFolder() + { + return isset($this->folder); + } + + public function clearFolder() + { + unset($this->folder); + } + + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Folder $var + * @return $this + */ + public function setFolder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folder = $var; + + return $this; + } + + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php new file mode 100644 index 00000000000..9f46eb9a63c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UpdateProjectMetadata + */ +class UpdateProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php new file mode 100644 index 00000000000..744e08216d1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php @@ -0,0 +1,141 @@ +google.cloud.resourcemanager.v3.UpdateProjectRequest + */ +class UpdateProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = null; + /** + * Optional. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ResourceManager\V3\Project $project Required. The new definition of the project. + * @param \Google\Protobuf\FieldMask $updateMask Optional. An update mask to selectively update fields. + * + * @return \Google\Cloud\ResourceManager\V3\UpdateProjectRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\Project $project, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setProject($project) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Project $project + * Required. The new definition of the project. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. An update mask to selectively update fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Project|null + */ + public function getProject() + { + return $this->project; + } + + public function hasProject() + { + return isset($this->project); + } + + public function clearProject() + { + unset($this->project); + } + + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Project $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); + $this->project = $var; + + return $this; + } + + /** + * Optional. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php new file mode 100644 index 00000000000..deef54c740c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + */ +class UpdateTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php new file mode 100644 index 00000000000..7bbd0760c73 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php @@ -0,0 +1,199 @@ +google.cloud.resourcemanager.v3.UpdateTagKeyRequest + */ +class UpdateTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_key = null; + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\ResourceManager\V3\TagKey $tagKey Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * @param \Google\Protobuf\FieldMask $updateMask Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * @return \Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\TagKey $tagKey, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTagKey($tagKey) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * @type bool $validate_only + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagKey|null + */ + public function getTagKey() + { + return $this->tag_key; + } + + public function hasTagKey() + { + return isset($this->tag_key); + } + + public function clearTagKey() + { + unset($this->tag_key); + } + + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagKey $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_key = $var; + + return $this; + } + + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php new file mode 100644 index 00000000000..2503e836508 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.UpdateTagValueMetadata + */ +class UpdateTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php new file mode 100644 index 00000000000..125d6761dfb --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php @@ -0,0 +1,189 @@ +google.cloud.resourcemanager.v3.UpdateTagValueRequest + */ +class UpdateTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_value = null; + /** + * Optional. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\ResourceManager\V3\TagValue $tagValue Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Fields to be updated. + * + * @return \Google\Cloud\ResourceManager\V3\UpdateTagValueRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ResourceManager\V3\TagValue $tagValue, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTagValue($tagValue) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Fields to be updated. + * @type bool $validate_only + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagValue|null + */ + public function getTagValue() + { + return $this->tag_value; + } + + public function hasTagValue() + { + return isset($this->tag_value); + } + + public function clearTagValue() + { + unset($this->tag_value); + } + + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagValue $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_value = $var; + + return $this; + } + + /** + * Optional. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php new file mode 100644 index 00000000000..30273263a0b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php @@ -0,0 +1,112 @@ +setParent($folderParent); + $request = (new CreateFolderRequest()) + ->setFolder($folder); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->createFolder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $folderParent = '[PARENT]'; + + create_folder_sample($folderParent); +} +// [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php new file mode 100644 index 00000000000..cef9c00ca8a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php @@ -0,0 +1,94 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->deleteFolder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FoldersClient::folderName('[FOLDER]'); + + delete_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php new file mode 100644 index 00000000000..b6712e919f2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Folder $response */ + $response = $foldersClient->getFolder($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FoldersClient::folderName('[FOLDER]'); + + get_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php new file mode 100644 index 00000000000..8e37a069b5b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php @@ -0,0 +1,75 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $foldersClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php new file mode 100644 index 00000000000..57faa6cf2dc --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php @@ -0,0 +1,89 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $foldersClient->listFolders($request); + + /** @var Folder $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_folders_sample($parent); +} +// [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php new file mode 100644 index 00000000000..bdc0df3c8cd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php @@ -0,0 +1,105 @@ +setName($formattedName) + ->setDestinationParent($destinationParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->moveFolder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FoldersClient::folderName('[FOLDER]'); + $destinationParent = '[DESTINATION_PARENT]'; + + move_folder_sample($formattedName, $destinationParent); +} +// [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php new file mode 100644 index 00000000000..cf499fa89b4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php @@ -0,0 +1,67 @@ +searchFolders($request); + + /** @var Folder $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php new file mode 100644 index 00000000000..e1de0478933 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $foldersClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php new file mode 100644 index 00000000000..1527da453d8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php @@ -0,0 +1,82 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $foldersClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php new file mode 100644 index 00000000000..8fec83f5907 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php @@ -0,0 +1,94 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->undeleteFolder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FoldersClient::folderName('[FOLDER]'); + + undelete_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php new file mode 100644 index 00000000000..7fae0b9ef92 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php @@ -0,0 +1,105 @@ +setParent($folderParent); + $updateMask = new FieldMask(); + $request = (new UpdateFolderRequest()) + ->setFolder($folder) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->updateFolder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $folderParent = '[PARENT]'; + + update_folder_sample($folderParent); +} +// [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php new file mode 100644 index 00000000000..f0dce09f595 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $organizationsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php new file mode 100644 index 00000000000..6f4e79269d0 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Organization $response */ + $response = $organizationsClient->getOrganization($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OrganizationsClient::organizationName('[ORGANIZATION]'); + + get_organization_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php new file mode 100644 index 00000000000..9d35014e064 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php @@ -0,0 +1,68 @@ +searchOrganizations($request); + + /** @var Organization $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php new file mode 100644 index 00000000000..a73ef30663f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $organizationsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php new file mode 100644 index 00000000000..c6821dcbb82 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php @@ -0,0 +1,82 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $organizationsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php new file mode 100644 index 00000000000..09f7d056814 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php @@ -0,0 +1,75 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->createProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php new file mode 100644 index 00000000000..ce8691d0cb9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php @@ -0,0 +1,115 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->deleteProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProjectsClient::projectName('[PROJECT]'); + + delete_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php new file mode 100644 index 00000000000..fe9a820f7ce --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $projectsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php new file mode 100644 index 00000000000..fd3601fd509 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Project $response */ + $response = $projectsClient->getProject($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProjectsClient::projectName('[PROJECT]'); + + get_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php new file mode 100644 index 00000000000..e270c89dda4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php @@ -0,0 +1,85 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $projectsClient->listProjects($request); + + /** @var Project $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_projects_sample($parent); +} +// [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php new file mode 100644 index 00000000000..a6d84c56e29 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php @@ -0,0 +1,101 @@ +setName($formattedName) + ->setDestinationParent($destinationParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->moveProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProjectsClient::projectName('[PROJECT]'); + $destinationParent = '[DESTINATION_PARENT]'; + + move_project_sample($formattedName, $destinationParent); +} +// [END cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php new file mode 100644 index 00000000000..60b34f3fddb --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php @@ -0,0 +1,71 @@ +searchProjects($request); + + /** @var Project $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php new file mode 100644 index 00000000000..bf8d180b3e2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php @@ -0,0 +1,113 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $projectsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php new file mode 100644 index 00000000000..8e3cdb58be5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $projectsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php new file mode 100644 index 00000000000..d81ca3464f2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php @@ -0,0 +1,93 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->undeleteProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProjectsClient::projectName('[PROJECT]'); + + undelete_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php new file mode 100644 index 00000000000..b17fd2e4f65 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php @@ -0,0 +1,76 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->updateProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php new file mode 100644 index 00000000000..42f06bd25f0 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php @@ -0,0 +1,71 @@ +setTagBinding($tagBinding); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagBindingsClient->createTagBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagBinding $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php new file mode 100644 index 00000000000..0b1fa2eaec9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagBindingsClient->deleteTagBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagBindingsClient::tagBindingName('[TAG_BINDING]'); + + delete_tag_binding_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php new file mode 100644 index 00000000000..9ce7917808f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php @@ -0,0 +1,78 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tagBindingsClient->listEffectiveTags($request); + + /** @var EffectiveTag $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_effective_tags_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php new file mode 100644 index 00000000000..1609d5315e2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php @@ -0,0 +1,81 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tagBindingsClient->listTagBindings($request); + + /** @var TagBinding $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_tag_bindings_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php new file mode 100644 index 00000000000..b86a239fb91 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php @@ -0,0 +1,92 @@ +setHolder($tagHoldHolder); + $request = (new CreateTagHoldRequest()) + ->setParent($formattedParent) + ->setTagHold($tagHold); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagHoldsClient->createTagHold($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagHold $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = TagHoldsClient::tagValueName('[TAG_VALUE]'); + $tagHoldHolder = '[HOLDER]'; + + create_tag_hold_sample($formattedParent, $tagHoldHolder); +} +// [END cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php new file mode 100644 index 00000000000..24f484e4f7a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagHoldsClient->deleteTagHold($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagHoldsClient::tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + + delete_tag_hold_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php new file mode 100644 index 00000000000..bd220c74ea7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tagHoldsClient->listTagHolds($request); + + /** @var TagHold $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = TagHoldsClient::tagValueName('[TAG_VALUE]'); + + list_tag_holds_sample($formattedParent); +} +// [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php new file mode 100644 index 00000000000..dd8624bafa3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php @@ -0,0 +1,92 @@ +setShortName($tagKeyShortName); + $request = (new CreateTagKeyRequest()) + ->setTagKey($tagKey); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagKeysClient->createTagKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $tagKeyShortName = '[SHORT_NAME]'; + + create_tag_key_sample($tagKeyShortName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php new file mode 100644 index 00000000000..81ae58c6bde --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagKeysClient->deleteTagKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); + + delete_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php new file mode 100644 index 00000000000..1cc5b669df5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $tagKeysClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php new file mode 100644 index 00000000000..618c6ff0393 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TagKey $response */ + $response = $tagKeysClient->getNamespacedTagKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); + + get_namespaced_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php new file mode 100644 index 00000000000..88f482a6a8f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TagKey $response */ + $response = $tagKeysClient->getTagKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); + + get_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php new file mode 100644 index 00000000000..3995dc0e069 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php @@ -0,0 +1,77 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tagKeysClient->listTagKeys($request); + + /** @var TagKey $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_tag_keys_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php new file mode 100644 index 00000000000..2e068ef74a1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $tagKeysClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php new file mode 100644 index 00000000000..d25e5c6aba7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php @@ -0,0 +1,82 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $tagKeysClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php new file mode 100644 index 00000000000..d799ce5e757 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php @@ -0,0 +1,89 @@ +setShortName($tagKeyShortName); + $request = (new UpdateTagKeyRequest()) + ->setTagKey($tagKey); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagKeysClient->updateTagKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $tagKeyShortName = '[SHORT_NAME]'; + + update_tag_key_sample($tagKeyShortName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php new file mode 100644 index 00000000000..3a5774d5f00 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php @@ -0,0 +1,92 @@ +setShortName($tagValueShortName); + $request = (new CreateTagValueRequest()) + ->setTagValue($tagValue); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagValuesClient->createTagValue($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $tagValueShortName = '[SHORT_NAME]'; + + create_tag_value_sample($tagValueShortName); +} +// [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php new file mode 100644 index 00000000000..3daadd457da --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagValuesClient->deleteTagValue($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); + + delete_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php new file mode 100644 index 00000000000..f258cacf49e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $tagValuesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php new file mode 100644 index 00000000000..40c29338a6d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TagValue $response */ + $response = $tagValuesClient->getNamespacedTagValue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); + + get_namespaced_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php new file mode 100644 index 00000000000..1722af1de80 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TagValue $response */ + $response = $tagValuesClient->getTagValue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); + + get_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php new file mode 100644 index 00000000000..5dfb8504d4e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php @@ -0,0 +1,75 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tagValuesClient->listTagValues($request); + + /** @var TagValue $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_tag_values_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php new file mode 100644 index 00000000000..6020b679341 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $tagValuesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php new file mode 100644 index 00000000000..945e3f282cc --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php @@ -0,0 +1,82 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $tagValuesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php new file mode 100644 index 00000000000..83f91c2c3e9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php @@ -0,0 +1,89 @@ +setShortName($tagValueShortName); + $request = (new UpdateTagValueRequest()) + ->setTagValue($tagValue); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagValuesClient->updateTagValue($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $tagValueShortName = '[SHORT_NAME]'; + + update_tag_value_sample($tagValueShortName); +} +// [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php new file mode 100644 index 00000000000..650a95686c8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php @@ -0,0 +1,684 @@ + createFolderAsync(CreateFolderRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFolderAsync(DeleteFolderRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFolderAsync(GetFolderRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listFoldersAsync(ListFoldersRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveFolderAsync(MoveFolderRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchFoldersAsync(SearchFoldersRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeleteFolderAsync(UndeleteFolderRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFolderAsync(UpdateFolderRequest $request, array $optionalArgs = []) + */ +final class FoldersClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Folders'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/folders_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/folders_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/folders_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/folders_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a folder + * resource. + * + * @param string $folder + * + * @return string The formatted folder resource. + */ + public static function folderName(string $folder): string + { + return self::getPathTemplate('folder')->render([ + 'folder' => $folder, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folder: folders/{folder} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a folder in the resource hierarchy. + * Returns an `Operation` which can be used to track the progress of the + * folder creation workflow. + * Upon success, the `Operation.response` field will be populated with the + * created Folder. + * + * In order to succeed, the addition of this new folder must not violate + * the folder naming, height, or fanout constraints. + * + * + The folder's `display_name` must be distinct from all other folders that + * share its parent. + * + The addition of the folder must not cause the active folder hierarchy + * to exceed a height of 10. Note, the full active + deleted folder hierarchy + * is allowed to reach a height of 20; this provides additional headroom when + * moving folders that contain deleted folders. + * + The addition of the folder must not cause the total number of folders + * under its parent to exceed 300. + * + * If the operation fails due to a folder constraint violation, some errors + * may be returned by the `CreateFolder` request, with status code + * `FAILED_PRECONDITION` and an error description. Other folder constraint + * violations will be communicated in the `Operation`, with the specific + * `PreconditionFailure` returned in the details list in the `Operation.error` + * field. + * + * The caller must have `resourcemanager.folders.create` permission on the + * identified parent. + * + * The async variant is {@see FoldersClient::createFolderAsync()} . + * + * @example samples/V3/FoldersClient/create_folder.php + * + * @param CreateFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createFolder(CreateFolderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateFolder', $request, $callOptions)->wait(); + } + + /** + * Requests deletion of a folder. The folder is moved into the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state immediately, and is deleted approximately 30 days later. This method + * may only be called on an empty folder, where a folder is empty if it + * doesn't contain any folders or projects in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If + * called on a folder in + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state the operation will result in a no-op success. + * The caller must have `resourcemanager.folders.delete` permission on the + * identified folder. + * + * The async variant is {@see FoldersClient::deleteFolderAsync()} . + * + * @example samples/V3/FoldersClient/delete_folder.php + * + * @param DeleteFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteFolder(DeleteFolderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteFolder', $request, $callOptions)->wait(); + } + + /** + * Retrieves a folder identified by the supplied resource name. + * Valid folder resource names have the format `folders/{folder_id}` + * (for example, `folders/1234`). + * The caller must have `resourcemanager.folders.get` permission on the + * identified folder. + * + * The async variant is {@see FoldersClient::getFolderAsync()} . + * + * @example samples/V3/FoldersClient/get_folder.php + * + * @param GetFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Folder + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFolder(GetFolderRequest $request, array $callOptions = []): Folder + { + return $this->startApiCall('GetFolder', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a folder. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the folder's resource name, for example: "folders/1234". + * The caller must have `resourcemanager.folders.getIamPolicy` permission + * on the identified folder. + * + * The async variant is {@see FoldersClient::getIamPolicyAsync()} . + * + * @example samples/V3/FoldersClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Lists the folders that are direct descendants of supplied parent resource. + * `list()` provides a strongly consistent view of the folders underneath + * the specified parent resource. + * `list()` returns folders sorted based upon the (ascending) lexical ordering + * of their display_name. + * The caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * + * The async variant is {@see FoldersClient::listFoldersAsync()} . + * + * @example samples/V3/FoldersClient/list_folders.php + * + * @param ListFoldersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listFolders(ListFoldersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListFolders', $request, $callOptions); + } + + /** + * Moves a folder under a new resource parent. + * Returns an `Operation` which can be used to track the progress of the + * folder move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved folder. + * Upon failure, a `FolderOperationError` categorizing the failure cause will + * be returned - if the failure occurs synchronously then the + * `FolderOperationError` will be returned in the `Status.details` field. + * If it occurs asynchronously, then the FolderOperation will be returned + * in the `Operation.error` field. + * In addition, the `Operation.metadata` field will be populated with a + * `FolderOperation` message as an aid to stateless clients. + * Folder moves will be rejected if they violate either the naming, height, + * or fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.move` + * permission on the folder's current and proposed new parent. + * + * The async variant is {@see FoldersClient::moveFolderAsync()} . + * + * @example samples/V3/FoldersClient/move_folder.php + * + * @param MoveFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function moveFolder(MoveFolderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('MoveFolder', $request, $callOptions)->wait(); + } + + /** + * Search for folders that match specific filter criteria. + * `search()` provides an eventually consistent view of the folders a user has + * access to which meet the specified filter criteria. + * + * This will only return folders on which the caller has the + * permission `resourcemanager.folders.get`. + * + * The async variant is {@see FoldersClient::searchFoldersAsync()} . + * + * @example samples/V3/FoldersClient/search_folders.php + * + * @param SearchFoldersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchFolders(SearchFoldersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchFolders', $request, $callOptions); + } + + /** + * Sets the access control policy on a folder, replacing any existing policy. + * The `resource` field should be the folder's resource name, for example: + * "folders/1234". + * The caller must have `resourcemanager.folders.setIamPolicy` permission + * on the identified folder. + * + * The async variant is {@see FoldersClient::setIamPolicyAsync()} . + * + * @example samples/V3/FoldersClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified folder. + * The `resource` field should be the folder's resource name, + * for example: "folders/1234". + * + * There are no permissions required for making this API call. + * + * The async variant is {@see FoldersClient::testIamPermissionsAsync()} . + * + * @example samples/V3/FoldersClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Cancels the deletion request for a folder. This method may be called on a + * folder in any state. If the folder is in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the + * result will be a no-op success. In order to succeed, the folder's parent + * must be in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In + * addition, reintroducing the folder into the tree must not violate folder + * naming, height, and fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.undelete` + * permission on the identified folder. + * + * The async variant is {@see FoldersClient::undeleteFolderAsync()} . + * + * @example samples/V3/FoldersClient/undelete_folder.php + * + * @param UndeleteFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeleteFolder(UndeleteFolderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeleteFolder', $request, $callOptions)->wait(); + } + + /** + * Updates a folder, changing its `display_name`. + * Changes to the folder `display_name` will be rejected if they violate + * either the `display_name` formatting rules or the naming constraints + * described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. + * + * The folder's `display_name` must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * between 3 and 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. + * + * If the update fails due to the unique name constraint then a + * `PreconditionFailure` explaining this violation will be returned + * in the Status.details field. + * + * The async variant is {@see FoldersClient::updateFolderAsync()} . + * + * @example samples/V3/FoldersClient/update_folder.php + * + * @param UpdateFolderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFolder(UpdateFolderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateFolder', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php new file mode 100644 index 00000000000..7bdbe0d01a8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php @@ -0,0 +1,375 @@ + getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getOrganizationAsync(GetOrganizationRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchOrganizationsAsync(SearchOrganizationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class OrganizationsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Organizations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/organizations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/organizations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/organizations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/organizations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a organization + * resource. + * + * @param string $organization + * + * @return string The formatted organization resource. + */ + public static function organizationName(string $organization): string + { + return self::getPathTemplate('organization')->render([ + 'organization' => $organization, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - organization: organizations/{organization} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets the access control policy for an organization resource. The policy may + * be empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization. + * + * The async variant is {@see OrganizationsClient::getIamPolicyAsync()} . + * + * @example samples/V3/OrganizationsClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Fetches an organization resource identified by the specified resource name. + * + * The async variant is {@see OrganizationsClient::getOrganizationAsync()} . + * + * @example samples/V3/OrganizationsClient/get_organization.php + * + * @param GetOrganizationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Organization + * + * @throws ApiException Thrown if the API call fails. + */ + public function getOrganization(GetOrganizationRequest $request, array $callOptions = []): Organization + { + return $this->startApiCall('GetOrganization', $request, $callOptions)->wait(); + } + + /** + * Searches organization resources that are visible to the user and satisfy + * the specified filter. This method returns organizations in an unspecified + * order. New organizations do not necessarily appear at the end of the + * results, and may take a small amount of time to appear. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + * + * The async variant is {@see OrganizationsClient::searchOrganizationsAsync()} . + * + * @example samples/V3/OrganizationsClient/search_organizations.php + * + * @param SearchOrganizationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchOrganizations(SearchOrganizationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchOrganizations', $request, $callOptions); + } + + /** + * Sets the access control policy on an organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization. + * + * The async variant is {@see OrganizationsClient::setIamPolicyAsync()} . + * + * @example samples/V3/OrganizationsClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns the permissions that a caller has on the specified organization. + * The `resource` field should be the organization's resource name, + * for example: "organizations/123". + * + * There are no permissions required for making this API call. + * + * The async variant is {@see OrganizationsClient::testIamPermissionsAsync()} . + * + * @example samples/V3/OrganizationsClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php new file mode 100644 index 00000000000..d17191d8afe --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php @@ -0,0 +1,702 @@ + createProjectAsync(CreateProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteProjectAsync(DeleteProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getProjectAsync(GetProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface listProjectsAsync(ListProjectsRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveProjectAsync(MoveProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchProjectsAsync(SearchProjectsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeleteProjectAsync(UndeleteProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateProjectAsync(UpdateProjectRequest $request, array $optionalArgs = []) + */ +final class ProjectsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Projects'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/projects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/projects_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Request that a new project be created. The result is an `Operation` which + * can be used to track the creation process. This process usually takes a few + * seconds, but can sometimes take much longer. The tracking `Operation` is + * automatically deleted after a few hours, so there is no need to call + * `DeleteOperation`. + * + * The async variant is {@see ProjectsClient::createProjectAsync()} . + * + * @example samples/V3/ProjectsClient/create_project.php + * + * @param CreateProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProject(CreateProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateProject', $request, $callOptions)->wait(); + } + + /** + * Marks the project identified by the specified + * `name` (for example, `projects/415104041262`) for deletion. + * + * This method will only affect the project if it has a lifecycle state of + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. + * + * This method changes the Project's lifecycle state from + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] + * to + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the project with [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * and the project remains visible to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects]. + * However, you cannot update the project. + * + * After the deletion completes, the project is not retrievable by + * the [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects], and + * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] + * methods. + * + * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + * project will not cause an error, but also won't do anything. + * + * The caller must have `resourcemanager.projects.delete` permissions for this + * project. + * + * The async variant is {@see ProjectsClient::deleteProjectAsync()} . + * + * @example samples/V3/ProjectsClient/delete_project.php + * + * @param DeleteProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteProject(DeleteProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteProject', $request, $callOptions)->wait(); + } + + /** + * Returns the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * Permission is denied if the policy or the resource do not exist. + * + * The async variant is {@see ProjectsClient::getIamPolicyAsync()} . + * + * @example samples/V3/ProjectsClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Retrieves the project identified by the specified `name` (for example, + * `projects/415104041262`). + * + * The caller must have `resourcemanager.projects.get` permission + * for this project. + * + * The async variant is {@see ProjectsClient::getProjectAsync()} . + * + * @example samples/V3/ProjectsClient/get_project.php + * + * @param GetProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Project + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProject(GetProjectRequest $request, array $callOptions = []): Project + { + return $this->startApiCall('GetProject', $request, $callOptions)->wait(); + } + + /** + * Lists projects that are direct children of the specified folder or + * organization resource. `list()` provides a strongly consistent view of the + * projects underneath the specified parent resource. `list()` returns + * projects sorted based upon the (ascending) lexical ordering of their + * `display_name`. The caller must have `resourcemanager.projects.list` + * permission on the identified parent. + * + * The async variant is {@see ProjectsClient::listProjectsAsync()} . + * + * @example samples/V3/ProjectsClient/list_projects.php + * + * @param ListProjectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProjects(ListProjectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProjects', $request, $callOptions); + } + + /** + * Move a project to another place in your resource hierarchy, under a new + * resource parent. + * + * Returns an operation which can be used to track the process of the project + * move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved project. + * + * The caller must have `resourcemanager.projects.move` permission on the + * project, on the project's current and proposed new parent. + * + * If project has no current parent, or it currently does not have an + * associated organization resource, you will also need the + * `resourcemanager.projects.setIamPolicy` permission in the project. + * + * + * + * The async variant is {@see ProjectsClient::moveProjectAsync()} . + * + * @example samples/V3/ProjectsClient/move_project.php + * + * @param MoveProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function moveProject(MoveProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('MoveProject', $request, $callOptions)->wait(); + } + + /** + * Search for projects that the caller has both `resourcemanager.projects.get` + * permission on, and also satisfy the specified query. + * + * This method returns projects in an unspecified order. + * + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the + * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. + * + * The async variant is {@see ProjectsClient::searchProjectsAsync()} . + * + * @example samples/V3/ProjectsClient/search_projects.php + * + * @param SearchProjectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchProjects(SearchProjectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchProjects', $request, $callOptions); + } + + /** + * Sets the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * + * CAUTION: This method will replace the existing policy, and cannot be used + * to append additional IAM settings. + * + * Note: Removing service accounts from policies or changing their roles can + * render services completely inoperable. It is important to understand how + * the service account is being used before removing or updating its roles. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted to a `user`, `serviceAccount`, or a group + * that is part of an organization. For example, + * group@myownpersonaldomain.com could be added as an owner to a project in + * the myownpersonaldomain.com organization, but not the examplepetstore.com + * organization. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited using the Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. If the project is part of an organization, you can remove all + * owners, potentially making the organization inaccessible. + * + * The async variant is {@see ProjectsClient::setIamPolicyAsync()} . + * + * @example samples/V3/ProjectsClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + * + * The async variant is {@see ProjectsClient::testIamPermissionsAsync()} . + * + * @example samples/V3/ProjectsClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Restores the project identified by the specified + * `name` (for example, `projects/415104041262`). + * You can only use this method for a project that has a lifecycle state of + * [DELETE_REQUESTED] + * [Projects.State.DELETE_REQUESTED]. + * After deletion starts, the project cannot be restored. + * + * The caller must have `resourcemanager.projects.undelete` permission for + * this project. + * + * The async variant is {@see ProjectsClient::undeleteProjectAsync()} . + * + * @example samples/V3/ProjectsClient/undelete_project.php + * + * @param UndeleteProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeleteProject(UndeleteProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeleteProject', $request, $callOptions)->wait(); + } + + /** + * Updates the `display_name` and labels of the project identified by the + * specified `name` (for example, `projects/415104041262`). Deleting all + * labels requires an update mask for labels field. + * + * The caller must have `resourcemanager.projects.update` permission for this + * project. + * + * The async variant is {@see ProjectsClient::updateProjectAsync()} . + * + * @example samples/V3/ProjectsClient/update_project.php + * + * @param UpdateProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateProject(UpdateProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateProject', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php new file mode 100644 index 00000000000..5056c5bc427 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php @@ -0,0 +1,385 @@ + createTagBindingAsync(CreateTagBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTagBindingAsync(DeleteTagBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEffectiveTagsAsync(ListEffectiveTagsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTagBindingsAsync(ListTagBindingsRequest $request, array $optionalArgs = []) + */ +final class TagBindingsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagBindings'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_bindings_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_bindings_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_bindings_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_bindings_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_binding + * resource. + * + * @param string $tagBinding + * + * @return string The formatted tag_binding resource. + */ + public static function tagBindingName(string $tagBinding): string + { + return self::getPathTemplate('tagBinding')->render([ + 'tag_binding' => $tagBinding, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagBinding: tagBindings/{tag_binding} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a TagBinding between a TagValue and a Google Cloud resource. + * + * The async variant is {@see TagBindingsClient::createTagBindingAsync()} . + * + * @example samples/V3/TagBindingsClient/create_tag_binding.php + * + * @param CreateTagBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTagBinding(CreateTagBindingRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateTagBinding', $request, $callOptions)->wait(); + } + + /** + * Deletes a TagBinding. + * + * The async variant is {@see TagBindingsClient::deleteTagBindingAsync()} . + * + * @example samples/V3/TagBindingsClient/delete_tag_binding.php + * + * @param DeleteTagBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTagBinding(DeleteTagBindingRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteTagBinding', $request, $callOptions)->wait(); + } + + /** + * Return a list of effective tags for the given Google Cloud resource, as + * specified in `parent`. + * + * The async variant is {@see TagBindingsClient::listEffectiveTagsAsync()} . + * + * @example samples/V3/TagBindingsClient/list_effective_tags.php + * + * @param ListEffectiveTagsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEffectiveTags(ListEffectiveTagsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEffectiveTags', $request, $callOptions); + } + + /** + * Lists the TagBindings for the given Google Cloud resource, as specified + * with `parent`. + * + * NOTE: The `parent` field is expected to be a full resource name: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * The async variant is {@see TagBindingsClient::listTagBindingsAsync()} . + * + * @example samples/V3/TagBindingsClient/list_tag_bindings.php + * + * @param ListTagBindingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTagBindings(ListTagBindingsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTagBindings', $request, $callOptions); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php new file mode 100644 index 00000000000..b3382dbd82e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php @@ -0,0 +1,374 @@ + createTagHoldAsync(CreateTagHoldRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTagHoldAsync(DeleteTagHoldRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTagHoldsAsync(ListTagHoldsRequest $request, array $optionalArgs = []) + */ +final class TagHoldsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagHolds'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_holds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_holds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_holds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_holds_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_hold + * resource. + * + * @param string $tagValue + * @param string $tagHold + * + * @return string The formatted tag_hold resource. + */ + public static function tagHoldName(string $tagValue, string $tagHold): string + { + return self::getPathTemplate('tagHold')->render([ + 'tag_value' => $tagValue, + 'tag_hold' => $tagHold, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_value + * resource. + * + * @param string $tagValue + * + * @return string The formatted tag_value resource. + */ + public static function tagValueName(string $tagValue): string + { + return self::getPathTemplate('tagValue')->render([ + 'tag_value' => $tagValue, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagHold: tagValues/{tag_value}/tagHolds/{tag_hold} + * - tagValue: tagValues/{tag_value} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same + * resource and origin exists under the same TagValue. + * + * The async variant is {@see TagHoldsClient::createTagHoldAsync()} . + * + * @example samples/V3/TagHoldsClient/create_tag_hold.php + * + * @param CreateTagHoldRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTagHold(CreateTagHoldRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateTagHold', $request, $callOptions)->wait(); + } + + /** + * Deletes a TagHold. + * + * The async variant is {@see TagHoldsClient::deleteTagHoldAsync()} . + * + * @example samples/V3/TagHoldsClient/delete_tag_hold.php + * + * @param DeleteTagHoldRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTagHold(DeleteTagHoldRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteTagHold', $request, $callOptions)->wait(); + } + + /** + * Lists TagHolds under a TagValue. + * + * The async variant is {@see TagHoldsClient::listTagHoldsAsync()} . + * + * @example samples/V3/TagHoldsClient/list_tag_holds.php + * + * @param ListTagHoldsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTagHolds(ListTagHoldsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTagHolds', $request, $callOptions); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php new file mode 100644 index 00000000000..6f4b1144d5b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php @@ -0,0 +1,541 @@ + createTagKeyAsync(CreateTagKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTagKeyAsync(DeleteTagKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNamespacedTagKeyAsync(GetNamespacedTagKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTagKeyAsync(GetTagKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTagKeysAsync(ListTagKeysRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateTagKeyAsync(UpdateTagKeyRequest $request, array $optionalArgs = []) + */ +final class TagKeysClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagKeys'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_keys_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_keys_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_keys_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_keys_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_key + * resource. + * + * @param string $tagKey + * + * @return string The formatted tag_key resource. + */ + public static function tagKeyName(string $tagKey): string + { + return self::getPathTemplate('tagKey')->render([ + 'tag_key' => $tagKey, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagKey: tagKeys/{tag_key} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new TagKey. If another request with the same parameters is + * sent while the original request is in process, the second request + * will receive an error. A maximum of 1000 TagKeys can exist under a parent + * at any given time. + * + * The async variant is {@see TagKeysClient::createTagKeyAsync()} . + * + * @example samples/V3/TagKeysClient/create_tag_key.php + * + * @param CreateTagKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTagKey(CreateTagKeyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateTagKey', $request, $callOptions)->wait(); + } + + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child + * TagValues. + * + * The async variant is {@see TagKeysClient::deleteTagKeyAsync()} . + * + * @example samples/V3/TagKeysClient/delete_tag_key.php + * + * @param DeleteTagKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTagKey(DeleteTagKeyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteTagKey', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a TagKey. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagKey's resource name. For example, "tagKeys/1234". + * The caller must have + * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + * the specified TagKey. + * + * The async variant is {@see TagKeysClient::getIamPolicyAsync()} . + * + * @example samples/V3/TagKeysClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Retrieves a TagKey by its namespaced name. + * This method will return `PERMISSION_DENIED` if the key does not exist + * or the user does not have permission to view it. + * + * The async variant is {@see TagKeysClient::getNamespacedTagKeyAsync()} . + * + * @example samples/V3/TagKeysClient/get_namespaced_tag_key.php + * + * @param GetNamespacedTagKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TagKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNamespacedTagKey(GetNamespacedTagKeyRequest $request, array $callOptions = []): TagKey + { + return $this->startApiCall('GetNamespacedTagKey', $request, $callOptions)->wait(); + } + + /** + * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + * key does not exist or the user does not have permission to view it. + * + * The async variant is {@see TagKeysClient::getTagKeyAsync()} . + * + * @example samples/V3/TagKeysClient/get_tag_key.php + * + * @param GetTagKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TagKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTagKey(GetTagKeyRequest $request, array $callOptions = []): TagKey + { + return $this->startApiCall('GetTagKey', $request, $callOptions)->wait(); + } + + /** + * Lists all TagKeys for a parent resource. + * + * The async variant is {@see TagKeysClient::listTagKeysAsync()} . + * + * @example samples/V3/TagKeysClient/list_tag_keys.php + * + * @param ListTagKeysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTagKeys(ListTagKeysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTagKeys', $request, $callOptions); + } + + /** + * Sets the access control policy on a TagKey, replacing any existing + * policy. The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + * on the identified tagValue. + * + * The async variant is {@see TagKeysClient::setIamPolicyAsync()} . + * + * @example samples/V3/TagKeysClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified TagKey. + * The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * + * There are no permissions required for making this API call. + * + * The async variant is {@see TagKeysClient::testIamPermissionsAsync()} . + * + * @example samples/V3/TagKeysClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the attributes of the TagKey resource. + * + * The async variant is {@see TagKeysClient::updateTagKeyAsync()} . + * + * @example samples/V3/TagKeysClient/update_tag_key.php + * + * @param UpdateTagKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTagKey(UpdateTagKeyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateTagKey', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php new file mode 100644 index 00000000000..49fe9f81ec5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php @@ -0,0 +1,541 @@ + createTagValueAsync(CreateTagValueRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTagValueAsync(DeleteTagValueRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNamespacedTagValueAsync(GetNamespacedTagValueRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTagValueAsync(GetTagValueRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTagValuesAsync(ListTagValuesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateTagValueAsync(UpdateTagValueRequest $request, array $optionalArgs = []) + */ +final class TagValuesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagValues'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_values_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_values_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_values_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_values_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_value + * resource. + * + * @param string $tagValue + * + * @return string The formatted tag_value resource. + */ + public static function tagValueName(string $tagValue): string + { + return self::getPathTemplate('tagValue')->render([ + 'tag_value' => $tagValue, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagValue: tagValues/{tag_value} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudresourcemanager.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a TagValue as a child of the specified TagKey. If a another + * request with the same parameters is sent while the original request is in + * process the second request will receive an error. A maximum of 1000 + * TagValues can exist under a TagKey at any given time. + * + * The async variant is {@see TagValuesClient::createTagValueAsync()} . + * + * @example samples/V3/TagValuesClient/create_tag_value.php + * + * @param CreateTagValueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTagValue(CreateTagValueRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateTagValue', $request, $callOptions)->wait(); + } + + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is + * deleted. + * + * The async variant is {@see TagValuesClient::deleteTagValueAsync()} . + * + * @example samples/V3/TagValuesClient/delete_tag_value.php + * + * @param DeleteTagValueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTagValue(DeleteTagValueRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteTagValue', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a TagValue. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagValue's resource name. For example: `tagValues/1234`. + * The caller must have the + * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + * the identified TagValue to get the access control policy. + * + * The async variant is {@see TagValuesClient::getIamPolicyAsync()} . + * + * @example samples/V3/TagValuesClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Retrieves a TagValue by its namespaced name. + * This method will return `PERMISSION_DENIED` if the value does not exist + * or the user does not have permission to view it. + * + * The async variant is {@see TagValuesClient::getNamespacedTagValueAsync()} . + * + * @example samples/V3/TagValuesClient/get_namespaced_tag_value.php + * + * @param GetNamespacedTagValueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TagValue + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNamespacedTagValue(GetNamespacedTagValueRequest $request, array $callOptions = []): TagValue + { + return $this->startApiCall('GetNamespacedTagValue', $request, $callOptions)->wait(); + } + + /** + * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + * value does not exist or the user does not have permission to view it. + * + * The async variant is {@see TagValuesClient::getTagValueAsync()} . + * + * @example samples/V3/TagValuesClient/get_tag_value.php + * + * @param GetTagValueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TagValue + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTagValue(GetTagValueRequest $request, array $callOptions = []): TagValue + { + return $this->startApiCall('GetTagValue', $request, $callOptions)->wait(); + } + + /** + * Lists all TagValues for a specific TagKey. + * + * The async variant is {@see TagValuesClient::listTagValuesAsync()} . + * + * @example samples/V3/TagValuesClient/list_tag_values.php + * + * @param ListTagValuesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTagValues(ListTagValuesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTagValues', $request, $callOptions); + } + + /** + * Sets the access control policy on a TagValue, replacing any existing + * policy. The `resource` field should be the TagValue's resource name. + * For example: `tagValues/1234`. + * The caller must have `resourcemanager.tagValues.setIamPolicy` permission + * on the identified tagValue. + * + * The async variant is {@see TagValuesClient::setIamPolicyAsync()} . + * + * @example samples/V3/TagValuesClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified TagValue. + * The `resource` field should be the TagValue's resource name. For example: + * `tagValues/1234`. + * + * There are no permissions required for making this API call. + * + * The async variant is {@see TagValuesClient::testIamPermissionsAsync()} . + * + * @example samples/V3/TagValuesClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the attributes of the TagValue resource. + * + * The async variant is {@see TagValuesClient::updateTagValueAsync()} . + * + * @example samples/V3/TagValuesClient/update_tag_value.php + * + * @param UpdateTagValueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTagValue(UpdateTagValueRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateTagValue', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json b/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json new file mode 100644 index 00000000000..ff967076dcd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json @@ -0,0 +1,332 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.resourcemanager.v3", + "libraryPackage": "Google\\Cloud\\ResourceManager\\V3", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "FoldersGapicClient", + "rpcs": { + "CreateFolder": { + "methods": [ + "createFolder" + ] + }, + "DeleteFolder": { + "methods": [ + "deleteFolder" + ] + }, + "GetFolder": { + "methods": [ + "getFolder" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "ListFolders": { + "methods": [ + "listFolders" + ] + }, + "MoveFolder": { + "methods": [ + "moveFolder" + ] + }, + "SearchFolders": { + "methods": [ + "searchFolders" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UndeleteFolder": { + "methods": [ + "undeleteFolder" + ] + }, + "UpdateFolder": { + "methods": [ + "updateFolder" + ] + } + } + } + } + }, + "Organizations": { + "clients": { + "grpc": { + "libraryClient": "OrganizationsGapicClient", + "rpcs": { + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetOrganization": { + "methods": [ + "getOrganization" + ] + }, + "SearchOrganizations": { + "methods": [ + "searchOrganizations" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "Projects": { + "clients": { + "grpc": { + "libraryClient": "ProjectsGapicClient", + "rpcs": { + "CreateProject": { + "methods": [ + "createProject" + ] + }, + "DeleteProject": { + "methods": [ + "deleteProject" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetProject": { + "methods": [ + "getProject" + ] + }, + "ListProjects": { + "methods": [ + "listProjects" + ] + }, + "MoveProject": { + "methods": [ + "moveProject" + ] + }, + "SearchProjects": { + "methods": [ + "searchProjects" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UndeleteProject": { + "methods": [ + "undeleteProject" + ] + }, + "UpdateProject": { + "methods": [ + "updateProject" + ] + } + } + } + } + }, + "TagBindings": { + "clients": { + "grpc": { + "libraryClient": "TagBindingsGapicClient", + "rpcs": { + "CreateTagBinding": { + "methods": [ + "createTagBinding" + ] + }, + "DeleteTagBinding": { + "methods": [ + "deleteTagBinding" + ] + }, + "ListEffectiveTags": { + "methods": [ + "listEffectiveTags" + ] + }, + "ListTagBindings": { + "methods": [ + "listTagBindings" + ] + } + } + } + } + }, + "TagHolds": { + "clients": { + "grpc": { + "libraryClient": "TagHoldsGapicClient", + "rpcs": { + "CreateTagHold": { + "methods": [ + "createTagHold" + ] + }, + "DeleteTagHold": { + "methods": [ + "deleteTagHold" + ] + }, + "ListTagHolds": { + "methods": [ + "listTagHolds" + ] + } + } + } + } + }, + "TagKeys": { + "clients": { + "grpc": { + "libraryClient": "TagKeysGapicClient", + "rpcs": { + "CreateTagKey": { + "methods": [ + "createTagKey" + ] + }, + "DeleteTagKey": { + "methods": [ + "deleteTagKey" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNamespacedTagKey": { + "methods": [ + "getNamespacedTagKey" + ] + }, + "GetTagKey": { + "methods": [ + "getTagKey" + ] + }, + "ListTagKeys": { + "methods": [ + "listTagKeys" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateTagKey": { + "methods": [ + "updateTagKey" + ] + } + } + } + } + }, + "TagValues": { + "clients": { + "grpc": { + "libraryClient": "TagValuesGapicClient", + "rpcs": { + "CreateTagValue": { + "methods": [ + "createTagValue" + ] + }, + "DeleteTagValue": { + "methods": [ + "deleteTagValue" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNamespacedTagValue": { + "methods": [ + "getNamespacedTagValue" + ] + }, + "GetTagValue": { + "methods": [ + "getTagValue" + ] + }, + "ListTagValues": { + "methods": [ + "listTagValues" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateTagValue": { + "methods": [ + "updateTagValue" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json new file mode 100644 index 00000000000..23bc7198bcd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Folders": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateFolder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteFolder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetFolder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListFolders": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "MoveFolder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SearchFolders": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UndeleteFolder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateFolder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php new file mode 100644 index 00000000000..f3c92fc6037 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.resourcemanager.v3.Folders' => [ + 'CreateFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'DeleteFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MoveFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeleteFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'folder.name', + 'fieldAccessors' => [ + 'getFolder', + 'getName', + ], + ], + ], + ], + 'GetFolder' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\Folder', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'ListFolders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFolders', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListFoldersResponse', + ], + 'SearchFolders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFolders', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchFoldersResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'folder' => 'folders/{folder}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php new file mode 100644 index 00000000000..94bf6dd0606 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php @@ -0,0 +1,156 @@ + [ + 'google.cloud.resourcemanager.v3.Folders' => [ + 'CreateFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/folders', + 'body' => 'folder', + ], + 'DeleteFolder' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=folders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetFolder' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=folders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListFolders' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/folders', + 'queryParams' => [ + 'parent', + ], + ], + 'MoveFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=folders/*}:move', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchFolders' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/folders:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UndeleteFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=folders/*}:undelete', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFolder' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{folder.name=folders/*}', + 'body' => 'folder', + 'placeholders' => [ + 'folder.name' => [ + 'getters' => [ + 'getFolder', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json new file mode 100644 index 00000000000..cd3f3bc9c02 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Organizations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetOrganization": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchOrganizations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php new file mode 100644 index 00000000000..7a585fc164c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php @@ -0,0 +1,91 @@ + [ + 'google.cloud.resourcemanager.v3.Organizations' => [ + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetOrganization' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\Organization', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SearchOrganizations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrganizations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchOrganizationsResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'organization' => 'organizations/{organization}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php new file mode 100644 index 00000000000..b1c01902a19 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php @@ -0,0 +1,93 @@ + [ + 'google.cloud.resourcemanager.v3.Organizations' => [ + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetOrganization' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=organizations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchOrganizations' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/organizations:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json new file mode 100644 index 00000000000..bf38535bd8a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Projects": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetProject": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListProjects": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "MoveProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SearchProjects": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UndeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php new file mode 100644 index 00000000000..4452903d703 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.resourcemanager.v3.Projects' => [ + 'CreateProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'DeleteProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MoveProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeleteProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project.name', + 'fieldAccessors' => [ + 'getProject', + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetProject' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\Project', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListProjects' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProjects', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListProjectsResponse', + ], + 'SearchProjects' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProjects', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchProjectsResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php new file mode 100644 index 00000000000..7a584fdaf5c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php @@ -0,0 +1,153 @@ + [ + 'google.cloud.resourcemanager.v3.Projects' => [ + 'CreateProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/projects', + 'body' => 'project', + ], + 'DeleteProject' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetProject' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListProjects' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/projects', + 'queryParams' => [ + 'parent', + ], + ], + 'MoveProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}:move', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchProjects' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/projects:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UndeleteProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}:undelete', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateProject' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{project.name=projects/*}', + 'body' => 'project', + 'placeholders' => [ + 'project.name' => [ + 'getters' => [ + 'getProject', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json new file mode 100644 index 00000000000..8f187c5e23a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagBindings": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListEffectiveTags": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTagBindings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php new file mode 100644 index 00000000000..696b63047a8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php @@ -0,0 +1,85 @@ + [ + 'google.cloud.resourcemanager.v3.TagBindings' => [ + 'CreateTagBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagBinding', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagBindingMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'DeleteTagBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagBindingMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEffectiveTags' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEffectiveTags', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListEffectiveTagsResponse', + ], + 'ListTagBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagBindings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagBindingsResponse', + ], + 'templateMap' => [ + 'tagBinding' => 'tagBindings/{tag_binding}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php new file mode 100644 index 00000000000..dfe8673c329 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php @@ -0,0 +1,72 @@ + [ + 'google.cloud.resourcemanager.v3.TagBindings' => [ + 'CreateTagBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagBindings', + 'body' => 'tag_binding', + ], + 'DeleteTagBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagBindings/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEffectiveTags' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/effectiveTags', + 'queryParams' => [ + 'parent', + ], + ], + 'ListTagBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagBindings', + 'queryParams' => [ + 'parent', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json new file mode 100644 index 00000000000..bf327d859db --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagHolds": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateTagHold": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteTagHold": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTagHolds": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php new file mode 100644 index 00000000000..197711c58ff --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php @@ -0,0 +1,90 @@ + [ + 'google.cloud.resourcemanager.v3.TagHolds' => [ + 'CreateTagHold' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagHold', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagHoldMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTagHold' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagHoldMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTagHolds' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagHolds', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagHoldsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'tagHold' => 'tagValues/{tag_value}/tagHolds/{tag_hold}', + 'tagValue' => 'tagValues/{tag_value}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php new file mode 100644 index 00000000000..9615ac90f61 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.resourcemanager.v3.TagHolds' => [ + 'CreateTagHold' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', + 'body' => 'tag_hold', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTagHold' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagValues/*/tagHolds/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagHolds' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json new file mode 100644 index 00000000000..75f389d694a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagKeys": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespacedTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTagKeys": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php new file mode 100644 index 00000000000..47f92359652 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php @@ -0,0 +1,145 @@ + [ + 'google.cloud.resourcemanager.v3.TagKeys' => [ + 'CreateTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'DeleteTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'tag_key.name', + 'fieldAccessors' => [ + 'getTagKey', + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\TagKey', + ], + 'GetTagKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\TagKey', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTagKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagKeys', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagKeysResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'tagKey' => 'tagKeys/{tag_key}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php new file mode 100644 index 00000000000..92b3ead1458 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php @@ -0,0 +1,132 @@ + [ + 'google.cloud.resourcemanager.v3.TagKeys' => [ + 'CreateTagKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagKeys', + 'body' => 'tag_key', + ], + 'DeleteTagKey' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagKeys/namespaced', + 'queryParams' => [ + 'name', + ], + ], + 'GetTagKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=tagKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagKeys', + 'queryParams' => [ + 'parent', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateTagKey' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{tag_key.name=tagKeys/*}', + 'body' => 'tag_key', + 'placeholders' => [ + 'tag_key.name' => [ + 'getters' => [ + 'getTagKey', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json new file mode 100644 index 00000000000..f9fae4e4bfd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagValues": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespacedTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTagValues": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php new file mode 100644 index 00000000000..6cc049800ae --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php @@ -0,0 +1,145 @@ + [ + 'google.cloud.resourcemanager.v3.TagValues' => [ + 'CreateTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'DeleteTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'tag_value.name', + 'fieldAccessors' => [ + 'getTagValue', + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagValue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\TagValue', + ], + 'GetTagValue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\TagValue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTagValues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagValues', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagValuesResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'tagValue' => 'tagValues/{tag_value}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php new file mode 100644 index 00000000000..ab34cd4357b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php @@ -0,0 +1,132 @@ + [ + 'google.cloud.resourcemanager.v3.TagValues' => [ + 'CreateTagValue' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagValues', + 'body' => 'tag_value', + ], + 'DeleteTagValue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagValues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagValue' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagValues/namespaced', + 'queryParams' => [ + 'name', + ], + ], + 'GetTagValue' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=tagValues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagValues' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagValues', + 'queryParams' => [ + 'parent', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateTagValue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{tag_value.name=tagValues/*}', + 'body' => 'tag_value', + 'placeholders' => [ + 'tag_value.name' => [ + 'getters' => [ + 'getTagValue', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php new file mode 100644 index 00000000000..34f0a88299d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php @@ -0,0 +1,1232 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FoldersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FoldersClient($options); + } + + /** @test */ + public function createFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $request = (new CreateFolderRequest()) + ->setFolder($folder); + $response = $gapicClient->createFolder($request); + $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.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFolder(); + $this->assertProtobufEquals($folder, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFolderTest'); + $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 createFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createFolderTest'); + $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 + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $request = (new CreateFolderRequest()) + ->setFolder($folder); + $response = $gapicClient->createFolder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFolderTest'); + 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 deleteFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $request = (new DeleteFolderRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteFolder($request); + $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.resourcemanager.v3.Folders/DeleteFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); + $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 deleteFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteFolderTest'); + $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 + $formattedName = $gapicClient->folderName('[FOLDER]'); + $request = (new DeleteFolderRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteFolder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); + 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 getFolderTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $request = (new GetFolderRequest()) + ->setName($formattedName); + $response = $gapicClient->getFolder($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/GetFolder', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFolderExceptionTest() + { + $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->folderName('[FOLDER]'); + $request = (new GetFolderRequest()) + ->setName($formattedName); + try { + $gapicClient->getFolder($request); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 listFoldersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $foldersElement = new Folder(); + $folders = [ + $foldersElement, + ]; + $expectedResponse = new ListFoldersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFolders($folders); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListFoldersRequest()) + ->setParent($parent); + $response = $gapicClient->listFolders($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/ListFolders', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFoldersExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListFoldersRequest()) + ->setParent($parent); + try { + $gapicClient->listFolders($request); + // 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 moveFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/moveFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/moveFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new MoveFolderRequest()) + ->setName($formattedName) + ->setDestinationParent($destinationParent); + $response = $gapicClient->moveFolder($request); + $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.resourcemanager.v3.Folders/MoveFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getDestinationParent(); + $this->assertProtobufEquals($destinationParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveFolderTest'); + $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 moveFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/moveFolderTest'); + $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 + $formattedName = $gapicClient->folderName('[FOLDER]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new MoveFolderRequest()) + ->setName($formattedName) + ->setDestinationParent($destinationParent); + $response = $gapicClient->moveFolder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveFolderTest'); + 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 searchFoldersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $foldersElement = new Folder(); + $folders = [ + $foldersElement, + ]; + $expectedResponse = new SearchFoldersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFolders($folders); + $transport->addResponse($expectedResponse); + $request = new SearchFoldersRequest(); + $response = $gapicClient->searchFolders($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SearchFolders', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchFoldersExceptionTest() + { + $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); + $request = new SearchFoldersRequest(); + try { + $gapicClient->searchFolders($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 undeleteFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/undeleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeleteFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $request = (new UndeleteFolderRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteFolder($request); + $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.resourcemanager.v3.Folders/UndeleteFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); + $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 undeleteFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/undeleteFolderTest'); + $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 + $formattedName = $gapicClient->folderName('[FOLDER]'); + $request = (new UndeleteFolderRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteFolder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); + 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 updateFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $updateMask = new FieldMask(); + $request = (new UpdateFolderRequest()) + ->setFolder($folder) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateFolder($request); + $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.resourcemanager.v3.Folders/UpdateFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFolder(); + $this->assertProtobufEquals($folder, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFolderTest'); + $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 updateFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateFolderTest'); + $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 + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $updateMask = new FieldMask(); + $request = (new UpdateFolderRequest()) + ->setFolder($folder) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateFolder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFolderTest'); + 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 createFolderAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $request = (new CreateFolderRequest()) + ->setFolder($folder); + $response = $gapicClient->createFolderAsync($request)->wait(); + $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.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFolder(); + $this->assertProtobufEquals($folder, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFolderTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php new file mode 100644 index 00000000000..c8d7573aa2b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php @@ -0,0 +1,440 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return OrganizationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new OrganizationsClient($options); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getOrganizationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $directoryCustomerId = 'directoryCustomerId813284938'; + $etag = 'etag3123477'; + $expectedResponse = new Organization(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDirectoryCustomerId($directoryCustomerId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->organizationName('[ORGANIZATION]'); + $request = (new GetOrganizationRequest()) + ->setName($formattedName); + $response = $gapicClient->getOrganization($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetOrganization', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOrganizationExceptionTest() + { + $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->organizationName('[ORGANIZATION]'); + $request = (new GetOrganizationRequest()) + ->setName($formattedName); + try { + $gapicClient->getOrganization($request); + // 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 searchOrganizationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $organizationsElement = new Organization(); + $organizations = [ + $organizationsElement, + ]; + $expectedResponse = new SearchOrganizationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOrganizations($organizations); + $transport->addResponse($expectedResponse); + $request = new SearchOrganizationsRequest(); + $response = $gapicClient->searchOrganizations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrganizations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchOrganizationsExceptionTest() + { + $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); + $request = new SearchOrganizationsRequest(); + try { + $gapicClient->searchOrganizations($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 getIamPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php new file mode 100644 index 00000000000..e4437871a5f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php @@ -0,0 +1,1229 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProjectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectsClient($options); + } + + /** @test */ + public function createProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = new Project(); + $request = (new CreateProjectRequest()) + ->setProject($project); + $response = $gapicClient->createProject($request); + $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.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectTest'); + $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 createProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createProjectTest'); + $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 + $project = new Project(); + $request = (new CreateProjectRequest()) + ->setProject($project); + $response = $gapicClient->createProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectTest'); + 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 deleteProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $request = (new DeleteProjectRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProject($request); + $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.resourcemanager.v3.Projects/DeleteProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); + $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 deleteProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteProjectTest'); + $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 + $formattedName = $gapicClient->projectName('[PROJECT]'); + $request = (new DeleteProjectRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); + 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getProjectTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $request = (new GetProjectRequest()) + ->setName($formattedName); + $response = $gapicClient->getProject($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/GetProject', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProjectExceptionTest() + { + $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->projectName('[PROJECT]'); + $request = (new GetProjectRequest()) + ->setName($formattedName); + try { + $gapicClient->getProject($request); + // 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 listProjectsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $projectsElement = new Project(); + $projects = [ + $projectsElement, + ]; + $expectedResponse = new ListProjectsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProjects($projects); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListProjectsRequest()) + ->setParent($parent); + $response = $gapicClient->listProjects($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/ListProjects', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProjectsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListProjectsRequest()) + ->setParent($parent); + try { + $gapicClient->listProjects($request); + // 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 moveProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/moveProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/moveProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new MoveProjectRequest()) + ->setName($formattedName) + ->setDestinationParent($destinationParent); + $response = $gapicClient->moveProject($request); + $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.resourcemanager.v3.Projects/MoveProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getDestinationParent(); + $this->assertProtobufEquals($destinationParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveProjectTest'); + $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 moveProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/moveProjectTest'); + $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 + $formattedName = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new MoveProjectRequest()) + ->setName($formattedName) + ->setDestinationParent($destinationParent); + $response = $gapicClient->moveProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveProjectTest'); + 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 searchProjectsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $projectsElement = new Project(); + $projects = [ + $projectsElement, + ]; + $expectedResponse = new SearchProjectsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProjects($projects); + $transport->addResponse($expectedResponse); + $request = new SearchProjectsRequest(); + $response = $gapicClient->searchProjects($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SearchProjects', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProjectsExceptionTest() + { + $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); + $request = new SearchProjectsRequest(); + try { + $gapicClient->searchProjects($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 undeleteProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/undeleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeleteProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $request = (new UndeleteProjectRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteProject($request); + $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.resourcemanager.v3.Projects/UndeleteProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); + $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 undeleteProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/undeleteProjectTest'); + $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 + $formattedName = $gapicClient->projectName('[PROJECT]'); + $request = (new UndeleteProjectRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); + 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 updateProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = new Project(); + $request = (new UpdateProjectRequest()) + ->setProject($project); + $response = $gapicClient->updateProject($request); + $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.resourcemanager.v3.Projects/UpdateProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectTest'); + $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 updateProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateProjectTest'); + $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 + $project = new Project(); + $request = (new UpdateProjectRequest()) + ->setProject($project); + $response = $gapicClient->updateProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectTest'); + 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 createProjectAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = new Project(); + $request = (new CreateProjectRequest()) + ->setProject($project); + $response = $gapicClient->createProjectAsync($request)->wait(); + $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.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php new file mode 100644 index 00000000000..560f038ccc2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php @@ -0,0 +1,539 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagBindingsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagBindingsClient($options); + } + + /** @test */ + public function createTagBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $tagValue = 'tagValue2092898444'; + $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; + $expectedResponse = new TagBinding(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setTagValue($tagValue); + $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagBinding = new TagBinding(); + $request = (new CreateTagBindingRequest()) + ->setTagBinding($tagBinding); + $response = $gapicClient->createTagBinding($request); + $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.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagBinding(); + $this->assertProtobufEquals($tagBinding, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); + $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 createTagBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagBindingTest'); + $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 + $tagBinding = new TagBinding(); + $request = (new CreateTagBindingRequest()) + ->setTagBinding($tagBinding); + $response = $gapicClient->createTagBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); + 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 deleteTagBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); + $request = (new DeleteTagBindingRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagBinding($request); + $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.resourcemanager.v3.TagBindings/DeleteTagBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); + $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 deleteTagBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagBindingTest'); + $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 + $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); + $request = (new DeleteTagBindingRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); + 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 listEffectiveTagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $effectiveTagsElement = new EffectiveTag(); + $effectiveTags = [ + $effectiveTagsElement, + ]; + $expectedResponse = new ListEffectiveTagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEffectiveTags($effectiveTags); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListEffectiveTagsRequest()) + ->setParent($parent); + $response = $gapicClient->listEffectiveTags($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEffectiveTags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEffectiveTagsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListEffectiveTagsRequest()) + ->setParent($parent); + try { + $gapicClient->listEffectiveTags($request); + // 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 listTagBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagBindingsElement = new TagBinding(); + $tagBindings = [ + $tagBindingsElement, + ]; + $expectedResponse = new ListTagBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagBindings($tagBindings); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListTagBindingsRequest()) + ->setParent($parent); + $response = $gapicClient->listTagBindings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagBindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagBindingsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListTagBindingsRequest()) + ->setParent($parent); + try { + $gapicClient->listTagBindings($request); + // 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 createTagBindingAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $tagValue = 'tagValue2092898444'; + $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; + $expectedResponse = new TagBinding(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setTagValue($tagValue); + $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagBinding = new TagBinding(); + $request = (new CreateTagBindingRequest()) + ->setTagBinding($tagBinding); + $response = $gapicClient->createTagBindingAsync($request)->wait(); + $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.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagBinding(); + $this->assertProtobufEquals($tagBinding, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php new file mode 100644 index 00000000000..635c0497818 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php @@ -0,0 +1,480 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagHoldsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagHoldsClient($options); + } + + /** @test */ + public function createTagHoldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $holder = 'holder-1211707988'; + $origin = 'origin-1008619738'; + $helpLink = 'helpLink1297152568'; + $expectedResponse = new TagHold(); + $expectedResponse->setName($name); + $expectedResponse->setHolder($holder); + $expectedResponse->setOrigin($origin); + $expectedResponse->setHelpLink($helpLink); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagHoldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $tagHold = new TagHold(); + $tagHoldHolder = 'tagHoldHolder-501201275'; + $tagHold->setHolder($tagHoldHolder); + $request = (new CreateTagHoldRequest()) + ->setParent($formattedParent) + ->setTagHold($tagHold); + $response = $gapicClient->createTagHold($request); + $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.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTagHold(); + $this->assertProtobufEquals($tagHold, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); + $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 createTagHoldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagHoldTest'); + $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->tagValueName('[TAG_VALUE]'); + $tagHold = new TagHold(); + $tagHoldHolder = 'tagHoldHolder-501201275'; + $tagHold->setHolder($tagHoldHolder); + $request = (new CreateTagHoldRequest()) + ->setParent($formattedParent) + ->setTagHold($tagHold); + $response = $gapicClient->createTagHold($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); + 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 deleteTagHoldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagHoldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + $request = (new DeleteTagHoldRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagHold($request); + $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.resourcemanager.v3.TagHolds/DeleteTagHold', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); + $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 deleteTagHoldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagHoldTest'); + $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 + $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + $request = (new DeleteTagHoldRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagHold($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); + 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 listTagHoldsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagHoldsElement = new TagHold(); + $tagHolds = [ + $tagHoldsElement, + ]; + $expectedResponse = new ListTagHoldsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagHolds($tagHolds); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $request = (new ListTagHoldsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTagHolds($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagHolds()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagHoldsExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + $request = (new ListTagHoldsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTagHolds($request); + // 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 createTagHoldAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $holder = 'holder-1211707988'; + $origin = 'origin-1008619738'; + $helpLink = 'helpLink1297152568'; + $expectedResponse = new TagHold(); + $expectedResponse->setName($name); + $expectedResponse->setHolder($holder); + $expectedResponse->setOrigin($origin); + $expectedResponse->setHelpLink($helpLink); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagHoldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $tagHold = new TagHold(); + $tagHoldHolder = 'tagHoldHolder-501201275'; + $tagHold->setHolder($tagHoldHolder); + $request = (new CreateTagHoldRequest()) + ->setParent($formattedParent) + ->setTagHold($tagHold); + $response = $gapicClient->createTagHoldAsync($request)->wait(); + $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.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTagHold(); + $this->assertProtobufEquals($tagHold, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php new file mode 100644 index 00000000000..bb277362eb8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php @@ -0,0 +1,988 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagKeysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagKeysClient($options); + } + + /** @test */ + public function createTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $request = (new CreateTagKeyRequest()) + ->setTagKey($tagKey); + $response = $gapicClient->createTagKey($request); + $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.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagKey(); + $this->assertProtobufEquals($tagKey, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); + $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 createTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagKeyTest'); + $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 + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $request = (new CreateTagKeyRequest()) + ->setTagKey($tagKey); + $response = $gapicClient->createTagKey($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); + 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 deleteTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $request = (new DeleteTagKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagKey($request); + $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.resourcemanager.v3.TagKeys/DeleteTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); + $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 deleteTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagKeyTest'); + $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 + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $request = (new DeleteTagKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagKey($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); + 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getNamespacedTagKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $request = (new GetNamespacedTagKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->getNamespacedTagKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetNamespacedTagKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespacedTagKeyExceptionTest() + { + $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->tagKeyName('[TAG_KEY]'); + $request = (new GetNamespacedTagKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->getNamespacedTagKey($request); + // 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 getTagKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $request = (new GetTagKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->getTagKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetTagKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTagKeyExceptionTest() + { + $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->tagKeyName('[TAG_KEY]'); + $request = (new GetTagKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->getTagKey($request); + // 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 listTagKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagKeysElement = new TagKey(); + $tagKeys = [ + $tagKeysElement, + ]; + $expectedResponse = new ListTagKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagKeys($tagKeys); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListTagKeysRequest()) + ->setParent($parent); + $response = $gapicClient->listTagKeys($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagKeysExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListTagKeysRequest()) + ->setParent($parent); + try { + $gapicClient->listTagKeys($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 updateTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $request = (new UpdateTagKeyRequest()) + ->setTagKey($tagKey); + $response = $gapicClient->updateTagKey($request); + $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.resourcemanager.v3.TagKeys/UpdateTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagKey(); + $this->assertProtobufEquals($tagKey, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); + $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 updateTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateTagKeyTest'); + $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 + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $request = (new UpdateTagKeyRequest()) + ->setTagKey($tagKey); + $response = $gapicClient->updateTagKey($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); + 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 createTagKeyAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $request = (new CreateTagKeyRequest()) + ->setTagKey($tagKey); + $response = $gapicClient->createTagKeyAsync($request)->wait(); + $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.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagKey(); + $this->assertProtobufEquals($tagKey, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php new file mode 100644 index 00000000000..50c0dfee188 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php @@ -0,0 +1,988 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagValuesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagValuesClient($options); + } + + /** @test */ + public function createTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $request = (new CreateTagValueRequest()) + ->setTagValue($tagValue); + $response = $gapicClient->createTagValue($request); + $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.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagValue(); + $this->assertProtobufEquals($tagValue, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagValueTest'); + $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 createTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagValueTest'); + $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 + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $request = (new CreateTagValueRequest()) + ->setTagValue($tagValue); + $response = $gapicClient->createTagValue($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagValueTest'); + 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 deleteTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $request = (new DeleteTagValueRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagValue($request); + $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.resourcemanager.v3.TagValues/DeleteTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); + $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 deleteTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteTagValueTest'); + $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 + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $request = (new DeleteTagValueRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTagValue($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); + 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getNamespacedTagValueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $request = (new GetNamespacedTagValueRequest()) + ->setName($formattedName); + $response = $gapicClient->getNamespacedTagValue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetNamespacedTagValue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespacedTagValueExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + $request = (new GetNamespacedTagValueRequest()) + ->setName($formattedName); + try { + $gapicClient->getNamespacedTagValue($request); + // 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 getTagValueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $request = (new GetTagValueRequest()) + ->setName($formattedName); + $response = $gapicClient->getTagValue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetTagValue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTagValueExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + $request = (new GetTagValueRequest()) + ->setName($formattedName); + try { + $gapicClient->getTagValue($request); + // 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 listTagValuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagValuesElement = new TagValue(); + $tagValues = [ + $tagValuesElement, + ]; + $expectedResponse = new ListTagValuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagValues($tagValues); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListTagValuesRequest()) + ->setParent($parent); + $response = $gapicClient->listTagValues($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagValues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagValuesExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListTagValuesRequest()) + ->setParent($parent); + try { + $gapicClient->listTagValues($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 updateTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $request = (new UpdateTagValueRequest()) + ->setTagValue($tagValue); + $response = $gapicClient->updateTagValue($request); + $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.resourcemanager.v3.TagValues/UpdateTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagValue(); + $this->assertProtobufEquals($tagValue, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); + $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 updateTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateTagValueTest'); + $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 + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $request = (new UpdateTagValueRequest()) + ->setTagValue($tagValue); + $response = $gapicClient->updateTagValue($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); + 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 createTagValueAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $request = (new CreateTagValueRequest()) + ->setTagValue($tagValue); + $response = $gapicClient->createTagValueAsync($request)->wait(); + $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.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagValue(); + $this->assertProtobufEquals($tagValue, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagValueTest'); + $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()); + } +} diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php b/owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php new file mode 100644 index 0000000000000000000000000000000000000000..0ddd1d8f7c88c52b096800ab85dfa2b2b8b3fc65 GIT binary patch literal 3819 zcmbVP&2Jk;6z|&k@=MaD(~r2JQnzkVoQSLy7ZBPst=5T?TFQsjIIgHHR%?6gENpg{ z-LXR&Swe8(h6G$Wa6|k9To8h5kLA`=4_xS9fKU(2&d#paPNKxkCF?iu{pP*j`&4tACR$x1 zT4kN#RaQK_%Huw~N_lY!pk`>UD+X&jd@ncxk^b4Os-f3JmuQ6kyQ{mZZt6tW4E-4m zb6IR?hKni4aotACtP$NZMbBW{tl{*W=wo`icWsN(vMdG;7CojYOO=92uw!aQWfi+M zN4JUP6sf8#H!%tM^(5&zzO4tRH^j8>qbwhDa#NJcX@)C?j!iO{&65vAGlv((58a{g4l0>|iC05K*e=$q##hGc2t=T#)d5dZn0%U(F^=lkPc@?7x81nieDTqQkfgZuwK5vZVD3y$77bPF(bRQ)S6?9ZC{z{3X z`!H@;HO)}ln$g0^F$PwdJsYj;>7zVc!gL_e{%B(kkr)iZcY}sU<7p< zKxH-{BpeZbkd$Rtq9Z61u(L=<$EVZ_H*>_lRI{~T#ZD&^m}ZXnm+JA@LFtBN)UiV? z{EyQ$-?yBmX6n!UmdPANf1YZU`aK4hxO)NP=qgOqb=NkuL*@ie<`o#P^ASONG8ywI zK$jumV6CoNrg4~zQ_&dOgoHNs~-BioU#%_LUDD_)cckq#kxT0!o=(inKqAydlQ7H{{Tj)Q@}H?61h}%HyM(9JeT+Y+2n5}L5nFTU z+~Ed^S4!+ZB@V*8S4y_l#HveAI#yl7h~|Nbi1isZS$QSU5)8F=YXQbNrpGk82}#;6CE7x2 zxsZR-*KF4T^{nQUox%$3I}vX7$n$G!`ISfC2WO`^s?VvK`EXD(zs6FXmkO`_um1Y``Wds)VOZL}tXFvC44DQkk&zZHAyVl>OMejXQ6rL9S%WH5;q?f0r6~4hZrEZ2g5qX*g zV!OK3ACX=CR}g-QiRUVI*?RQS^^e7gl>q(UEWuVZ(7AX#QevfK|P j%jL!D2&JD`_h!Sp{d@j{DDr+f_3gwo{WnerIspFz4MzrJ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php new file mode 100644 index 00000000000..c6eee9fa8d1 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php @@ -0,0 +1,125 @@ +google.cloud.resourcesettings.v1.GetSettingRequest + */ +class GetSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * requirements. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; + */ + protected $view = 0; + + /** + * @param string $name Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * requirements. Please see + * {@see ResourceSettingsServiceClient::settingName()} for help formatting this field. + * + * @return \Google\Cloud\ResourceSettings\V1\GetSettingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * requirements. + * @type int $view + * The SettingView for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * requirements. + * + * 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 name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * requirements. + * + * 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; + } + + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php new file mode 100644 index 00000000000..55dbf4f3fa7 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php @@ -0,0 +1,208 @@ +google.cloud.resourcesettings.v1.ListSettingsRequest + */ +class ListSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: + * * `projects/{project_number}` + * * `projects/{project_id}` + * * `folders/{folder_id}` + * * `organizations/{organization_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Unused. The size of the page to be returned. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Unused. A page token used to retrieve the next page. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; + */ + protected $view = 0; + + /** + * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: + * + * * `projects/{project_number}` + * * `projects/{project_id}` + * * `folders/{folder_id}` + * * `organizations/{organization_id}` + * + * @return \Google\Cloud\ResourceSettings\V1\ListSettingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: + * * `projects/{project_number}` + * * `projects/{project_id}` + * * `folders/{folder_id}` + * * `organizations/{organization_id}` + * @type int $page_size + * Unused. The size of the page to be returned. + * @type string $page_token + * Unused. A page token used to retrieve the next page. + * @type int $view + * The SettingView for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: + * * `projects/{project_number}` + * * `projects/{project_id}` + * * `folders/{folder_id}` + * * `organizations/{organization_id}` + * + * 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 Cloud resource that parents the setting. Must be in one of + * the following forms: + * * `projects/{project_number}` + * * `projects/{project_id}` + * * `folders/{folder_id}` + * * `organizations/{organization_id}` + * + * 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; + } + + /** + * Unused. The size of the page to be returned. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Unused. The size of the page to be returned. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Unused. A page token used to retrieve the next page. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Unused. A page token used to retrieve the next page. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The SettingView for this request. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php new file mode 100644 index 00000000000..7b1ed2d089d --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php @@ -0,0 +1,101 @@ +google.cloud.resourcesettings.v1.ListSettingsResponse + */ +class ListSettingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of settings that are available at the specified Cloud resource. + * + * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; + */ + private $settings; + /** + * Unused. A page token used to retrieve the next page. + * + * 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\ResourceSettings\V1\Setting>|\Google\Protobuf\Internal\RepeatedField $settings + * A list of settings that are available at the specified Cloud resource. + * @type string $next_page_token + * Unused. A page token used to retrieve the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * A list of settings that are available at the specified Cloud resource. + * + * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSettings() + { + return $this->settings; + } + + /** + * A list of settings that are available at the specified Cloud resource. + * + * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; + * @param array<\Google\Cloud\ResourceSettings\V1\Setting>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceSettings\V1\Setting::class); + $this->settings = $arr; + + return $this; + } + + /** + * Unused. A page token used to retrieve the next page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Unused. A page token used to retrieve the next page. + * + * 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/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php new file mode 100644 index 00000000000..5f66a0f4311 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php @@ -0,0 +1,329 @@ +google.cloud.resourcesettings.v1.Setting + */ +class Setting extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the setting. Must be in one of the following forms: + * * `projects/{project_number}/settings/{setting_name}` + * * `folders/{folder_id}/settings/{setting_name}` + * * `organizations/{organization_id}/settings/{setting_name}` + * For example, "/projects/123/settings/gcp-enableMyFeature" + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Metadata about a setting which is not editable by the end + * user. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $metadata = null; + /** + * The configured value of the setting at the given parent resource (ignoring + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; + */ + protected $local_value = null; + /** + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). + * The effective value evaluates to one of the following options in the given + * order (the next option is used if the previous one does not exist): + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 2. if one of the given resource's ancestors have a local setting value, + * the local value at the nearest such ancestor + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 4. an empty value (defined as a `Value` with all fields unset) + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_value = null; + /** + * A fingerprint used for optimistic concurrency. See + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. + * + * Generated from protobuf field string etag = 10; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the setting. Must be in one of the following forms: + * * `projects/{project_number}/settings/{setting_name}` + * * `folders/{folder_id}/settings/{setting_name}` + * * `organizations/{organization_id}/settings/{setting_name}` + * For example, "/projects/123/settings/gcp-enableMyFeature" + * @type \Google\Cloud\ResourceSettings\V1\SettingMetadata $metadata + * Output only. Metadata about a setting which is not editable by the end + * user. + * @type \Google\Cloud\ResourceSettings\V1\Value $local_value + * The configured value of the setting at the given parent resource (ignoring + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * @type \Google\Cloud\ResourceSettings\V1\Value $effective_value + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). + * The effective value evaluates to one of the following options in the given + * order (the next option is used if the previous one does not exist): + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 2. if one of the given resource's ancestors have a local setting value, + * the local value at the nearest such ancestor + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 4. an empty value (defined as a `Value` with all fields unset) + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * @type string $etag + * A fingerprint used for optimistic concurrency. See + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the setting. Must be in one of the following forms: + * * `projects/{project_number}/settings/{setting_name}` + * * `folders/{folder_id}/settings/{setting_name}` + * * `organizations/{organization_id}/settings/{setting_name}` + * For example, "/projects/123/settings/gcp-enableMyFeature" + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the setting. Must be in one of the following forms: + * * `projects/{project_number}/settings/{setting_name}` + * * `folders/{folder_id}/settings/{setting_name}` + * * `organizations/{organization_id}/settings/{setting_name}` + * For example, "/projects/123/settings/gcp-enableMyFeature" + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Metadata about a setting which is not editable by the end + * user. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ResourceSettings\V1\SettingMetadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Output only. Metadata about a setting which is not editable by the end + * user. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ResourceSettings\V1\SettingMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\SettingMetadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * The configured value of the setting at the given parent resource (ignoring + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; + * @return \Google\Cloud\ResourceSettings\V1\Value|null + */ + public function getLocalValue() + { + return $this->local_value; + } + + public function hasLocalValue() + { + return isset($this->local_value); + } + + public function clearLocalValue() + { + unset($this->local_value); + } + + /** + * The configured value of the setting at the given parent resource (ignoring + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; + * @param \Google\Cloud\ResourceSettings\V1\Value $var + * @return $this + */ + public function setLocalValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); + $this->local_value = $var; + + return $this; + } + + /** + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). + * The effective value evaluates to one of the following options in the given + * order (the next option is used if the previous one does not exist): + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 2. if one of the given resource's ancestors have a local setting value, + * the local value at the nearest such ancestor + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 4. an empty value (defined as a `Value` with all fields unset) + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ResourceSettings\V1\Value|null + */ + public function getEffectiveValue() + { + return $this->effective_value; + } + + public function hasEffectiveValue() + { + return isset($this->effective_value); + } + + public function clearEffectiveValue() + { + unset($this->effective_value); + } + + /** + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). + * The effective value evaluates to one of the following options in the given + * order (the next option is used if the previous one does not exist): + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 2. if one of the given resource's ancestors have a local setting value, + * the local value at the nearest such ancestor + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 4. an empty value (defined as a `Value` with all fields unset) + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ResourceSettings\V1\Value $var + * @return $this + */ + public function setEffectiveValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); + $this->effective_value = $var; + + return $this; + } + + /** + * A fingerprint used for optimistic concurrency. See + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. + * + * Generated from protobuf field string etag = 10; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A fingerprint used for optimistic concurrency. See + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. + * + * Generated from protobuf field string etag = 10; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php new file mode 100644 index 00000000000..0c7450691b7 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php @@ -0,0 +1,229 @@ +google.cloud.resourcesettings.v1.SettingMetadata + */ +class SettingMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The human readable name for this setting. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * A detailed description of what this setting does. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * A flag indicating that values of this setting cannot be modified (see + * documentation of the specific setting for updates and reasons). + * + * Generated from protobuf field bool read_only = 3; + */ + protected $read_only = false; + /** + * The data type for this setting. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; + */ + protected $data_type = 0; + /** + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. + * Note: not all settings have a default value. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; + */ + protected $default_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The human readable name for this setting. + * @type string $description + * A detailed description of what this setting does. + * @type bool $read_only + * A flag indicating that values of this setting cannot be modified (see + * documentation of the specific setting for updates and reasons). + * @type int $data_type + * The data type for this setting. + * @type \Google\Cloud\ResourceSettings\V1\Value $default_value + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. + * Note: not all settings have a default value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * The human readable name for this setting. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The human readable name for this setting. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * A detailed description of what this setting does. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A detailed description of what this setting does. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A flag indicating that values of this setting cannot be modified (see + * documentation of the specific setting for updates and reasons). + * + * Generated from protobuf field bool read_only = 3; + * @return bool + */ + public function getReadOnly() + { + return $this->read_only; + } + + /** + * A flag indicating that values of this setting cannot be modified (see + * documentation of the specific setting for updates and reasons). + * + * Generated from protobuf field bool read_only = 3; + * @param bool $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkBool($var); + $this->read_only = $var; + + return $this; + } + + /** + * The data type for this setting. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; + * @return int + */ + public function getDataType() + { + return $this->data_type; + } + + /** + * The data type for this setting. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; + * @param int $var + * @return $this + */ + public function setDataType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingMetadata\DataType::class); + $this->data_type = $var; + + return $this; + } + + /** + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. + * Note: not all settings have a default value. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; + * @return \Google\Cloud\ResourceSettings\V1\Value|null + */ + public function getDefaultValue() + { + return $this->default_value; + } + + public function hasDefaultValue() + { + return isset($this->default_value); + } + + public function clearDefaultValue() + { + unset($this->default_value); + } + + /** + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. + * Note: not all settings have a default value. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; + * @param \Google\Cloud\ResourceSettings\V1\Value $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); + $this->default_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php new file mode 100644 index 00000000000..933bb281ab6 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php @@ -0,0 +1,80 @@ +google.cloud.resourcesettings.v1.SettingMetadata.DataType + */ +class DataType +{ + /** + * Unspecified data type. + * + * Generated from protobuf enum DATA_TYPE_UNSPECIFIED = 0; + */ + const DATA_TYPE_UNSPECIFIED = 0; + /** + * A boolean setting. + * + * Generated from protobuf enum BOOLEAN = 1; + */ + const BOOLEAN = 1; + /** + * A string setting. + * + * Generated from protobuf enum STRING = 2; + */ + const STRING = 2; + /** + * A string set setting. + * + * Generated from protobuf enum STRING_SET = 3; + */ + const STRING_SET = 3; + /** + * A Enum setting + * + * Generated from protobuf enum ENUM_VALUE = 4; + */ + const ENUM_VALUE = 4; + + private static $valueToName = [ + self::DATA_TYPE_UNSPECIFIED => 'DATA_TYPE_UNSPECIFIED', + self::BOOLEAN => 'BOOLEAN', + self::STRING => 'STRING', + self::STRING_SET => 'STRING_SET', + self::ENUM_VALUE => 'ENUM_VALUE', + ]; + + 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(DataType::class, \Google\Cloud\ResourceSettings\V1\SettingMetadata_DataType::class); + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php new file mode 100644 index 00000000000..80dad94f8b5 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php @@ -0,0 +1,76 @@ +google.cloud.resourcesettings.v1.SettingView + */ +class SettingView +{ + /** + * The default / unset value. + * The API will default to the SETTING_VIEW_BASIC view. + * + * Generated from protobuf enum SETTING_VIEW_UNSPECIFIED = 0; + */ + const SETTING_VIEW_UNSPECIFIED = 0; + /** + * Include + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata], but + * nothing else. This is the default value (for both ListSettings and + * GetSetting). + * + * Generated from protobuf enum SETTING_VIEW_BASIC = 1; + */ + const SETTING_VIEW_BASIC = 1; + /** + * Include + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value], + * but nothing else. + * + * Generated from protobuf enum SETTING_VIEW_EFFECTIVE_VALUE = 2; + */ + const SETTING_VIEW_EFFECTIVE_VALUE = 2; + /** + * Include + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value], + * but nothing else. + * + * Generated from protobuf enum SETTING_VIEW_LOCAL_VALUE = 3; + */ + const SETTING_VIEW_LOCAL_VALUE = 3; + + private static $valueToName = [ + self::SETTING_VIEW_UNSPECIFIED => 'SETTING_VIEW_UNSPECIFIED', + self::SETTING_VIEW_BASIC => 'SETTING_VIEW_BASIC', + self::SETTING_VIEW_EFFECTIVE_VALUE => 'SETTING_VIEW_EFFECTIVE_VALUE', + self::SETTING_VIEW_LOCAL_VALUE => 'SETTING_VIEW_LOCAL_VALUE', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php new file mode 100644 index 00000000000..9f21c56b455 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php @@ -0,0 +1,81 @@ +google.cloud.resourcesettings.v1.UpdateSettingRequest + */ +class UpdateSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $setting = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceSettings\V1\Setting $setting + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceSettings\V1\Setting|null + */ + public function getSetting() + { + return $this->setting; + } + + public function hasSetting() + { + return isset($this->setting); + } + + public function clearSetting() + { + unset($this->setting); + } + + /** + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceSettings\V1\Setting $var + * @return $this + */ + public function setSetting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Setting::class); + $this->setting = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php new file mode 100644 index 00000000000..e43966d7129 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php @@ -0,0 +1,174 @@ +google.cloud.resourcesettings.v1.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $boolean_value + * Defines this value as being a boolean value. + * @type string $string_value + * Defines this value as being a string value. + * @type \Google\Cloud\ResourceSettings\V1\Value\StringSet $string_set_value + * Defines this value as being a StringSet. + * @type \Google\Cloud\ResourceSettings\V1\Value\EnumValue $enum_value + * Defines this value as being a Enum. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * Defines this value as being a boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @return bool + */ + public function getBooleanValue() + { + return $this->readOneof(1); + } + + public function hasBooleanValue() + { + return $this->hasOneof(1); + } + + /** + * Defines this value as being a boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @param bool $var + * @return $this + */ + public function setBooleanValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Defines this value as being a string value. + * + * Generated from protobuf field string string_value = 2; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(2); + } + + public function hasStringValue() + { + return $this->hasOneof(2); + } + + /** + * Defines this value as being a string value. + * + * Generated from protobuf field string string_value = 2; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Defines this value as being a StringSet. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3; + * @return \Google\Cloud\ResourceSettings\V1\Value\StringSet|null + */ + public function getStringSetValue() + { + return $this->readOneof(3); + } + + public function hasStringSetValue() + { + return $this->hasOneof(3); + } + + /** + * Defines this value as being a StringSet. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3; + * @param \Google\Cloud\ResourceSettings\V1\Value\StringSet $var + * @return $this + */ + public function setStringSetValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\StringSet::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Defines this value as being a Enum. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4; + * @return \Google\Cloud\ResourceSettings\V1\Value\EnumValue|null + */ + public function getEnumValue() + { + return $this->readOneof(4); + } + + public function hasEnumValue() + { + return $this->hasOneof(4); + } + + /** + * Defines this value as being a Enum. + * + * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4; + * @param \Google\Cloud\ResourceSettings\V1\Value\EnumValue $var + * @return $this + */ + public function setEnumValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\EnumValue::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php new file mode 100644 index 00000000000..b1b28bd7172 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php @@ -0,0 +1,72 @@ +google.cloud.resourcesettings.v1.Value.EnumValue + */ +class EnumValue extends \Google\Protobuf\Internal\Message +{ + /** + * The value of this enum + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The value of this enum + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * The value of this enum + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value of this enum + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EnumValue::class, \Google\Cloud\ResourceSettings\V1\Value_EnumValue::class); + diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php new file mode 100644 index 00000000000..2639831851a --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php @@ -0,0 +1,72 @@ +google.cloud.resourcesettings.v1.Value.StringSet + */ +class StringSet extends \Google\Protobuf\Internal\Message +{ + /** + * The strings in the set + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * The strings in the set + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); + parent::__construct($data); + } + + /** + * The strings in the set + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The strings in the set + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringSet::class, \Google\Cloud\ResourceSettings\V1\Value_StringSet::class); + diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php new file mode 100644 index 00000000000..9e69e9c6355 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Setting $response */ + $response = $resourceSettingsServiceClient->getSetting($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ResourceSettingsServiceClient::settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); + + get_setting_sample($formattedName); +} +// [END resourcesettings_v1_generated_ResourceSettingsService_GetSetting_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php new file mode 100644 index 00000000000..eae0ab609c4 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php @@ -0,0 +1,81 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $resourceSettingsServiceClient->listSettings($request); + + /** @var Setting $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_settings_sample($parent); +} +// [END resourcesettings_v1_generated_ResourceSettingsService_ListSettings_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php new file mode 100644 index 00000000000..69c6244265c --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php @@ -0,0 +1,74 @@ +setSetting($setting); + + // Call the API and handle any network failures. + try { + /** @var Setting $response */ + $response = $resourceSettingsServiceClient->updateSetting($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END resourcesettings_v1_generated_ResourceSettingsService_UpdateSetting_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php b/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php new file mode 100644 index 00000000000..43c970351b4 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php @@ -0,0 +1,387 @@ + getSettingAsync(GetSettingRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSettingsAsync(ListSettingsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSettingAsync(UpdateSettingRequest $request, array $optionalArgs = []) + */ +final class ResourceSettingsServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.resourcesettings.v1.ResourceSettingsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'resourcesettings.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'resourcesettings.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/resource_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/resource_settings_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/resource_settings_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/resource_settings_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_setting_name resource. + * + * @param string $folder + * @param string $settingName + * + * @return string The formatted folder_setting_name resource. + */ + public static function folderSettingNameName(string $folder, string $settingName): string + { + return self::getPathTemplate('folderSettingName')->render([ + 'folder' => $folder, + 'setting_name' => $settingName, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_setting_name resource. + * + * @param string $organization + * @param string $settingName + * + * @return string The formatted organization_setting_name resource. + */ + public static function organizationSettingNameName(string $organization, string $settingName): string + { + return self::getPathTemplate('organizationSettingName')->render([ + 'organization' => $organization, + 'setting_name' => $settingName, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_number_setting_name resource. + * + * @param string $projectNumber + * @param string $settingName + * + * @return string The formatted project_number_setting_name resource. + */ + public static function projectNumberSettingNameName(string $projectNumber, string $settingName): string + { + return self::getPathTemplate('projectNumberSettingName')->render([ + 'project_number' => $projectNumber, + 'setting_name' => $settingName, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a setting + * resource. + * + * @param string $projectNumber + * @param string $settingName + * + * @return string The formatted setting resource. + */ + public static function settingName(string $projectNumber, string $settingName): string + { + return self::getPathTemplate('setting')->render([ + 'project_number' => $projectNumber, + 'setting_name' => $settingName, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderSettingName: folders/{folder}/settings/{setting_name} + * - organizationSettingName: organizations/{organization}/settings/{setting_name} + * - projectNumberSettingName: projects/{project_number}/settings/{setting_name} + * - setting: projects/{project_number}/settings/{setting_name} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'resourcesettings.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets a setting. + * + * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the + * setting does not exist. + * + * The async variant is {@see ResourceSettingsServiceClient::getSettingAsync()} . + * + * @example samples/V1/ResourceSettingsServiceClient/get_setting.php + * + * @param GetSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Setting + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSetting(GetSettingRequest $request, array $callOptions = []): Setting + { + return $this->startApiCall('GetSetting', $request, $callOptions)->wait(); + } + + /** + * Lists all the settings that are available on the Cloud resource `parent`. + * + * The async variant is {@see ResourceSettingsServiceClient::listSettingsAsync()} . + * + * @example samples/V1/ResourceSettingsServiceClient/list_settings.php + * + * @param ListSettingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSettings(ListSettingsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSettings', $request, $callOptions); + } + + /** + * Updates a setting. + * + * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the + * setting does not exist. + * Returns a `google.rpc.Status` with `google.rpc.Code.FAILED_PRECONDITION` if + * the setting is flagged as read only. + * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag + * supplied in the request does not match the persisted etag of the setting + * value. + * + * On success, the response will contain only `name`, `local_value` and + * `etag`. The `metadata` and `effective_value` cannot be updated through + * this API. + * + * Note: the supplied setting will perform a full overwrite of the + * `local_value` field. + * + * The async variant is {@see ResourceSettingsServiceClient::updateSettingAsync()} + * . + * + * @example samples/V1/ResourceSettingsServiceClient/update_setting.php + * + * @param UpdateSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Setting + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSetting(UpdateSettingRequest $request, array $callOptions = []): Setting + { + return $this->startApiCall('UpdateSetting', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json b/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..497c42f7092 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.resourcesettings.v1", + "libraryPackage": "Google\\Cloud\\ResourceSettings\\V1", + "services": { + "ResourceSettingsService": { + "clients": { + "grpc": { + "libraryClient": "ResourceSettingsServiceGapicClient", + "rpcs": { + "GetSetting": { + "methods": [ + "getSetting" + ] + }, + "ListSettings": { + "methods": [ + "listSettings" + ] + }, + "UpdateSetting": { + "methods": [ + "updateSetting" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json new file mode 100644 index 00000000000..598f9f1eed9 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.resourcesettings.v1.ResourceSettingsService": { + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetSetting": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSettings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSetting": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php new file mode 100644 index 00000000000..1a389b803c1 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php @@ -0,0 +1,79 @@ + [ + 'google.cloud.resourcesettings.v1.ResourceSettingsService' => [ + 'GetSetting' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceSettings\V1\Setting', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSettings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSettings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ResourceSettings\V1\ListSettingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSetting' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ResourceSettings\V1\Setting', + 'headerParams' => [ + [ + 'keyName' => 'setting.name', + 'fieldAccessors' => [ + 'getSetting', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'folderSettingName' => 'folders/{folder}/settings/{setting_name}', + 'organizationSettingName' => 'organizations/{organization}/settings/{setting_name}', + 'projectNumberSettingName' => 'projects/{project_number}/settings/{setting_name}', + 'setting' => 'projects/{project_number}/settings/{setting_name}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php new file mode 100644 index 00000000000..af1aea76015 --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php @@ -0,0 +1,96 @@ + [ + 'google.cloud.resourcesettings.v1.ResourceSettingsService' => [ + 'GetSetting' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/settings/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/settings/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/settings/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSettings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*}/settings', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*}/settings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/settings', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSetting' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{setting.name=organizations/*/settings/*}', + 'body' => 'setting', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{setting.name=folders/*/settings/*}', + 'body' => 'setting', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{setting.name=projects/*/settings/*}', + 'body' => 'setting', + ], + ], + 'placeholders' => [ + 'setting.name' => [ + 'getters' => [ + 'getSetting', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php b/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php new file mode 100644 index 00000000000..68b79b6962d --- /dev/null +++ b/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php @@ -0,0 +1,300 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ResourceSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ResourceSettingsServiceClient($options); + } + + /** @test */ + public function getSettingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new Setting(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); + $request = (new GetSettingRequest()) + ->setName($formattedName); + $response = $gapicClient->getSetting($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/GetSetting', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSettingExceptionTest() + { + $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->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); + $request = (new GetSettingRequest()) + ->setName($formattedName); + try { + $gapicClient->getSetting($request); + // 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 listSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $settingsElement = new Setting(); + $settings = [ + $settingsElement, + ]; + $expectedResponse = new ListSettingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSettings($settings); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListSettingsRequest()) + ->setParent($parent); + $response = $gapicClient->listSettings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSettings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/ListSettings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSettingsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $request = (new ListSettingsRequest()) + ->setParent($parent); + try { + $gapicClient->listSettings($request); + // 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 updateSettingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $expectedResponse = new Setting(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $setting = new Setting(); + $request = (new UpdateSettingRequest()) + ->setSetting($setting); + $response = $gapicClient->updateSetting($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/UpdateSetting', $actualFuncCall); + $actualValue = $actualRequestObject->getSetting(); + $this->assertProtobufEquals($setting, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSettingExceptionTest() + { + $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 + $setting = new Setting(); + $request = (new UpdateSettingRequest()) + ->setSetting($setting); + try { + $gapicClient->updateSetting($request); + // 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 getSettingAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new Setting(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); + $request = (new GetSettingRequest()) + ->setName($formattedName); + $response = $gapicClient->getSettingAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/GetSetting', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php new file mode 100644 index 00000000000..ad28cd54f00 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + ' +� +.google/cloud/retail/v2/analytics_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto*google/cloud/retail/v2/export_config.proto#google/longrunning/operations.proto2� +AnalyticsService� +ExportAnalyticsMetrics5.google.cloud.retail.v2.ExportAnalyticsMetricsRequest.google.longrunning.Operation"��A^ +5google.cloud.retail.v2.ExportAnalyticsMetricsResponse%google.cloud.retail.v2.ExportMetadata���K"F/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BAnalyticsServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php new file mode 100644 index 0000000000000000000000000000000000000000..b421b2082c35c38f63489d95268a0fa9689a9869 GIT binary patch literal 4735 zcmbtY&vV*F6fQV+?1z6~#UYqU9EErqCv{;;JFTNMNikrT#>OtjG;Nq@gjlc=A!#Jx z+RgaT{ujOW*xuX!p?^iL&Gg=D-|k960h3`IUo2MdeednJZ=b&1FCSY+7TgxMi9u|| zB`vXeD!NBRv~1HgRZ|z6y>^?}qH1<6O(%9n6pMReWv?cdisjlZbal+0trAJ>m}W;O zSyeZCt*lL4Mbop#xvZ+Vif(o?3=qIjy2P;*m5AH>o4aV$!uO4B=G!Px-$s@BHtM+t z0IIGyj#%Ir@CroyvwBTkQ$@#BT>Q7HIkIMGuBPbPPniEhv90J1LEmB9cF#~<%``;n zuxF@b?XJi%sqLy|;(Q;9em47*0-S!MY`DZW6unU-j%sU`Yufv0DoGvU2E@^kwYy$e z3a7QjHJ+m+4JG+dbnPAqM;ArptY;e!Sl$%iEO=_1!&TnW8e1CCTbtxaIo3>DlKQji zgN$;m5^vqc_8M56M#1cMO=JA1gZ|~NW!i4RG}>Bce3W2OY8n=jt8}gNec57u{7Cbb zF5hYeE477nycTdvnZ5&mtib9x1uP`ERfd&$hL?HfIG0-XycJ8s;^*A*nor#x1|7?hZL7I_FqefrMsskTl!@GWyc@ zvU_TgWJHXt%?QXzm)Po&Vz{zOC~<+6){@(_){;?bnf`A9;@+OjyRNM@doB^;F!7R{ za;(jX*ZHV$1*SAZ?l~kmgKpDwa6%}FOhRRKa>LkD4Eyoe*hLPs<>PoEYOv@K zg%Tag`!d76KQ{J3fZ(CZa1EKj6&=QoG3-ZUW0xq-P=GoJSnjq)j>CD+GHhvVY;5j6 zgqQd?Fw2rQ({z;m4ABFw=|<#4xDEf?@-G~I-S!M-QL^>U?HdYa$dDam{Lwens?KCB${XQ_D)cQh#=gt%o(-WyCBnI2J7c3UiHo_M$+28E3+}fx>gIH2@BO;x=$@kzx zPd9SygObt7;Q1;$ICbF(_OKU3b)D=h@98Y7o5(3D9USu?&$1rPIOaW_Wdm}&HA??F ziJ}cpaXO*y?_9V9%y$)6JwmxCn|6!Xysrt@V4JWs|mc zg3DlZ+#~jxnZ&j+r}SJC2Nl~uz$8^8)A;R3hG6gnXZ28ZGL_3TTrBs=NM3_U6tTL> z)RWJKtHKQ2!b2nKpnjIJr=m@Z9&)Knq*88%+aJQ!7BNnB4Sn89gG#cCr|}W2ur&JE zT*>!ynC|CL$70rX^T**NsB*q|66n=Es3b~{7wED z+&F)e`e{lR-internalAddGeneratedFile( + ' +�$ +,google/cloud/retail/v2/catalog_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/retail/v2/catalog.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"w +ListCatalogsRequest9 +parent ( B)�A�A# +!locations.googleapis.com/Location + page_size ( + +page_token ( "b +ListCatalogsResponse1 +catalogs ( 2.google.cloud.retail.v2.Catalog +next_page_token ( "~ +UpdateCatalogRequest5 +catalog ( 2.google.cloud.retail.v2.CatalogB�A/ + update_mask ( 2.google.protobuf.FieldMask"� +SetDefaultBranchRequest3 +catalog ( B"�A +retail.googleapis.com/Catalog4 + branch_id ( B!�A +retail.googleapis.com/Branch +note (  +force ("N +GetDefaultBranchRequest3 +catalog ( B"�A +retail.googleapis.com/Catalog"� +GetDefaultBranchResponse1 +branch ( B!�A +retail.googleapis.com/Branch, +set_time ( 2.google.protobuf.Timestamp +note ( "Z +GetCompletionConfigRequest< +name ( B.�A�A( +&retail.googleapis.com/CompletionConfig"� +UpdateCompletionConfigRequestH +completion_config ( 2(.google.cloud.retail.v2.CompletionConfigB�A/ + update_mask ( 2.google.protobuf.FieldMask"Z +GetAttributesConfigRequest< +name ( B.�A�A( +&retail.googleapis.com/AttributesConfig"� +UpdateAttributesConfigRequestH +attributes_config ( 2(.google.cloud.retail.v2.AttributesConfigB�A/ + update_mask ( 2.google.protobuf.FieldMask"� +AddCatalogAttributeRequestI +attributes_config ( B.�A�A( +&retail.googleapis.com/AttributesConfigH +catalog_attribute ( 2(.google.cloud.retail.v2.CatalogAttributeB�A"| +RemoveCatalogAttributeRequestI +attributes_config ( B.�A�A( +&retail.googleapis.com/AttributesConfig +key ( B�A"� +ReplaceCatalogAttributeRequestI +attributes_config ( B.�A�A( +&retail.googleapis.com/AttributesConfigH +catalog_attribute ( 2(.google.cloud.retail.v2.CatalogAttributeB�A/ + update_mask ( 2.google.protobuf.FieldMask2� +CatalogService� + ListCatalogs+.google.cloud.retail.v2.ListCatalogsRequest,.google.cloud.retail.v2.ListCatalogsResponse"=�Aparent���.,/v2/{parent=projects/*/locations/*}/catalogs� + UpdateCatalog,.google.cloud.retail.v2.UpdateCatalogRequest.google.cloud.retail.v2.Catalog"[�Acatalog,update_mask���?24/v2/{catalog.name=projects/*/locations/*/catalogs/*}:catalog� +SetDefaultBranch/.google.cloud.retail.v2.SetDefaultBranchRequest.google.protobuf.Empty"U�Acatalog���E"@/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch:*� +GetDefaultBranch/.google.cloud.retail.v2.GetDefaultBranchRequest0.google.cloud.retail.v2.GetDefaultBranchResponse"R�Acatalog���B@/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch� +GetCompletionConfig2.google.cloud.retail.v2.GetCompletionConfigRequest(.google.cloud.retail.v2.CompletionConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}� +UpdateCompletionConfig5.google.cloud.retail.v2.UpdateCompletionConfigRequest(.google.cloud.retail.v2.CompletionConfig"��Acompletion_config,update_mask���d2O/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}:completion_config� +GetAttributesConfig2.google.cloud.retail.v2.GetAttributesConfigRequest(.google.cloud.retail.v2.AttributesConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}� +UpdateAttributesConfig5.google.cloud.retail.v2.UpdateAttributesConfigRequest(.google.cloud.retail.v2.AttributesConfig"��Aattributes_config,update_mask���d2O/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}:attributes_config� +AddCatalogAttribute2.google.cloud.retail.v2.AddCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"i���c"^/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute:*� +RemoveCatalogAttribute5.google.cloud.retail.v2.RemoveCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"l���f"a/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute:*� +ReplaceCatalogAttribute6.google.cloud.retail.v2.ReplaceCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"m���g"b/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BCatalogServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..5456558d657a3f2cc5e14a010e7b94b882c7acab GIT binary patch literal 4745 zcma)A-*VeZ8L#XnjXx(%qUNNj52UJFPTdj|aHnUAO99)lQ-d2D+bPiTjF9EEvmk4Q z{-iNXZy6Y#;xNO_c>vx4E_ep6x#j`*c2`p3#Lh`C8d>}Oe*693Py3^vxF;?=)((k7 zJTo9eZ7|h>6Qa2u3z)@hZ4iz|#M3M`aj8u_UDFO)+EJ^g)eaiHM+o&<=vkzsjTsx; zWZ$w`INbM0U{ZVkw78GJ33GJ82jG|!;=86rw8M7g9SRN2!0aCiXury#{f>b4-xps4 zShnf=T2)ZMA3?)^ZaA>1rTKvw;GZYdH>g7cYTEPZ8k z$0CJin&jlNPh5u9zR_Z3+S~zXe81rY#B)r$e?WZ8qi(>wHj0)?V-h58<8KPjqHQ@H z9ccxrW2tmS$v0Zyh2-MynuZ<=J?FL1n-hFWp89iKRd#8=PKiCNkQ4KiGOtuRx9Xf^ z9yBqmM==(GIdSJ>g+spgV;Y%X9u5<0>zE0JL_e3P=`h0Rd!Rf!? zpdMn>I&7Ml52wW7I~ktojLA;=raatv9S%|N!@6sZiD6;+jG0G?zjGT|GC3VG=ew=J z(y3{O1T|F(8C3-sg|=->%)mO?N#VPd9EHp|s}6v%@dBZo0A-80*u28_Q||9us1cS4(>8&?O6`GLV*!5pDUwpfTax)daxWAq9Kl!g4;Tj<7hj|{0t ztb`;j_FotbLDGpZ2~QWcnL|FBQ^TJ+%$ZL7Sf^z{_k(M7Y6)mJLMEg=xIbiu!%#Kf zXBNc}#jJO3z)) z!TaJ`L+c!kM*{Z7I>#pJzJq%nnJ_Hh8O}Aq`At#axLLX%LdJ@lOH^);7Acl=lS=wO zAzmcL&oF-OjXf5+K5m3rlYha_Xq$NrXT-REI6*QGD|A9_elUu#@=O=+W6+-z zSg)cF*`yqsBg1wUL?={aI1e9Aqde zdM4IxCu<6>Rn{PDoFgl%060HJviTyc*Fzht(B|P3Ht_VBy0K?BAtU;}L5H#OuVAS$ zK|i3^(@9Z^#=z}7A#{8a$SCm6@R1IK6QS=?{tQ;cY>9J$x(RnCIKWN9iHIQ@f+lW~ zGs_NrKBB~n{AlNkT;4nr^4xgkEqBR9`Dl?_kBgNhNF#;#W1i*zl7>v%qZSb+egn*pTn}#wi{s3+DlxdHAnauq74^f?o~i)78!r zu3kHms4rnNLY}!eO~^?`9{tzNJ$1-Rn4I6_slK z&bvmos4e14;`i!`cjOTEjmUf(mOJ<<B3U}H?VT-6Ip^-I3Ye`z6v@qcv2U8*3ct9PvK}76+*ZNZY$g7 z=Ws6?>co;qaN3TdypsPa1$UdwGVO+QiV)^aMbF_A(fLj<0c2z-_5!g}wz%*}O#-9- z47*C)1$<#qw)o{D|IaF+C+)+pIRPrQ3!6A)$MtORLXL)W9`xI}53qh2l7;l|$TV`+ zm+{apgV}$&NRLb1tCV`BJjbrKm9XQ;FrwooIVHCG1?0=UUZ+tx?$wNH>!{v1G@7;d zwWe`=)NR+Qje4VYuyISx!*09NIykQOqUFn|4TZ~8%e`{56;oW1Nj;~q+GTdg=ldRd zK>ap6=(d{2y+-TE=>57~yR@wa-s&6+^&%aV& zw?p_RKb{nroy_s&jDvaGa`|ud`>;1l*fr{nX0O(1932|1w$N(U59qJOh=WGATxp`e z6!kmsXt7-FNQ$MO|5bs{y5j7Jy@J(JHGQHM;EA-vNX$F#Vu;H4->gcH;o(Bb$Qg=y zolvFI`enDak*fSdfgJj4L1I<1^6o=?v$vHGMfpJ%f90~t{+PvgEv8HHxC8vT9oU-3dex`BzWVDJv+zo`cjR4NHnsU%^g j();3IS$v1Sc$(YinternalAddGeneratedFile( + ' +� +/google/cloud/retail/v2/completion_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto#google/longrunning/operations.proto"� +CompleteQueryRequest6 +catalog ( B%�A�A +retail.googleapis.com/Catalog +query ( B�A + +visitor_id (  +language_codes (  + device_type (  +dataset (  +max_suggestions ($ +enable_attribute_suggestions ( +entity + ( "� +CompleteQueryResponseZ +completion_results ( 2>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult +attribution_token ( c +recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB^ +attribute_results ( 2C.google.cloud.retail.v2.CompleteQueryResponse.AttributeResultsEntry� +CompletionResult + +suggestion ( b + +attributes ( 2N.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.AttributesEntryZ +AttributesEntry +key ( 6 +value ( 2\'.google.cloud.retail.v2.CustomAttribute:8/ +RecentSearchResult + recent_search ( :& +AttributeResult + suggestions ( v +AttributeResultsEntry +key ( L +value ( 2=.google.cloud.retail.v2.CompleteQueryResponse.AttributeResult:82� +CompletionService� + CompleteQuery,.google.cloud.retail.v2.CompleteQueryRequest-.google.cloud.retail.v2.CompleteQueryResponse"E���?=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery� +ImportCompletionData3.google.cloud.retail.v2.ImportCompletionDataRequest.google.longrunning.Operation"��A\\ +3google.cloud.retail.v2.ImportCompletionDataResponse%google.cloud.retail.v2.ImportMetadata���I"D/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BCompletionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php new file mode 100644 index 0000000000000000000000000000000000000000..1c5526688448af68ce6a200a48e9f9900646ccc6 GIT binary patch literal 1465 zcma)6%}(1u5N;9(VvCTP0}7}}+Y*UTfi1Z=Q(EN*C{k&nH04lPvNrZ6*=pl;z3WI6 zblPtmd04yX``Tr%37@7r(2-^`nL;W$J)_>=}TB8vKWaEaBJ;xH0Q zc!J|WJRH&pdtwqYP9p>3b_aj#^zm`~tp5U_QpAx*Z9EcU#Hs0V5&LFD6=B?*TBaug z6$x&nga`#>LS;xiich=EbI9_EBF<@wby^A5>7`ib!a79A<3vi_(j4dtVfcmdfHMzE zMHKwim~>gd6eFB{2mMEQNVuecy`MXb15Ys#-~`YKJX+twnls6*g#zk5!nvAm(gG;o zISUkx0>Yg(m0rX`C892*+V+U5dE=6k`d;>ILdS-ykmI0_C^ z-3h^L9yt&6su42hgi-D{>6lEJh-~||s#}sp&>qdc+oMtceH^DHCKC}n{A$|DgSRYe zT*LS0eL4Xb)#sHZb?&0S%c%Ak`&2e`mXVsw&?Ymc*4Ac*CLsgs>B_X@wssa0C-QaD z%bz8*l9{ZskCvjC)9Ml~)Sp_veCS>(YP)VdgD7hhhIpJtfVnESi~IcrdRbfU`WDnQ%n77{OTJ3&_Ay*internalAddGeneratedFile( + ' +� +,google/cloud/retail/v2/control_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/retail/v2/control.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +CreateControlRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog5 +control ( 2.google.cloud.retail.v2.ControlB�A + +control_id ( B�A"~ +UpdateControlRequest5 +control ( 2.google.cloud.retail.v2.ControlB�A/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteControlRequest3 +name ( B%�A�A +retail.googleapis.com/Control"H +GetControlRequest3 +name ( B%�A�A +retail.googleapis.com/Control"� +ListControlsRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog + page_size (B�A + +page_token ( B�A +filter ( B�A"b +ListControlsResponse1 +controls ( 2.google.cloud.retail.v2.Control +next_page_token ( 2� +ControlService� + CreateControl,.google.cloud.retail.v2.CreateControlRequest.google.cloud.retail.v2.Control"d�Aparent,control,control_id���B"7/v2/{parent=projects/*/locations/*/catalogs/*}/controls:control� + DeleteControl,.google.cloud.retail.v2.DeleteControlRequest.google.protobuf.Empty"F�Aname���9*7/v2/{name=projects/*/locations/*/catalogs/*/controls/*}� + UpdateControl,.google.cloud.retail.v2.UpdateControlRequest.google.cloud.retail.v2.Control"f�Acontrol,update_mask���J2?/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}:control� + +GetControl).google.cloud.retail.v2.GetControlRequest.google.cloud.retail.v2.Control"F�Aname���97/v2/{name=projects/*/locations/*/catalogs/*/controls/*}� + ListControls+.google.cloud.retail.v2.ListControlsRequest,.google.cloud.retail.v2.ListControlsResponse"H�Aparent���97/v2/{parent=projects/*/locations/*/catalogs/*}/controlsI�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BControlServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..e619134ed1cb47ed4aae99b7b8b89417fe7ad0b7 GIT binary patch literal 2256 zcma)7U2hvj6s;X8&@oBq61AxXWiUZ;si98@w;O+PUYHm2cbBP zq{KbL^wbccpAm+K=cAOySgJ_DYm>?$&8VVLN`Hc*?BYq3N&*BoV<&kQE6Osg0S8%3 zn%mfN>ex-r;OM)!Na;|k0ZN4XnIa;K(r}N+SWvE*IE2t3NQf#m)PI`WZd*-9C%9>I z41ya;?qVf!GQB&-AYU%B9h0{vxG2BE8G>~<4WChxj=SU}I-^Vk!R4tgN#;QZ#9iUS zs8Wt23iqg@Q@;3)10IL3;J$J>8)KyZ{A=oj?u^H!uFt@L%~A=i%NF{xh8`~NJnycJ z^^Hq?>r(%$UBB-*B2K}(Ru5~|`p0g`SQk9dQpKTNz&#frc-+#roJ+gVcw0s99psAV z%9_@DiPn->4#%Jw&A_rO+o<45v(|p>&(6!AhWq_kg6#_E^IP6)v_7KAk2w+NS4gXd z^vi`vyEOS;6I@}ge}Pu7?&du}cbGZLFc);l1)0z{Ci~mnrMI1GouCh9P zKEHJx`b!0UWU(D6=yPZw5;~E9*MNYeQhDp>ofvXYSu&mYw`j!)VSCz!ReN(0wT)EX zDq5b<6dH*=SVN#yn@G_Ky%ws)f@Tym&0e<&wC3_tgDqWvk z?R^wIhn=<(R*Y=ufH1XfXXK-u;^VjK@}PIr*?;kS^={wHY2VCge_-acf8747SP0z& zFGe`b@PDfJEhq>KDhMnr2#(vMW#i|^TV-c|WGCX(0M%`k#xsVeiL@i`0$m{VFWYb7 AE&u=k literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php new file mode 100644 index 00000000000..6eae16d4295 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' +� +0google/cloud/retail/v2/generative_question.protogoogle.cloud.retail.v2"u + GenerativeQuestionsFeatureConfig +catalog ( B�A +feature_enabled (B�A +minimum_products (B�A"� +GenerativeQuestionConfig +catalog ( B�A +facet ( B�A +generated_question ( B�A +final_question ( B�A +example_values ( B�A + frequency (B�A$ +allowed_in_conversation (B�AB� +com.google.cloud.retail.v2BGenerativeQuestionProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php new file mode 100644 index 00000000000..a3d9d98c38e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php @@ -0,0 +1,59 @@ +internalAddGeneratedFile( + ' +� +8google/cloud/retail/v2/generative_question_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto0google/cloud/retail/v2/generative_question.proto google/protobuf/field_mask.proto"� +-UpdateGenerativeQuestionsFeatureConfigRequestj +#generative_questions_feature_config ( 28.google.cloud.retail.v2.GenerativeQuestionsFeatureConfigB�A4 + update_mask ( 2.google.protobuf.FieldMaskB�A"d +*GetGenerativeQuestionsFeatureConfigRequest6 +catalog ( B%�A�A +retail.googleapis.com/Catalog"] +$ListGenerativeQuestionConfigsRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog"~ +%ListGenerativeQuestionConfigsResponseU +generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfig"� +%UpdateGenerativeQuestionConfigRequestY +generative_question_config ( 20.google.cloud.retail.v2.GenerativeQuestionConfigB�A4 + update_mask ( 2.google.protobuf.FieldMaskB�A"� ++BatchUpdateGenerativeQuestionConfigsRequest5 +parent ( B%�A�A +retail.googleapis.com/CatalogT +requests ( 2=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequestB�A"� +,BatchUpdateGenerativeQuestionConfigsResponseZ +generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfigB�A2� +GenerativeQuestionService� +&UpdateGenerativeQuestionsFeatureConfigE.google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"��A/generative_questions_feature_config,update_mask����2m/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature:#generative_questions_feature_config� +#GetGenerativeQuestionsFeatureConfigB.google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"[�Acatalog���KI/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature� +ListGenerativeQuestionConfigs<.google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest=.google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse"S�Aparent���DB/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions� +UpdateGenerativeQuestionConfig=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest0.google.cloud.retail.v2.GenerativeQuestionConfig"��A&generative_question_config,update_mask���{2]/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion:generative_question_config� +$BatchUpdateGenerativeQuestionConfigsC.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequestD.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse"j�Aparent,requests���R"M/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BGenerativeQuestionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..854cd533e53961ea0d54dfd23d3e16414c7c3846 GIT binary patch literal 4253 zcmc&%OLN;)6t3+Ol4F{tN|QKgOB6TI^d%4GHFa9Rb{y9;&I8BIf-$3!+L9N_zK1chm!+hOz>@MwT0v5nF`owb$lc?4G(hkaY4Bu!~1wyOL5n2s_ z&^pX-0+^QJd1_4{l?4!d1uFizLEECH>iLF`|JJFeQ=9tKu;`cQ$`iF~SRO%uVcBkA zn?7}Hl`HJoCfT^FN=z=h?mFoD6E!kvpGN~D(W==#VYXqlwuomk>iQ1bN6|u|NBlU3 z{AA;9crAycU3Ej+SSSn``9$?uK+fK-su;e2*_*;{4)7xW)fy47qDx!blvte-IWmr^ z!wQ8{uTDY6sWwQM!ilv8GStHGbOO_#{Mtc)XC7gdV`BdUh&Uy}^Bu$cZ1U@4-6q94 z^o_ndxo*QXTL)Ngfj7BM^TZ{sEo`sRDx%sRen7+8Dt05nruw%IKQ$SVi+#Pc9kU{`*US|47@Az97?tBj1dbkn>yj?3?(COKz-3h zxh}6(y^l!?C00YISi+Ao6ACPa0?ajYyp;kk{1CdA^D)Lbq!A*|vyWh=YI+BPoRlR1 zYP*522aI}|gqqrzDW!fbCY53J`M;w2?6fItZOhI zxy7+{eoJNwMbr6fnzT#f*K0h*PcJD70Q&Kqn7&RsnO8U_w}4;d5pkB_XVQWNnD&jf zMYyQAULG&O)t>3;=xUGJJ-tI&CMAFdEWRv|(l8U7m)(K+eVM45ZBd(qF1!cRXcg~M z8G&?uH8OsnG_+7%SdwkRLfoF`05>6hn&}90Z5(EdAyFTJBKf?+n8Q5D>dJKh?zPKE zmwthH!YDnxRJwvm!ZxKgvbSeC5;5`lJS+2wk+dNVh0hk2fIpBGnDJ3%rr2?{C5YE|At8ZD%={K{4#c<<@A*5$Sgk?7o+&z8t0S$HqY4~5^zJhSH|a- zMR>U*rx;Ovzod)xkuJV9&c*Y05BYgv@&!j_e@lQe+zv_|7O+-11K~4`Gm|c-j_B5O z{{A?FVyII#LzaDCazzNisWY7)%RccaK*bWwwP{aB%3vpv1>Ej*{>^a~oSz0rNz*VT zFV6mzfa{}*LOFy?5D&tU4nG`s-5I=7mj#=k`Hx@9??}7)Z=DZ;&P2e5<*_A$?KK>1 z&g&Bgd-%SeaXiZ|i8coX3DRVQ6C{5(g!ME`knwYmD};Wq_6;2yudVx=OK*; zIAM6jq!c{v;-V8U5*~AIP7RC{@d6Md<-*<(lPCLi0u~2}*mE7*Bg)-ylIR}3SS=Eb zTqPd)d#nOQTsf9ynar77E2FyQqkdZp_-5MpCS87VR1q*>a>N5{&DqDk_@|yEq@Di~q z;mdQyboyi5DqV~2;kz`lqVMb{KFLex!*?iZ=Xy@Gf8$dJS8zE1-S%emfa?7t77Ta%6#d@S^6Ccth3kJm$UZP{_<=8(1*M79`Q(EF*1^e z$1*!4vL8@JZR*OyXgnr?Y}2XlxFk?yx!ILFT|;g)HRBFKLmCA(QRNAx6PHwMmqw#X zK$zvYm7{89N=L+11Ra29O-blmHj(#w^`~evvY0j46Uae>BL})b4i2i10BqL^L-{FZ zfEOU+pC1if$Cg88G5mMW2~Edym}9xlbBz75Jht4BAo8^BIPz@fP*3K7u4j{-2Xf5G zZSVOMbA2qQvGjQQnEF8T7zsSf9W+U32aeBZ&_h#Ioe-84jlbD>khtY^&RE`wV^q~s zK|YpQ5Rq5C%QDt03cN=mZcZ@Eo(2mlRr8&}u0z~Wog7+64h>ZGB&!pWWl)_YcXnpf z+|>*kbULNp*}Z1vG#nHFv!?!Hthk0xzH*YH*G8kP#=EG#ovbRnM)%>rB5c21cG6~S zqX=m#u{4#VYI!TcTE2sVjcXDswS0F8Ew%wBo*3OujD)yREESe!7aMH99lXE+l>xF-7d1(vQMo#Fv*0Cv$@+U`6V4VdPUa2=Rxr|7ufQReVkCerkD8h+i zB$z&ja3?uw7p{aPI65IZFNi*TGf_W=WIP4wA*|W~L0XgNSh|2LtJQMKk`_S8u9tfk zsL00_Pf#moLt(Ahu}?}D(LAZuUD%{PdUl>;-&4<|!ygHD^ARasN{w>TK3w-n;Lwp{ zn=E>zc&li$Ui~zUc1{LK@p=i=5Xda`ob&~(;}~L`GRb4@Y!X->RbdA;_c2x}T z3Un+Q9o|VrV^eSJOib4aSyZj z&<{!Qx)ZJ`jFXXHn291EMK%jfAx_?{Z`Bk=%Aq*@1kylN$6^1GgN+3_NzdTUI19`i zipWfsgqBu}&ydw>^Uc?Aw)~!)tKWd@JRx&Luy3$cM~Rzl9oCZ43dKpcV5{HK546sn z**9uN%iQnud##4HtF@ZNbJ7}I(mJ(L8HR923KAiQqp@+ zHuRd-S;mSyz1n^s!8z_BwJqkif5Q?k=vnD~xYKLtTDPe+Omw@9_+2Q?n>Dq5t=<-{ zZoo#Z-A?h@K|#6+H|AljPK?TLH{o*Dpi&t&n>C}huvV*ZQJi(Z#kAG|#E+J)cXdqc zXV_Sv8=hCA+c8?-8D>xKHuoDw-!#7O&0hn$?PJdEmN{pQp6~{r?zauCclxwn%&R}W ztR2G5*>;PqTOr z#1~=;%<6yVpp3*zL|g~q5F3ZlUhao#JhIb|AI3AG>57RV;+7dl?GGQN4}a!Y^p;W6 z+JEIY_r!jwh$TkR#eS(ARR2j22Fd1`uAaDizRYjMAXOD8RgGb)dQcs%VD5~5c0XH2 ZK8_cinternalAddGeneratedFile( + ' +� +*google/cloud/retail/v2/model_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"google/cloud/retail/v2/model.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +CreateModelRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog1 +model ( 2.google.cloud.retail.v2.ModelB�A +dry_run (B�A"} +UpdateModelRequest1 +model ( 2.google.cloud.retail.v2.ModelB�A4 + update_mask ( 2.google.protobuf.FieldMaskB�A"D +GetModelRequest1 +name ( B#�A�A +retail.googleapis.com/Model"F +PauseModelRequest1 +name ( B#�A�A +retail.googleapis.com/Model"\' +ResumeModelRequest +name ( B�A"{ +ListModelsRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog + page_size (B�A + +page_token ( B�A"G +DeleteModelRequest1 +name ( B#�A�A +retail.googleapis.com/Model"\\ +ListModelsResponse- +models ( 2.google.cloud.retail.v2.Model +next_page_token ( "E +TuneModelRequest1 +name ( B#�A�A +retail.googleapis.com/Model"$ +CreateModelMetadata +model ( "" +TuneModelMetadata +model ( " +TuneModelResponse2� + ModelService� + CreateModel*.google.cloud.retail.v2.CreateModelRequest.google.longrunning.Operation"��AJ +google.cloud.retail.v2.Model*google.cloud.retail.v2.CreateModelMetadata�A parent,model���>"5/v2/{parent=projects/*/locations/*/catalogs/*}/models:model� +GetModel\'.google.cloud.retail.v2.GetModelRequest.google.cloud.retail.v2.Model"D�Aname���75/v2/{name=projects/*/locations/*/catalogs/*/models/*}� + +PauseModel).google.cloud.retail.v2.PauseModelRequest.google.cloud.retail.v2.Model"M�Aname���@";/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause:*� + ResumeModel*.google.cloud.retail.v2.ResumeModelRequest.google.cloud.retail.v2.Model"N�Aname���A"internalAddGeneratedFile( + ' +� +/google/cloud/retail/v2/prediction_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/cloud/retail/v2/user_event.protogoogle/protobuf/struct.proto"� +PredictRequest + placement ( B�A: + +user_event ( 2!.google.cloud.retail.v2.UserEventB�A + page_size ( + +page_token ( B +filter (  + validate_only (B +params ( 22.google.cloud.retail.v2.PredictRequest.ParamsEntryB +labels ( 22.google.cloud.retail.v2.PredictRequest.LabelsEntryE + ParamsEntry +key ( % +value ( 2.google.protobuf.Value:8- + LabelsEntry +key (  +value ( :8"� +PredictResponseI +results ( 28.google.cloud.retail.v2.PredictResponse.PredictionResult +attribution_token (  + missing_ids (  + validate_only (� +PredictionResult + +id ( X +metadata ( 2F.google.cloud.retail.v2.PredictResponse.PredictionResult.MetadataEntryG + MetadataEntry +key ( % +value ( 2.google.protobuf.Value:82� +PredictionService� +Predict&.google.cloud.retail.v2.PredictRequest\'.google.cloud.retail.v2.PredictResponse"�����"F/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict:*ZO"J/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BPredictionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php new file mode 100644 index 0000000000000000000000000000000000000000..73c316f2f6b3e26e32a93a234465d77b4ff3c3c0 GIT binary patch literal 3387 zcmb_e&2HO95Uzgg*eltQnV-^5oG^}&I6y+R3fdG*(}I#EmxyBtisB-H0AWR~uHD{T3S1bs(H{!hJfbYg3}J zPvNe{Qi!kU*3A@R=m1b}X>=>a$WMwY?XF2XSQmGxJdl->`$^ZB?+>}8dt<1Nw79;= zz>*@Qx%fe5I^N&;YYm+P;qWG;e2NO>N1q0y$63^pmf0&*w)EIVY!4S+pV#@DkCb~T z$C#sT2-D5COcNzmbAOw8FyBCV-s02@*st=%CFMNI(t(;iU3h@2kIkU2jEaiXw3D5sFepMTwyf zWmEM6Al55)(>x`$HDf;lqdY*$so(D->_R=J>P6xEO2Pz%7dJ_VSLuG`7&{SBOjH_1 z&X79Jn7E(`o}Eh~;oaK_Zc$y0Q-DZP0p+5As+YmrDu{j=WHy4jeJp6U(^xES1qoZh z(SQzf(L8cVogX%K0u+m18eV{+}-3rp zxsrv3v(jqUo9+F2yOdMb&}!AJJ&u3ojbAda&7U)9TfU?5vjIRK(zu;3r_TA3G>xDm)FkH-v+^%;ZrN3t{ABag^ zuklG;Z;MG?Kd$_lY;@%epA7LZ#lOyO#vsEGD8qt~gRaJIWc>4NRz)V1!~Zjx f{bgWd-u>J2aq4b7hrcnlr;hBxG9IjFXok=~Dd;#! literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php new file mode 100644 index 00000000000..e080f2bcc9a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php @@ -0,0 +1,129 @@ +internalAddGeneratedFile( + ' +�/ +,google/cloud/retail/v2/product_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto$google/cloud/retail/v2/product.proto)google/cloud/retail/v2/purge_config.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� +CreateProductRequest4 +parent ( B$�A�A +retail.googleapis.com/Branch5 +product ( 2.google.cloud.retail.v2.ProductB�A + +product_id ( B�A"H +GetProductRequest3 +name ( B%�A�A +retail.googleapis.com/Product"� +UpdateProductRequest5 +product ( 2.google.cloud.retail.v2.ProductB�A/ + update_mask ( 2.google.protobuf.FieldMask + allow_missing ("K +DeleteProductRequest3 +name ( B%�A�A +retail.googleapis.com/Product"� +ListProductsRequest4 +parent ( B$�A�A +retail.googleapis.com/Branch + page_size ( + +page_token (  +filter ( - + read_mask ( 2.google.protobuf.FieldMask"b +ListProductsResponse1 +products ( 2.google.cloud.retail.v2.Product +next_page_token ( "� +SetInventoryRequest7 + inventory ( 2.google.cloud.retail.v2.ProductB�A, +set_mask ( 2.google.protobuf.FieldMask, +set_time ( 2.google.protobuf.Timestamp + allow_missing (" +SetInventoryMetadata" +SetInventoryResponse"� +AddFulfillmentPlacesRequest6 +product ( B%�A�A +retail.googleapis.com/Product +type ( B�A + place_ids ( B�A, +add_time ( 2.google.protobuf.Timestamp + allow_missing (" +AddFulfillmentPlacesMetadata" +AddFulfillmentPlacesResponse"� +AddLocalInventoriesRequest6 +product ( B%�A�A +retail.googleapis.com/ProductF +local_inventories ( 2&.google.cloud.retail.v2.LocalInventoryB�A, +add_mask ( 2.google.protobuf.FieldMask, +add_time ( 2.google.protobuf.Timestamp + allow_missing (" +AddLocalInventoriesMetadata" +AddLocalInventoriesResponse"� +RemoveLocalInventoriesRequest6 +product ( B%�A�A +retail.googleapis.com/Product + place_ids ( B�A/ + remove_time ( 2.google.protobuf.Timestamp + allow_missing (" +RemoveLocalInventoriesMetadata" +RemoveLocalInventoriesResponse"� +RemoveFulfillmentPlacesRequest6 +product ( B%�A�A +retail.googleapis.com/Product +type ( B�A + place_ids ( B�A/ + remove_time ( 2.google.protobuf.Timestamp + allow_missing ("! +RemoveFulfillmentPlacesMetadata"! +RemoveFulfillmentPlacesResponse2� +ProductService� + CreateProduct,.google.cloud.retail.v2.CreateProductRequest.google.cloud.retail.v2.Product"o�Aparent,product,product_id���M"B/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:product� + +GetProduct).google.cloud.retail.v2.GetProductRequest.google.cloud.retail.v2.Product"R�Aname���EC/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}� + ListProducts+.google.cloud.retail.v2.ListProductsRequest,.google.cloud.retail.v2.ListProductsResponse"S�Aparent���DB/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products� + UpdateProduct,.google.cloud.retail.v2.UpdateProductRequest.google.cloud.retail.v2.Product"r�Aproduct,update_mask���V2K/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:product� + DeleteProduct,.google.cloud.retail.v2.DeleteProductRequest.google.protobuf.Empty"R�Aname���E*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}� + PurgeProducts,.google.cloud.retail.v2.PurgeProductsRequest.google.longrunning.Operation"��A\\ +,google.cloud.retail.v2.PurgeProductsResponse,google.cloud.retail.v2.PurgeProductsMetadata���M"H/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge:*� +ImportProducts-.google.cloud.retail.v2.ImportProductsRequest.google.longrunning.Operation"��AV +-google.cloud.retail.v2.ImportProductsResponse%google.cloud.retail.v2.ImportMetadata���N"I/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import:*� + SetInventory+.google.cloud.retail.v2.SetInventoryRequest.google.longrunning.Operation"��AZ ++google.cloud.retail.v2.SetInventoryResponse+google.cloud.retail.v2.SetInventoryMetadata�Ainventory,set_mask���_"Z/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory:*� +AddFulfillmentPlaces3.google.cloud.retail.v2.AddFulfillmentPlacesRequest.google.longrunning.Operation"��Aj +3google.cloud.retail.v2.AddFulfillmentPlacesResponse3google.cloud.retail.v2.AddFulfillmentPlacesMetadata�Aproduct���`"[/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces:*� +RemoveFulfillmentPlaces6.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.google.longrunning.Operation"��Ap +6google.cloud.retail.v2.RemoveFulfillmentPlacesResponse6google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata�Aproduct���c"^/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces:*� +AddLocalInventories2.google.cloud.retail.v2.AddLocalInventoriesRequest.google.longrunning.Operation"��Ah +2google.cloud.retail.v2.AddLocalInventoriesResponse2google.cloud.retail.v2.AddLocalInventoriesMetadata�Aproduct���_"Z/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories:*� +RemoveLocalInventories5.google.cloud.retail.v2.RemoveLocalInventoriesRequest.google.longrunning.Operation"��An +5google.cloud.retail.v2.RemoveLocalInventoriesResponse5google.cloud.retail.v2.RemoveLocalInventoriesMetadata�Aproduct���b"]/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BProductServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php new file mode 100644 index 00000000000..223553cd345 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +� +&google/cloud/retail/v2/promotion.protogoogle.cloud.retail.v2"! + Promotion + promotion_id ( B� +com.google.cloud.retail.v2BPromotionProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php new file mode 100644 index 00000000000..aadd07c3e56 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php @@ -0,0 +1,52 @@ +internalAddGeneratedFile( + ' +� +)google/cloud/retail/v2/purge_config.protogoogle.cloud.retail.v2google/api/resource.protogoogle/protobuf/timestamp.proto" + PurgeMetadata"� +PurgeProductsMetadata/ + create_time ( 2.google.protobuf.Timestamp/ + update_time ( 2.google.protobuf.Timestamp + success_count ( + failure_count ("p +PurgeProductsRequest4 +parent ( B$�A�A +retail.googleapis.com/Branch +filter ( B�A +force ("f +PurgeProductsResponse + purge_count (8 + purge_sample ( B"�A +retail.googleapis.com/Product"s +PurgeUserEventsRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog +filter ( B�A +force ("6 +PurgeUserEventsResponse +purged_events_count (B� +com.google.cloud.retail.v2BPurgeConfigProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php new file mode 100644 index 0000000000000000000000000000000000000000..4af2d655f344f299a75149ce9cf251fda8337465 GIT binary patch literal 8443 zcmcIp&2JmW6*s95laID6ul2FsIPr##6FG^=gbwmS#|cP^mWkMsBFb)>uw5*dLu%{g z?sj)6TQPL$sfVIKP#{5jYI`ZrTMtG5hxFE7dMwZ$iXM6{l0*CE&F=C;q)er$FBW%Z ze)Hyi{N8&r@4oNuxo}0@U^esgfVI@-fg0>F)%BdfF&s;6_S$XcsfN>aO^bOsRbAgw zH@9}x>UwSWd0gr{J9z763v|=U?-%ku(>-HP^O?7A8Z1Y+0Jh#` zzN;Hd-PkVQ!^tf@&>I^B(Wr2U#tuO=9u#f@7?$q)YMr3!0tudgivQeR(=rX!5A*>4 zd%^TI(>4QBx6DuRFt^mUZutxmj?QiOY$GroTjdM3Y=f;`Qw1iU`-1D>;cuytOxs)^ zsEbC;4wz@_R%4y{hG)8g<89;AVzI-5Sd0A2+O=?74rjL2H6dfMctprsYT)(Q;O?r5 z3ha6IO_G}f9L9e&#%QeMnvIfeJ6sEn?H7yvGxZ@REv#53vxAeZxotA5Rc3qozUg=; zTe`zSkC|G?5r1e@oNm{#r{8sSJ=(I>Gfr^g*!Xnpd%FK{`px6Dbu{v%P08D?zh{QN zRcf_jSGtW+w-y_pyTVKG?|0yp6NHT%M@$^xXwW;jBNGX*s#BpTIqE<(uuBLTC!XjEw%R#9v&ou)_PX+jV#SEg`%64t16 z54iMqPDu|yIf^(U;A_)@Mgk-5^Kj8)F4`GA1Q}+ZY0)-jOP=9MD_?-~(YN?8*`FwI zR*?1%`(cmyfwTf?*FxIwB9hR4dFHRBr1Uz>H$B}p_Jj?}&wo{V4laeBDm02t>gUjj z@@1OHt%jK1fe=7i1=u%z6X{q(p=L=ag1!Oi9%diR3vEZ9BgIZM(tVs*!+FwqlvD38 z&Brt%pTKBLZ{3*;wRYe=oR+k9ai*P#nYtpoIJ)6n{8 z@-ps_DZDuy*t%FBW0sS0LaG2X9mf~a$!7^~O5w_UT`1fVnM`AkUETIERncMP1%i8f zI`KZ_Mz2Nyg!>F!*w;N%w*$>{EUV{g57~h)pGOs@(J{`E-3%;mI*w;DUtXnwDrCaq zr0cYpd>MsUC`=5GVTFrd_i&x`9awUi=Q~&vn4ePq6^BykQ1484sO@0{I#mhgExpMs zU(S**ygnV&U0PGM1Mfik9xVGVvnyOTW z&acrHQ#ukS;msHz23J0tfpqNr$kJ&MNa#|;See3<_%VhE&kxvv;5sBO%j}u~QQe$$ z36|Jn!|JtIE2IeFy))#bmtmFJdK1qYg|+J-%VFpc$EB3NB_KsRA-=Q-Gm)5Su^F;o zlmL9(kaNmJ_KO%_x(Mfy>@i~+*b#`7b|oHKJ8^TUFue6_A=YhC>@kz-2vJOPWNyd>3NmLivD z%Z0+t=^SemCC7s}`xeYnFfYO4y{+}Cc7Lho z`aWc+c*APp5mr^a*31-Y(}mF_xpKV9D-odbmn1;{r?d>2fIY@~Tx>_}0oK1hob#E5 z`4inQ9OB|-3LkxIlH}^)212kqr1K99c^iRYLvDvP0}^rMY#@{!NMmqkO)WmyJGU~ zMD`PaffDW+Sglt}JC!@y81i35g4o$wzhBwa!bxEi;K1!trMg>P9~wxOWmw@=*3q&n z`x}YdlwXML;Pn^Y)G%osPDhL;On76`Ifoab!-P1$|Qr4?ef>7naTblsy zj<8(g?G6vJIT4anG@>0aTCvd*85@g(sKet0yl96+_Qo(qo({BuK4~7o(!53{h=IbN z+A-c)WeQKNk%g*q!-<0Wv?Vy>v6jheTdn7r{kALeAf%N5djioVw&Hw7<;DOLFN-ZpW*cIHbJDI_c_vPB(oU}tMq|jIV z6AzKQ7jF4L>`2#uzG$%?!g3@>*n83yj*nLje7n2fWV>*i9qMK2awpsj0}Ne+dQC0t z4Nv1XY2_nOj*)SQ4X+K}c4Z1mBp@1sF4=N)I=bXUrc`!7o+!=`?$u%3l_R)x5YE2J zPm?ewm}dxK1Li~BiALqE2x8>kvQK@&R0JiOEZPIp_}QpiB32~dNGV?=0BEk5buJP( zO7m}={5B7Z18nE|4miVaj(F=r2chex1bxyUho3khCdy}{%O0Ai)J98cA^>cL;;L6L zFqbqX;dKYr#CBW@BbD(0;Msac`OhpU$He-WN=t+y>Wuew998Tk3NQ~Oy(M@uzQPi{ zV5YD$rF|xglf#>CYL;{h@44~bj4Be$Fmc(4viL#N?WQFQ&ilPihib>L6pJG5!~b2H zdIT+sFsX~FE*3DlzvBk{znopsvDO}u;F#i!o9(1`#7YwuM^!F;+j~@CX+m%V&!)UEF;GQ<5k5fUOje9yd)G)q46O^CM>UgRk{jS z#_ur%Dt!PK`x1_VQP55gR$hh+17O|oA+~^RQFw7rdmBvpIsx+{B}!MH7HAZ+%EU4! z&aA}V*w#wg&pTzG2w=g6901G=m|8m}P@cI^Mfd7qu>6X*sf5vn1 z$6?W@iny3~`Qy!O?ZjCApy`J3l-if2<*~N;Qz^F>1g>Aq=N~bk6$O} zcdEOk+TGtKS2pNfJy+rH>bV`^#}5i$MgxuT#XWj*$2a$XCNGLb#UiaL7R9n+5ywi8 zo*oTSJ+|JH@UO!GD?W(~de}GTlhCk-`Myi~`6vA!hs}9}3Y;4+#qXi7il_5|m-dOT O>@-unh9ANqz<&V)VZ$u| literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..77ff7ac9d3ee6060672264dcddcb7498ef5c9abc GIT binary patch literal 2231 zcmb7F-EJF26vj>)(n*shOVT=_z|cghD_||T5)vB%va?QPQ4-5`gIZZyt#`-Hz1!re=oopLR#W!BfIp;g)eCO}m@8gRY?co!`i0~B& zaes={1;Mf4iU&Nx{qbNx1P=HprV$Y~#_kzDJ?r9z+w6W0rjn0EKpZ^ed>D~R5b<$X z5k&bks!XaCNyLP*p%-vAphH{ZBEn*`|(d^6QvLWxK}yIPuT{YY2U_&$-OI`%t^vMb>~uFk87$ZfV(lv?WML1qt$& zNK5z7$La-t0d&YI<7_&TIS4CL;*2a*x~-M=(fyEnj4Kb;4G$u4$u-5_&@O@2G)`bvdLd!ch)Pu|fpo?C32ns?Cx=}} zU&40f%+npP4bs)>H;cnc`a0`?Rvtk&fs589kH#7?NmQ0T0&3Q)`wJmc?IgAO^6Od= zrr<${*77-jigw-Rd86HFcAt6OXRU_!^t97z95s)d4R_-MtAw`NPoFfrdacuNy}9Z} z5xR2Qt#xaj+Xnm7E21Um_rjanZw0iM?gP{HunMFNLte>`>T|elKSPVk%B%EiR*5(i z0H}kv>~mIuCqLptcuT)#*_AZK1c6=)^Q$?l|5HG_;Bf&%bt@N%zE!Ql^Qzfp*{DLm zL!Mn`$N`SCNh|IjWFLPOm)nhQt@-5d;@uN{jcvWE?Y6$g_IdT+Owdd3batrWQokwg q7$e8gR*qxL9Ot~+Uj|YXfBbO1r@u63@5+^2cpxnnalL+C%68Qetx literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php new file mode 100644 index 00000000000..9526ad57524 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php @@ -0,0 +1,76 @@ +internalAddGeneratedFile( + ' +� +3google/cloud/retail/v2/serving_config_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto+google/cloud/retail/v2/serving_config.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +CreateServingConfigRequest5 +parent ( B%�A�A +retail.googleapis.com/CatalogB +serving_config ( 2%.google.cloud.retail.v2.ServingConfigB�A +serving_config_id ( B�A"� +UpdateServingConfigRequestB +serving_config ( 2%.google.cloud.retail.v2.ServingConfigB�A/ + update_mask ( 2.google.protobuf.FieldMask"W +DeleteServingConfigRequest9 +name ( B+�A�A% +#retail.googleapis.com/ServingConfig"T +GetServingConfigRequest9 +name ( B+�A�A% +#retail.googleapis.com/ServingConfig"� +ListServingConfigsRequest5 +parent ( B%�A�A +retail.googleapis.com/Catalog + page_size (B�A + +page_token ( B�A"u +ListServingConfigsResponse> +serving_configs ( 2%.google.cloud.retail.v2.ServingConfig +next_page_token ( "q +AddControlRequestC +serving_config ( B+�A�A% +#retail.googleapis.com/ServingConfig + +control_id ( B�A"t +RemoveControlRequestC +serving_config ( B+�A�A% +#retail.googleapis.com/ServingConfig + +control_id ( B�A2� +ServingConfigService� +CreateServingConfig2.google.cloud.retail.v2.CreateServingConfigRequest%.google.cloud.retail.v2.ServingConfig"�A\'parent,serving_config,serving_config_id���O"=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs:serving_config� +DeleteServingConfig2.google.cloud.retail.v2.DeleteServingConfigRequest.google.protobuf.Empty"L�Aname���?*=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}� +UpdateServingConfig2.google.cloud.retail.v2.UpdateServingConfigRequest%.google.cloud.retail.v2.ServingConfig"��Aserving_config,update_mask���^2L/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}:serving_config� +GetServingConfig/.google.cloud.retail.v2.GetServingConfigRequest%.google.cloud.retail.v2.ServingConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}� +ListServingConfigs1.google.cloud.retail.v2.ListServingConfigsRequest2.google.cloud.retail.v2.ListServingConfigsResponse"N�Aparent���?=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs� + +AddControl).google.cloud.retail.v2.AddControlRequest%.google.cloud.retail.v2.ServingConfig"n�Aserving_config���W"R/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl:*� + RemoveControl,.google.cloud.retail.v2.RemoveControlRequest%.google.cloud.retail.v2.ServingConfig"q�Aserving_config���Z"U/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.retail.v2BServingConfigServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php new file mode 100644 index 00000000000..3bab4092058 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php @@ -0,0 +1,77 @@ +internalAddGeneratedFile( + ' +� +\'google/cloud/retail/v2/user_event.protogoogle.cloud.retail.v2#google/cloud/retail/v2/common.proto$google/cloud/retail/v2/product.protogoogle/protobuf/timestamp.protogoogle/protobuf/wrappers.proto"� + UserEvent + +event_type ( B�A + +visitor_id ( B�A + +session_id ( . + +event_time ( 2.google.protobuf.Timestamp +experiment_ids (  +attribution_token ( > +product_details ( 2%.google.cloud.retail.v2.ProductDetailC +completion_detail ( 2(.google.cloud.retail.v2.CompletionDetailE + +attributes ( 21.google.cloud.retail.v2.UserEvent.AttributesEntry +cart_id ( I +purchase_transaction ( 2+.google.cloud.retail.v2.PurchaseTransaction + search_query + (  +filter (  +order_by (  +offset ( +page_categories ( 3 + user_info ( 2 .google.cloud.retail.v2.UserInfo +uri (  + referrer_uri (  + page_view_id (  +entity ( Z +AttributesEntry +key ( 6 +value ( 2\'.google.cloud.retail.v2.CustomAttribute:8"u + ProductDetail5 +product ( 2.google.cloud.retail.v2.ProductB�A- +quantity ( 2.google.protobuf.Int32Value"p +CompletionDetail$ +completion_attribution_token (  +selected_suggestion (  +selected_position ("n +PurchaseTransaction + +id (  +revenue (B�A +tax ( +cost ( + currency_code ( B�AB� +com.google.cloud.retail.v2BUserEventProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php new file mode 100644 index 0000000000000000000000000000000000000000..f297355c86508920494c66f8ef86b3eebc866335 GIT binary patch literal 3520 zcmb_fO>g5w7~Z5%ZKv98*1O$iBO$!rqJD_lQsCs$UGm{}gLa!JX$wM@EXSFoQ@I{9 zwo{c=FMHs^ksp8rhy#CsBb=PVf2fK1N>h~d$9enH~7ZO#L>rHvLxhEU-#@<8f8sLaH zP?rZ74_v4@E{=K{fuW6DZCKW#01^uhp%+?oG(-+md29eY`xpkk?Lc{_Reeq!dUj}= zJ3Ne8V`0oT4`UvbHvw>5I|$@`8pL4HIwBZ&0c85;M_m^=auC`f{kMz)3wbC+wu`=` zd)kuwwi`eiWZJeLc}|G1Co_kp=fKr9S;Sk$svj0`0BDud5nm+$#Js)XX(higtUr} z%!=n>#sc;NT_5df6e7#9<|0b#^?bGwbbD2JXb%x4*K>UuhJF|KPOsJ1%c^G9Qx9`V-tNQ9;+Lx zCpLI6W^fowmZ(5kG(jKvEqYxvMq;aJGNcRu=QC=FPfSw8MdRM76*M48@i+X zXgJM}FjCII;->_KFwJ`#ei6YSlXxaAYrjgT8!BywSKmH~Ns z<8o+AQ_y0}^I#?-h_5#%(H}4jif_?KGg1NEB=(7Q6kxCTHj7=o0~TmrhL8kQ!hBKX zUy85|k1+C5fI))rQjQ>48gXP1?rH@NWu6muyIjvAEMu7wk;0(EVkrY~F9kIAT{2g| zqy3K2wu}Q~ch71YpEMi0R;Si%8P@)8r)AU{+YO^$xFOvEx7eIf7p9#;jxxKjzkBgx zUU>|P)5rp!7IP>mphWl%Vb2=vI-rt`V&%*zrD^}I5DMHYf|aF{Qb{w^3RngtRZ+Iq`pPFfFml!KwH;b?1(}}$8==7ctAg&@!o-7 z_JPjjtdE@t>4zLBOv+i(vanBDCg|@a4zyIM>`toEJ4tD9z%{Az`haQg#7>&@RURzx z+ajetkkn++iMpvy7$zX!N$khUi<*{y<@?-uAG;!^@DPEmcM^KSV{Y@_eJAB_D;xrBXCR6%b$TW0R96wC$=d7 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php new file mode 100644 index 00000000000..ca8eb927743 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php @@ -0,0 +1,121 @@ +google.cloud.retail.v2.AddCatalogAttributeRequest + */ +class AddCatalogAttributeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $attributes_config = ''; + /** + * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] + * to add. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog_attribute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attributes_config + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * @type \Google\Cloud\Retail\V2\CatalogAttribute $catalog_attribute + * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] + * to add. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAttributesConfig() + { + return $this->attributes_config; + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAttributesConfig($var) + { + GPBUtil::checkString($var, True); + $this->attributes_config = $var; + + return $this; + } + + /** + * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] + * to add. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\CatalogAttribute|null + */ + public function getCatalogAttribute() + { + return $this->catalog_attribute; + } + + public function hasCatalogAttribute() + { + return isset($this->catalog_attribute); + } + + public function clearCatalogAttribute() + { + unset($this->catalog_attribute); + } + + /** + * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] + * to add. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\CatalogAttribute $var + * @return $this + */ + public function setCatalogAttribute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute::class); + $this->catalog_attribute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php new file mode 100644 index 00000000000..fd9a08869a5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php @@ -0,0 +1,124 @@ +google.cloud.retail.v2.AddControlRequest + */ +class AddControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $serving_config = ''; + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config - if id is not found a NOT_FOUND error is returned. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control_id = ''; + + /** + * @param string $servingConfig Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\AddControlRequest + * + * @experimental + */ + public static function build(string $servingConfig): self + { + return (new self()) + ->setServingConfig($servingConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serving_config + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * @type string $control_id + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config - if id is not found a NOT_FOUND error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServingConfig() + { + return $this->serving_config; + } + + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->serving_config = $var; + + return $this; + } + + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config - if id is not found a NOT_FOUND error is returned. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getControlId() + { + return $this->control_id; + } + + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config - if id is not found a NOT_FOUND error is returned. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setControlId($var) + { + GPBUtil::checkString($var, True); + $this->control_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php new file mode 100644 index 00000000000..7a61c9633e1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.AddFulfillmentPlacesMetadata + */ +class AddFulfillmentPlacesMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php new file mode 100644 index 00000000000..6d7ec88e6f0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php @@ -0,0 +1,391 @@ +google.cloud.retail.v2.AddFulfillmentPlacesRequest + */ +class AddFulfillmentPlacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $product = ''; + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = ''; + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery" to be added for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate + * IDs will be automatically ignored. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * If the total number of place IDs exceeds 2000 for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after + * adding, then the update will be rejected. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $place_ids; + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; + */ + protected $add_time = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + */ + protected $allow_missing = false; + + /** + * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\AddFulfillmentPlacesRequest + * + * @experimental + */ + public static function build(string $product): self + { + return (new self()) + ->setProduct($product); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $product + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @type string $type + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids + * Required. The IDs for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery" to be added for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate + * IDs will be automatically ignored. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * If the total number of place IDs exceeds 2000 for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after + * adding, then the update will be rejected. + * @type \Google\Protobuf\Timestamp $add_time + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProduct() + { + return $this->product; + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkString($var, True); + $this->product = $var; + + return $this; + } + + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery" to be added for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate + * IDs will be automatically ignored. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * If the total number of place IDs exceeds 2000 for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after + * adding, then the update will be rejected. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPlaceIds() + { + return $this->place_ids; + } + + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery" to be added for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate + * IDs will be automatically ignored. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * If the total number of place IDs exceeds 2000 for this + * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after + * adding, then the update will be rejected. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPlaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->place_ids = $arr; + + return $this; + } + + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAddTime() + { + return $this->add_time; + } + + public function hasAddTime() + { + return isset($this->add_time); + } + + public function clearAddTime() + { + unset($this->add_time); + } + + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAddTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->add_time = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php new file mode 100644 index 00000000000..5e6c00aad40 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.AddFulfillmentPlacesResponse + */ +class AddFulfillmentPlacesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php new file mode 100644 index 00000000000..e72fd7926a8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.AddLocalInventoriesMetadata + */ +class AddLocalInventoriesMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php new file mode 100644 index 00000000000..15b6d1dbb6f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php @@ -0,0 +1,337 @@ +google.cloud.retail.v2.AddLocalInventoriesRequest + */ +class AddLocalInventoriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $product = ''; + /** + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $local_inventories; + /** + * Indicates which inventory fields in the provided list of + * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; + */ + protected $add_mask = null; + /** + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; + */ + protected $add_time = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is + * created. If set to false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 6; + */ + protected $allow_missing = false; + + /** + * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\AddLocalInventoriesRequest + * + * @experimental + */ + public static function build(string $product): self + { + return (new self()) + ->setProduct($product); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $product + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @type array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $local_inventories + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * @type \Google\Protobuf\FieldMask $add_mask + * Indicates which inventory fields in the provided list of + * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * @type \Google\Protobuf\Timestamp $add_time + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is + * created. If set to false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProduct() + { + return $this->product; + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkString($var, True); + $this->product = $var; + + return $this; + } + + /** + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocalInventories() + { + return $this->local_inventories; + } + + /** + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocalInventories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\LocalInventory::class); + $this->local_inventories = $arr; + + return $this; + } + + /** + * Indicates which inventory fields in the provided list of + * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; + * @return \Google\Protobuf\FieldMask|null + */ + public function getAddMask() + { + return $this->add_mask; + } + + public function hasAddMask() + { + return isset($this->add_mask); + } + + public function clearAddMask() + { + unset($this->add_mask); + } + + /** + * Indicates which inventory fields in the provided list of + * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setAddMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->add_mask = $var; + + return $this; + } + + /** + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAddTime() + { + return $this->add_time; + } + + public function hasAddTime() + { + return isset($this->add_time); + } + + public function clearAddTime() + { + unset($this->add_time); + } + + /** + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAddTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->add_time = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is + * created. If set to false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 6; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is + * created. If set to false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 6; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php new file mode 100644 index 00000000000..368f468499c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php @@ -0,0 +1,38 @@ +google.cloud.retail.v2.AddLocalInventoriesResponse + */ +class AddLocalInventoriesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php new file mode 100644 index 00000000000..e5ce089effe --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.AttributeConfigLevel + */ +class AttributeConfigLevel +{ + /** + * Value used when unset. In this case, server behavior defaults to + * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. + * + * Generated from protobuf enum ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + */ + const ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + /** + * At this level, we honor the attribute configurations set in + * [Product.attributes][google.cloud.retail.v2.Product.attributes]. + * + * Generated from protobuf enum PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + */ + const PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + /** + * At this level, we honor the attribute configurations set in + * [CatalogConfig.attribute_configs][]. + * + * Generated from protobuf enum CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + */ + const CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + + private static $valueToName = [ + self::ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED => 'ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED', + self::PRODUCT_LEVEL_ATTRIBUTE_CONFIG => 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', + self::CATALOG_LEVEL_ATTRIBUTE_CONFIG => 'CATALOG_LEVEL_ATTRIBUTE_CONFIG', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php new file mode 100644 index 00000000000..f76fa7a1e2f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php @@ -0,0 +1,171 @@ +google.cloud.retail.v2.AttributesConfig + */ +class AttributesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The fully qualified resource name of the attribute + * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Enable attribute(s) config at catalog level. + * For example, indexable, dynamic_facetable, or searchable for each + * attribute. + * The key is catalog attribute's name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * The maximum number of catalog attributes allowed in a request is 1000. + * + * Generated from protobuf field map catalog_attributes = 2; + */ + private $catalog_attributes; + /** + * Output only. The + * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used + * for this catalog. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attribute_config_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Immutable. The fully qualified resource name of the attribute + * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + * @type array|\Google\Protobuf\Internal\MapField $catalog_attributes + * Enable attribute(s) config at catalog level. + * For example, indexable, dynamic_facetable, or searchable for each + * attribute. + * The key is catalog attribute's name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * The maximum number of catalog attributes allowed in a request is 1000. + * @type int $attribute_config_level + * Output only. The + * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used + * for this catalog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The fully qualified resource name of the attribute + * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Immutable. The fully qualified resource name of the attribute + * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enable attribute(s) config at catalog level. + * For example, indexable, dynamic_facetable, or searchable for each + * attribute. + * The key is catalog attribute's name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * The maximum number of catalog attributes allowed in a request is 1000. + * + * Generated from protobuf field map catalog_attributes = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCatalogAttributes() + { + return $this->catalog_attributes; + } + + /** + * Enable attribute(s) config at catalog level. + * For example, indexable, dynamic_facetable, or searchable for each + * attribute. + * The key is catalog attribute's name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * The maximum number of catalog attributes allowed in a request is 1000. + * + * Generated from protobuf field map catalog_attributes = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCatalogAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute::class); + $this->catalog_attributes = $arr; + + return $this; + } + + /** + * Output only. The + * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used + * for this catalog. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getAttributeConfigLevel() + { + return $this->attribute_config_level; + } + + /** + * Output only. The + * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used + * for this catalog. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setAttributeConfigLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\AttributeConfigLevel::class); + $this->attribute_config_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php new file mode 100644 index 00000000000..d718f9622a0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php @@ -0,0 +1,178 @@ +google.cloud.retail.v2.Audience + */ +class Audience extends \Google\Protobuf\Internal\Message +{ + /** + * The genders of the audience. Strongly encouraged to use the standard + * values: "male", "female", "unisex". + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [gender](https://support.google.com/merchants/answer/6324479). Schema.org + * property + * [Product.audience.suggestedGender](https://schema.org/suggestedGender). + * + * Generated from protobuf field repeated string genders = 1; + */ + private $genders; + /** + * The age groups of the audience. Strongly encouraged to use the standard + * values: "newborn" (up to 3 months old), "infant" (3–12 months old), + * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + * teens or older). + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [age_group](https://support.google.com/merchants/answer/6324463). + * Schema.org property + * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + * + * Generated from protobuf field repeated string age_groups = 2; + */ + private $age_groups; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $genders + * The genders of the audience. Strongly encouraged to use the standard + * values: "male", "female", "unisex". + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [gender](https://support.google.com/merchants/answer/6324479). Schema.org + * property + * [Product.audience.suggestedGender](https://schema.org/suggestedGender). + * @type array|\Google\Protobuf\Internal\RepeatedField $age_groups + * The age groups of the audience. Strongly encouraged to use the standard + * values: "newborn" (up to 3 months old), "infant" (3–12 months old), + * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + * teens or older). + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [age_group](https://support.google.com/merchants/answer/6324463). + * Schema.org property + * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The genders of the audience. Strongly encouraged to use the standard + * values: "male", "female", "unisex". + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [gender](https://support.google.com/merchants/answer/6324479). Schema.org + * property + * [Product.audience.suggestedGender](https://schema.org/suggestedGender). + * + * Generated from protobuf field repeated string genders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenders() + { + return $this->genders; + } + + /** + * The genders of the audience. Strongly encouraged to use the standard + * values: "male", "female", "unisex". + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [gender](https://support.google.com/merchants/answer/6324479). Schema.org + * property + * [Product.audience.suggestedGender](https://schema.org/suggestedGender). + * + * Generated from protobuf field repeated string genders = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->genders = $arr; + + return $this; + } + + /** + * The age groups of the audience. Strongly encouraged to use the standard + * values: "newborn" (up to 3 months old), "infant" (3–12 months old), + * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + * teens or older). + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [age_group](https://support.google.com/merchants/answer/6324463). + * Schema.org property + * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + * + * Generated from protobuf field repeated string age_groups = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAgeGroups() + { + return $this->age_groups; + } + + /** + * The age groups of the audience. Strongly encouraged to use the standard + * values: "newborn" (up to 3 months old), "infant" (3–12 months old), + * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + * teens or older). + * At most 5 values are allowed. Each value must be a UTF-8 encoded string + * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Google Merchant Center property + * [age_group](https://support.google.com/merchants/answer/6324463). + * Schema.org property + * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + * + * Generated from protobuf field repeated string age_groups = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAgeGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->age_groups = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php new file mode 100644 index 00000000000..a45ef2bbec3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php @@ -0,0 +1,121 @@ +google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest + */ +class BatchUpdateGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requests; + + /** + * @param string $parent Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @param \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest[] $requests Required. The updates question configs. + * + * @return \Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsRequest + * + * @experimental + */ + public static function build(string $parent, array $requests): self + { + return (new self()) + ->setParent($parent) + ->setRequests($requests); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * Required. The updates question configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequests() + { + return $this->requests; + } + + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest::class); + $this->requests = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php new file mode 100644 index 00000000000..3fe2b844ef8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse + */ +class BatchUpdateGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $generative_question_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs + * Optional. The updates question configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerativeQuestionConfigs() + { + return $this->generative_question_configs; + } + + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerativeQuestionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php new file mode 100644 index 00000000000..3027d965076 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php @@ -0,0 +1,101 @@ +google.cloud.retail.v2.BigQueryOutputResult + */ +class BigQueryOutputResult extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1; + */ + protected $dataset_id = ''; + /** + * The ID of a BigQuery Table. + * + * Generated from protobuf field string table_id = 2; + */ + protected $table_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * The ID of a BigQuery Dataset. + * @type string $table_id + * The ID of a BigQuery Table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * The ID of a BigQuery Table. + * + * Generated from protobuf field string table_id = 2; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * The ID of a BigQuery Table. + * + * Generated from protobuf field string table_id = 2; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php new file mode 100644 index 00000000000..d2a7b935faa --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php @@ -0,0 +1,351 @@ +google.cloud.retail.v2.BigQuerySource + */ +class BigQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * The project ID (can be project # or ID) that the BigQuery source is in with + * a length limit of 128 characters. If not specified, inherits the project + * ID from the parent request. + * + * Generated from protobuf field string project_id = 5; + */ + protected $project_id = ''; + /** + * Required. The BigQuery data set to copy the data from with a length limit + * of 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The BigQuery table to copy the data from with a length limit of + * 1,024 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id = ''; + /** + * Intermediate Cloud Storage directory used for the import with a length + * limit of 2,000 characters. Can be specified if one wants to have the + * BigQuery export to a specific Cloud Storage directory. + * + * Generated from protobuf field string gcs_staging_dir = 3; + */ + protected $gcs_staging_dir = ''; + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: + * The schema is available here: + * https://support.google.com/analytics/answer/3437719. + * * `user_event_ga4`: + * The schema is available here: + * https://support.google.com/analytics/answer/7029846. + * Supported values for autocomplete imports: + * * `suggestions` (default): One JSON completion suggestion per line. + * * `denylist`: One JSON deny suggestion per line. + * * `allowlist`: One JSON allow suggestion per line. + * + * Generated from protobuf field string data_schema = 4; + */ + protected $data_schema = ''; + protected $partition; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\Date $partition_date + * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + * Only supported in + * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. + * @type string $project_id + * The project ID (can be project # or ID) that the BigQuery source is in with + * a length limit of 128 characters. If not specified, inherits the project + * ID from the parent request. + * @type string $dataset_id + * Required. The BigQuery data set to copy the data from with a length limit + * of 1,024 characters. + * @type string $table_id + * Required. The BigQuery table to copy the data from with a length limit of + * 1,024 characters. + * @type string $gcs_staging_dir + * Intermediate Cloud Storage directory used for the import with a length + * limit of 2,000 characters. Can be specified if one wants to have the + * BigQuery export to a specific Cloud Storage directory. + * @type string $data_schema + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: + * The schema is available here: + * https://support.google.com/analytics/answer/3437719. + * * `user_event_ga4`: + * The schema is available here: + * https://support.google.com/analytics/answer/7029846. + * Supported values for autocomplete imports: + * * `suggestions` (default): One JSON completion suggestion per line. + * * `denylist`: One JSON deny suggestion per line. + * * `allowlist`: One JSON allow suggestion per line. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + * Only supported in + * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. + * + * Generated from protobuf field .google.type.Date partition_date = 6; + * @return \Google\Type\Date|null + */ + public function getPartitionDate() + { + return $this->readOneof(6); + } + + public function hasPartitionDate() + { + return $this->hasOneof(6); + } + + /** + * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + * Only supported in + * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. + * + * Generated from protobuf field .google.type.Date partition_date = 6; + * @param \Google\Type\Date $var + * @return $this + */ + public function setPartitionDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The project ID (can be project # or ID) that the BigQuery source is in with + * a length limit of 128 characters. If not specified, inherits the project + * ID from the parent request. + * + * Generated from protobuf field string project_id = 5; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * The project ID (can be project # or ID) that the BigQuery source is in with + * a length limit of 128 characters. If not specified, inherits the project + * ID from the parent request. + * + * Generated from protobuf field string project_id = 5; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Required. The BigQuery data set to copy the data from with a length limit + * of 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The BigQuery data set to copy the data from with a length limit + * of 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The BigQuery table to copy the data from with a length limit of + * 1,024 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Required. The BigQuery table to copy the data from with a length limit of + * 1,024 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + + /** + * Intermediate Cloud Storage directory used for the import with a length + * limit of 2,000 characters. Can be specified if one wants to have the + * BigQuery export to a specific Cloud Storage directory. + * + * Generated from protobuf field string gcs_staging_dir = 3; + * @return string + */ + public function getGcsStagingDir() + { + return $this->gcs_staging_dir; + } + + /** + * Intermediate Cloud Storage directory used for the import with a length + * limit of 2,000 characters. Can be specified if one wants to have the + * BigQuery export to a specific Cloud Storage directory. + * + * Generated from protobuf field string gcs_staging_dir = 3; + * @param string $var + * @return $this + */ + public function setGcsStagingDir($var) + { + GPBUtil::checkString($var, True); + $this->gcs_staging_dir = $var; + + return $this; + } + + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: + * The schema is available here: + * https://support.google.com/analytics/answer/3437719. + * * `user_event_ga4`: + * The schema is available here: + * https://support.google.com/analytics/answer/7029846. + * Supported values for autocomplete imports: + * * `suggestions` (default): One JSON completion suggestion per line. + * * `denylist`: One JSON deny suggestion per line. + * * `allowlist`: One JSON allow suggestion per line. + * + * Generated from protobuf field string data_schema = 4; + * @return string + */ + public function getDataSchema() + { + return $this->data_schema; + } + + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: + * The schema is available here: + * https://support.google.com/analytics/answer/3437719. + * * `user_event_ga4`: + * The schema is available here: + * https://support.google.com/analytics/answer/7029846. + * Supported values for autocomplete imports: + * * `suggestions` (default): One JSON completion suggestion per line. + * * `denylist`: One JSON deny suggestion per line. + * * `allowlist`: One JSON allow suggestion per line. + * + * Generated from protobuf field string data_schema = 4; + * @param string $var + * @return $this + */ + public function setDataSchema($var) + { + GPBUtil::checkString($var, True); + $this->data_schema = $var; + + return $this; + } + + /** + * @return string + */ + public function getPartition() + { + return $this->whichOneof("partition"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php new file mode 100644 index 00000000000..4c5530a4d35 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php @@ -0,0 +1,153 @@ +google.cloud.retail.v2.Catalog + */ +class Catalog extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The fully qualified resource name of the catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. Immutable. The catalog display name. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $display_name = ''; + /** + * Required. The product level configuration. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product_level_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Immutable. The fully qualified resource name of the catalog. + * @type string $display_name + * Required. Immutable. The catalog display name. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type \Google\Cloud\Retail\V2\ProductLevelConfig $product_level_config + * Required. The product level configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The fully qualified resource name of the catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Immutable. The fully qualified resource name of the catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Immutable. The catalog display name. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Immutable. The catalog display name. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The product level configuration. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\ProductLevelConfig|null + */ + public function getProductLevelConfig() + { + return $this->product_level_config; + } + + public function hasProductLevelConfig() + { + return isset($this->product_level_config); + } + + public function clearProductLevelConfig() + { + unset($this->product_level_config); + } + + /** + * Required. The product level configuration. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\ProductLevelConfig $var + * @return $this + */ + public function setProductLevelConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductLevelConfig::class); + $this->product_level_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php new file mode 100644 index 00000000000..3fda535adc3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php @@ -0,0 +1,578 @@ +google.cloud.retail.v2.CatalogAttribute + */ +class CatalogAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Attribute name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * To be indexable, the attribute name can contain only alpha-numeric + * characters and underscores. For example, an attribute named + * `attributes.abc_xyz` can be indexed, but an attribute named + * `attributes.abc-xyz` cannot be indexed. + * If the attribute key starts with `attributes.`, then the attribute is a + * custom attribute. Attributes such as `brands`, `patterns`, and `title` are + * built-in and called system attributes. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + /** + * Output only. Indicates whether this attribute has been used by any + * products. `True` if at least one [Product][google.cloud.retail.v2.Product] + * is using this attribute in + * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, + * this field is `False`. + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be + * pre-loaded by using + * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], + * [CatalogService.ImportCatalogAttributes][], or + * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] + * APIs. This field is `False` for pre-loaded + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. + * Only pre-loaded [catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in + * use by products nor predefined can be deleted. [Catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are + * either in use by products or are predefined attributes cannot be deleted; + * however, their configuration properties will reset to default values upon + * removal request. + * After catalog changes, it takes about 10 minutes for this field to update. + * + * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $in_use = false; + /** + * Output only. The type of this attribute. This is derived from the attribute + * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $type = 0; + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + * are indexed so that it can be filtered, faceted, or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; + */ + protected $indexable_option = 0; + /** + * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + * facet. Could only be DYNAMIC_FACETABLE_DISABLED if + * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] + * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + * Must be specified, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + */ + protected $dynamic_facetable_option = 0; + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + * are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + * will not be searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as + * there are no text values associated to numerical attributes. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; + */ + protected $searchable_option = 0; + /** + * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + * This property only applies to textual custom attributes and requires + * indexable set to enabled to enable exact-searchable. If unset, the server + * behavior defaults to + * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + */ + protected $exact_searchable_option = 0; + /** + * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + * results. If unset, the server behavior defaults to + * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; + */ + protected $retrievable_option = 0; + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + */ + protected $facet_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Required. Attribute name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * To be indexable, the attribute name can contain only alpha-numeric + * characters and underscores. For example, an attribute named + * `attributes.abc_xyz` can be indexed, but an attribute named + * `attributes.abc-xyz` cannot be indexed. + * If the attribute key starts with `attributes.`, then the attribute is a + * custom attribute. Attributes such as `brands`, `patterns`, and `title` are + * built-in and called system attributes. + * @type bool $in_use + * Output only. Indicates whether this attribute has been used by any + * products. `True` if at least one [Product][google.cloud.retail.v2.Product] + * is using this attribute in + * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, + * this field is `False`. + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be + * pre-loaded by using + * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], + * [CatalogService.ImportCatalogAttributes][], or + * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] + * APIs. This field is `False` for pre-loaded + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. + * Only pre-loaded [catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in + * use by products nor predefined can be deleted. [Catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are + * either in use by products or are predefined attributes cannot be deleted; + * however, their configuration properties will reset to default values upon + * removal request. + * After catalog changes, it takes about 10 minutes for this field to update. + * @type int $type + * Output only. The type of this attribute. This is derived from the attribute + * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. + * @type int $indexable_option + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + * are indexed so that it can be filtered, faceted, or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * @type int $dynamic_facetable_option + * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + * facet. Could only be DYNAMIC_FACETABLE_DISABLED if + * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] + * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + * Must be specified, otherwise throws INVALID_FORMAT error. + * @type int $searchable_option + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + * are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + * will not be searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as + * there are no text values associated to numerical attributes. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * @type int $exact_searchable_option + * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + * This property only applies to textual custom attributes and requires + * indexable set to enabled to enable exact-searchable. If unset, the server + * behavior defaults to + * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. + * @type int $retrievable_option + * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + * results. If unset, the server behavior defaults to + * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $facet_config + * Contains facet options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Attribute name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * To be indexable, the attribute name can contain only alpha-numeric + * characters and underscores. For example, an attribute named + * `attributes.abc_xyz` can be indexed, but an attribute named + * `attributes.abc-xyz` cannot be indexed. + * If the attribute key starts with `attributes.`, then the attribute is a + * custom attribute. Attributes such as `brands`, `patterns`, and `title` are + * built-in and called system attributes. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. Attribute name. + * For example: `color`, `brands`, `attributes.custom_attribute`, such as + * `attributes.xyz`. + * To be indexable, the attribute name can contain only alpha-numeric + * characters and underscores. For example, an attribute named + * `attributes.abc_xyz` can be indexed, but an attribute named + * `attributes.abc-xyz` cannot be indexed. + * If the attribute key starts with `attributes.`, then the attribute is a + * custom attribute. Attributes such as `brands`, `patterns`, and `title` are + * built-in and called system attributes. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Output only. Indicates whether this attribute has been used by any + * products. `True` if at least one [Product][google.cloud.retail.v2.Product] + * is using this attribute in + * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, + * this field is `False`. + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be + * pre-loaded by using + * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], + * [CatalogService.ImportCatalogAttributes][], or + * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] + * APIs. This field is `False` for pre-loaded + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. + * Only pre-loaded [catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in + * use by products nor predefined can be deleted. [Catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are + * either in use by products or are predefined attributes cannot be deleted; + * however, their configuration properties will reset to default values upon + * removal request. + * After catalog changes, it takes about 10 minutes for this field to update. + * + * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getInUse() + { + return $this->in_use; + } + + /** + * Output only. Indicates whether this attribute has been used by any + * products. `True` if at least one [Product][google.cloud.retail.v2.Product] + * is using this attribute in + * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, + * this field is `False`. + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be + * pre-loaded by using + * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], + * [CatalogService.ImportCatalogAttributes][], or + * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] + * APIs. This field is `False` for pre-loaded + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. + * Only pre-loaded [catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in + * use by products nor predefined can be deleted. [Catalog + * attributes][google.cloud.retail.v2.CatalogAttribute] that are + * either in use by products or are predefined attributes cannot be deleted; + * however, their configuration properties will reset to default values upon + * removal request. + * After catalog changes, it takes about 10 minutes for this field to update. + * + * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setInUse($var) + { + GPBUtil::checkBool($var); + $this->in_use = $var; + + return $this; + } + + /** + * Output only. The type of this attribute. This is derived from the attribute + * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Output only. The type of this attribute. This is derived from the attribute + * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\AttributeType::class); + $this->type = $var; + + return $this; + } + + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + * are indexed so that it can be filtered, faceted, or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; + * @return int + */ + public function getIndexableOption() + { + return $this->indexable_option; + } + + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + * are indexed so that it can be filtered, faceted, or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; + * @param int $var + * @return $this + */ + public function setIndexableOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\IndexableOption::class); + $this->indexable_option = $var; + + return $this; + } + + /** + * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + * facet. Could only be DYNAMIC_FACETABLE_DISABLED if + * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] + * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + * Must be specified, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * @return int + */ + public function getDynamicFacetableOption() + { + return $this->dynamic_facetable_option; + } + + /** + * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + * facet. Could only be DYNAMIC_FACETABLE_DISABLED if + * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] + * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + * Must be specified, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * @param int $var + * @return $this + */ + public function setDynamicFacetableOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\DynamicFacetableOption::class); + $this->dynamic_facetable_option = $var; + + return $this; + } + + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + * are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + * will not be searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as + * there are no text values associated to numerical attributes. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; + * @return int + */ + public function getSearchableOption() + { + return $this->searchable_option; + } + + /** + * When + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + * are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + * will not be searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as + * there are no text values associated to numerical attributes. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; + * @param int $var + * @return $this + */ + public function setSearchableOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\SearchableOption::class); + $this->searchable_option = $var; + + return $this; + } + + /** + * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + * This property only applies to textual custom attributes and requires + * indexable set to enabled to enable exact-searchable. If unset, the server + * behavior defaults to + * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * @return int + */ + public function getExactSearchableOption() + { + return $this->exact_searchable_option; + } + + /** + * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + * This property only applies to textual custom attributes and requires + * indexable set to enabled to enable exact-searchable. If unset, the server + * behavior defaults to + * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * @param int $var + * @return $this + */ + public function setExactSearchableOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\ExactSearchableOption::class); + $this->exact_searchable_option = $var; + + return $this; + } + + /** + * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + * results. If unset, the server behavior defaults to + * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; + * @return int + */ + public function getRetrievableOption() + { + return $this->retrievable_option; + } + + /** + * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + * results. If unset, the server behavior defaults to + * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; + * @param int $var + * @return $this + */ + public function setRetrievableOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\RetrievableOption::class); + $this->retrievable_option = $var; + + return $this; + } + + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig|null + */ + public function getFacetConfig() + { + return $this->facet_config; + } + + public function hasFacetConfig() + { + return isset($this->facet_config); + } + + public function clearFacetConfig() + { + unset($this->facet_config); + } + + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $var + * @return $this + */ + public function setFacetConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig::class); + $this->facet_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php new file mode 100644 index 00000000000..bdc0382cfa8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php @@ -0,0 +1,66 @@ +google.cloud.retail.v2.CatalogAttribute.AttributeType + */ +class AttributeType +{ + /** + * The type of the attribute is unknown. + * Used when type cannot be derived from attribute that is not + * [in_use][google.cloud.retail.v2.CatalogAttribute.in_use]. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * Textual attribute. + * + * Generated from protobuf enum TEXTUAL = 1; + */ + const TEXTUAL = 1; + /** + * Numerical attribute. + * + * Generated from protobuf enum NUMERICAL = 2; + */ + const NUMERICAL = 2; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::TEXTUAL => 'TEXTUAL', + self::NUMERICAL => 'NUMERICAL', + ]; + + 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(AttributeType::class, \Google\Cloud\Retail\V2\CatalogAttribute_AttributeType::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php new file mode 100644 index 00000000000..e189b4de7e3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption + */ +class DynamicFacetableOption +{ + /** + * Value used when unset. + * + * Generated from protobuf enum DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + const DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + /** + * Dynamic facetable option enabled for an attribute. + * + * Generated from protobuf enum DYNAMIC_FACETABLE_ENABLED = 1; + */ + const DYNAMIC_FACETABLE_ENABLED = 1; + /** + * Dynamic facetable option disabled for an attribute. + * + * Generated from protobuf enum DYNAMIC_FACETABLE_DISABLED = 2; + */ + const DYNAMIC_FACETABLE_DISABLED = 2; + + private static $valueToName = [ + self::DYNAMIC_FACETABLE_OPTION_UNSPECIFIED => 'DYNAMIC_FACETABLE_OPTION_UNSPECIFIED', + self::DYNAMIC_FACETABLE_ENABLED => 'DYNAMIC_FACETABLE_ENABLED', + self::DYNAMIC_FACETABLE_DISABLED => 'DYNAMIC_FACETABLE_DISABLED', + ]; + + 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(DynamicFacetableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_DynamicFacetableOption::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php new file mode 100644 index 00000000000..3db1b7dc5d1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption + */ +class ExactSearchableOption +{ + /** + * Value used when unset. + * + * Generated from protobuf enum EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + const EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; + /** + * Exact searchable option enabled for an attribute. + * + * Generated from protobuf enum EXACT_SEARCHABLE_ENABLED = 1; + */ + const EXACT_SEARCHABLE_ENABLED = 1; + /** + * Exact searchable option disabled for an attribute. + * + * Generated from protobuf enum EXACT_SEARCHABLE_DISABLED = 2; + */ + const EXACT_SEARCHABLE_DISABLED = 2; + + private static $valueToName = [ + self::EXACT_SEARCHABLE_OPTION_UNSPECIFIED => 'EXACT_SEARCHABLE_OPTION_UNSPECIFIED', + self::EXACT_SEARCHABLE_ENABLED => 'EXACT_SEARCHABLE_ENABLED', + self::EXACT_SEARCHABLE_DISABLED => 'EXACT_SEARCHABLE_DISABLED', + ]; + + 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(ExactSearchableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_ExactSearchableOption::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php new file mode 100644 index 00000000000..bb06db0b572 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php @@ -0,0 +1,315 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig + */ +class FacetConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + */ + private $facet_intervals; + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + */ + private $ignored_facet_values; + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + */ + private $merged_facet_values; + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + */ + protected $merged_facet = null; + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + */ + protected $rerank_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $facet_intervals + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $ignored_facet_values + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $merged_facet_values + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $merged_facet + * Use this field only if you want to merge a facet key into another facet + * key. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $rerank_config + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetIntervals() + { + return $this->facet_intervals; + } + + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetIntervals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Interval::class); + $this->facet_intervals = $arr; + + return $this; + } + + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoredFacetValues() + { + return $this->ignored_facet_values; + } + + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoredFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues::class); + $this->ignored_facet_values = $arr; + + return $this; + } + + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMergedFacetValues() + { + return $this->merged_facet_values; + } + + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMergedFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue::class); + $this->merged_facet_values = $arr; + + return $this; + } + + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet|null + */ + public function getMergedFacet() + { + return $this->merged_facet; + } + + public function hasMergedFacet() + { + return isset($this->merged_facet); + } + + public function clearMergedFacet() + { + unset($this->merged_facet); + } + + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $var + * @return $this + */ + public function setMergedFacet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet::class); + $this->merged_facet = $var; + + return $this; + } + + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig|null + */ + public function getRerankConfig() + { + return $this->rerank_config; + } + + public function hasRerankConfig() + { + return isset($this->rerank_config); + } + + public function clearRerankConfig() + { + unset($this->rerank_config); + } + + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $var + * @return $this + */ + public function setRerankConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig::class); + $this->rerank_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FacetConfig::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php new file mode 100644 index 00000000000..dbc9036dff5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php @@ -0,0 +1,202 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + */ +class IgnoredFacetValues extends \Google\Protobuf\Internal\Message +{ + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * @type \Google\Protobuf\Timestamp $start_time + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * @type \Google\Protobuf\Timestamp $end_time + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IgnoredFacetValues::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_IgnoredFacetValues::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php new file mode 100644 index 00000000000..433268737bd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php @@ -0,0 +1,94 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + */ +class MergedFacet extends \Google\Protobuf\Internal\Message +{ + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + */ + protected $merged_facet_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $merged_facet_key + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + * @return string + */ + public function getMergedFacetKey() + { + return $this->merged_facet_key; + } + + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + * @param string $var + * @return $this + */ + public function setMergedFacetKey($var) + { + GPBUtil::checkString($var, True); + $this->merged_facet_key = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MergedFacet::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_MergedFacet::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php new file mode 100644 index 00000000000..ced040a5af1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php @@ -0,0 +1,123 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + */ +class MergedFacetValue extends \Google\Protobuf\Internal\Message +{ + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + */ + protected $merged_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * @type string $merged_value + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + * @return string + */ + public function getMergedValue() + { + return $this->merged_value; + } + + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + * @param string $var + * @return $this + */ + public function setMergedValue($var) + { + GPBUtil::checkString($var, True); + $this->merged_value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MergedFacetValue::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_MergedFacetValue::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php new file mode 100644 index 00000000000..d453dd3f306 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php @@ -0,0 +1,123 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + */ +class RerankConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + */ + protected $rerank_facet = false; + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + */ + private $facet_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $rerank_facet + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * @type array|\Google\Protobuf\Internal\RepeatedField $facet_values + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + * @return bool + */ + public function getRerankFacet() + { + return $this->rerank_facet; + } + + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + * @param bool $var + * @return $this + */ + public function setRerankFacet($var) + { + GPBUtil::checkBool($var); + $this->rerank_facet = $var; + + return $this; + } + + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetValues() + { + return $this->facet_values; + } + + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->facet_values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RerankConfig::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_RerankConfig::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php new file mode 100644 index 00000000000..bbab5d7c490 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CatalogAttribute.IndexableOption + */ +class IndexableOption +{ + /** + * Value used when unset. + * + * Generated from protobuf enum INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + const INDEXABLE_OPTION_UNSPECIFIED = 0; + /** + * Indexable option enabled for an attribute. + * + * Generated from protobuf enum INDEXABLE_ENABLED = 1; + */ + const INDEXABLE_ENABLED = 1; + /** + * Indexable option disabled for an attribute. + * + * Generated from protobuf enum INDEXABLE_DISABLED = 2; + */ + const INDEXABLE_DISABLED = 2; + + private static $valueToName = [ + self::INDEXABLE_OPTION_UNSPECIFIED => 'INDEXABLE_OPTION_UNSPECIFIED', + self::INDEXABLE_ENABLED => 'INDEXABLE_ENABLED', + self::INDEXABLE_DISABLED => 'INDEXABLE_DISABLED', + ]; + + 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(IndexableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_IndexableOption::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php new file mode 100644 index 00000000000..150c5f7d15d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CatalogAttribute.RetrievableOption + */ +class RetrievableOption +{ + /** + * Value used when unset. + * + * Generated from protobuf enum RETRIEVABLE_OPTION_UNSPECIFIED = 0; + */ + const RETRIEVABLE_OPTION_UNSPECIFIED = 0; + /** + * Retrievable option enabled for an attribute. + * + * Generated from protobuf enum RETRIEVABLE_ENABLED = 1; + */ + const RETRIEVABLE_ENABLED = 1; + /** + * Retrievable option disabled for an attribute. + * + * Generated from protobuf enum RETRIEVABLE_DISABLED = 2; + */ + const RETRIEVABLE_DISABLED = 2; + + private static $valueToName = [ + self::RETRIEVABLE_OPTION_UNSPECIFIED => 'RETRIEVABLE_OPTION_UNSPECIFIED', + self::RETRIEVABLE_ENABLED => 'RETRIEVABLE_ENABLED', + self::RETRIEVABLE_DISABLED => 'RETRIEVABLE_DISABLED', + ]; + + 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(RetrievableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_RetrievableOption::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php new file mode 100644 index 00000000000..6bca457f0b3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CatalogAttribute.SearchableOption + */ +class SearchableOption +{ + /** + * Value used when unset. + * + * Generated from protobuf enum SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + const SEARCHABLE_OPTION_UNSPECIFIED = 0; + /** + * Searchable option enabled for an attribute. + * + * Generated from protobuf enum SEARCHABLE_ENABLED = 1; + */ + const SEARCHABLE_ENABLED = 1; + /** + * Searchable option disabled for an attribute. + * + * Generated from protobuf enum SEARCHABLE_DISABLED = 2; + */ + const SEARCHABLE_DISABLED = 2; + + private static $valueToName = [ + self::SEARCHABLE_OPTION_UNSPECIFIED => 'SEARCHABLE_OPTION_UNSPECIFIED', + self::SEARCHABLE_ENABLED => 'SEARCHABLE_ENABLED', + self::SEARCHABLE_DISABLED => 'SEARCHABLE_DISABLED', + ]; + + 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(SearchableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_SearchableOption::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php new file mode 100644 index 00000000000..f0b77babfc2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php @@ -0,0 +1,288 @@ +google.cloud.retail.v2.CollectUserEventRequest + */ +class CollectUserEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. URL encoded UserEvent proto with a length limit of 2,000,000 + * characters. + * + * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = ''; + /** + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. 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; + */ + protected $uri = ''; + /** + * 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; + */ + protected $ets = 0; + /** + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. + * + * Generated from protobuf field string raw_json = 5; + */ + protected $raw_json = ''; + protected $conversion_rule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $prebuilt_rule + * The prebuilt rule name that can convert a specific type of raw_json. + * For example: "ga4_bq" rule for the GA4 user event schema. + * @type string $parent + * Required. The parent catalog name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * @type string $user_event + * Required. URL encoded UserEvent proto with a length limit of 2,000,000 + * characters. + * @type string $uri + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. This is often more useful than the + * referer URL, because many browsers only send the domain for 3rd party + * requests. + * @type int|string $ets + * The event timestamp in milliseconds. This prevents browser caching of + * otherwise identical get requests. The name is abbreviated to reduce the + * payload bytes. + * @type string $raw_json + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * The prebuilt rule name that can convert a specific type of raw_json. + * For example: "ga4_bq" rule for the GA4 user event schema. + * + * Generated from protobuf field string prebuilt_rule = 6; + * @return string + */ + public function getPrebuiltRule() + { + return $this->readOneof(6); + } + + public function hasPrebuiltRule() + { + return $this->hasOneof(6); + } + + /** + * The prebuilt rule name that can convert a specific type of raw_json. + * For example: "ga4_bq" rule for the GA4 user event schema. + * + * Generated from protobuf field string prebuilt_rule = 6; + * @param string $var + * @return $this + */ + public function setPrebuiltRule($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required. The parent catalog name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent catalog name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. URL encoded UserEvent proto with a length limit of 2,000,000 + * characters. + * + * 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 with a length limit of 2,000,000 + * characters. + * + * 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; + } + + /** + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. 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; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. 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; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * 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; + * @return int|string + */ + public function getEts() + { + return $this->ets; + } + + /** + * 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; + * @param int|string $var + * @return $this + */ + public function setEts($var) + { + GPBUtil::checkInt64($var); + $this->ets = $var; + + return $this; + } + + /** + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. + * + * Generated from protobuf field string raw_json = 5; + * @return string + */ + public function getRawJson() + { + return $this->raw_json; + } + + /** + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. + * + * Generated from protobuf field string raw_json = 5; + * @param string $var + * @return $this + */ + public function setRawJson($var) + { + GPBUtil::checkString($var, True); + $this->raw_json = $var; + + return $this; + } + + /** + * @return string + */ + public function getConversionRule() + { + return $this->whichOneof("conversion_rule"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php new file mode 100644 index 00000000000..29cdde8fd03 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php @@ -0,0 +1,177 @@ +google.cloud.retail.v2.ColorInfo + */ +class ColorInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The standard color families. Strongly recommended to use the following + * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + * "Mixed". Normally it is expected to have only 1 color family. May consider + * using single "Mixed" instead of multiple values. + * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string color_families = 1; + */ + private $color_families; + /** + * The color display names, which may be different from standard color family + * names, such as the color aliases used in the website frontend. Normally + * it is expected to have only 1 color. May consider using single "Mixed" + * instead of multiple values. + * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string colors = 2; + */ + private $colors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $color_families + * The standard color families. Strongly recommended to use the following + * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + * "Mixed". Normally it is expected to have only 1 color family. May consider + * using single "Mixed" instead of multiple values. + * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * @type array|\Google\Protobuf\Internal\RepeatedField $colors + * The color display names, which may be different from standard color family + * names, such as the color aliases used in the website frontend. Normally + * it is expected to have only 1 color. May consider using single "Mixed" + * instead of multiple values. + * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The standard color families. Strongly recommended to use the following + * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + * "Mixed". Normally it is expected to have only 1 color family. May consider + * using single "Mixed" instead of multiple values. + * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string color_families = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColorFamilies() + { + return $this->color_families; + } + + /** + * The standard color families. Strongly recommended to use the following + * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + * "Mixed". Normally it is expected to have only 1 color family. May consider + * using single "Mixed" instead of multiple values. + * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string color_families = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColorFamilies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->color_families = $arr; + + return $this; + } + + /** + * The color display names, which may be different from standard color family + * names, such as the color aliases used in the website frontend. Normally + * it is expected to have only 1 color. May consider using single "Mixed" + * instead of multiple values. + * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string colors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColors() + { + return $this->colors; + } + + /** + * The color display names, which may be different from standard color family + * names, such as the color aliases used in the website frontend. Normally + * it is expected to have only 1 color. May consider using single "Mixed" + * instead of multiple values. + * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field repeated string colors = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->colors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php new file mode 100644 index 00000000000..2118cf1f06f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php @@ -0,0 +1,511 @@ +google.cloud.retail.v2.CompleteQueryRequest + */ +class CompleteQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Catalog for which the completion is performed. + * Full resource name of catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $catalog = ''; + /** + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 7; + */ + protected $visitor_id = ''; + /** + * Note that this field applies for `user-data` dataset only. For requests + * with `cloud-retail` dataset, setting this field has no effect. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. + * + * Generated from protobuf field repeated string language_codes = 3; + */ + private $language_codes; + /** + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * It can apply different suggestions on different device types, e.g. + * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + * types. + * Supported formats: + * * `UNKNOWN_DEVICE_TYPE` + * * `DESKTOP` + * * `MOBILE` + * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + * + * Generated from protobuf field string device_type = 4; + */ + protected $device_type = ''; + /** + * Determines which dataset to use for fetching completion. "user-data" will + * use the imported dataset through + * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. + * "cloud-retail" will use the dataset generated by cloud retail based on user + * events. If leave empty, it will use the "user-data". + * Current supported values: + * * user-data + * * cloud-retail: + * This option requires enabling auto-learning function first. See + * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + * + * Generated from protobuf field string dataset = 6; + */ + protected $dataset = ''; + /** + * Completion max suggestions. If left unset or set to 0, then will fallback + * to the configured value + * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. + * The maximum allowed max suggestions is 20. If it is set higher, it will be + * capped by 20. + * + * Generated from protobuf field int32 max_suggestions = 5; + */ + protected $max_suggestions = 0; + /** + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + */ + protected $enable_attribute_suggestions = false; + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it must be an exact match with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get + * per-entity autocomplete results. + * + * Generated from protobuf field string entity = 10; + */ + protected $entity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Catalog for which the completion is performed. + * Full resource name of catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @type string $query + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + * @type string $visitor_id + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $language_codes + * Note that this field applies for `user-data` dataset only. For requests + * with `cloud-retail` dataset, setting this field has no effect. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. + * @type string $device_type + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * It can apply different suggestions on different device types, e.g. + * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + * types. + * Supported formats: + * * `UNKNOWN_DEVICE_TYPE` + * * `DESKTOP` + * * `MOBILE` + * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + * @type string $dataset + * Determines which dataset to use for fetching completion. "user-data" will + * use the imported dataset through + * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. + * "cloud-retail" will use the dataset generated by cloud retail based on user + * events. If leave empty, it will use the "user-data". + * Current supported values: + * * user-data + * * cloud-retail: + * This option requires enabling auto-learning function first. See + * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + * @type int $max_suggestions + * Completion max suggestions. If left unset or set to 0, then will fallback + * to the configured value + * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. + * The maximum allowed max suggestions is 20. If it is set higher, it will be + * capped by 20. + * @type bool $enable_attribute_suggestions + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. + * @type string $entity + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it must be an exact match with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get + * per-entity autocomplete results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Catalog for which the completion is performed. + * Full resource name of catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Catalog for which the completion is performed. + * Full resource name of catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 7; + * @return string + */ + public function getVisitorId() + { + return $this->visitor_id; + } + + /** + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 7; + * @param string $var + * @return $this + */ + public function setVisitorId($var) + { + GPBUtil::checkString($var, True); + $this->visitor_id = $var; + + return $this; + } + + /** + * Note that this field applies for `user-data` dataset only. For requests + * with `cloud-retail` dataset, setting this field has no effect. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. + * + * Generated from protobuf field repeated string language_codes = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLanguageCodes() + { + return $this->language_codes; + } + + /** + * Note that this field applies for `user-data` dataset only. For requests + * with `cloud-retail` dataset, setting this field has no effect. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. + * + * Generated from protobuf field repeated string language_codes = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_codes = $arr; + + return $this; + } + + /** + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * It can apply different suggestions on different device types, e.g. + * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + * types. + * Supported formats: + * * `UNKNOWN_DEVICE_TYPE` + * * `DESKTOP` + * * `MOBILE` + * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + * + * Generated from protobuf field string device_type = 4; + * @return string + */ + public function getDeviceType() + { + return $this->device_type; + } + + /** + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * It can apply different suggestions on different device types, e.g. + * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + * types. + * Supported formats: + * * `UNKNOWN_DEVICE_TYPE` + * * `DESKTOP` + * * `MOBILE` + * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + * + * Generated from protobuf field string device_type = 4; + * @param string $var + * @return $this + */ + public function setDeviceType($var) + { + GPBUtil::checkString($var, True); + $this->device_type = $var; + + return $this; + } + + /** + * Determines which dataset to use for fetching completion. "user-data" will + * use the imported dataset through + * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. + * "cloud-retail" will use the dataset generated by cloud retail based on user + * events. If leave empty, it will use the "user-data". + * Current supported values: + * * user-data + * * cloud-retail: + * This option requires enabling auto-learning function first. See + * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + * + * Generated from protobuf field string dataset = 6; + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Determines which dataset to use for fetching completion. "user-data" will + * use the imported dataset through + * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. + * "cloud-retail" will use the dataset generated by cloud retail based on user + * events. If leave empty, it will use the "user-data". + * Current supported values: + * * user-data + * * cloud-retail: + * This option requires enabling auto-learning function first. See + * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + * + * Generated from protobuf field string dataset = 6; + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + + /** + * Completion max suggestions. If left unset or set to 0, then will fallback + * to the configured value + * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. + * The maximum allowed max suggestions is 20. If it is set higher, it will be + * capped by 20. + * + * Generated from protobuf field int32 max_suggestions = 5; + * @return int + */ + public function getMaxSuggestions() + { + return $this->max_suggestions; + } + + /** + * Completion max suggestions. If left unset or set to 0, then will fallback + * to the configured value + * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. + * The maximum allowed max suggestions is 20. If it is set higher, it will be + * capped by 20. + * + * Generated from protobuf field int32 max_suggestions = 5; + * @param int $var + * @return $this + */ + public function setMaxSuggestions($var) + { + GPBUtil::checkInt32($var); + $this->max_suggestions = $var; + + return $this; + } + + /** + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + * @return bool + */ + public function getEnableAttributeSuggestions() + { + return $this->enable_attribute_suggestions; + } + + /** + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + * @param bool $var + * @return $this + */ + public function setEnableAttributeSuggestions($var) + { + GPBUtil::checkBool($var); + $this->enable_attribute_suggestions = $var; + + return $this; + } + + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it must be an exact match with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get + * per-entity autocomplete results. + * + * Generated from protobuf field string entity = 10; + * @return string + */ + public function getEntity() + { + return $this->entity; + } + + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it must be an exact match with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get + * per-entity autocomplete results. + * + * Generated from protobuf field string entity = 10; + * @param string $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkString($var, True); + $this->entity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php new file mode 100644 index 00000000000..2aa2c0bf0cd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php @@ -0,0 +1,262 @@ +google.cloud.retail.v2.CompleteQueryResponse + */ +class CompleteQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Results of the matching suggestions. The result list is ordered and the + * first result is top suggestion. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + */ + private $completion_results; + /** + * A unique complete token. This should be included in the + * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] + * for search events resulting from this completion, which enables accurate + * attribution of complete model performance. + * + * Generated from protobuf field string attribution_token = 2; + */ + protected $attribution_token = ''; + /** + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. + * This feature is only available when + * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] + * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. + * The recent searches satisfy the follow rules: + * * They are ordered from latest to oldest. + * * They are matched with + * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] + * case insensitively. + * * They are transformed to lower case. + * * They are UTF-8 safe. + * Recent searches are deduplicated. More recent searches will be reserved + * when duplication happens. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; + * @deprecated + */ + private $recent_search_results; + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + */ + private $attribute_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>|\Google\Protobuf\Internal\RepeatedField $completion_results + * Results of the matching suggestions. The result list is ordered and the + * first result is top suggestion. + * @type string $attribution_token + * A unique complete token. This should be included in the + * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] + * for search events resulting from this completion, which enables accurate + * attribution of complete model performance. + * @type array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $recent_search_results + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. + * This feature is only available when + * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] + * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. + * The recent searches satisfy the follow rules: + * * They are ordered from latest to oldest. + * * They are matched with + * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] + * case insensitively. + * * They are transformed to lower case. + * * They are UTF-8 safe. + * Recent searches are deduplicated. More recent searches will be reserved + * when duplication happens. + * @type array|\Google\Protobuf\Internal\MapField $attribute_results + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * Results of the matching suggestions. The result list is ordered and the + * first result is top suggestion. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompletionResults() + { + return $this->completion_results; + } + + /** + * Results of the matching suggestions. The result list is ordered and the + * first result is top suggestion. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * @param array<\Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompletionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult::class); + $this->completion_results = $arr; + + return $this; + } + + /** + * A unique complete token. This should be included in the + * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] + * for search events resulting from this completion, which enables accurate + * attribution of complete model performance. + * + * Generated from protobuf field string attribution_token = 2; + * @return string + */ + public function getAttributionToken() + { + return $this->attribution_token; + } + + /** + * A unique complete token. This should be included in the + * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] + * for search events resulting from this completion, which enables accurate + * attribution of complete model performance. + * + * Generated from protobuf field string attribution_token = 2; + * @param string $var + * @return $this + */ + public function setAttributionToken($var) + { + GPBUtil::checkString($var, True); + $this->attribution_token = $var; + + return $this; + } + + /** + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. + * This feature is only available when + * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] + * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. + * The recent searches satisfy the follow rules: + * * They are ordered from latest to oldest. + * * They are matched with + * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] + * case insensitively. + * * They are transformed to lower case. + * * They are UTF-8 safe. + * Recent searches are deduplicated. More recent searches will be reserved + * when duplication happens. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getRecentSearchResults() + { + @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); + return $this->recent_search_results; + } + + /** + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. + * This feature is only available when + * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] + * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. + * The recent searches satisfy the follow rules: + * * They are ordered from latest to oldest. + * * They are matched with + * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] + * case insensitively. + * * They are transformed to lower case. + * * They are UTF-8 safe. + * Recent searches are deduplicated. More recent searches will be reserved + * when duplication happens. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; + * @param array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setRecentSearchResults($var) + { + @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult::class); + $this->recent_search_results = $arr; + + return $this; + } + + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributeResults() + { + return $this->attribute_results; + } + + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributeResults($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\AttributeResult::class); + $this->attribute_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php new file mode 100644 index 00000000000..5ba02e18561 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.CompleteQueryResponse.AttributeResult + */ +class AttributeResult extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated string suggestions = 1; + */ + private $suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $suggestions + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated string suggestions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestions() + { + return $this->suggestions; + } + + /** + * Generated from protobuf field repeated string suggestions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->suggestions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AttributeResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_AttributeResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php new file mode 100644 index 00000000000..2700d24dbe8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php @@ -0,0 +1,128 @@ +google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + */ +class CompletionResult extends \Google\Protobuf\Internal\Message +{ + /** + * The suggestion for the query. + * + * Generated from protobuf field string suggestion = 1; + */ + protected $suggestion = ''; + /** + * Custom attributes for the suggestion term. + * * For "user-data", the attributes are additional custom attributes + * ingested through BigQuery. + * * For "cloud-retail", the attributes are product attributes generated + * by Cloud Retail. It requires + * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] + * is imported properly. + * + * Generated from protobuf field map attributes = 2; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $suggestion + * The suggestion for the query. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Custom attributes for the suggestion term. + * * For "user-data", the attributes are additional custom attributes + * ingested through BigQuery. + * * For "cloud-retail", the attributes are product attributes generated + * by Cloud Retail. It requires + * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] + * is imported properly. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * The suggestion for the query. + * + * Generated from protobuf field string suggestion = 1; + * @return string + */ + public function getSuggestion() + { + return $this->suggestion; + } + + /** + * The suggestion for the query. + * + * Generated from protobuf field string suggestion = 1; + * @param string $var + * @return $this + */ + public function setSuggestion($var) + { + GPBUtil::checkString($var, True); + $this->suggestion = $var; + + return $this; + } + + /** + * Custom attributes for the suggestion term. + * * For "user-data", the attributes are additional custom attributes + * ingested through BigQuery. + * * For "cloud-retail", the attributes are product attributes generated + * by Cloud Retail. It requires + * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] + * is imported properly. + * + * Generated from protobuf field map attributes = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Custom attributes for the suggestion term. + * * For "user-data", the attributes are additional custom attributes + * ingested through BigQuery. + * * For "cloud-retail", the attributes are product attributes generated + * by Cloud Retail. It requires + * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] + * is imported properly. + * + * Generated from protobuf field map attributes = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompletionResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_CompletionResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php new file mode 100644 index 00000000000..72d46e2a5d9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php @@ -0,0 +1,71 @@ +google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + */ +class RecentSearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * The recent search query. + * + * Generated from protobuf field string recent_search = 1; + */ + protected $recent_search = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $recent_search + * The recent search query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * The recent search query. + * + * Generated from protobuf field string recent_search = 1; + * @return string + */ + public function getRecentSearch() + { + return $this->recent_search; + } + + /** + * The recent search query. + * + * Generated from protobuf field string recent_search = 1; + * @param string $var + * @return $this + */ + public function setRecentSearch($var) + { + GPBUtil::checkString($var, True); + $this->recent_search = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RecentSearchResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_RecentSearchResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php new file mode 100644 index 00000000000..10eb8f210b7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php @@ -0,0 +1,546 @@ +google.cloud.retail.v2.CompletionConfig + */ +class CompletionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Fully qualified name + * `projects/*/locations/*/catalogs/*/completionConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Specifies the matching order for autocomplete suggestions, e.g., a query + * consisting of 'sh' with 'out-of-order' specified would suggest "women's + * shoes", whereas a query of 'red s' with 'exact-prefix' specified would + * suggest "red shoes". Currently supported values: + * * 'out-of-order' + * * 'exact-prefix' + * Default value: 'exact-prefix'. + * + * Generated from protobuf field string matching_order = 2; + */ + protected $matching_order = ''; + /** + * The maximum number of autocomplete suggestions returned per term. Default + * value is 20. If left unset or set to 0, then will fallback to default + * value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 max_suggestions = 3; + */ + protected $max_suggestions = 0; + /** + * The minimum number of characters needed to be typed in order to get + * suggestions. Default value is 2. If left unset or set to 0, then will + * fallback to default value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 min_prefix_length = 4; + */ + protected $min_prefix_length = 0; + /** + * If set to true, the auto learning function is enabled. Auto learning uses + * user data to generate suggestions using ML techniques. Default value is + * false. Only after enabling auto learning can users use `cloud-retail` + * data in + * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. + * + * Generated from protobuf field bool auto_learning = 11; + */ + protected $auto_learning = false; + /** + * Output only. The source data for the latest import of the autocomplete + * suggestion phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $suggestions_input_config = null; + /** + * Output only. Name of the LRO corresponding to the latest suggestion terms + * list import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_suggestions_import_operation = ''; + /** + * Output only. The source data for the latest import of the autocomplete + * denylist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $denylist_input_config = null; + /** + * Output only. Name of the LRO corresponding to the latest denylist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_denylist_import_operation = ''; + /** + * Output only. The source data for the latest import of the autocomplete + * allowlist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $allowlist_input_config = null; + /** + * Output only. Name of the LRO corresponding to the latest allowlist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_allowlist_import_operation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Immutable. Fully qualified name + * `projects/*/locations/*/catalogs/*/completionConfig` + * @type string $matching_order + * Specifies the matching order for autocomplete suggestions, e.g., a query + * consisting of 'sh' with 'out-of-order' specified would suggest "women's + * shoes", whereas a query of 'red s' with 'exact-prefix' specified would + * suggest "red shoes". Currently supported values: + * * 'out-of-order' + * * 'exact-prefix' + * Default value: 'exact-prefix'. + * @type int $max_suggestions + * The maximum number of autocomplete suggestions returned per term. Default + * value is 20. If left unset or set to 0, then will fallback to default + * value. + * Value range is 1 to 20. + * @type int $min_prefix_length + * The minimum number of characters needed to be typed in order to get + * suggestions. Default value is 2. If left unset or set to 0, then will + * fallback to default value. + * Value range is 1 to 20. + * @type bool $auto_learning + * If set to true, the auto learning function is enabled. Auto learning uses + * user data to generate suggestions using ML techniques. Default value is + * false. Only after enabling auto learning can users use `cloud-retail` + * data in + * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. + * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $suggestions_input_config + * Output only. The source data for the latest import of the autocomplete + * suggestion phrases. + * @type string $last_suggestions_import_operation + * Output only. Name of the LRO corresponding to the latest suggestion terms + * list import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. + * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $denylist_input_config + * Output only. The source data for the latest import of the autocomplete + * denylist phrases. + * @type string $last_denylist_import_operation + * Output only. Name of the LRO corresponding to the latest denylist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $allowlist_input_config + * Output only. The source data for the latest import of the autocomplete + * allowlist phrases. + * @type string $last_allowlist_import_operation + * Output only. Name of the LRO corresponding to the latest allowlist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Fully qualified name + * `projects/*/locations/*/catalogs/*/completionConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Immutable. Fully qualified name + * `projects/*/locations/*/catalogs/*/completionConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Specifies the matching order for autocomplete suggestions, e.g., a query + * consisting of 'sh' with 'out-of-order' specified would suggest "women's + * shoes", whereas a query of 'red s' with 'exact-prefix' specified would + * suggest "red shoes". Currently supported values: + * * 'out-of-order' + * * 'exact-prefix' + * Default value: 'exact-prefix'. + * + * Generated from protobuf field string matching_order = 2; + * @return string + */ + public function getMatchingOrder() + { + return $this->matching_order; + } + + /** + * Specifies the matching order for autocomplete suggestions, e.g., a query + * consisting of 'sh' with 'out-of-order' specified would suggest "women's + * shoes", whereas a query of 'red s' with 'exact-prefix' specified would + * suggest "red shoes". Currently supported values: + * * 'out-of-order' + * * 'exact-prefix' + * Default value: 'exact-prefix'. + * + * Generated from protobuf field string matching_order = 2; + * @param string $var + * @return $this + */ + public function setMatchingOrder($var) + { + GPBUtil::checkString($var, True); + $this->matching_order = $var; + + return $this; + } + + /** + * The maximum number of autocomplete suggestions returned per term. Default + * value is 20. If left unset or set to 0, then will fallback to default + * value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 max_suggestions = 3; + * @return int + */ + public function getMaxSuggestions() + { + return $this->max_suggestions; + } + + /** + * The maximum number of autocomplete suggestions returned per term. Default + * value is 20. If left unset or set to 0, then will fallback to default + * value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 max_suggestions = 3; + * @param int $var + * @return $this + */ + public function setMaxSuggestions($var) + { + GPBUtil::checkInt32($var); + $this->max_suggestions = $var; + + return $this; + } + + /** + * The minimum number of characters needed to be typed in order to get + * suggestions. Default value is 2. If left unset or set to 0, then will + * fallback to default value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 min_prefix_length = 4; + * @return int + */ + public function getMinPrefixLength() + { + return $this->min_prefix_length; + } + + /** + * The minimum number of characters needed to be typed in order to get + * suggestions. Default value is 2. If left unset or set to 0, then will + * fallback to default value. + * Value range is 1 to 20. + * + * Generated from protobuf field int32 min_prefix_length = 4; + * @param int $var + * @return $this + */ + public function setMinPrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->min_prefix_length = $var; + + return $this; + } + + /** + * If set to true, the auto learning function is enabled. Auto learning uses + * user data to generate suggestions using ML techniques. Default value is + * false. Only after enabling auto learning can users use `cloud-retail` + * data in + * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. + * + * Generated from protobuf field bool auto_learning = 11; + * @return bool + */ + public function getAutoLearning() + { + return $this->auto_learning; + } + + /** + * If set to true, the auto learning function is enabled. Auto learning uses + * user data to generate suggestions using ML techniques. Default value is + * false. Only after enabling auto learning can users use `cloud-retail` + * data in + * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. + * + * Generated from protobuf field bool auto_learning = 11; + * @param bool $var + * @return $this + */ + public function setAutoLearning($var) + { + GPBUtil::checkBool($var); + $this->auto_learning = $var; + + return $this; + } + + /** + * Output only. The source data for the latest import of the autocomplete + * suggestion phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null + */ + public function getSuggestionsInputConfig() + { + return $this->suggestions_input_config; + } + + public function hasSuggestionsInputConfig() + { + return isset($this->suggestions_input_config); + } + + public function clearSuggestionsInputConfig() + { + unset($this->suggestions_input_config); + } + + /** + * Output only. The source data for the latest import of the autocomplete + * suggestion phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var + * @return $this + */ + public function setSuggestionsInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); + $this->suggestions_input_config = $var; + + return $this; + } + + /** + * Output only. Name of the LRO corresponding to the latest suggestion terms + * list import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastSuggestionsImportOperation() + { + return $this->last_suggestions_import_operation; + } + + /** + * Output only. Name of the LRO corresponding to the latest suggestion terms + * list import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastSuggestionsImportOperation($var) + { + GPBUtil::checkString($var, True); + $this->last_suggestions_import_operation = $var; + + return $this; + } + + /** + * Output only. The source data for the latest import of the autocomplete + * denylist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null + */ + public function getDenylistInputConfig() + { + return $this->denylist_input_config; + } + + public function hasDenylistInputConfig() + { + return isset($this->denylist_input_config); + } + + public function clearDenylistInputConfig() + { + unset($this->denylist_input_config); + } + + /** + * Output only. The source data for the latest import of the autocomplete + * denylist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var + * @return $this + */ + public function setDenylistInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); + $this->denylist_input_config = $var; + + return $this; + } + + /** + * Output only. Name of the LRO corresponding to the latest denylist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastDenylistImportOperation() + { + return $this->last_denylist_import_operation; + } + + /** + * Output only. Name of the LRO corresponding to the latest denylist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastDenylistImportOperation($var) + { + GPBUtil::checkString($var, True); + $this->last_denylist_import_operation = $var; + + return $this; + } + + /** + * Output only. The source data for the latest import of the autocomplete + * allowlist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null + */ + public function getAllowlistInputConfig() + { + return $this->allowlist_input_config; + } + + public function hasAllowlistInputConfig() + { + return isset($this->allowlist_input_config); + } + + public function clearAllowlistInputConfig() + { + unset($this->allowlist_input_config); + } + + /** + * Output only. The source data for the latest import of the autocomplete + * allowlist phrases. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var + * @return $this + */ + public function setAllowlistInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); + $this->allowlist_input_config = $var; + + return $this; + } + + /** + * Output only. Name of the LRO corresponding to the latest allowlist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastAllowlistImportOperation() + { + return $this->last_allowlist_import_operation; + } + + /** + * Output only. Name of the LRO corresponding to the latest allowlist import. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + * retrieve the latest state of the Long Running Operation. + * + * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastAllowlistImportOperation($var) + { + GPBUtil::checkString($var, True); + $this->last_allowlist_import_operation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php new file mode 100644 index 00000000000..6c1c6ccf343 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php @@ -0,0 +1,84 @@ +google.cloud.retail.v2.CompletionDataInputConfig + */ +class CompletionDataInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source + * Required. BigQuery input source. + * Add the IAM permission "BigQuery Data Viewer" for + * cloud-retail-customer-data-access@system.gserviceaccount.com before + * using this feature otherwise an error is thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. BigQuery input source. + * Add the IAM permission "BigQuery Data Viewer" for + * cloud-retail-customer-data-access@system.gserviceaccount.com before + * using this feature otherwise an error is thrown. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\BigQuerySource|null + */ + public function getBigQuerySource() + { + return $this->readOneof(1); + } + + public function hasBigQuerySource() + { + return $this->hasOneof(1); + } + + /** + * Required. BigQuery input source. + * Add the IAM permission "BigQuery Data Viewer" for + * cloud-retail-customer-data-access@system.gserviceaccount.com before + * using this feature otherwise an error is thrown. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\BigQuerySource $var + * @return $this + */ + public function setBigQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php new file mode 100644 index 00000000000..34e8ffe98e9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php @@ -0,0 +1,152 @@ +google.cloud.retail.v2.CompletionDetail + */ +class CompletionDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Completion attribution token in + * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. + * + * Generated from protobuf field string completion_attribution_token = 1; + */ + protected $completion_attribution_token = ''; + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. + * + * Generated from protobuf field string selected_suggestion = 2; + */ + protected $selected_suggestion = ''; + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] + * position, starting from 0. + * + * Generated from protobuf field int32 selected_position = 3; + */ + protected $selected_position = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $completion_attribution_token + * Completion attribution token in + * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. + * @type string $selected_suggestion + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. + * @type int $selected_position + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] + * position, starting from 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Completion attribution token in + * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. + * + * Generated from protobuf field string completion_attribution_token = 1; + * @return string + */ + public function getCompletionAttributionToken() + { + return $this->completion_attribution_token; + } + + /** + * Completion attribution token in + * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. + * + * Generated from protobuf field string completion_attribution_token = 1; + * @param string $var + * @return $this + */ + public function setCompletionAttributionToken($var) + { + GPBUtil::checkString($var, True); + $this->completion_attribution_token = $var; + + return $this; + } + + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. + * + * Generated from protobuf field string selected_suggestion = 2; + * @return string + */ + public function getSelectedSuggestion() + { + return $this->selected_suggestion; + } + + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. + * + * Generated from protobuf field string selected_suggestion = 2; + * @param string $var + * @return $this + */ + public function setSelectedSuggestion($var) + { + GPBUtil::checkString($var, True); + $this->selected_suggestion = $var; + + return $this; + } + + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] + * position, starting from 0. + * + * Generated from protobuf field int32 selected_position = 3; + * @return int + */ + public function getSelectedPosition() + { + return $this->selected_position; + } + + /** + * End user selected + * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] + * position, starting from 0. + * + * Generated from protobuf field int32 selected_position = 3; + * @param int $var + * @return $this + */ + public function setSelectedPosition($var) + { + GPBUtil::checkInt32($var); + $this->selected_position = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php new file mode 100644 index 00000000000..7f735eab09e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php @@ -0,0 +1,168 @@ +google.cloud.retail.v2.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * A list (up to 10 entries) of terms to match the query on. If not + * specified, match all queries. + * If many query terms are specified, the condition + * is matched if any of the terms is a match (i.e. using the OR operator). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; + */ + private $query_terms; + /** + * Range of time(s) specifying when Condition is active. + * Condition true if any time range matches. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; + */ + private $active_time_range; + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + */ + private $page_categories; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $query_terms + * A list (up to 10 entries) of terms to match the query on. If not + * specified, match all queries. + * If many query terms are specified, the condition + * is matched if any of the terms is a match (i.e. using the OR operator). + * @type array<\Google\Cloud\Retail\V2\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $active_time_range + * Range of time(s) specifying when Condition is active. + * Condition true if any time range matches. + * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * A list (up to 10 entries) of terms to match the query on. If not + * specified, match all queries. + * If many query terms are specified, the condition + * is matched if any of the terms is a match (i.e. using the OR operator). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * A list (up to 10 entries) of terms to match the query on. If not + * specified, match all queries. + * If many query terms are specified, the condition + * is matched if any of the terms is a match (i.e. using the OR operator). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; + * @param array<\Google\Cloud\Retail\V2\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Condition\QueryTerm::class); + $this->query_terms = $arr; + + return $this; + } + + /** + * Range of time(s) specifying when Condition is active. + * Condition true if any time range matches. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveTimeRange() + { + return $this->active_time_range; + } + + /** + * Range of time(s) specifying when Condition is active. + * Condition true if any time range matches. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; + * @param array<\Google\Cloud\Retail\V2\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveTimeRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Condition\TimeRange::class); + $this->active_time_range = $arr; + + return $this; + } + + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageCategories() + { + return $this->page_categories; + } + + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->page_categories = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php new file mode 100644 index 00000000000..67dabf7388d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php @@ -0,0 +1,124 @@ +google.cloud.retail.v2.Condition.QueryTerm + */ +class QueryTerm extends \Google\Protobuf\Internal\Message +{ + /** + * The value of the term to match on. + * Value cannot be empty. + * Value can have at most 3 terms if specified as a partial match. Each + * space separated string is considered as one term. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + /** + * Whether this is supposed to be a full or partial match. + * + * Generated from protobuf field bool full_match = 2; + */ + protected $full_match = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The value of the term to match on. + * Value cannot be empty. + * Value can have at most 3 terms if specified as a partial match. Each + * space separated string is considered as one term. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. + * @type bool $full_match + * Whether this is supposed to be a full or partial match. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The value of the term to match on. + * Value cannot be empty. + * Value can have at most 3 terms if specified as a partial match. Each + * space separated string is considered as one term. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value of the term to match on. + * Value cannot be empty. + * Value can have at most 3 terms if specified as a partial match. Each + * space separated string is considered as one term. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Whether this is supposed to be a full or partial match. + * + * Generated from protobuf field bool full_match = 2; + * @return bool + */ + public function getFullMatch() + { + return $this->full_match; + } + + /** + * Whether this is supposed to be a full or partial match. + * + * Generated from protobuf field bool full_match = 2; + * @param bool $var + * @return $this + */ + public function setFullMatch($var) + { + GPBUtil::checkBool($var); + $this->full_match = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryTerm::class, \Google\Cloud\Retail\V2\Condition_QueryTerm::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php new file mode 100644 index 00000000000..0321302ba94 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php @@ -0,0 +1,125 @@ +google.cloud.retail.v2.Condition.TimeRange + */ +class TimeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Start of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start of time range. Range is inclusive. + * @type \Google\Protobuf\Timestamp $end_time + * End of time range. Range is inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Start of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End of time range. Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeRange::class, \Google\Cloud\Retail\V2\Condition_TimeRange::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php new file mode 100644 index 00000000000..95c0064ea00 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php @@ -0,0 +1,325 @@ +google.cloud.retail.v2.Control + */ +class Control extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The human readable control display name. Used in Retail UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] + * ids that are associated with this control in the same + * [Catalog][google.cloud.retail.v2.Catalog]. + * Note the association is managed via the + * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output + * only denormalized view. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $associated_serving_config_ids; + /** + * Required. Immutable. The solution types that the control is used for. + * Currently we support setting only one type of solution at creation time. + * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. + * If no solution type is provided at creation time, will default to + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + private $solution_types; + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only settable by search controls. + * Will default to + * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + * if not specified. Currently only allow one search_solution_use_case per + * control. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; + */ + private $search_solution_use_case; + protected $control; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Rule $rule + * A rule control - a condition-action pair. + * Enacts a set action when the condition is triggered. + * For example: Boost "gShoe" when query full matches "Running Shoes". + * @type string $name + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/controls/*` + * @type string $display_name + * Required. The human readable control display name. Used in Retail UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is thrown. + * @type array|\Google\Protobuf\Internal\RepeatedField $associated_serving_config_ids + * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] + * ids that are associated with this control in the same + * [Catalog][google.cloud.retail.v2.Catalog]. + * Note the association is managed via the + * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output + * only denormalized view. + * @type array|\Google\Protobuf\Internal\RepeatedField $solution_types + * Required. Immutable. The solution types that the control is used for. + * Currently we support setting only one type of solution at creation time. + * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. + * If no solution type is provided at creation time, will default to + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $search_solution_use_case + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only settable by search controls. + * Will default to + * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + * if not specified. Currently only allow one search_solution_use_case per + * control. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Control::initOnce(); + parent::__construct($data); + } + + /** + * A rule control - a condition-action pair. + * Enacts a set action when the condition is triggered. + * For example: Boost "gShoe" when query full matches "Running Shoes". + * + * Generated from protobuf field .google.cloud.retail.v2.Rule rule = 4; + * @return \Google\Cloud\Retail\V2\Rule|null + */ + public function getRule() + { + return $this->readOneof(4); + } + + public function hasRule() + { + return $this->hasOneof(4); + } + + /** + * A rule control - a condition-action pair. + * Enacts a set action when the condition is triggered. + * For example: Boost "gShoe" when query full matches "Running Shoes". + * + * Generated from protobuf field .google.cloud.retail.v2.Rule rule = 4; + * @param \Google\Cloud\Retail\V2\Rule $var + * @return $this + */ + public function setRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The human readable control display name. Used in Retail UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The human readable control display name. Used in Retail UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] + * ids that are associated with this control in the same + * [Catalog][google.cloud.retail.v2.Catalog]. + * Note the association is managed via the + * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output + * only denormalized view. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociatedServingConfigIds() + { + return $this->associated_serving_config_ids; + } + + /** + * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] + * ids that are associated with this control in the same + * [Catalog][google.cloud.retail.v2.Catalog]. + * Note the association is managed via the + * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output + * only denormalized view. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociatedServingConfigIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->associated_serving_config_ids = $arr; + + return $this; + } + + /** + * Required. Immutable. The solution types that the control is used for. + * Currently we support setting only one type of solution at creation time. + * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. + * If no solution type is provided at creation time, will default to + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSolutionTypes() + { + return $this->solution_types; + } + + /** + * Required. Immutable. The solution types that the control is used for. + * Currently we support setting only one type of solution at creation time. + * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. + * If no solution type is provided at creation time, will default to + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSolutionTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SolutionType::class); + $this->solution_types = $arr; + + return $this; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only settable by search controls. + * Will default to + * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + * if not specified. Currently only allow one search_solution_use_case per + * control. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSearchSolutionUseCase() + { + return $this->search_solution_use_case; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only settable by search controls. + * Will default to + * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + * if not specified. Currently only allow one search_solution_use_case per + * control. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSearchSolutionUseCase($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SearchSolutionUseCase::class); + $this->search_solution_use_case = $arr; + + return $this; + } + + /** + * @return string + */ + public function getControl() + { + return $this->whichOneof("control"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php new file mode 100644 index 00000000000..46341e8ca69 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php @@ -0,0 +1,184 @@ +google.cloud.retail.v2.CreateControlRequest + */ +class CreateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of parent catalog. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control_id = ''; + + /** + * @param string $parent Required. Full resource name of parent catalog. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ControlServiceClient::catalogName()} for help formatting this field. + * @param \Google\Cloud\Retail\V2\Control $control Required. The Control to create. + * @param string $controlId Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * @return \Google\Cloud\Retail\V2\CreateControlRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Retail\V2\Control $control, string $controlId): self + { + return (new self()) + ->setParent($parent) + ->setControl($control) + ->setControlId($controlId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Full resource name of parent catalog. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type \Google\Cloud\Retail\V2\Control $control + * Required. The Control to create. + * @type string $control_id + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of parent catalog. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. Full resource name of parent catalog. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 Control to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getControlId() + { + return $this->control_id; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setControlId($var) + { + GPBUtil::checkString($var, True); + $this->control_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php new file mode 100644 index 00000000000..861be04c86a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.CreateModelMetadata + */ +class CreateModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the model that this create applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * The resource name of the model that this create applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the model that this create applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * The resource name of the model that this create applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php new file mode 100644 index 00000000000..cb224299c9c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php @@ -0,0 +1,175 @@ +google.cloud.retail.v2.CreateModelRequest + */ +class CreateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The payload of the [Model][google.cloud.retail.v2.Model] to + * create. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + /** + * Optional. Whether to run a dry run to validate the request (without + * actually creating the model). + * + * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dry_run = false; + + /** + * @param string $parent Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ModelServiceClient::catalogName()} for help formatting this field. + * @param \Google\Cloud\Retail\V2\Model $model Required. The payload of the [Model][google.cloud.retail.v2.Model] to + * create. + * + * @return \Google\Cloud\Retail\V2\CreateModelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Retail\V2\Model $model): self + { + return (new self()) + ->setParent($parent) + ->setModel($model); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type \Google\Cloud\Retail\V2\Model $model + * Required. The payload of the [Model][google.cloud.retail.v2.Model] to + * create. + * @type bool $dry_run + * Optional. Whether to run a dry run to validate the request (without + * actually creating the model). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 payload of the [Model][google.cloud.retail.v2.Model] to + * create. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The payload of the [Model][google.cloud.retail.v2.Model] to + * create. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model::class); + $this->model = $var; + + return $this; + } + + /** + * Optional. Whether to run a dry run to validate the request (without + * actually creating the model). + * + * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDryRun() + { + return $this->dry_run; + } + + /** + * Optional. Whether to run a dry run to validate the request (without + * actually creating the model). + * + * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDryRun($var) + { + GPBUtil::checkBool($var); + $this->dry_run = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php new file mode 100644 index 00000000000..5da8a9affe8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php @@ -0,0 +1,228 @@ +google.cloud.retail.v2.CreateProductRequest + */ +class CreateProductRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The [Product][google.cloud.retail.v2.Product] to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product = null; + /** + * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2.Product.name]. + * If the caller does not have permission to create the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * This field must be unique among all + * [Product][google.cloud.retail.v2.Product]s with the same + * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product_id = ''; + + /** + * @param string $parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. Please see + * {@see ProductServiceClient::branchName()} for help formatting this field. + * @param \Google\Cloud\Retail\V2\Product $product Required. The [Product][google.cloud.retail.v2.Product] to create. + * @param string $productId Required. The ID to use for the [Product][google.cloud.retail.v2.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2.Product.name]. + * + * If the caller does not have permission to create the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * This field must be unique among all + * [Product][google.cloud.retail.v2.Product]s with the same + * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + * + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * @return \Google\Cloud\Retail\V2\CreateProductRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Retail\V2\Product $product, string $productId): self + { + return (new self()) + ->setParent($parent) + ->setProduct($product) + ->setProductId($productId); + } + + /** + * 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/branches/default_branch`. + * @type \Google\Cloud\Retail\V2\Product $product + * Required. The [Product][google.cloud.retail.v2.Product] to create. + * @type string $product_id + * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2.Product.name]. + * If the caller does not have permission to create the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * This field must be unique among all + * [Product][google.cloud.retail.v2.Product]s with the same + * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * + * 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/branches/default_branch`. + * + * 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 [Product][google.cloud.retail.v2.Product] to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Product|null + */ + public function getProduct() + { + return $this->product; + } + + public function hasProduct() + { + return isset($this->product); + } + + public function clearProduct() + { + unset($this->product); + } + + /** + * Required. The [Product][google.cloud.retail.v2.Product] to create. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Product $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); + $this->product = $var; + + return $this; + } + + /** + * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2.Product.name]. + * If the caller does not have permission to create the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * This field must be unique among all + * [Product][google.cloud.retail.v2.Product]s with the same + * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProductId() + { + return $this->product_id; + } + + /** + * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2.Product.name]. + * If the caller does not have permission to create the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * This field must be unique among all + * [Product][google.cloud.retail.v2.Product]s with the same + * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProductId($var) + { + GPBUtil::checkString($var, True); + $this->product_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php new file mode 100644 index 00000000000..a1dcf87819f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php @@ -0,0 +1,184 @@ +google.cloud.retail.v2.CreateServingConfigRequest + */ +class CreateServingConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of parent. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ServingConfig to create. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $serving_config = null; + /** + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $serving_config_id = ''; + + /** + * @param string $parent Required. Full resource name of parent. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ServingConfigServiceClient::catalogName()} for help formatting this field. + * @param \Google\Cloud\Retail\V2\ServingConfig $servingConfig Required. The ServingConfig to create. + * @param string $servingConfigId Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * @return \Google\Cloud\Retail\V2\CreateServingConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Retail\V2\ServingConfig $servingConfig, string $servingConfigId): self + { + return (new self()) + ->setParent($parent) + ->setServingConfig($servingConfig) + ->setServingConfigId($servingConfigId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Full resource name of parent. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type \Google\Cloud\Retail\V2\ServingConfig $serving_config + * Required. The ServingConfig to create. + * @type string $serving_config_id + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of parent. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. Full resource name of parent. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 ServingConfig to create. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\ServingConfig|null + */ + public function getServingConfig() + { + return $this->serving_config; + } + + public function hasServingConfig() + { + return isset($this->serving_config); + } + + public function clearServingConfig() + { + unset($this->serving_config); + } + + /** + * Required. The ServingConfig to create. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\ServingConfig $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ServingConfig::class); + $this->serving_config = $var; + + return $this; + } + + /** + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServingConfigId() + { + return $this->serving_config_id; + } + + /** + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + * + * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServingConfigId($var) + { + GPBUtil::checkString($var, True); + $this->serving_config_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php new file mode 100644 index 00000000000..729f9371c9b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php @@ -0,0 +1,340 @@ +google.cloud.retail.v2.CustomAttribute + */ +class CustomAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * The textual values of this custom attribute. For example, `["yellow", + * "green"]` when the key is "color". + * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string text = 1; + */ + private $text; + /** + * The numerical values of this custom attribute. For example, `[2.3, 15.4]` + * when the key is "lengths_cm". + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated double numbers = 2; + */ + private $numbers; + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is + * set. Otherwise, a INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; + * @deprecated + */ + protected $searchable = null; + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are indexed, so that they can be filtered, + * faceted or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * for more details. + * + * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; + * @deprecated + */ + protected $indexable = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $text + * The textual values of this custom attribute. For example, `["yellow", + * "green"]` when the key is "color". + * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $numbers + * The numerical values of this custom attribute. For example, `[2.3, 15.4]` + * when the key is "lengths_cm". + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @type bool $searchable + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is + * set. Otherwise, a INVALID_ARGUMENT error is returned. + * @type bool $indexable + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are indexed, so that they can be filtered, + * faceted or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The textual values of this custom attribute. For example, `["yellow", + * "green"]` when the key is "color". + * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string text = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getText() + { + return $this->text; + } + + /** + * The textual values of this custom attribute. For example, `["yellow", + * "green"]` when the key is "color". + * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string text = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setText($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->text = $arr; + + return $this; + } + + /** + * The numerical values of this custom attribute. For example, `[2.3, 15.4]` + * when the key is "lengths_cm". + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated double numbers = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNumbers() + { + return $this->numbers; + } + + /** + * The numerical values of this custom attribute. For example, `[2.3, 15.4]` + * when the key is "lengths_cm". + * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or + * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated double numbers = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNumbers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->numbers = $arr; + + return $this; + } + + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is + * set. Otherwise, a INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getSearchable() + { + @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); + return isset($this->searchable) ? $this->searchable : false; + } + + public function hasSearchable() + { + @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); + return isset($this->searchable); + } + + public function clearSearchable() + { + @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); + unset($this->searchable); + } + + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are searchable by text queries in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is + * set. Otherwise, a INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setSearchable($var) + { + @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->searchable = $var; + + return $this; + } + + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are indexed, so that they can be filtered, + * faceted or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * for more details. + * + * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getIndexable() + { + @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); + return isset($this->indexable) ? $this->indexable : false; + } + + public function hasIndexable() + { + @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); + return isset($this->indexable); + } + + public function clearIndexable() + { + @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); + unset($this->indexable); + } + + /** + * This field is normally ignored unless + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated + * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + * attribute configuration, see [Configuration + * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + * If true, custom attribute values are indexed, so that they can be filtered, + * faceted or boosted in + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * for more details. + * + * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setIndexable($var) + { + @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->indexable = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php new file mode 100644 index 00000000000..3d0df8b6b5b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.DeleteControlRequest + */ +class DeleteControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\DeleteControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php new file mode 100644 index 00000000000..c0d11278c52 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php @@ -0,0 +1,91 @@ +google.cloud.retail.v2.DeleteModelRequest + */ +class DeleteModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * Please see {@see ModelServiceClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\DeleteModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The resource name of the [Model][google.cloud.retail.v2.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php new file mode 100644 index 00000000000..2108d81c180 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php @@ -0,0 +1,167 @@ +google.cloud.retail.v2.DeleteProductRequest + */ +class DeleteProductRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, + * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, + * a NOT_FOUND error is returned. + * + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\DeleteProductRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, + * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, + * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. + * + * 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 [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, + * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php new file mode 100644 index 00000000000..4cf751c33d1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.DeleteServingConfigRequest + */ +class DeleteServingConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the ServingConfig to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the ServingConfig to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\DeleteServingConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the ServingConfig to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the ServingConfig to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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. The resource name of the ServingConfig to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php new file mode 100644 index 00000000000..bcc68426616 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php @@ -0,0 +1,120 @@ +google.cloud.retail.v2.ExperimentInfo + */ +class ExperimentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified resource name of the experiment that provides the + * serving config under test, should an active experiment exist. For example: + * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` + * + * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { + */ + protected $experiment = ''; + protected $experiment_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment $serving_config_experiment + * A/B test between existing Cloud Retail Search + * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. + * @type string $experiment + * The fully qualified resource name of the experiment that provides the + * serving config under test, should an active experiment exist. For example: + * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * A/B test between existing Cloud Retail Search + * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. + * + * Generated from protobuf field .google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment serving_config_experiment = 2; + * @return \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment|null + */ + public function getServingConfigExperiment() + { + return $this->readOneof(2); + } + + public function hasServingConfigExperiment() + { + return $this->hasOneof(2); + } + + /** + * A/B test between existing Cloud Retail Search + * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. + * + * Generated from protobuf field .google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment serving_config_experiment = 2; + * @param \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment $var + * @return $this + */ + public function setServingConfigExperiment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The fully qualified resource name of the experiment that provides the + * serving config under test, should an active experiment exist. For example: + * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` + * + * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getExperiment() + { + return $this->experiment; + } + + /** + * The fully qualified resource name of the experiment that provides the + * serving config under test, should an active experiment exist. For example: + * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` + * + * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setExperiment($var) + { + GPBUtil::checkString($var, True); + $this->experiment = $var; + + return $this; + } + + /** + * @return string + */ + public function getExperimentMetadata() + { + return $this->whichOneof("experiment_metadata"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php new file mode 100644 index 00000000000..f4415879967 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php @@ -0,0 +1,128 @@ +google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment + */ +class ServingConfigExperiment extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified resource name of the original + * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] + * in the search request prior to reassignment by experiment API. For + * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { + */ + protected $original_serving_config = ''; + /** + * The fully qualified resource name of the serving config + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: + * `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { + */ + protected $experiment_serving_config = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $original_serving_config + * The fully qualified resource name of the original + * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] + * in the search request prior to reassignment by experiment API. For + * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * @type string $experiment_serving_config + * The fully qualified resource name of the serving config + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: + * `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified resource name of the original + * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] + * in the search request prior to reassignment by experiment API. For + * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getOriginalServingConfig() + { + return $this->original_serving_config; + } + + /** + * The fully qualified resource name of the original + * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] + * in the search request prior to reassignment by experiment API. For + * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOriginalServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->original_serving_config = $var; + + return $this; + } + + /** + * The fully qualified resource name of the serving config + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: + * `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getExperimentServingConfig() + { + return $this->experiment_serving_config; + } + + /** + * The fully qualified resource name of the serving config + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: + * `projects/*/locations/*/catalogs/*/servingConfigs/*`. + * + * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setExperimentServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->experiment_serving_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServingConfigExperiment::class, \Google\Cloud\Retail\V2\ExperimentInfo_ServingConfigExperiment::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php new file mode 100644 index 00000000000..fe27a13b98d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php @@ -0,0 +1,197 @@ +google.cloud.retail.v2.ExportAnalyticsMetricsRequest + */ +class ExportAnalyticsMetricsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of the parent catalog. + * Expected format: `projects/*/locations/*/catalogs/*` + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = ''; + /** + * Required. The output location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + /** + * A filtering expression to specify restrictions on returned metrics. + * The expression is a sequence of terms. Each term applies a restriction to + * the returned metrics. Use this expression to restrict results to a + * specific time range. + * Currently we expect only one types of fields: + * * `timestamp`: This can be specified twice, once with a + * less than operator and once with a greater than operator. The + * `timestamp` restriction should result in one, contiguous, valid, + * `timestamp` range. + * Some examples of valid filters expressions: + * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + * timestamp < "2012-04-23T18:30:43.511Z"` + * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Full resource name of the parent catalog. + * Expected format: `projects/*/locations/*/catalogs/*` + * @type \Google\Cloud\Retail\V2\OutputConfig $output_config + * Required. The output location of the data. + * @type string $filter + * A filtering expression to specify restrictions on returned metrics. + * The expression is a sequence of terms. Each term applies a restriction to + * the returned metrics. Use this expression to restrict results to a + * specific time range. + * Currently we expect only one types of fields: + * * `timestamp`: This can be specified twice, once with a + * less than operator and once with a greater than operator. The + * `timestamp` restriction should result in one, contiguous, valid, + * `timestamp` range. + * Some examples of valid filters expressions: + * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + * timestamp < "2012-04-23T18:30:43.511Z"` + * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of the parent catalog. + * Expected format: `projects/*/locations/*/catalogs/*` + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Full resource name of the parent catalog. + * Expected format: `projects/*/locations/*/catalogs/*` + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Required. The output location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The output location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * A filtering expression to specify restrictions on returned metrics. + * The expression is a sequence of terms. Each term applies a restriction to + * the returned metrics. Use this expression to restrict results to a + * specific time range. + * Currently we expect only one types of fields: + * * `timestamp`: This can be specified twice, once with a + * less than operator and once with a greater than operator. The + * `timestamp` restriction should result in one, contiguous, valid, + * `timestamp` range. + * Some examples of valid filters expressions: + * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + * timestamp < "2012-04-23T18:30:43.511Z"` + * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filtering expression to specify restrictions on returned metrics. + * The expression is a sequence of terms. Each term applies a restriction to + * the returned metrics. Use this expression to restrict results to a + * specific time range. + * Currently we expect only one types of fields: + * * `timestamp`: This can be specified twice, once with a + * less than operator and once with a greater than operator. The + * `timestamp` restriction should result in one, contiguous, valid, + * `timestamp` range. + * Some examples of valid filters expressions: + * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + * timestamp < "2012-04-23T18:30:43.511Z"` + * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php new file mode 100644 index 00000000000..83a6f850ab7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php @@ -0,0 +1,157 @@ +google.cloud.retail.v2.ExportAnalyticsMetricsResponse + */ +class ExportAnalyticsMetricsResponse 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; + /** + * This field is never set. + * + * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; + */ + protected $errors_config = null; + /** + * Output result indicating where the data were exported to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; + */ + protected $output_result = 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\Retail\V2\ExportErrorsConfig $errors_config + * This field is never set. + * @type \Google\Cloud\Retail\V2\OutputResult $output_result + * Output result indicating where the data were exported to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::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; + } + + /** + * This field is never set. + * + * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; + * @return \Google\Cloud\Retail\V2\ExportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * This field is never set. + * + * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; + * @param \Google\Cloud\Retail\V2\ExportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ExportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + + /** + * Output result indicating where the data were exported to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; + * @return \Google\Cloud\Retail\V2\OutputResult|null + */ + public function getOutputResult() + { + return $this->output_result; + } + + public function hasOutputResult() + { + return isset($this->output_result); + } + + public function clearOutputResult() + { + unset($this->output_result); + } + + /** + * Output result indicating where the data were exported to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; + * @param \Google\Cloud\Retail\V2\OutputResult $var + * @return $this + */ + public function setOutputResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputResult::class); + $this->output_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php new file mode 100644 index 00000000000..157be71516b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php @@ -0,0 +1,84 @@ +google.cloud.retail.v2.ExportErrorsConfig + */ +class ExportErrorsConfig 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. Export 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\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage path for import errors. This must be an empty, + * existing Cloud Storage bucket. Export 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. Export 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php new file mode 100644 index 00000000000..2eeb972c6c1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php @@ -0,0 +1,126 @@ +google.cloud.retail.v2.ExportMetadata + */ +class ExportMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * @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\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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 = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $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 = 2; + * @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 = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php new file mode 100644 index 00000000000..d1aa1982708 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php @@ -0,0 +1,190 @@ +google.cloud.retail.v2.FulfillmentInfo + */ +class FulfillmentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The fulfillment type, including commonly used types (such as pickup in + * store and same day delivery), and custom types. Customers have to map + * custom types to their display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such + * as the store IDs for + * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] + * or the region IDs for + * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. + * A maximum of 3000 values are allowed. Each value must be a string with a + * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string place_ids = 2; + */ + private $place_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The fulfillment type, including commonly used types (such as pickup in + * store and same day delivery), and custom types. Customers have to map + * custom types to their display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids + * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such + * as the store IDs for + * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] + * or the region IDs for + * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. + * A maximum of 3000 values are allowed. Each value must be a string with a + * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The fulfillment type, including commonly used types (such as pickup in + * store and same day delivery), and custom types. Customers have to map + * custom types to their display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The fulfillment type, including commonly used types (such as pickup in + * store and same day delivery), and custom types. Customers have to map + * custom types to their display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such + * as the store IDs for + * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] + * or the region IDs for + * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. + * A maximum of 3000 values are allowed. Each value must be a string with a + * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string place_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPlaceIds() + { + return $this->place_ids; + } + + /** + * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such + * as the store IDs for + * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] + * or the region IDs for + * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. + * A maximum of 3000 values are allowed. Each value must be a string with a + * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string place_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPlaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->place_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php new file mode 100644 index 00000000000..98715d2fa04 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.GcsOutputResult + */ +class GcsOutputResult extends \Google\Protobuf\Internal\Message +{ + /** + * The uri of Gcs output + * + * Generated from protobuf field string output_uri = 1; + */ + protected $output_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_uri + * The uri of Gcs output + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * The uri of Gcs output + * + * Generated from protobuf field string output_uri = 1; + * @return string + */ + public function getOutputUri() + { + return $this->output_uri; + } + + /** + * The uri of Gcs output + * + * Generated from protobuf field string output_uri = 1; + * @param string $var + * @return $this + */ + public function setOutputUri($var) + { + GPBUtil::checkString($var, True); + $this->output_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php new file mode 100644 index 00000000000..54ca3742fb9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php @@ -0,0 +1,197 @@ +google.cloud.retail.v2.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 product + * information](https://cloud.google.com/retail/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; + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: Using + * https://support.google.com/analytics/answer/3437719. + * Supported values for control imports: + * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] + * per line. + * Supported values for catalog attribute imports: + * * `catalog_attribute` (default): One CSV + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. + * + * Generated from protobuf field string data_schema = 2; + */ + protected $data_schema = ''; + + /** + * 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 product + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) + * for the expected file format and setup instructions. + * @type string $data_schema + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: Using + * https://support.google.com/analytics/answer/3437719. + * Supported values for control imports: + * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] + * per line. + * Supported values for catalog attribute imports: + * * `catalog_attribute` (default): One CSV + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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 product + * information](https://cloud.google.com/retail/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 product + * information](https://cloud.google.com/retail/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; + } + + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: Using + * https://support.google.com/analytics/answer/3437719. + * Supported values for control imports: + * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] + * per line. + * Supported values for catalog attribute imports: + * * `catalog_attribute` (default): One CSV + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. + * + * Generated from protobuf field string data_schema = 2; + * @return string + */ + public function getDataSchema() + { + return $this->data_schema; + } + + /** + * The schema to use when parsing the data from the source. + * Supported values for product imports: + * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] + * per line. Each product must + * have a valid [Product.id][google.cloud.retail.v2.Product.id]. + * * `product_merchant_center`: See [Importing catalog data from Merchant + * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + * Supported values for user events imports: + * * `user_event` (default): One JSON + * [UserEvent][google.cloud.retail.v2.UserEvent] per line. + * * `user_event_ga360`: Using + * https://support.google.com/analytics/answer/3437719. + * Supported values for control imports: + * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] + * per line. + * Supported values for catalog attribute imports: + * * `catalog_attribute` (default): One CSV + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. + * + * Generated from protobuf field string data_schema = 2; + * @param string $var + * @return $this + */ + public function setDataSchema($var) + { + GPBUtil::checkString($var, True); + $this->data_schema = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php new file mode 100644 index 00000000000..3735bded7aa --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php @@ -0,0 +1,283 @@ +google.cloud.retail.v2.GenerativeQuestionConfig + */ +class GenerativeQuestionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = ''; + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $facet = ''; + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generated_question = ''; + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $final_question = ''; + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $example_values; + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $frequency = 0.0; + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allowed_in_conversation = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type string $facet + * Required. The facet to which the question is associated. + * @type string $generated_question + * Output only. The LLM generated question. + * @type string $final_question + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * @type array|\Google\Protobuf\Internal\RepeatedField $example_values + * Output only. Values that can be used to answer the question. + * @type float $frequency + * Output only. The ratio of how often a question was asked. + * @type bool $allowed_in_conversation + * Optional. Whether the question is asked at serving time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFacet() + { + return $this->facet; + } + + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFacet($var) + { + GPBUtil::checkString($var, True); + $this->facet = $var; + + return $this; + } + + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGeneratedQuestion() + { + return $this->generated_question; + } + + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGeneratedQuestion($var) + { + GPBUtil::checkString($var, True); + $this->generated_question = $var; + + return $this; + } + + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFinalQuestion() + { + return $this->final_question; + } + + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFinalQuestion($var) + { + GPBUtil::checkString($var, True); + $this->final_question = $var; + + return $this; + } + + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExampleValues() + { + return $this->example_values; + } + + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExampleValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->example_values = $arr; + + return $this; + } + + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkFloat($var); + $this->frequency = $var; + + return $this; + } + + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowedInConversation() + { + return $this->allowed_in_conversation; + } + + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowedInConversation($var) + { + GPBUtil::checkBool($var); + $this->allowed_in_conversation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php new file mode 100644 index 00000000000..a2efd07cd0b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php @@ -0,0 +1,151 @@ +google.cloud.retail.v2.GenerativeQuestionsFeatureConfig + */ +class GenerativeQuestionsFeatureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = ''; + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feature_enabled = false; + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_products = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type bool $feature_enabled + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * @type int $minimum_products + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFeatureEnabled() + { + return $this->feature_enabled; + } + + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFeatureEnabled($var) + { + GPBUtil::checkBool($var); + $this->feature_enabled = $var; + + return $this; + } + + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinimumProducts() + { + return $this->minimum_products; + } + + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinimumProducts($var) + { + GPBUtil::checkInt32($var); + $this->minimum_products = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php new file mode 100644 index 00000000000..a896e48b57d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php @@ -0,0 +1,88 @@ +google.cloud.retail.v2.GetAttributesConfigRequest + */ +class GetAttributesConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * Please see {@see CatalogServiceClient::attributesConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetAttributesConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * 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 AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php new file mode 100644 index 00000000000..c72abb70dfe --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php @@ -0,0 +1,88 @@ +google.cloud.retail.v2.GetCompletionConfigRequest + */ +class GetCompletionConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full CompletionConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Full CompletionConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + * Please see {@see CatalogServiceClient::completionConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetCompletionConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full CompletionConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full CompletionConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + * + * 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 CompletionConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php new file mode 100644 index 00000000000..6cb3a8650e8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.GetControlRequest + */ +class GetControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php new file mode 100644 index 00000000000..fcecd2fdd1d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php @@ -0,0 +1,85 @@ +google.cloud.retail.v2.GetDefaultBranchRequest + */ +class GetDefaultBranchRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + */ + protected $catalog = ''; + + /** + * @param string $catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * @return \Google\Cloud\Retail\V2\GetDefaultBranchRequest + * + * @experimental + */ + public static function build(string $catalog): self + { + return (new self()) + ->setCatalog($catalog); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php new file mode 100644 index 00000000000..0158f17088b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php @@ -0,0 +1,154 @@ +google.cloud.retail.v2.GetDefaultBranchResponse + */ +class GetDefaultBranchResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Full resource name of the branch id currently set as default branch. + * + * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { + */ + protected $branch = ''; + /** + * The time when this branch is set to default. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; + */ + protected $set_time = null; + /** + * This corresponds to + * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] + * field, when this branch was set as default. + * + * Generated from protobuf field string note = 3; + */ + protected $note = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $branch + * Full resource name of the branch id currently set as default branch. + * @type \Google\Protobuf\Timestamp $set_time + * The time when this branch is set to default. + * @type string $note + * This corresponds to + * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] + * field, when this branch was set as default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Full resource name of the branch id currently set as default branch. + * + * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getBranch() + { + return $this->branch; + } + + /** + * Full resource name of the branch id currently set as default branch. + * + * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBranch($var) + { + GPBUtil::checkString($var, True); + $this->branch = $var; + + return $this; + } + + /** + * The time when this branch is set to default. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSetTime() + { + return $this->set_time; + } + + public function hasSetTime() + { + return isset($this->set_time); + } + + public function clearSetTime() + { + unset($this->set_time); + } + + /** + * The time when this branch is set to default. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSetTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->set_time = $var; + + return $this; + } + + /** + * This corresponds to + * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] + * field, when this branch was set as default. + * + * Generated from protobuf field string note = 3; + * @return string + */ + public function getNote() + { + return $this->note; + } + + /** + * This corresponds to + * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] + * field, when this branch was set as default. + * + * Generated from protobuf field string note = 3; + * @param string $var + * @return $this + */ + public function setNote($var) + { + GPBUtil::checkString($var, True); + $this->note = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php new file mode 100644 index 00000000000..3187270c7c1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest + */ +class GetGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $catalog = ''; + + /** + * @param string $catalog Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetGenerativeQuestionsFeatureConfigRequest + * + * @experimental + */ + public static function build(string $catalog): self + { + return (new self()) + ->setCatalog($catalog); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php new file mode 100644 index 00000000000..fc92f0dfca3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php @@ -0,0 +1,91 @@ +google.cloud.retail.v2.GetModelRequest + */ +class GetModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + * Please see {@see ModelServiceClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to + * get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_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. The resource name of the [Model][google.cloud.retail.v2.Model] to + * get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php new file mode 100644 index 00000000000..97de4c43c47 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php @@ -0,0 +1,120 @@ +google.cloud.retail.v2.GetProductRequest + */ +class GetProductRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the requested [Product][google.cloud.retail.v2.Product] does not exist, + * a NOT_FOUND error is returned. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * If the requested [Product][google.cloud.retail.v2.Product] does not exist, + * a NOT_FOUND error is returned. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetProductRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the requested [Product][google.cloud.retail.v2.Product] does not exist, + * a NOT_FOUND error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the requested [Product][google.cloud.retail.v2.Product] does not exist, + * a NOT_FOUND error is returned. + * + * 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 [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the requested [Product][google.cloud.retail.v2.Product] does not exist, + * a NOT_FOUND error is returned. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php new file mode 100644 index 00000000000..907764e94dd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.GetServingConfigRequest + */ +class GetServingConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the ServingConfig to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the ServingConfig to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetServingConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the ServingConfig to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the ServingConfig to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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. The resource name of the ServingConfig to get. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php new file mode 100644 index 00000000000..f15550d0855 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php @@ -0,0 +1,174 @@ +google.cloud.retail.v2.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI of the image. + * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + /** + * Height of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 height = 2; + */ + protected $height = 0; + /** + * Width of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 width = 3; + */ + protected $width = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI of the image. + * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * @type int $height + * Height of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * @type int $width + * Width of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI of the image. + * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI of the image. + * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * 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; + } + + /** + * Height of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 height = 2; + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Height of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 height = 2; + * @param int $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkInt32($var); + $this->height = $var; + + return $this; + } + + /** + * Width of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 width = 3; + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Width of the image in number of pixels. + * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 width = 3; + * @param int $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkInt32($var); + $this->width = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php new file mode 100644 index 00000000000..c7530e9863e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php @@ -0,0 +1,165 @@ +google.cloud.retail.v2.ImportCompletionDataRequest + */ +class ImportCompletionDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The catalog which the suggestions dataset belongs to. + * Format: `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 = ''; + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 3; + */ + protected $notification_pubsub_topic = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The catalog which the suggestions dataset belongs to. + * Format: `projects/1234/locations/global/catalogs/default_catalog`. + * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $input_config + * Required. The desired input location of the data. + * @type string $notification_pubsub_topic + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The catalog which the suggestions dataset belongs to. + * Format: `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. The catalog which the suggestions dataset belongs to. + * Format: `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; + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|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.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 3; + * @return string + */ + public function getNotificationPubsubTopic() + { + return $this->notification_pubsub_topic; + } + + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 3; + * @param string $var + * @return $this + */ + public function setNotificationPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->notification_pubsub_topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php new file mode 100644 index 00000000000..10a922238dd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php @@ -0,0 +1,70 @@ +google.cloud.retail.v2.ImportCompletionDataResponse + */ +class ImportCompletionDataResponse 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; + + /** + * 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php new file mode 100644 index 00000000000..313d0176838 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php @@ -0,0 +1,84 @@ +google.cloud.retail.v2.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 prefix for import errors. This must be an empty, + * existing Cloud Storage directory. Import errors are written to + * sharded files in this directory, one per line, as a JSON-encoded + * `google.rpc.Status` message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage prefix for import errors. This must be an empty, + * existing Cloud Storage directory. Import errors are written to + * sharded files in this directory, 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 prefix for import errors. This must be an empty, + * existing Cloud Storage directory. Import errors are written to + * sharded files in this directory, 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php new file mode 100644 index 00000000000..292ef3e241a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php @@ -0,0 +1,283 @@ +google.cloud.retail.v2.ImportMetadata + */ +class ImportMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + */ + protected $update_time = null; + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 3; + */ + protected $success_count = 0; + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 4; + */ + protected $failure_count = 0; + /** + * Deprecated. This field is never set. + * + * Generated from protobuf field string request_id = 5 [deprecated = true]; + * @deprecated + */ + protected $request_id = ''; + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 6; + */ + protected $notification_pubsub_topic = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * @type \Google\Protobuf\Timestamp $update_time + * Operation last update time. If the operation is done, this is also the + * finish 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 string $request_id + * Deprecated. This field is never set. + * @type string $notification_pubsub_topic + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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 = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $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 = 2; + * @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 = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @return int|string + */ + public function getSuccessCount() + { + return $this->success_count; + } + + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @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 = 4; + * @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 = 4; + * @param int|string $var + * @return $this + */ + public function setFailureCount($var) + { + GPBUtil::checkInt64($var); + $this->failure_count = $var; + + return $this; + } + + /** + * Deprecated. This field is never set. + * + * Generated from protobuf field string request_id = 5 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRequestId() + { + @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); + return $this->request_id; + } + + /** + * Deprecated. This field is never set. + * + * Generated from protobuf field string request_id = 5 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRequestId($var) + { + @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 6; + * @return string + */ + public function getNotificationPubsubTopic() + { + return $this->notification_pubsub_topic; + } + + /** + * Pub/Sub topic for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string notification_pubsub_topic = 6; + * @param string $var + * @return $this + */ + public function setNotificationPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->notification_pubsub_topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php new file mode 100644 index 00000000000..7347b2709ab --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php @@ -0,0 +1,386 @@ +google.cloud.retail.v2.ImportProductsRequest + */ +class ImportProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + * If no updateMask is specified, requires products.create permission. + * If updateMask is specified, requires products.update permission. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field string request_id = 6 [deprecated = true]; + * @deprecated + */ + protected $request_id = ''; + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + */ + protected $errors_config = null; + /** + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; + */ + protected $update_mask = null; + /** + * The mode of reconciliation between existing products and the products to be + * imported. Defaults to + * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + */ + protected $reconciliation_mode = 0; + /** + * Full Pub/Sub topic name for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + * to be within the same project as + * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. + * + * Generated from protobuf field string notification_pubsub_topic = 7; + */ + protected $notification_pubsub_topic = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + * If no updateMask is specified, requires products.create permission. + * If updateMask is specified, requires products.update permission. + * @type string $request_id + * Deprecated. This field has no effect. + * @type \Google\Cloud\Retail\V2\ProductInputConfig $input_config + * Required. The desired input location of the data. + * @type \Google\Cloud\Retail\V2\ImportErrorsConfig $errors_config + * The desired location of errors incurred during the Import. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. + * @type int $reconciliation_mode + * The mode of reconciliation between existing products and the products to be + * imported. Defaults to + * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + * @type string $notification_pubsub_topic + * Full Pub/Sub topic name for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + * to be within the same project as + * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + * If no updateMask is specified, requires products.create permission. + * If updateMask is specified, requires products.update permission. + * + * 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/branches/default_branch` + * If no updateMask is specified, requires products.create permission. + * If updateMask is specified, requires products.update permission. + * + * 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; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field string request_id = 6 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRequestId() + { + @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); + return $this->request_id; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field string request_id = 6 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRequestId($var) + { + @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\ProductInputConfig|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.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\ProductInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + * @return \Google\Cloud\Retail\V2\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + + /** + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; + * @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); + } + + /** + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * The mode of reconciliation between existing products and the products to be + * imported. Defaults to + * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * @return int + */ + public function getReconciliationMode() + { + return $this->reconciliation_mode; + } + + /** + * The mode of reconciliation between existing products and the products to be + * imported. Defaults to + * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * @param int $var + * @return $this + */ + public function setReconciliationMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\ImportProductsRequest\ReconciliationMode::class); + $this->reconciliation_mode = $var; + + return $this; + } + + /** + * Full Pub/Sub topic name for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + * to be within the same project as + * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. + * + * Generated from protobuf field string notification_pubsub_topic = 7; + * @return string + */ + public function getNotificationPubsubTopic() + { + return $this->notification_pubsub_topic; + } + + /** + * Full Pub/Sub topic name for receiving notification. If this field is set, + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a + * [Operation][google.longrunning.Operation]. + * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + * to be within the same project as + * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. + * + * Generated from protobuf field string notification_pubsub_topic = 7; + * @param string $var + * @return $this + */ + public function setNotificationPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->notification_pubsub_topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php new file mode 100644 index 00000000000..818733abb91 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php @@ -0,0 +1,66 @@ +google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode + */ +class ReconciliationMode +{ + /** + * Defaults to INCREMENTAL. + * + * Generated from protobuf enum RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + const RECONCILIATION_MODE_UNSPECIFIED = 0; + /** + * Inserts new products or updates existing products. + * + * Generated from protobuf enum INCREMENTAL = 1; + */ + const INCREMENTAL = 1; + /** + * Calculates diff and replaces the entire product dataset. Existing + * products may be deleted if they are not present in the source location. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::RECONCILIATION_MODE_UNSPECIFIED => 'RECONCILIATION_MODE_UNSPECIFIED', + self::INCREMENTAL => 'INCREMENTAL', + self::FULL => 'FULL', + ]; + + 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(ReconciliationMode::class, \Google\Cloud\Retail\V2\ImportProductsRequest_ReconciliationMode::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php new file mode 100644 index 00000000000..c4593b68a24 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php @@ -0,0 +1,114 @@ +google.cloud.retail.v2.ImportProductsResponse + */ +class ImportProductsResponse 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.retail.v2.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\Retail\V2\ImportErrorsConfig $errors_config + * Echoes the destination for the complete errors in the request if set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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.retail.v2.ImportErrorsConfig errors_config = 2; + * @return \Google\Cloud\Retail\V2\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.retail.v2.ImportErrorsConfig errors_config = 2; + * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php new file mode 100644 index 00000000000..ba58a17e1f8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php @@ -0,0 +1,159 @@ +google.cloud.retail.v2.ImportUserEventsRequest + */ +class ImportUserEventsRequest 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 = ''; + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + */ + 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 \Google\Cloud\Retail\V2\UserEventInputConfig $input_config + * Required. The desired input location of the data. + * @type \Google\Cloud\Retail\V2\ImportErrorsConfig $errors_config + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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; + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\UserEventInputConfig|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.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\UserEventInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + * @return \Google\Cloud\Retail\V2\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + * + * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; + * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php new file mode 100644 index 00000000000..45a281f8a87 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php @@ -0,0 +1,161 @@ +google.cloud.retail.v2.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.retail.v2.ImportErrorsConfig errors_config = 2; + */ + protected $errors_config = null; + /** + * Aggregated statistics of user event import status. + * + * Generated from protobuf field .google.cloud.retail.v2.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\Retail\V2\ImportErrorsConfig $errors_config + * Echoes the destination for the complete errors if this field was set in + * the request. + * @type \Google\Cloud\Retail\V2\UserEventImportSummary $import_summary + * Aggregated statistics of user event import status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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.retail.v2.ImportErrorsConfig errors_config = 2; + * @return \Google\Cloud\Retail\V2\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.retail.v2.ImportErrorsConfig errors_config = 2; + * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + + /** + * Aggregated statistics of user event import status. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEventImportSummary import_summary = 3; + * @return \Google\Cloud\Retail\V2\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.retail.v2.UserEventImportSummary import_summary = 3; + * @param \Google\Cloud\Retail\V2\UserEventImportSummary $var + * @return $this + */ + public function setImportSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventImportSummary::class); + $this->import_summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php new file mode 100644 index 00000000000..b0ec7451168 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php @@ -0,0 +1,183 @@ +google.cloud.retail.v2.Interval + */ +class Interval extends \Google\Protobuf\Internal\Message +{ + protected $min; + protected $max; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $minimum + * Inclusive lower bound. + * @type float $exclusive_minimum + * Exclusive lower bound. + * @type float $maximum + * Inclusive upper bound. + * @type float $exclusive_maximum + * Exclusive upper bound. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive lower bound. + * + * Generated from protobuf field double minimum = 1; + * @return float + */ + public function getMinimum() + { + return $this->readOneof(1); + } + + public function hasMinimum() + { + return $this->hasOneof(1); + } + + /** + * Inclusive lower bound. + * + * Generated from protobuf field double minimum = 1; + * @param float $var + * @return $this + */ + public function setMinimum($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Exclusive lower bound. + * + * Generated from protobuf field double exclusive_minimum = 2; + * @return float + */ + public function getExclusiveMinimum() + { + return $this->readOneof(2); + } + + public function hasExclusiveMinimum() + { + return $this->hasOneof(2); + } + + /** + * Exclusive lower bound. + * + * Generated from protobuf field double exclusive_minimum = 2; + * @param float $var + * @return $this + */ + public function setExclusiveMinimum($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Inclusive upper bound. + * + * Generated from protobuf field double maximum = 3; + * @return float + */ + public function getMaximum() + { + return $this->readOneof(3); + } + + public function hasMaximum() + { + return $this->hasOneof(3); + } + + /** + * Inclusive upper bound. + * + * Generated from protobuf field double maximum = 3; + * @param float $var + * @return $this + */ + public function setMaximum($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Exclusive upper bound. + * + * Generated from protobuf field double exclusive_maximum = 4; + * @return float + */ + public function getExclusiveMaximum() + { + return $this->readOneof(4); + } + + public function hasExclusiveMaximum() + { + return $this->hasOneof(4); + } + + /** + * Exclusive upper bound. + * + * Generated from protobuf field double exclusive_maximum = 4; + * @param float $var + * @return $this + */ + public function setExclusiveMaximum($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMin() + { + return $this->whichOneof("min"); + } + + /** + * @return string + */ + public function getMax() + { + return $this->whichOneof("max"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php new file mode 100644 index 00000000000..19d4bfb33c0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php @@ -0,0 +1,216 @@ +google.cloud.retail.v2.ListCatalogsRequest + */ +class ListCatalogsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account resource name with an associated location. + * If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless + * of whether or not this location exists, a PERMISSION_DENIED error is + * returned. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If + * unspecified, defaults to 50. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token + * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], + * received from a previous + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The account resource name with an associated location. + * + * If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless + * of whether or not this location exists, a PERMISSION_DENIED error is + * returned. Please see + * {@see CatalogServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListCatalogsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account resource name with an associated location. + * If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless + * of whether or not this location exists, a PERMISSION_DENIED error is + * returned. + * @type int $page_size + * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If + * unspecified, defaults to 50. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT is returned. + * @type string $page_token + * A page token + * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], + * received from a previous + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account resource name with an associated location. + * If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless + * of whether or not this location exists, a PERMISSION_DENIED error is + * returned. + * + * 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 account resource name with an associated location. + * If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless + * of whether or not this location exists, a PERMISSION_DENIED error is + * returned. + * + * 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; + } + + /** + * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If + * unspecified, defaults to 50. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If + * unspecified, defaults to 50. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token + * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], + * received from a previous + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token + * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], + * received from a previous + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php new file mode 100644 index 00000000000..e457e32e976 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php @@ -0,0 +1,115 @@ +google.cloud.retail.v2.ListCatalogsResponse + */ +class ListCatalogsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; + */ + private $catalogs; + /** + * A token that can be sent as + * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * 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\Retail\V2\Catalog>|\Google\Protobuf\Internal\RepeatedField $catalogs + * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. + * @type string $next_page_token + * A token that can be sent as + * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCatalogs() + { + return $this->catalogs; + } + + /** + * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; + * @param array<\Google\Cloud\Retail\V2\Catalog>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCatalogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Catalog::class); + $this->catalogs = $arr; + + return $this; + } + + /** + * A token that can be sent as + * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as + * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php new file mode 100644 index 00000000000..b9584106181 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php @@ -0,0 +1,212 @@ +google.cloud.retail.v2.ListControlsRequest + */ +class ListControlsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * 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. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ControlServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListControlsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type int $page_size + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @type string $filter + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * 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. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * 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. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * + * 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. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php new file mode 100644 index 00000000000..00eefc66fb7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php @@ -0,0 +1,101 @@ +google.cloud.retail.v2.ListControlsResponse + */ +class ListControlsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the Controls for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; + */ + private $controls; + /** + * Pagination token, if not returned indicates the last page. + * + * 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\Retail\V2\Control>|\Google\Protobuf\Internal\RepeatedField $controls + * All the Controls for a given catalog. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * All the Controls for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControls() + { + return $this->controls; + } + + /** + * All the Controls for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; + * @param array<\Google\Cloud\Retail\V2\Control>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Control::class); + $this->controls = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php new file mode 100644 index 00000000000..b68f5f75f2d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest + */ +class ListGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{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. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{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; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php new file mode 100644 index 00000000000..cbec187cb9c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse + */ +class ListGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + */ + private $generative_question_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs + * All the questions for a given catalog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerativeQuestionConfigs() + { + return $this->generative_question_configs; + } + + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerativeQuestionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php new file mode 100644 index 00000000000..b615a76a3cd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php @@ -0,0 +1,167 @@ +google.cloud.retail.v2.ListModelsRequest + */ +class ListModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent for which to list models. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListModels` + * call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent for which to list models. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ModelServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListModelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent for which to list models. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type int $page_size + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListModels` + * call. Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent for which to list models. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 for which to list models. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * 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. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * 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. A page token, received from a previous `ListModels` + * call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListModels` + * call. Provide this to retrieve the subsequent page. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php new file mode 100644 index 00000000000..6ffcc8bc535 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php @@ -0,0 +1,101 @@ +google.cloud.retail.v2.ListModelsResponse + */ +class ListModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Models. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; + */ + private $models; + /** + * Pagination token, if not returned indicates the last page. + * + * 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\Retail\V2\Model>|\Google\Protobuf\Internal\RepeatedField $models + * List of Models. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * List of Models. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModels() + { + return $this->models; + } + + /** + * List of Models. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; + * @param array<\Google\Cloud\Retail\V2\Model>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Model::class); + $this->models = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php new file mode 100644 index 00000000000..29c8efc8f7f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php @@ -0,0 +1,452 @@ +google.cloud.retail.v2.ListProductsRequest + */ +class ListProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + * `default_branch` as the branch ID, to list products under the default + * branch. + * If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of + * whether or not this branch exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to 100. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token + * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], + * received from a previous + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. + * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s sharing the same + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. For example: + * `primary_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s bundled in a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product]. + * For example: + * `collection_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. + * For example: + * `type = "PRIMARY"` + * `type = "VARIANT"` + * `type = "COLLECTION"` + * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + * If the specified + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] or + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error + * is returned. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * The fields of [Product][google.cloud.retail.v2.Product] to return in the + * responses. If not set or empty, the following fields are returned: + * * [Product.name][google.cloud.retail.v2.Product.name] + * * [Product.id][google.cloud.retail.v2.Product.id] + * * [Product.title][google.cloud.retail.v2.Product.title] + * * [Product.uri][google.cloud.retail.v2.Product.uri] + * * [Product.images][google.cloud.retail.v2.Product.images] + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.brands][google.cloud.retail.v2.Product.brands] + * If "*" is provided, all fields are returned. + * [Product.name][google.cloud.retail.v2.Product.name] is always returned no + * matter what mask is set. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; + */ + protected $read_mask = null; + + /** + * @param string $parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + * `default_branch` as the branch ID, to list products under the default + * branch. + * + * If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of + * whether or not this branch exists, a PERMISSION_DENIED error is returned. Please see + * {@see ProductServiceClient::branchName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListProductsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + * `default_branch` as the branch ID, to list products under the default + * branch. + * If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of + * whether or not this branch exists, a PERMISSION_DENIED error is returned. + * @type int $page_size + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to 100. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT error is returned. + * @type string $page_token + * A page token + * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], + * received from a previous + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * @type string $filter + * A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. + * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s sharing the same + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. For example: + * `primary_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s bundled in a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product]. + * For example: + * `collection_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. + * For example: + * `type = "PRIMARY"` + * `type = "VARIANT"` + * `type = "COLLECTION"` + * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + * If the specified + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] or + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error + * is returned. + * @type \Google\Protobuf\FieldMask $read_mask + * The fields of [Product][google.cloud.retail.v2.Product] to return in the + * responses. If not set or empty, the following fields are returned: + * * [Product.name][google.cloud.retail.v2.Product.name] + * * [Product.id][google.cloud.retail.v2.Product.id] + * * [Product.title][google.cloud.retail.v2.Product.title] + * * [Product.uri][google.cloud.retail.v2.Product.uri] + * * [Product.images][google.cloud.retail.v2.Product.images] + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.brands][google.cloud.retail.v2.Product.brands] + * If "*" is provided, all fields are returned. + * [Product.name][google.cloud.retail.v2.Product.name] is always returned no + * matter what mask is set. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + * `default_branch` as the branch ID, to list products under the default + * branch. + * If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of + * whether or not this branch exists, a PERMISSION_DENIED error is returned. + * + * 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 branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + * `default_branch` as the branch ID, to list products under the default + * branch. + * If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of + * whether or not this branch exists, a PERMISSION_DENIED error is returned. + * + * 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; + } + + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to 100. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to 100. The maximum allowed value is 1000. Values + * above 1000 will be coerced to 1000. + * If this field is negative, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token + * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], + * received from a previous + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token + * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], + * received from a previous + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * must match the call that provided the page token. Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. + * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s sharing the same + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. For example: + * `primary_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s bundled in a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product]. + * For example: + * `collection_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. + * For example: + * `type = "PRIMARY"` + * `type = "VARIANT"` + * `type = "COLLECTION"` + * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + * If the specified + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] or + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error + * is returned. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. + * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s sharing the same + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. For example: + * `primary_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s bundled in a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product]. + * For example: + * `collection_product_id = "some_product_id"` + * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. + * For example: + * `type = "PRIMARY"` + * `type = "VARIANT"` + * `type = "COLLECTION"` + * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + * If the specified + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] or + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error + * is returned. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The fields of [Product][google.cloud.retail.v2.Product] to return in the + * responses. If not set or empty, the following fields are returned: + * * [Product.name][google.cloud.retail.v2.Product.name] + * * [Product.id][google.cloud.retail.v2.Product.id] + * * [Product.title][google.cloud.retail.v2.Product.title] + * * [Product.uri][google.cloud.retail.v2.Product.uri] + * * [Product.images][google.cloud.retail.v2.Product.images] + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.brands][google.cloud.retail.v2.Product.brands] + * If "*" is provided, all fields are returned. + * [Product.name][google.cloud.retail.v2.Product.name] is always returned no + * matter what mask is set. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * The fields of [Product][google.cloud.retail.v2.Product] to return in the + * responses. If not set or empty, the following fields are returned: + * * [Product.name][google.cloud.retail.v2.Product.name] + * * [Product.id][google.cloud.retail.v2.Product.id] + * * [Product.title][google.cloud.retail.v2.Product.title] + * * [Product.uri][google.cloud.retail.v2.Product.uri] + * * [Product.images][google.cloud.retail.v2.Product.images] + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.brands][google.cloud.retail.v2.Product.brands] + * If "*" is provided, all fields are returned. + * [Product.name][google.cloud.retail.v2.Product.name] is always returned no + * matter what mask is set. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php new file mode 100644 index 00000000000..75ecb23e6e9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php @@ -0,0 +1,115 @@ +google.cloud.retail.v2.ListProductsResponse + */ +class ListProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; + */ + private $products; + /** + * A token that can be sent as + * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * 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\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $products + * The [Product][google.cloud.retail.v2.Product]s. + * @type string $next_page_token + * A token that can be sent as + * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * The [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducts() + { + return $this->products; + } + + /** + * The [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; + * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); + $this->products = $arr; + + return $this; + } + + /** + * A token that can be sent as + * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as + * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php new file mode 100644 index 00000000000..e8f5af467cb --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php @@ -0,0 +1,166 @@ +google.cloud.retail.v2.ListServingConfigsRequest + */ +class ListServingConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 100. If a value greater than 100 is provided, at most 100 results are + * returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * Please see {@see ServingConfigServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListServingConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @type int $page_size + * Optional. Maximum number of results to return. If unspecified, defaults + * to 100. If a value greater than 100 is provided, at most 100 results are + * returned. + * @type string $page_token + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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 catalog resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * + * 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. If unspecified, defaults + * to 100. If a value greater than 100 is provided, at most 100 results are + * returned. + * + * 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. If unspecified, defaults + * to 100. If a value greater than 100 is provided, at most 100 results are + * returned. + * + * 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. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php new file mode 100644 index 00000000000..0d7fd5c2803 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php @@ -0,0 +1,101 @@ +google.cloud.retail.v2.ListServingConfigsResponse + */ +class ListServingConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the ServingConfigs for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; + */ + private $serving_configs; + /** + * Pagination token, if not returned indicates the last page. + * + * 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\Retail\V2\ServingConfig>|\Google\Protobuf\Internal\RepeatedField $serving_configs + * All the ServingConfigs for a given catalog. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * All the ServingConfigs for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServingConfigs() + { + return $this->serving_configs; + } + + /** + * All the ServingConfigs for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; + * @param array<\Google\Cloud\Retail\V2\ServingConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServingConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ServingConfig::class); + $this->serving_configs = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php new file mode 100644 index 00000000000..4bc4a6e4383 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php @@ -0,0 +1,316 @@ +google.cloud.retail.v2.LocalInventory + */ +class LocalInventory extends \Google\Protobuf\Internal\Message +{ + /** + * The place ID for the current set of inventory information. + * + * Generated from protobuf field string place_id = 1; + */ + protected $place_id = ''; + /** + * Product price and cost information. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; + */ + protected $price_info = null; + /** + * Additional local inventory attributes, for example, store name, promotion + * tags, etc. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * At most 30 attributes are allowed. + * * The key must be a UTF-8 encoded string with a length limit of 32 + * characters. + * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + * key0LikeThis or KEY_1_LIKE_THIS. + * * The attribute values must be of the same type (text or number). + * * Only 1 value is allowed for each attribute. + * * For text values, the length limit is 256 UTF-8 characters. + * * The attribute does not support search. The `searchable` field should be + * unset or set to false. + * * The max summed total bytes of custom attribute keys and values per + * product is 5MiB. + * + * Generated from protobuf field map attributes = 3; + */ + private $attributes; + /** + * Input only. Supported fulfillment types. Valid fulfillment type values + * include commonly used types (such as pickup in store and same day + * delivery), and custom types. Customers have to map custom types to their + * display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $fulfillment_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $place_id + * The place ID for the current set of inventory information. + * @type \Google\Cloud\Retail\V2\PriceInfo $price_info + * Product price and cost information. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Additional local inventory attributes, for example, store name, promotion + * tags, etc. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * At most 30 attributes are allowed. + * * The key must be a UTF-8 encoded string with a length limit of 32 + * characters. + * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + * key0LikeThis or KEY_1_LIKE_THIS. + * * The attribute values must be of the same type (text or number). + * * Only 1 value is allowed for each attribute. + * * For text values, the length limit is 256 UTF-8 characters. + * * The attribute does not support search. The `searchable` field should be + * unset or set to false. + * * The max summed total bytes of custom attribute keys and values per + * product is 5MiB. + * @type array|\Google\Protobuf\Internal\RepeatedField $fulfillment_types + * Input only. Supported fulfillment types. Valid fulfillment type values + * include commonly used types (such as pickup in store and same day + * delivery), and custom types. Customers have to map custom types to their + * display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The place ID for the current set of inventory information. + * + * Generated from protobuf field string place_id = 1; + * @return string + */ + public function getPlaceId() + { + return $this->place_id; + } + + /** + * The place ID for the current set of inventory information. + * + * Generated from protobuf field string place_id = 1; + * @param string $var + * @return $this + */ + public function setPlaceId($var) + { + GPBUtil::checkString($var, True); + $this->place_id = $var; + + return $this; + } + + /** + * Product price and cost information. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; + * @return \Google\Cloud\Retail\V2\PriceInfo|null + */ + public function getPriceInfo() + { + return $this->price_info; + } + + public function hasPriceInfo() + { + return isset($this->price_info); + } + + public function clearPriceInfo() + { + unset($this->price_info); + } + + /** + * Product price and cost information. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; + * @param \Google\Cloud\Retail\V2\PriceInfo $var + * @return $this + */ + public function setPriceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo::class); + $this->price_info = $var; + + return $this; + } + + /** + * Additional local inventory attributes, for example, store name, promotion + * tags, etc. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * At most 30 attributes are allowed. + * * The key must be a UTF-8 encoded string with a length limit of 32 + * characters. + * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + * key0LikeThis or KEY_1_LIKE_THIS. + * * The attribute values must be of the same type (text or number). + * * Only 1 value is allowed for each attribute. + * * For text values, the length limit is 256 UTF-8 characters. + * * The attribute does not support search. The `searchable` field should be + * unset or set to false. + * * The max summed total bytes of custom attribute keys and values per + * product is 5MiB. + * + * Generated from protobuf field map attributes = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Additional local inventory attributes, for example, store name, promotion + * tags, etc. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * At most 30 attributes are allowed. + * * The key must be a UTF-8 encoded string with a length limit of 32 + * characters. + * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + * key0LikeThis or KEY_1_LIKE_THIS. + * * The attribute values must be of the same type (text or number). + * * Only 1 value is allowed for each attribute. + * * For text values, the length limit is 256 UTF-8 characters. + * * The attribute does not support search. The `searchable` field should be + * unset or set to false. + * * The max summed total bytes of custom attribute keys and values per + * product is 5MiB. + * + * Generated from protobuf field map attributes = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Input only. Supported fulfillment types. Valid fulfillment type values + * include commonly used types (such as pickup in store and same day + * delivery), and custom types. Customers have to map custom types to their + * display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFulfillmentTypes() + { + return $this->fulfillment_types; + } + + /** + * Input only. Supported fulfillment types. Valid fulfillment type values + * include commonly used types (such as pickup in store and same day + * delivery), and custom types. Customers have to map custom types to their + * display names before rendering UI. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFulfillmentTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->fulfillment_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php new file mode 100644 index 00000000000..33ddf82980a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php @@ -0,0 +1,811 @@ +google.cloud.retail.v2.Model + */ +class Model extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * catalog_id has char limit of 50. + * recommendation_model_id has char limit of 40. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The display name of the model. + * Should be human readable, used to display Recommendation Models in the + * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 + * characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. The training state that the model is in (e.g. + * `TRAINING` or `PAUSED`). + * Since part of the cost of running the service + * is frequency of training - this can be used to determine when to train + * model in order to control cost. If not specified: the default value for + * `CreateModel` method is `TRAINING`. The default value for + * `UpdateModel` method is to keep the state the same as before. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $training_state = 0; + /** + * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $serving_state = 0; + /** + * Output only. Timestamp the Recommendation Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp the Recommendation Model was last updated. E.g. + * if a Recommendation Model was paused - this would be the time the pause was + * initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The type of model e.g. `home-page`. + * Currently supported values: `recommended-for-you`, `others-you-may-like`, + * `frequently-bought-together`, `page-optimization`, `similar-items`, + * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = ''; + /** + * Optional. The optimization objective e.g. `cvr`. + * Currently supported + * values: `ctr`, `cvr`, `revenue-per-order`. + * If not specified, we choose default based on model type. + * Default depends on type of recommendation: + * `recommended-for-you` => `ctr` + * `others-you-may-like` => `ctr` + * `frequently-bought-together` => `revenue_per_order` + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.type] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $optimization_objective = ''; + /** + * Optional. The state of periodic tuning. + * The period we use is 3 months - to do a + * one-off tune earlier use the `TuneModel` method. Default value + * is `PERIODIC_TUNING_ENABLED`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $periodic_tuning_state = 0; + /** + * Output only. The timestamp when the latest successful tune finished. + * + * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_tune_time = null; + /** + * Output only. The tune operation associated with the model. + * Can be used to determine if there is an ongoing tune for this + * recommendation. Empty field implies no tune is goig on. + * + * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tuning_operation = ''; + /** + * Output only. The state of data requirements for this model: `DATA_OK` and + * `DATA_ERROR`. + * Recommendation model cannot be trained if the data is in + * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + * if serving state is `ACTIVE`: models were trained successfully before, but + * cannot be refreshed because model no longer has sufficient + * data for training. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_state = 0; + /** + * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + * by attributes is enabled for the model. + * + * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filtering_option = 0; + /** + * Output only. The list of valid serving configs associated with the + * PageOptimizationConfig. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $serving_config_lists; + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_features_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * catalog_id has char limit of 50. + * recommendation_model_id has char limit of 40. + * @type string $display_name + * Required. The display name of the model. + * Should be human readable, used to display Recommendation Models in the + * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 + * characters. + * @type int $training_state + * Optional. The training state that the model is in (e.g. + * `TRAINING` or `PAUSED`). + * Since part of the cost of running the service + * is frequency of training - this can be used to determine when to train + * model in order to control cost. If not specified: the default value for + * `CreateModel` method is `TRAINING`. The default value for + * `UpdateModel` method is to keep the state the same as before. + * @type int $serving_state + * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp the Recommendation Model was created at. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp the Recommendation Model was last updated. E.g. + * if a Recommendation Model was paused - this would be the time the pause was + * initiated. + * @type string $type + * Required. The type of model e.g. `home-page`. + * Currently supported values: `recommended-for-you`, `others-you-may-like`, + * `frequently-bought-together`, `page-optimization`, `similar-items`, + * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * @type string $optimization_objective + * Optional. The optimization objective e.g. `cvr`. + * Currently supported + * values: `ctr`, `cvr`, `revenue-per-order`. + * If not specified, we choose default based on model type. + * Default depends on type of recommendation: + * `recommended-for-you` => `ctr` + * `others-you-may-like` => `ctr` + * `frequently-bought-together` => `revenue_per_order` + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.type] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * @type int $periodic_tuning_state + * Optional. The state of periodic tuning. + * The period we use is 3 months - to do a + * one-off tune earlier use the `TuneModel` method. Default value + * is `PERIODIC_TUNING_ENABLED`. + * @type \Google\Protobuf\Timestamp $last_tune_time + * Output only. The timestamp when the latest successful tune finished. + * @type string $tuning_operation + * Output only. The tune operation associated with the model. + * Can be used to determine if there is an ongoing tune for this + * recommendation. Empty field implies no tune is goig on. + * @type int $data_state + * Output only. The state of data requirements for this model: `DATA_OK` and + * `DATA_ERROR`. + * Recommendation model cannot be trained if the data is in + * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + * if serving state is `ACTIVE`: models were trained successfully before, but + * cannot be refreshed because model no longer has sufficient + * data for training. + * @type int $filtering_option + * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + * by attributes is enabled for the model. + * @type array<\Google\Cloud\Retail\V2\Model\ServingConfigList>|\Google\Protobuf\Internal\RepeatedField $serving_config_lists + * Output only. The list of valid serving configs associated with the + * PageOptimizationConfig. + * @type \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $model_features_config + * Optional. Additional model features config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * catalog_id has char limit of 50. + * recommendation_model_id has char limit of 40. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * catalog_id has char limit of 50. + * recommendation_model_id has char limit of 40. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the model. + * Should be human readable, used to display Recommendation Models in the + * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 + * characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the model. + * Should be human readable, used to display Recommendation Models in the + * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 + * characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The training state that the model is in (e.g. + * `TRAINING` or `PAUSED`). + * Since part of the cost of running the service + * is frequency of training - this can be used to determine when to train + * model in order to control cost. If not specified: the default value for + * `CreateModel` method is `TRAINING`. The default value for + * `UpdateModel` method is to keep the state the same as before. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainingState() + { + return $this->training_state; + } + + /** + * Optional. The training state that the model is in (e.g. + * `TRAINING` or `PAUSED`). + * Since part of the cost of running the service + * is frequency of training - this can be used to determine when to train + * model in order to control cost. If not specified: the default value for + * `CreateModel` method is `TRAINING`. The default value for + * `UpdateModel` method is to keep the state the same as before. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainingState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\TrainingState::class); + $this->training_state = $var; + + return $this; + } + + /** + * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getServingState() + { + return $this->serving_state; + } + + /** + * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setServingState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\ServingState::class); + $this->serving_state = $var; + + return $this; + } + + /** + * Output only. Timestamp the Recommendation Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp the Recommendation Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp the Recommendation Model was last updated. E.g. + * if a Recommendation Model was paused - this would be the time the pause was + * initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Timestamp the Recommendation Model was last updated. E.g. + * if a Recommendation Model was paused - this would be the time the pause was + * initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The type of model e.g. `home-page`. + * Currently supported values: `recommended-for-you`, `others-you-may-like`, + * `frequently-bought-together`, `page-optimization`, `similar-items`, + * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of model e.g. `home-page`. + * Currently supported values: `recommended-for-you`, `others-you-may-like`, + * `frequently-bought-together`, `page-optimization`, `similar-items`, + * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Optional. The optimization objective e.g. `cvr`. + * Currently supported + * values: `ctr`, `cvr`, `revenue-per-order`. + * If not specified, we choose default based on model type. + * Default depends on type of recommendation: + * `recommended-for-you` => `ctr` + * `others-you-may-like` => `ctr` + * `frequently-bought-together` => `revenue_per_order` + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.type] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOptimizationObjective() + { + return $this->optimization_objective; + } + + /** + * Optional. The optimization objective e.g. `cvr`. + * Currently supported + * values: `ctr`, `cvr`, `revenue-per-order`. + * If not specified, we choose default based on model type. + * Default depends on type of recommendation: + * `recommended-for-you` => `ctr` + * `others-you-may-like` => `ctr` + * `frequently-bought-together` => `revenue_per_order` + * This field together with + * [optimization_objective][google.cloud.retail.v2.Model.type] + * describe model metadata to use to control model training and serving. + * See https://cloud.google.com/retail/docs/models + * for more details on what the model metadata control and which combination + * of parameters are valid. For invalid combinations of parameters (e.g. type + * = `frequently-bought-together` and optimization_objective = `ctr`), you + * receive an error 400 if you try to create/update a recommendation with + * this set of knobs. + * + * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOptimizationObjective($var) + { + GPBUtil::checkString($var, True); + $this->optimization_objective = $var; + + return $this; + } + + /** + * Optional. The state of periodic tuning. + * The period we use is 3 months - to do a + * one-off tune earlier use the `TuneModel` method. Default value + * is `PERIODIC_TUNING_ENABLED`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPeriodicTuningState() + { + return $this->periodic_tuning_state; + } + + /** + * Optional. The state of periodic tuning. + * The period we use is 3 months - to do a + * one-off tune earlier use the `TuneModel` method. Default value + * is `PERIODIC_TUNING_ENABLED`. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPeriodicTuningState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\PeriodicTuningState::class); + $this->periodic_tuning_state = $var; + + return $this; + } + + /** + * Output only. The timestamp when the latest successful tune finished. + * + * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastTuneTime() + { + return $this->last_tune_time; + } + + public function hasLastTuneTime() + { + return isset($this->last_tune_time); + } + + public function clearLastTuneTime() + { + unset($this->last_tune_time); + } + + /** + * Output only. The timestamp when the latest successful tune finished. + * + * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastTuneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_tune_time = $var; + + return $this; + } + + /** + * Output only. The tune operation associated with the model. + * Can be used to determine if there is an ongoing tune for this + * recommendation. Empty field implies no tune is goig on. + * + * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTuningOperation() + { + return $this->tuning_operation; + } + + /** + * Output only. The tune operation associated with the model. + * Can be used to determine if there is an ongoing tune for this + * recommendation. Empty field implies no tune is goig on. + * + * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTuningOperation($var) + { + GPBUtil::checkString($var, True); + $this->tuning_operation = $var; + + return $this; + } + + /** + * Output only. The state of data requirements for this model: `DATA_OK` and + * `DATA_ERROR`. + * Recommendation model cannot be trained if the data is in + * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + * if serving state is `ACTIVE`: models were trained successfully before, but + * cannot be refreshed because model no longer has sufficient + * data for training. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDataState() + { + return $this->data_state; + } + + /** + * Output only. The state of data requirements for this model: `DATA_OK` and + * `DATA_ERROR`. + * Recommendation model cannot be trained if the data is in + * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + * if serving state is `ACTIVE`: models were trained successfully before, but + * cannot be refreshed because model no longer has sufficient + * data for training. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDataState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\DataState::class); + $this->data_state = $var; + + return $this; + } + + /** + * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + * by attributes is enabled for the model. + * + * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFilteringOption() + { + return $this->filtering_option; + } + + /** + * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + * by attributes is enabled for the model. + * + * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFilteringOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\RecommendationsFilteringOption::class); + $this->filtering_option = $var; + + return $this; + } + + /** + * Output only. The list of valid serving configs associated with the + * PageOptimizationConfig. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServingConfigLists() + { + return $this->serving_config_lists; + } + + /** + * Output only. The list of valid serving configs associated with the + * PageOptimizationConfig. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Retail\V2\Model\ServingConfigList>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServingConfigLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Model\ServingConfigList::class); + $this->serving_config_lists = $arr; + + return $this; + } + + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig|null + */ + public function getModelFeaturesConfig() + { + return $this->model_features_config; + } + + public function hasModelFeaturesConfig() + { + return isset($this->model_features_config); + } + + public function clearModelFeaturesConfig() + { + unset($this->model_features_config); + } + + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $var + * @return $this + */ + public function setModelFeaturesConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig::class); + $this->model_features_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php new file mode 100644 index 00000000000..8ae561915ce --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php @@ -0,0 +1,68 @@ +google.cloud.retail.v2.Model.ContextProductsType + */ +class ContextProductsType +{ + /** + * Unspecified default value, should never be explicitly set. + * Defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf enum CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + */ + const CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + /** + * Use only a single product as context for the recommendation. Typically + * used on pages like add-to-cart or product details. + * + * Generated from protobuf enum SINGLE_CONTEXT_PRODUCT = 1; + */ + const SINGLE_CONTEXT_PRODUCT = 1; + /** + * Use one or multiple products as context for the recommendation. Typically + * used on shopping cart pages. + * + * Generated from protobuf enum MULTIPLE_CONTEXT_PRODUCTS = 2; + */ + const MULTIPLE_CONTEXT_PRODUCTS = 2; + + private static $valueToName = [ + self::CONTEXT_PRODUCTS_TYPE_UNSPECIFIED => 'CONTEXT_PRODUCTS_TYPE_UNSPECIFIED', + self::SINGLE_CONTEXT_PRODUCT => 'SINGLE_CONTEXT_PRODUCT', + self::MULTIPLE_CONTEXT_PRODUCTS => 'MULTIPLE_CONTEXT_PRODUCTS', + ]; + + 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(ContextProductsType::class, \Google\Cloud\Retail\V2\Model_ContextProductsType::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php new file mode 100644 index 00000000000..34f169a78c7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php @@ -0,0 +1,66 @@ +google.cloud.retail.v2.Model.DataState + */ +class DataState +{ + /** + * Unspecified default value, should never be explicitly set. + * + * Generated from protobuf enum DATA_STATE_UNSPECIFIED = 0; + */ + const DATA_STATE_UNSPECIFIED = 0; + /** + * The model has sufficient training data. + * + * Generated from protobuf enum DATA_OK = 1; + */ + const DATA_OK = 1; + /** + * The model does not have sufficient training data. Error + * messages can be queried via Stackdriver. + * + * Generated from protobuf enum DATA_ERROR = 2; + */ + const DATA_ERROR = 2; + + private static $valueToName = [ + self::DATA_STATE_UNSPECIFIED => 'DATA_STATE_UNSPECIFIED', + self::DATA_OK => 'DATA_OK', + self::DATA_ERROR => 'DATA_ERROR', + ]; + + 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(DataState::class, \Google\Cloud\Retail\V2\Model_DataState::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php new file mode 100644 index 00000000000..859d56509a7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php @@ -0,0 +1,82 @@ +google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + */ +class FrequentlyBoughtTogetherFeaturesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_products_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $context_products_type + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextProductsType() + { + return $this->context_products_type; + } + + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextProductsType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\ContextProductsType::class); + $this->context_products_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FrequentlyBoughtTogetherFeaturesConfig::class, \Google\Cloud\Retail\V2\Model_FrequentlyBoughtTogetherFeaturesConfig::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php new file mode 100644 index 00000000000..7755626aca7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php @@ -0,0 +1,78 @@ +google.cloud.retail.v2.Model.ModelFeaturesConfig + */ +class ModelFeaturesConfig extends \Google\Protobuf\Internal\Message +{ + protected $type_dedicated_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $frequently_bought_together_config + * Additional configs for frequently-bought-together models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Additional configs for frequently-bought-together models. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; + * @return \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig|null + */ + public function getFrequentlyBoughtTogetherConfig() + { + return $this->readOneof(1); + } + + public function hasFrequentlyBoughtTogetherConfig() + { + return $this->hasOneof(1); + } + + /** + * Additional configs for frequently-bought-together models. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; + * @param \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $var + * @return $this + */ + public function setFrequentlyBoughtTogetherConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getTypeDedicatedConfig() + { + return $this->whichOneof("type_dedicated_config"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ModelFeaturesConfig::class, \Google\Cloud\Retail\V2\Model_ModelFeaturesConfig::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php new file mode 100644 index 00000000000..4dff3ca9028 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php @@ -0,0 +1,82 @@ +google.cloud.retail.v2.Model.PeriodicTuningState + */ +class PeriodicTuningState +{ + /** + * Unspecified default value, should never be explicitly set. + * + * Generated from protobuf enum PERIODIC_TUNING_STATE_UNSPECIFIED = 0; + */ + const PERIODIC_TUNING_STATE_UNSPECIFIED = 0; + /** + * The model has periodic tuning disabled. Tuning + * can be reenabled by calling the `EnableModelPeriodicTuning` + * method or by calling the `TuneModel` method. + * + * Generated from protobuf enum PERIODIC_TUNING_DISABLED = 1; + */ + const PERIODIC_TUNING_DISABLED = 1; + /** + * The model cannot be tuned with periodic tuning OR the + * `TuneModel` method. Hide the options in customer UI and + * reject any requests through the backend self serve API. + * + * Generated from protobuf enum ALL_TUNING_DISABLED = 3; + */ + const ALL_TUNING_DISABLED = 3; + /** + * The model has periodic tuning enabled. Tuning + * can be disabled by calling the `DisableModelPeriodicTuning` + * method. + * + * Generated from protobuf enum PERIODIC_TUNING_ENABLED = 2; + */ + const PERIODIC_TUNING_ENABLED = 2; + + private static $valueToName = [ + self::PERIODIC_TUNING_STATE_UNSPECIFIED => 'PERIODIC_TUNING_STATE_UNSPECIFIED', + self::PERIODIC_TUNING_DISABLED => 'PERIODIC_TUNING_DISABLED', + self::ALL_TUNING_DISABLED => 'ALL_TUNING_DISABLED', + self::PERIODIC_TUNING_ENABLED => 'PERIODIC_TUNING_ENABLED', + ]; + + 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(PeriodicTuningState::class, \Google\Cloud\Retail\V2\Model_PeriodicTuningState::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php new file mode 100644 index 00000000000..627101be7aa --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.Model.ServingConfigList + */ +class ServingConfigList extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A set of valid serving configs that may be used for + * `PAGE_OPTIMIZATION`. + * + * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $serving_config_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $serving_config_ids + * Optional. A set of valid serving configs that may be used for + * `PAGE_OPTIMIZATION`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A set of valid serving configs that may be used for + * `PAGE_OPTIMIZATION`. + * + * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServingConfigIds() + { + return $this->serving_config_ids; + } + + /** + * Optional. A set of valid serving configs that may be used for + * `PAGE_OPTIMIZATION`. + * + * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServingConfigIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->serving_config_ids = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServingConfigList::class, \Google\Cloud\Retail\V2\Model_ServingConfigList::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php new file mode 100644 index 00000000000..3dd9513c78f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php @@ -0,0 +1,72 @@ +google.cloud.retail.v2.Model.ServingState + */ +class ServingState +{ + /** + * Unspecified serving state. + * + * Generated from protobuf enum SERVING_STATE_UNSPECIFIED = 0; + */ + const SERVING_STATE_UNSPECIFIED = 0; + /** + * The model is not serving. + * + * Generated from protobuf enum INACTIVE = 1; + */ + const INACTIVE = 1; + /** + * The model is serving and can be queried. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The model is trained on tuned hyperparameters and can be + * queried. + * + * Generated from protobuf enum TUNED = 3; + */ + const TUNED = 3; + + private static $valueToName = [ + self::SERVING_STATE_UNSPECIFIED => 'SERVING_STATE_UNSPECIFIED', + self::INACTIVE => 'INACTIVE', + self::ACTIVE => 'ACTIVE', + self::TUNED => 'TUNED', + ]; + + 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(ServingState::class, \Google\Cloud\Retail\V2\Model_ServingState::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php new file mode 100644 index 00000000000..cbbf2e8206b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.Model.TrainingState + */ +class TrainingState +{ + /** + * Unspecified training state. + * + * Generated from protobuf enum TRAINING_STATE_UNSPECIFIED = 0; + */ + const TRAINING_STATE_UNSPECIFIED = 0; + /** + * The model training is paused. + * + * Generated from protobuf enum PAUSED = 1; + */ + const PAUSED = 1; + /** + * The model is training. + * + * Generated from protobuf enum TRAINING = 2; + */ + const TRAINING = 2; + + private static $valueToName = [ + self::TRAINING_STATE_UNSPECIFIED => 'TRAINING_STATE_UNSPECIFIED', + self::PAUSED => 'PAUSED', + self::TRAINING => 'TRAINING', + ]; + + 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(TrainingState::class, \Google\Cloud\Retail\V2\Model_TrainingState::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php new file mode 100644 index 00000000000..bee83402eb8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php @@ -0,0 +1,108 @@ +google.cloud.retail.v2.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $gcs_destination + * The Google Cloud Storage location where the output is to be written to. + * @type \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $bigquery_destination + * The BigQuery location where the output is to be written to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location where the output is to be written to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1; + * @return \Google\Cloud\Retail\V2\OutputConfig\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * The Google Cloud Storage location where the output is to be written to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1; + * @param \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The BigQuery location where the output is to be written to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2; + * @return \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination|null + */ + public function getBigqueryDestination() + { + return $this->readOneof(2); + } + + public function hasBigqueryDestination() + { + return $this->hasOneof(2); + } + + /** + * The BigQuery location where the output is to be written to. + * + * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2; + * @param \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $var + * @return $this + */ + public function setBigqueryDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php new file mode 100644 index 00000000000..5a39edd74aa --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php @@ -0,0 +1,146 @@ +google.cloud.retail.v2.OutputConfig.BigQueryDestination + */ +class BigQueryDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The prefix of exported BigQuery tables. + * + * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id_prefix = ''; + /** + * Required. Describes the table type. The following values are supported: + * * `table`: A BigQuery native table. + * * `view`: A virtual table defined by a SQL query. + * + * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * Required. The ID of a BigQuery Dataset. + * @type string $table_id_prefix + * Required. The prefix of exported BigQuery tables. + * @type string $table_type + * Required. Describes the table type. The following values are supported: + * * `table`: A BigQuery native table. + * * `view`: A virtual table defined by a SQL query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The ID of a BigQuery Dataset. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The prefix of exported BigQuery tables. + * + * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableIdPrefix() + { + return $this->table_id_prefix; + } + + /** + * Required. The prefix of exported BigQuery tables. + * + * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableIdPrefix($var) + { + GPBUtil::checkString($var, True); + $this->table_id_prefix = $var; + + return $this; + } + + /** + * Required. Describes the table type. The following values are supported: + * * `table`: A BigQuery native table. + * * `view`: A virtual table defined by a SQL query. + * + * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableType() + { + return $this->table_type; + } + + /** + * Required. Describes the table type. The following values are supported: + * * `table`: A BigQuery native table. + * * `view`: A virtual table defined by a SQL query. + * + * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableType($var) + { + GPBUtil::checkString($var, True); + $this->table_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigQueryDestination::class, \Google\Cloud\Retail\V2\OutputConfig_BigQueryDestination::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php new file mode 100644 index 00000000000..51297093536 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php @@ -0,0 +1,94 @@ +google.cloud.retail.v2.OutputConfig.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The output uri prefix for saving output data to json files. + * Some mapping examples are as follows: + * output_uri_prefix sample output(assuming the object is foo.json) + * ======================== ============================================= + * gs://bucket/ gs://bucket/foo.json + * gs://bucket/folder/ gs://bucket/folder/foo.json + * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_uri_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_uri_prefix + * Required. The output uri prefix for saving output data to json files. + * Some mapping examples are as follows: + * output_uri_prefix sample output(assuming the object is foo.json) + * ======================== ============================================= + * gs://bucket/ gs://bucket/foo.json + * gs://bucket/folder/ gs://bucket/folder/foo.json + * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The output uri prefix for saving output data to json files. + * Some mapping examples are as follows: + * output_uri_prefix sample output(assuming the object is foo.json) + * ======================== ============================================= + * gs://bucket/ gs://bucket/foo.json + * gs://bucket/folder/ gs://bucket/folder/foo.json + * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * Required. The output uri prefix for saving output data to json files. + * Some mapping examples are as follows: + * output_uri_prefix sample output(assuming the object is foo.json) + * ======================== ============================================= + * gs://bucket/ gs://bucket/foo.json + * gs://bucket/folder/ gs://bucket/folder/foo.json + * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GcsDestination::class, \Google\Cloud\Retail\V2\OutputConfig_GcsDestination::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php new file mode 100644 index 00000000000..a077308ec8f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php @@ -0,0 +1,102 @@ +google.cloud.retail.v2.OutputResult + */ +class OutputResult extends \Google\Protobuf\Internal\Message +{ + /** + * The BigQuery location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; + */ + private $bigquery_result; + /** + * The Google Cloud Storage location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; + */ + private $gcs_result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\BigQueryOutputResult>|\Google\Protobuf\Internal\RepeatedField $bigquery_result + * The BigQuery location where the result is stored. + * @type array<\Google\Cloud\Retail\V2\GcsOutputResult>|\Google\Protobuf\Internal\RepeatedField $gcs_result + * The Google Cloud Storage location where the result is stored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); + parent::__construct($data); + } + + /** + * The BigQuery location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBigqueryResult() + { + return $this->bigquery_result; + } + + /** + * The BigQuery location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; + * @param array<\Google\Cloud\Retail\V2\BigQueryOutputResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBigqueryResult($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\BigQueryOutputResult::class); + $this->bigquery_result = $arr; + + return $this; + } + + /** + * The Google Cloud Storage location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGcsResult() + { + return $this->gcs_result; + } + + /** + * The Google Cloud Storage location where the result is stored. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; + * @param array<\Google\Cloud\Retail\V2\GcsOutputResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGcsResult($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GcsOutputResult::class); + $this->gcs_result = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php new file mode 100644 index 00000000000..cddd83bb5b6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php @@ -0,0 +1,91 @@ +google.cloud.retail.v2.PauseModelRequest + */ +class PauseModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the model to pause. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the model to pause. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * Please see {@see ModelServiceClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\PauseModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the model to pause. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the model to pause. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The name of the model to pause. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php new file mode 100644 index 00000000000..e1587eb62af --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php @@ -0,0 +1,708 @@ +google.cloud.retail.v2.PredictRequest + */ +class PredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of the format: + * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + * or + * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + * We recommend using the `servingConfigs` resource. `placements` is a legacy + * resource. + * The ID of the Recommendations AI serving config or placement. + * Before you can request predictions from your model, you must create at + * least one serving config or placement for it. For more information, see + * [Manage serving configs] + * (https://cloud.google.com/retail/docs/manage-configs). + * The full list of available serving configs can be seen at + * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $placement = ''; + /** + * 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. + * Don't set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same + * fixed ID for different users. If you are trying to receive non-personalized + * recommendations (not recommended; this can negatively impact model + * performance), instead set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a + * random unique ID and leave + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = null; + /** + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * This field is not used; leave it unset. + * + * Generated from protobuf field string page_token = 4 [deprecated = true]; + * @deprecated + */ + protected $page_token = ''; + /** + * Filter for restricting prediction results with a length limit of 5,000 + * characters. Accepts values for tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to products 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,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. + * * filterOutOfStockItems. Restricts predictions to products 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 + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + * If `filterSyntaxV2` is set to true under the `params` field, then + * attribute-based expressions are expected instead of the above described + * tag-based syntax. Examples: + * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + * * (availability: ANY("IN_STOCK")) AND + * (colors: ANY("Red") OR categories: ANY("Phones")) + * For more information, see + * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + /** + * Use validate only mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary products. + * Note that the validate only mode should only be used for testing the API, + * or if the model is not ready. + * + * Generated from protobuf field bool validate_only = 6; + */ + protected $validate_only = false; + /** + * Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnProduct`: Boolean. If set to true, the associated product + * object will be returned in the `results.metadata` field in the + * prediction response. + * * `returnScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned product will be set in the + * `results.metadata` field in the prediction response. The given + * 'score' indicates the probability of a product being clicked/purchased + * given the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to false, the service + * will return generic (unfiltered) popular products instead of empty if + * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. + * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + * field is interpreteted according to the new, attribute-based syntax. + * + * Generated from protobuf field map params = 7; + */ + private $params; + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map labels = 8; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $placement + * Required. Full resource name of the format: + * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + * or + * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + * We recommend using the `servingConfigs` resource. `placements` is a legacy + * resource. + * The ID of the Recommendations AI serving config or placement. + * Before you can request predictions from your model, you must create at + * least one serving config or placement for it. For more information, see + * [Manage serving configs] + * (https://cloud.google.com/retail/docs/manage-configs). + * The full list of available serving configs can be seen at + * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + * @type \Google\Cloud\Retail\V2\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. + * Don't set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same + * fixed ID for different users. If you are trying to receive non-personalized + * recommendations (not recommended; this can negatively impact model + * performance), instead set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a + * random unique ID and leave + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. + * @type int $page_size + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. + * @type string $page_token + * This field is not used; leave it unset. + * @type string $filter + * Filter for restricting prediction results with a length limit of 5,000 + * characters. Accepts values for tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to products 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,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. + * * filterOutOfStockItems. Restricts predictions to products 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 + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + * If `filterSyntaxV2` is set to true under the `params` field, then + * attribute-based expressions are expected instead of the above described + * tag-based syntax. Examples: + * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + * * (availability: ANY("IN_STOCK")) AND + * (colors: ANY("Red") OR categories: ANY("Phones")) + * For more information, see + * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + * @type bool $validate_only + * Use validate only mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary products. + * Note that the validate only mode should only be used for testing the API, + * or if the model is not ready. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnProduct`: Boolean. If set to true, the associated product + * object will be returned in the `results.metadata` field in the + * prediction response. + * * `returnScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned product will be set in the + * `results.metadata` field in the prediction response. The given + * 'score' indicates the probability of a product being clicked/purchased + * given the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to false, the service + * will return generic (unfiltered) popular products instead of empty if + * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. + * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + * field is interpreteted according to the new, attribute-based syntax. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of the format: + * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + * or + * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + * We recommend using the `servingConfigs` resource. `placements` is a legacy + * resource. + * The ID of the Recommendations AI serving config or placement. + * Before you can request predictions from your model, you must create at + * least one serving config or placement for it. For more information, see + * [Manage serving configs] + * (https://cloud.google.com/retail/docs/manage-configs). + * The full list of available serving configs can be seen at + * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPlacement() + { + return $this->placement; + } + + /** + * Required. Full resource name of the format: + * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + * or + * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + * We recommend using the `servingConfigs` resource. `placements` is a legacy + * resource. + * The ID of the Recommendations AI serving config or placement. + * Before you can request predictions from your model, you must create at + * least one serving config or placement for it. For more information, see + * [Manage serving configs] + * (https://cloud.google.com/retail/docs/manage-configs). + * The full list of available serving configs can be seen at + * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPlacement($var) + { + GPBUtil::checkString($var, True); + $this->placement = $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. + * Don't set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same + * fixed ID for different users. If you are trying to receive non-personalized + * recommendations (not recommended; this can negatively impact model + * performance), instead set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a + * random unique ID and leave + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\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. + * Don't set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same + * fixed ID for different users. If you are trying to receive non-personalized + * recommendations (not recommended; this can negatively impact model + * performance), instead set + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a + * random unique ID and leave + * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\UserEvent $var + * @return $this + */ + public function setUserEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEvent::class); + $this->user_event = $var; + + return $this; + } + + /** + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * This field is not used; leave it unset. + * + * Generated from protobuf field string page_token = 4 [deprecated = true]; + * @return string + * @deprecated + */ + public function getPageToken() + { + @trigger_error('page_token is deprecated.', E_USER_DEPRECATED); + return $this->page_token; + } + + /** + * This field is not used; leave it unset. + * + * Generated from protobuf field string page_token = 4 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setPageToken($var) + { + @trigger_error('page_token is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filter for restricting prediction results with a length limit of 5,000 + * characters. Accepts values for tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to products 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,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. + * * filterOutOfStockItems. Restricts predictions to products 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 + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + * If `filterSyntaxV2` is set to true under the `params` field, then + * attribute-based expressions are expected instead of the above described + * tag-based syntax. Examples: + * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + * * (availability: ANY("IN_STOCK")) AND + * (colors: ANY("Red") OR categories: ANY("Phones")) + * For more information, see + * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter for restricting prediction results with a length limit of 5,000 + * characters. Accepts values for tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to products 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,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. + * * filterOutOfStockItems. Restricts predictions to products 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 + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + * If `filterSyntaxV2` is set to true under the `params` field, then + * attribute-based expressions are expected instead of the above described + * tag-based syntax. Examples: + * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + * * (availability: ANY("IN_STOCK")) AND + * (colors: ANY("Red") OR categories: ANY("Phones")) + * For more information, see + * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Use validate only mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary products. + * Note that the validate only mode should only be used for testing the API, + * or if the model is not ready. + * + * Generated from protobuf field bool validate_only = 6; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Use validate only mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary products. + * Note that the validate only mode should only be used for testing the API, + * or if the model is not ready. + * + * Generated from protobuf field bool validate_only = 6; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnProduct`: Boolean. If set to true, the associated product + * object will be returned in the `results.metadata` field in the + * prediction response. + * * `returnScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned product will be set in the + * `results.metadata` field in the prediction response. The given + * 'score' indicates the probability of a product being clicked/purchased + * given the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to false, the service + * will return generic (unfiltered) popular products instead of empty if + * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. + * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + * field is interpreteted according to the new, attribute-based syntax. + * + * Generated from protobuf field map params = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnProduct`: Boolean. If set to true, the associated product + * object will be returned in the `results.metadata` field in the + * prediction response. + * * `returnScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned product will be set in the + * `results.metadata` field in the prediction response. The given + * 'score' indicates the probability of a product being clicked/purchased + * given the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to false, the service + * will return generic (unfiltered) popular products instead of empty if + * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. + * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + * field is interpreteted according to the new, attribute-based syntax. + * + * Generated from protobuf field map params = 7; + * @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; + } + + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map labels = 8; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php new file mode 100644 index 00000000000..af070db151c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php @@ -0,0 +1,185 @@ +google.cloud.retail.v2.PredictResponse + */ +class PredictResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of recommended products. The order represents the ranking (from the + * most relevant product to the least). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; + */ + private $results; + /** + * A unique attribution token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * recommendation, which enables accurate attribution of recommendation model + * performance. + * + * Generated from protobuf field string attribution_token = 2; + */ + protected $attribution_token = ''; + /** + * IDs of products in the request that were missing from the inventory. + * + * Generated from protobuf field repeated string missing_ids = 3; + */ + private $missing_ids; + /** + * True if the validateOnly property was set in the request. + * + * Generated from protobuf field bool validate_only = 4; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $results + * A list of recommended products. The order represents the ranking (from the + * most relevant product to the least). + * @type string $attribution_token + * A unique attribution token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * recommendation, which enables accurate attribution of recommendation model + * performance. + * @type array|\Google\Protobuf\Internal\RepeatedField $missing_ids + * IDs of products in the request that were missing from the inventory. + * @type bool $validate_only + * True if the validateOnly property was set in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * A list of recommended products. The order represents the ranking (from the + * most relevant product to the least). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * A list of recommended products. The order represents the ranking (from the + * most relevant product to the least). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; + * @param array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\PredictResponse\PredictionResult::class); + $this->results = $arr; + + return $this; + } + + /** + * A unique attribution token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * recommendation, which enables accurate attribution of recommendation model + * performance. + * + * Generated from protobuf field string attribution_token = 2; + * @return string + */ + public function getAttributionToken() + { + return $this->attribution_token; + } + + /** + * A unique attribution token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * recommendation, which enables accurate attribution of recommendation model + * performance. + * + * Generated from protobuf field string attribution_token = 2; + * @param string $var + * @return $this + */ + public function setAttributionToken($var) + { + GPBUtil::checkString($var, True); + $this->attribution_token = $var; + + return $this; + } + + /** + * IDs of products in the request that were missing from the inventory. + * + * Generated from protobuf field repeated string missing_ids = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMissingIds() + { + return $this->missing_ids; + } + + /** + * IDs of products in the request that were missing from the inventory. + * + * Generated from protobuf field repeated string missing_ids = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMissingIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->missing_ids = $arr; + + return $this; + } + + /** + * True if the validateOnly property was set in the request. + * + * Generated from protobuf field bool validate_only = 4; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * True if the validateOnly property was set in the request. + * + * Generated from protobuf field bool validate_only = 4; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php new file mode 100644 index 00000000000..d8ffc3b8276 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php @@ -0,0 +1,124 @@ +google.cloud.retail.v2.PredictResponse.PredictionResult + */ +class PredictionResult extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the recommended product + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Additional product metadata / annotations. + * Possible values: + * * `product`: JSON representation of the product. Is set if + * `returnProduct` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Is set if + * `returnScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map metadata = 2; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * ID of the recommended product + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional product metadata / annotations. + * Possible values: + * * `product`: JSON representation of the product. Is set if + * `returnProduct` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Is set if + * `returnScore` is set to true in `PredictRequest.params`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * ID of the recommended product + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * ID of the recommended product + * + * 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 product metadata / annotations. + * Possible values: + * * `product`: JSON representation of the product. Is set if + * `returnProduct` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Is set if + * `returnScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional product metadata / annotations. + * Possible values: + * * `product`: JSON representation of the product. Is set if + * `returnProduct` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Is set if + * `returnScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map metadata = 2; + * @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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PredictionResult::class, \Google\Cloud\Retail\V2\PredictResponse_PredictionResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php new file mode 100644 index 00000000000..31a7e1a2114 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php @@ -0,0 +1,505 @@ +google.cloud.retail.v2.PriceInfo + */ +class PriceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The 3-letter currency code defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html). + * If this field is an unrecognizable currency code, an INVALID_ARGUMENT + * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string currency_code = 1; + */ + protected $currency_code = ''; + /** + * Price of the product. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). Schema.org + * property [Offer.price](https://schema.org/price). + * + * Generated from protobuf field float price = 2; + */ + protected $price = 0.0; + /** + * Price of the product without any discount. If zero, by default set to be + * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be + * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], + * otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field float original_price = 3; + */ + protected $original_price = 0.0; + /** + * The costs associated with the sale of a particular product. Used for gross + * profit reporting. + * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - + * [cost][google.cloud.retail.v2.PriceInfo.cost] + * Google Merchant Center property + * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + * + * Generated from protobuf field float cost = 4; + */ + protected $cost = 0.0; + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * starts to be effective. This can be set as a future timestamp, and the + * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search + * after + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * If so, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used before + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; + */ + protected $price_effective_time = null; + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] + * is used for search before + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If + * this field is set, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used after + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; + */ + protected $price_expire_time = null; + /** + * Output only. The price range of all the child + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s grouped together on the + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Only populated for + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $price_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $currency_code + * The 3-letter currency code defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html). + * If this field is an unrecognizable currency code, an INVALID_ARGUMENT + * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. + * @type float $price + * Price of the product. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). Schema.org + * property [Offer.price](https://schema.org/price). + * @type float $original_price + * Price of the product without any discount. If zero, by default set to be + * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be + * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], + * otherwise an INVALID_ARGUMENT error is thrown. + * @type float $cost + * The costs associated with the sale of a particular product. Used for gross + * profit reporting. + * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - + * [cost][google.cloud.retail.v2.PriceInfo.cost] + * Google Merchant Center property + * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + * @type \Google\Protobuf\Timestamp $price_effective_time + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * starts to be effective. This can be set as a future timestamp, and the + * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search + * after + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * If so, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used before + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * @type \Google\Protobuf\Timestamp $price_expire_time + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] + * is used for search before + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If + * this field is set, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used after + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * @type \Google\Cloud\Retail\V2\PriceInfo\PriceRange $price_range + * Output only. The price range of all the child + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s grouped together on the + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Only populated for + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The 3-letter currency code defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html). + * If this field is an unrecognizable currency code, an INVALID_ARGUMENT + * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string currency_code = 1; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * The 3-letter currency code defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html). + * If this field is an unrecognizable currency code, an INVALID_ARGUMENT + * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string currency_code = 1; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Price of the product. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). Schema.org + * property [Offer.price](https://schema.org/price). + * + * Generated from protobuf field float price = 2; + * @return float + */ + public function getPrice() + { + return $this->price; + } + + /** + * Price of the product. + * Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). Schema.org + * property [Offer.price](https://schema.org/price). + * + * Generated from protobuf field float price = 2; + * @param float $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkFloat($var); + $this->price = $var; + + return $this; + } + + /** + * Price of the product without any discount. If zero, by default set to be + * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be + * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], + * otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field float original_price = 3; + * @return float + */ + public function getOriginalPrice() + { + return $this->original_price; + } + + /** + * Price of the product without any discount. If zero, by default set to be + * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be + * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], + * otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field float original_price = 3; + * @param float $var + * @return $this + */ + public function setOriginalPrice($var) + { + GPBUtil::checkFloat($var); + $this->original_price = $var; + + return $this; + } + + /** + * The costs associated with the sale of a particular product. Used for gross + * profit reporting. + * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - + * [cost][google.cloud.retail.v2.PriceInfo.cost] + * Google Merchant Center property + * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + * + * Generated from protobuf field float cost = 4; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * The costs associated with the sale of a particular product. Used for gross + * profit reporting. + * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - + * [cost][google.cloud.retail.v2.PriceInfo.cost] + * Google Merchant Center property + * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + * + * Generated from protobuf field float cost = 4; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkFloat($var); + $this->cost = $var; + + return $this; + } + + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * starts to be effective. This can be set as a future timestamp, and the + * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search + * after + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * If so, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used before + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPriceEffectiveTime() + { + return $this->price_effective_time; + } + + public function hasPriceEffectiveTime() + { + return isset($this->price_effective_time); + } + + public function clearPriceEffectiveTime() + { + unset($this->price_effective_time); + } + + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * starts to be effective. This can be set as a future timestamp, and the + * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search + * after + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * If so, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used before + * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPriceEffectiveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->price_effective_time = $var; + + return $this; + } + + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] + * is used for search before + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If + * this field is set, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used after + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPriceExpireTime() + { + return $this->price_expire_time; + } + + public function hasPriceExpireTime() + { + return isset($this->price_expire_time); + } + + public function clearPriceExpireTime() + { + unset($this->price_expire_time); + } + + /** + * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] + * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] + * is used for search before + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If + * this field is set, the + * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be + * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] + * is used after + * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. + * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always + * effective because it will cause additional latency during search. + * + * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPriceExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->price_expire_time = $var; + + return $this; + } + + /** + * Output only. The price range of all the child + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s grouped together on the + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Only populated for + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Retail\V2\PriceInfo\PriceRange|null + */ + public function getPriceRange() + { + return $this->price_range; + } + + public function hasPriceRange() + { + return isset($this->price_range); + } + + public function clearPriceRange() + { + unset($this->price_range); + } + + /** + * Output only. The price range of all the child + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s grouped together on the + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Only populated for + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Retail\V2\PriceInfo\PriceRange $var + * @return $this + */ + public function setPriceRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo\PriceRange::class); + $this->price_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php new file mode 100644 index 00000000000..bcd10811f24 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php @@ -0,0 +1,159 @@ +google.cloud.retail.v2.PriceInfo.PriceRange + */ +class PriceRange extends \Google\Protobuf\Internal\Message +{ + /** + * The inclusive + * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] + * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; + */ + protected $price = null; + /** + * The inclusive + * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] + * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; + */ + protected $original_price = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Interval $price + * The inclusive + * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] + * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * @type \Google\Cloud\Retail\V2\Interval $original_price + * The inclusive + * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] + * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The inclusive + * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] + * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; + * @return \Google\Cloud\Retail\V2\Interval|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * The inclusive + * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] + * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; + * @param \Google\Cloud\Retail\V2\Interval $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); + $this->price = $var; + + return $this; + } + + /** + * The inclusive + * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] + * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; + * @return \Google\Cloud\Retail\V2\Interval|null + */ + public function getOriginalPrice() + { + return $this->original_price; + } + + public function hasOriginalPrice() + { + return isset($this->original_price); + } + + public function clearOriginalPrice() + { + unset($this->original_price); + } + + /** + * The inclusive + * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] + * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] having the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. + * + * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; + * @param \Google\Cloud\Retail\V2\Interval $var + * @return $this + */ + public function setOriginalPrice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); + $this->original_price = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PriceRange::class, \Google\Cloud\Retail\V2\PriceInfo_PriceRange::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php new file mode 100644 index 00000000000..0d56e63f4e4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php @@ -0,0 +1,2502 @@ +google.cloud.retail.v2.Product + */ +class Product extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Full resource name of the product, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is + * the final component of [name][google.cloud.retail.v2.Product.name]. For + * example, this field is "id_1", if + * [name][google.cloud.retail.v2.Product.name] is + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [id](https://support.google.com/merchants/answer/6324405). Schema.org + * property [Product.sku](https://schema.org/sku). + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $id = ''; + /** + * Immutable. The type of the product. Default to + * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * if unset. + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $type = 0; + /** + * Variant group identifier. Must be an + * [id][google.cloud.retail.v2.Product.id], with the same parent branch with + * this product. Otherwise, an error is thrown. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or + * set to the same value as [id][google.cloud.retail.v2.Product.id]. + * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot + * be empty. A maximum of 2,000 products are allowed to share the same + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT + * error is returned. + * Corresponding properties: Google Merchant Center property + * [item_group_id](https://support.google.com/merchants/answer/6324507). + * Schema.org property + * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + * + * Generated from protobuf field string primary_product_id = 4; + */ + protected $primary_product_id = ''; + /** + * The [id][google.cloud.retail.v2.Product.id] of the collection members when + * [type][google.cloud.retail.v2.Product.type] is + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. + * Non-existent product ids are allowed. + * The [type][google.cloud.retail.v2.Product.type] of the members must be + * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an + * INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + * return. + * + * Generated from protobuf field repeated string collection_member_ids = 5; + */ + private $collection_member_ids; + /** + * The Global Trade Item Number (GTIN) of the product. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponding properties: Google Merchant Center property + * [gtin](https://support.google.com/merchants/answer/6324461). + * Schema.org property + * [Product.isbn](https://schema.org/isbn), + * [Product.gtin8](https://schema.org/gtin8), + * [Product.gtin12](https://schema.org/gtin12), + * [Product.gtin13](https://schema.org/gtin13), or + * [Product.gtin14](https://schema.org/gtin14). + * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string gtin = 6; + */ + protected $gtin = ''; + /** + * Product categories. This field is repeated for supporting one product + * belonging to several parallel categories. Strongly recommended using the + * full path for better search / recommendation quality. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categories": [ + * "Shoes & Accessories > Shoes", + * "Sports & Fitness > Athletic Clothing > Shoes" + * ] + * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT + * error is returned. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [google_product_category][mc_google_product_category]. Schema.org property + * [Product.category] (https://schema.org/category). + * [mc_google_product_category]: + * https://support.google.com/merchants/answer/6324436 + * + * Generated from protobuf field repeated string categories = 7; + */ + private $categories; + /** + * Required. Product title. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [title](https://support.google.com/merchants/answer/6324415). Schema.org + * property [Product.name](https://schema.org/name). + * + * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * The brands of the product. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [brand](https://support.google.com/merchants/answer/6324351). Schema.org + * property [Product.brand](https://schema.org/brand). + * + * Generated from protobuf field repeated string brands = 9; + */ + private $brands; + /** + * Product description. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [description](https://support.google.com/merchants/answer/6324468). + * Schema.org property [Product.description](https://schema.org/description). + * + * Generated from protobuf field string description = 10; + */ + protected $description = ''; + /** + * Language of the title/description and other string attributes. Use language + * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * For product prediction, this field is ignored and the model automatically + * detects the text language. The [Product][google.cloud.retail.v2.Product] + * can include text in different languages, but duplicating + * [Product][google.cloud.retail.v2.Product]s to provide text in multiple + * languages can result in degraded model performance. + * For product search this field is in use. It defaults to "en-US" if unset. + * + * Generated from protobuf field string language_code = 11; + */ + protected $language_code = ''; + /** + * Highly encouraged. Extra product attributes to be included. For example, + * for 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 attributes here. + * Features that can take on one of a limited number of possible values. Two + * types of features can be set are: + * Textual features. some examples would be the brand/maker of a product, or + * country of a customer. Numerical features. Some examples would be the + * height/weight of a product, or age of a customer. + * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + * }`. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * For indexable attribute, the key must match the pattern: + * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + * `KEY_1_LIKE_THIS`. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a non-empty UTF-8 encoded string with a + * length limit of 256 characters. + * * For number attributes, at most 400 values are allowed. + * + * Generated from protobuf field map attributes = 12; + */ + private $attributes; + /** + * Custom tags associated with the product. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 + * encoded string with a length limit of 1,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the + * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. + * Corresponding properties: Google Merchant Center property + * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + * + * Generated from protobuf field repeated string tags = 13; + */ + private $tags; + /** + * Product price and cost information. + * Corresponding properties: Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + protected $price_info = null; + /** + * The rating of this product. + * + * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; + */ + protected $rating = null; + /** + * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes + * available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note + * that this is only applicable to + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and + * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * + * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; + */ + protected $available_time = null; + /** + * The online availability of the [Product][google.cloud.retail.v2.Product]. + * Default to + * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. + * Corresponding properties: Google Merchant Center property + * [availability](https://support.google.com/merchants/answer/6324448). + * Schema.org property [Offer.availability](https://schema.org/availability). + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; + */ + protected $availability = 0; + /** + * The available quantity of the item. + * + * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; + */ + protected $available_quantity = null; + /** + * Fulfillment information, such as the store IDs for in-store pickup or + * region IDs for different shipping methods. + * All the elements must have distinct + * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + private $fulfillment_info; + /** + * Canonical URL directly linking to the product detail page. + * It is strongly recommended to provide a valid uri for the product, + * otherwise the service performance could be significantly degraded. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [link](https://support.google.com/merchants/answer/6324416). Schema.org + * property [Offer.url](https://schema.org/url). + * + * Generated from protobuf field string uri = 22; + */ + protected $uri = ''; + /** + * Product images for the product. We highly recommend putting the main + * image first. + * A maximum of 300 images are allowed. + * Corresponding properties: Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; + */ + private $images; + /** + * The target group associated with a given audience (e.g. male, veterans, + * car owners, musicians, etc.) of the product. + * + * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; + */ + protected $audience = null; + /** + * The color of the product. + * Corresponding properties: Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; + */ + protected $color_info = null; + /** + * The size of the product. To represent different size systems or size types, + * consider using this format: [[[size_system:]size_type:]size_value]. + * For example, in "US:MENS:M", "US" represents size system; "MENS" represents + * size type; "M" represents size value. In "GIRLS:27", size system is empty; + * "GIRLS" represents size type; "27" represents size value. In "32 inches", + * both size system and size type are empty, while size value is "32 inches". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [size](https://support.google.com/merchants/answer/6324492), + * [size_type](https://support.google.com/merchants/answer/6324497), and + * [size_system](https://support.google.com/merchants/answer/6324502). + * Schema.org property [Product.size](https://schema.org/size). + * + * Generated from protobuf field repeated string sizes = 26; + */ + private $sizes; + /** + * The material of the product. For example, "leather", "wooden". + * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 200 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [material](https://support.google.com/merchants/answer/6324410). Schema.org + * property [Product.material](https://schema.org/material). + * + * Generated from protobuf field repeated string materials = 27; + */ + private $materials; + /** + * The pattern or graphic print of the product. For example, "striped", "polka + * dot", "paisley". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + * property [Product.pattern](https://schema.org/pattern). + * + * Generated from protobuf field repeated string patterns = 28; + */ + private $patterns; + /** + * The condition of the product. Strongly encouraged to use the standard + * values: "new", "refurbished", "used". + * A maximum of 1 value is allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [condition](https://support.google.com/merchants/answer/6324469). + * Schema.org property + * [Offer.itemCondition](https://schema.org/itemCondition). + * + * Generated from protobuf field repeated string conditions = 29; + */ + private $conditions; + /** + * The promotions applied to the product. A maximum of 10 values are allowed + * per [Product][google.cloud.retail.v2.Product]. Only + * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] + * will be used, other fields will be ignored if set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + private $promotions; + /** + * The timestamp when the product is published by the retailer for the first + * time, which indicates the freshness of the products. Note that this field + * is different from + * [available_time][google.cloud.retail.v2.Product.available_time], given it + * purely describes product freshness regardless of when it is available on + * search and recommendation. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; + */ + protected $publish_time = null; + /** + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Note: Returning more fields in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase + * response payload size and serving latency. + * This field is deprecated. Use the retrievable site-wide control instead. + * + * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; + * @deprecated + */ + protected $retrievable_fields = null; + /** + * Output only. Product variants grouped together on primary product which + * share similar product attributes. It's automatically grouped by + * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for + * all the product variants. Only populated for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $variants; + /** + * Output only. A list of local inventories specific to different places. + * This field can be managed by + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * and + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * APIs if fine-grained, high-volume updates are necessary. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $local_inventories; + protected $expiration; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $expire_time + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. + * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later + * than [available_time][google.cloud.retail.v2.Product.available_time] and + * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an + * INVALID_ARGUMENT error is thrown. + * Corresponding properties: Google Merchant Center property + * [expiration_date](https://support.google.com/merchants/answer/6324499). + * @type \Google\Protobuf\Duration $ttl + * Input only. The TTL (time to live) of the product. Note that this is only + * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], + * and ignored for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, + * we suggest the users to delete the stale products explicitly, instead of + * using this field to determine staleness. + * If it is set, it must be a non-negative value, and + * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The + * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is + * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is + * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. + * If it is set, the product is not available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. + * However, the product can still be retrieved by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * and + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * @type string $name + * Immutable. Full resource name of the product, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + * @type string $id + * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is + * the final component of [name][google.cloud.retail.v2.Product.name]. For + * example, this field is "id_1", if + * [name][google.cloud.retail.v2.Product.name] is + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [id](https://support.google.com/merchants/answer/6324405). Schema.org + * property [Product.sku](https://schema.org/sku). + * @type int $type + * Immutable. The type of the product. Default to + * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * if unset. + * @type string $primary_product_id + * Variant group identifier. Must be an + * [id][google.cloud.retail.v2.Product.id], with the same parent branch with + * this product. Otherwise, an error is thrown. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or + * set to the same value as [id][google.cloud.retail.v2.Product.id]. + * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot + * be empty. A maximum of 2,000 products are allowed to share the same + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT + * error is returned. + * Corresponding properties: Google Merchant Center property + * [item_group_id](https://support.google.com/merchants/answer/6324507). + * Schema.org property + * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_member_ids + * The [id][google.cloud.retail.v2.Product.id] of the collection members when + * [type][google.cloud.retail.v2.Product.type] is + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. + * Non-existent product ids are allowed. + * The [type][google.cloud.retail.v2.Product.type] of the members must be + * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an + * INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + * return. + * @type string $gtin + * The Global Trade Item Number (GTIN) of the product. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponding properties: Google Merchant Center property + * [gtin](https://support.google.com/merchants/answer/6324461). + * Schema.org property + * [Product.isbn](https://schema.org/isbn), + * [Product.gtin8](https://schema.org/gtin8), + * [Product.gtin12](https://schema.org/gtin12), + * [Product.gtin13](https://schema.org/gtin13), or + * [Product.gtin14](https://schema.org/gtin14). + * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $categories + * Product categories. This field is repeated for supporting one product + * belonging to several parallel categories. Strongly recommended using the + * full path for better search / recommendation quality. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categories": [ + * "Shoes & Accessories > Shoes", + * "Sports & Fitness > Athletic Clothing > Shoes" + * ] + * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT + * error is returned. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [google_product_category][mc_google_product_category]. Schema.org property + * [Product.category] (https://schema.org/category). + * [mc_google_product_category]: + * https://support.google.com/merchants/answer/6324436 + * @type string $title + * Required. Product title. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [title](https://support.google.com/merchants/answer/6324415). Schema.org + * property [Product.name](https://schema.org/name). + * @type array|\Google\Protobuf\Internal\RepeatedField $brands + * The brands of the product. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [brand](https://support.google.com/merchants/answer/6324351). Schema.org + * property [Product.brand](https://schema.org/brand). + * @type string $description + * Product description. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [description](https://support.google.com/merchants/answer/6324468). + * Schema.org property [Product.description](https://schema.org/description). + * @type string $language_code + * Language of the title/description and other string attributes. Use language + * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * For product prediction, this field is ignored and the model automatically + * detects the text language. The [Product][google.cloud.retail.v2.Product] + * can include text in different languages, but duplicating + * [Product][google.cloud.retail.v2.Product]s to provide text in multiple + * languages can result in degraded model performance. + * For product search this field is in use. It defaults to "en-US" if unset. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Highly encouraged. Extra product attributes to be included. For example, + * for 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 attributes here. + * Features that can take on one of a limited number of possible values. Two + * types of features can be set are: + * Textual features. some examples would be the brand/maker of a product, or + * country of a customer. Numerical features. Some examples would be the + * height/weight of a product, or age of a customer. + * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + * }`. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * For indexable attribute, the key must match the pattern: + * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + * `KEY_1_LIKE_THIS`. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a non-empty UTF-8 encoded string with a + * length limit of 256 characters. + * * For number attributes, at most 400 values are allowed. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Custom tags associated with the product. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 + * encoded string with a length limit of 1,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the + * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. + * Corresponding properties: Google Merchant Center property + * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + * @type \Google\Cloud\Retail\V2\PriceInfo $price_info + * Product price and cost information. + * Corresponding properties: Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * @type \Google\Cloud\Retail\V2\Rating $rating + * The rating of this product. + * @type \Google\Protobuf\Timestamp $available_time + * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes + * available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note + * that this is only applicable to + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and + * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * @type int $availability + * The online availability of the [Product][google.cloud.retail.v2.Product]. + * Default to + * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. + * Corresponding properties: Google Merchant Center property + * [availability](https://support.google.com/merchants/answer/6324448). + * Schema.org property [Offer.availability](https://schema.org/availability). + * @type \Google\Protobuf\Int32Value $available_quantity + * The available quantity of the item. + * @type array<\Google\Cloud\Retail\V2\FulfillmentInfo>|\Google\Protobuf\Internal\RepeatedField $fulfillment_info + * Fulfillment information, such as the store IDs for in-store pickup or + * region IDs for different shipping methods. + * All the elements must have distinct + * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $uri + * Canonical URL directly linking to the product detail page. + * It is strongly recommended to provide a valid uri for the product, + * otherwise the service performance could be significantly degraded. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [link](https://support.google.com/merchants/answer/6324416). Schema.org + * property [Offer.url](https://schema.org/url). + * @type array<\Google\Cloud\Retail\V2\Image>|\Google\Protobuf\Internal\RepeatedField $images + * Product images for the product. We highly recommend putting the main + * image first. + * A maximum of 300 images are allowed. + * Corresponding properties: Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * @type \Google\Cloud\Retail\V2\Audience $audience + * The target group associated with a given audience (e.g. male, veterans, + * car owners, musicians, etc.) of the product. + * @type \Google\Cloud\Retail\V2\ColorInfo $color_info + * The color of the product. + * Corresponding properties: Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * @type array|\Google\Protobuf\Internal\RepeatedField $sizes + * The size of the product. To represent different size systems or size types, + * consider using this format: [[[size_system:]size_type:]size_value]. + * For example, in "US:MENS:M", "US" represents size system; "MENS" represents + * size type; "M" represents size value. In "GIRLS:27", size system is empty; + * "GIRLS" represents size type; "27" represents size value. In "32 inches", + * both size system and size type are empty, while size value is "32 inches". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [size](https://support.google.com/merchants/answer/6324492), + * [size_type](https://support.google.com/merchants/answer/6324497), and + * [size_system](https://support.google.com/merchants/answer/6324502). + * Schema.org property [Product.size](https://schema.org/size). + * @type array|\Google\Protobuf\Internal\RepeatedField $materials + * The material of the product. For example, "leather", "wooden". + * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 200 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [material](https://support.google.com/merchants/answer/6324410). Schema.org + * property [Product.material](https://schema.org/material). + * @type array|\Google\Protobuf\Internal\RepeatedField $patterns + * The pattern or graphic print of the product. For example, "striped", "polka + * dot", "paisley". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + * property [Product.pattern](https://schema.org/pattern). + * @type array|\Google\Protobuf\Internal\RepeatedField $conditions + * The condition of the product. Strongly encouraged to use the standard + * values: "new", "refurbished", "used". + * A maximum of 1 value is allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [condition](https://support.google.com/merchants/answer/6324469). + * Schema.org property + * [Offer.itemCondition](https://schema.org/itemCondition). + * @type array<\Google\Cloud\Retail\V2\Promotion>|\Google\Protobuf\Internal\RepeatedField $promotions + * The promotions applied to the product. A maximum of 10 values are allowed + * per [Product][google.cloud.retail.v2.Product]. Only + * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] + * will be used, other fields will be ignored if set. + * @type \Google\Protobuf\Timestamp $publish_time + * The timestamp when the product is published by the retailer for the first + * time, which indicates the freshness of the products. Note that this field + * is different from + * [available_time][google.cloud.retail.v2.Product.available_time], given it + * purely describes product freshness regardless of when it is available on + * search and recommendation. + * @type \Google\Protobuf\FieldMask $retrievable_fields + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Note: Returning more fields in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase + * response payload size and serving latency. + * This field is deprecated. Use the retrievable site-wide control instead. + * @type array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $variants + * Output only. Product variants grouped together on primary product which + * share similar product attributes. It's automatically grouped by + * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for + * all the product variants. Only populated for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * @type array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $local_inventories + * Output only. A list of local inventories specific to different places. + * This field can be managed by + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * and + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * APIs if fine-grained, high-volume updates are necessary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Product::initOnce(); + parent::__construct($data); + } + + /** + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. + * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later + * than [available_time][google.cloud.retail.v2.Product.available_time] and + * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an + * INVALID_ARGUMENT error is thrown. + * Corresponding properties: Google Merchant Center property + * [expiration_date](https://support.google.com/merchants/answer/6324499). + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 16; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->readOneof(16); + } + + public function hasExpireTime() + { + return $this->hasOneof(16); + } + + /** + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. + * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later + * than [available_time][google.cloud.retail.v2.Product.available_time] and + * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an + * INVALID_ARGUMENT error is thrown. + * Corresponding properties: Google Merchant Center property + * [expiration_date](https://support.google.com/merchants/answer/6324499). + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 16; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Input only. The TTL (time to live) of the product. Note that this is only + * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], + * and ignored for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, + * we suggest the users to delete the stale products explicitly, instead of + * using this field to determine staleness. + * If it is set, it must be a non-negative value, and + * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The + * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is + * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is + * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. + * If it is set, the product is not available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. + * However, the product can still be retrieved by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * and + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getTtl() + { + return $this->readOneof(17); + } + + public function hasTtl() + { + return $this->hasOneof(17); + } + + /** + * Input only. The TTL (time to live) of the product. Note that this is only + * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], + * and ignored for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, + * we suggest the users to delete the stale products explicitly, instead of + * using this field to determine staleness. + * If it is set, it must be a non-negative value, and + * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The + * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is + * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is + * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. + * If it is set, the product is not available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after + * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. + * However, the product can still be retrieved by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * and + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Immutable. Full resource name of the product, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Full resource name of the product, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is + * the final component of [name][google.cloud.retail.v2.Product.name]. For + * example, this field is "id_1", if + * [name][google.cloud.retail.v2.Product.name] is + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [id](https://support.google.com/merchants/answer/6324405). Schema.org + * property [Product.sku](https://schema.org/sku). + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is + * the final component of [name][google.cloud.retail.v2.Product.name]. For + * example, this field is "id_1", if + * [name][google.cloud.retail.v2.Product.name] is + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [id](https://support.google.com/merchants/answer/6324405). Schema.org + * property [Product.sku](https://schema.org/sku). + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Immutable. The type of the product. Default to + * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * if unset. + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Immutable. The type of the product. Default to + * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * if unset. + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Product\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Variant group identifier. Must be an + * [id][google.cloud.retail.v2.Product.id], with the same parent branch with + * this product. Otherwise, an error is thrown. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or + * set to the same value as [id][google.cloud.retail.v2.Product.id]. + * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot + * be empty. A maximum of 2,000 products are allowed to share the same + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT + * error is returned. + * Corresponding properties: Google Merchant Center property + * [item_group_id](https://support.google.com/merchants/answer/6324507). + * Schema.org property + * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + * + * Generated from protobuf field string primary_product_id = 4; + * @return string + */ + public function getPrimaryProductId() + { + return $this->primary_product_id; + } + + /** + * Variant group identifier. Must be an + * [id][google.cloud.retail.v2.Product.id], with the same parent branch with + * this product. Otherwise, an error is thrown. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or + * set to the same value as [id][google.cloud.retail.v2.Product.id]. + * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot + * be empty. A maximum of 2,000 products are allowed to share the same + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT + * error is returned. + * Corresponding properties: Google Merchant Center property + * [item_group_id](https://support.google.com/merchants/answer/6324507). + * Schema.org property + * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + * + * Generated from protobuf field string primary_product_id = 4; + * @param string $var + * @return $this + */ + public function setPrimaryProductId($var) + { + GPBUtil::checkString($var, True); + $this->primary_product_id = $var; + + return $this; + } + + /** + * The [id][google.cloud.retail.v2.Product.id] of the collection members when + * [type][google.cloud.retail.v2.Product.type] is + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. + * Non-existent product ids are allowed. + * The [type][google.cloud.retail.v2.Product.type] of the members must be + * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an + * INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + * return. + * + * Generated from protobuf field repeated string collection_member_ids = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionMemberIds() + { + return $this->collection_member_ids; + } + + /** + * The [id][google.cloud.retail.v2.Product.id] of the collection members when + * [type][google.cloud.retail.v2.Product.type] is + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. + * Non-existent product ids are allowed. + * The [type][google.cloud.retail.v2.Product.type] of the members must be + * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an + * INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + * return. + * + * Generated from protobuf field repeated string collection_member_ids = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionMemberIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_member_ids = $arr; + + return $this; + } + + /** + * The Global Trade Item Number (GTIN) of the product. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponding properties: Google Merchant Center property + * [gtin](https://support.google.com/merchants/answer/6324461). + * Schema.org property + * [Product.isbn](https://schema.org/isbn), + * [Product.gtin8](https://schema.org/gtin8), + * [Product.gtin12](https://schema.org/gtin12), + * [Product.gtin13](https://schema.org/gtin13), or + * [Product.gtin14](https://schema.org/gtin14). + * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string gtin = 6; + * @return string + */ + public function getGtin() + { + return $this->gtin; + } + + /** + * The Global Trade Item Number (GTIN) of the product. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponding properties: Google Merchant Center property + * [gtin](https://support.google.com/merchants/answer/6324461). + * Schema.org property + * [Product.isbn](https://schema.org/isbn), + * [Product.gtin8](https://schema.org/gtin8), + * [Product.gtin12](https://schema.org/gtin12), + * [Product.gtin13](https://schema.org/gtin13), or + * [Product.gtin14](https://schema.org/gtin14). + * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string gtin = 6; + * @param string $var + * @return $this + */ + public function setGtin($var) + { + GPBUtil::checkString($var, True); + $this->gtin = $var; + + return $this; + } + + /** + * Product categories. This field is repeated for supporting one product + * belonging to several parallel categories. Strongly recommended using the + * full path for better search / recommendation quality. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categories": [ + * "Shoes & Accessories > Shoes", + * "Sports & Fitness > Athletic Clothing > Shoes" + * ] + * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT + * error is returned. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [google_product_category][mc_google_product_category]. Schema.org property + * [Product.category] (https://schema.org/category). + * [mc_google_product_category]: + * https://support.google.com/merchants/answer/6324436 + * + * Generated from protobuf field repeated string categories = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategories() + { + return $this->categories; + } + + /** + * Product categories. This field is repeated for supporting one product + * belonging to several parallel categories. Strongly recommended using the + * full path for better search / recommendation quality. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categories": [ + * "Shoes & Accessories > Shoes", + * "Sports & Fitness > Athletic Clothing > Shoes" + * ] + * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT + * error is returned. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [google_product_category][mc_google_product_category]. Schema.org property + * [Product.category] (https://schema.org/category). + * [mc_google_product_category]: + * https://support.google.com/merchants/answer/6324436 + * + * Generated from protobuf field repeated string categories = 7; + * @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; + } + + /** + * Required. Product title. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [title](https://support.google.com/merchants/answer/6324415). Schema.org + * property [Product.name](https://schema.org/name). + * + * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Product title. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [title](https://support.google.com/merchants/answer/6324415). Schema.org + * property [Product.name](https://schema.org/name). + * + * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The brands of the product. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [brand](https://support.google.com/merchants/answer/6324351). Schema.org + * property [Product.brand](https://schema.org/brand). + * + * Generated from protobuf field repeated string brands = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBrands() + { + return $this->brands; + } + + /** + * The brands of the product. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [brand](https://support.google.com/merchants/answer/6324351). Schema.org + * property [Product.brand](https://schema.org/brand). + * + * Generated from protobuf field repeated string brands = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBrands($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->brands = $arr; + + return $this; + } + + /** + * Product description. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [description](https://support.google.com/merchants/answer/6324468). + * Schema.org property [Product.description](https://schema.org/description). + * + * Generated from protobuf field string description = 10; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Product description. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [description](https://support.google.com/merchants/answer/6324468). + * Schema.org property [Product.description](https://schema.org/description). + * + * Generated from protobuf field string description = 10; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Language of the title/description and other string attributes. Use language + * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * For product prediction, this field is ignored and the model automatically + * detects the text language. The [Product][google.cloud.retail.v2.Product] + * can include text in different languages, but duplicating + * [Product][google.cloud.retail.v2.Product]s to provide text in multiple + * languages can result in degraded model performance. + * For product search this field is in use. It defaults to "en-US" if unset. + * + * Generated from protobuf field string language_code = 11; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language of the title/description and other string attributes. Use language + * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * For product prediction, this field is ignored and the model automatically + * detects the text language. The [Product][google.cloud.retail.v2.Product] + * can include text in different languages, but duplicating + * [Product][google.cloud.retail.v2.Product]s to provide text in multiple + * languages can result in degraded model performance. + * For product search this field is in use. It defaults to "en-US" if unset. + * + * Generated from protobuf field string language_code = 11; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Highly encouraged. Extra product attributes to be included. For example, + * for 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 attributes here. + * Features that can take on one of a limited number of possible values. Two + * types of features can be set are: + * Textual features. some examples would be the brand/maker of a product, or + * country of a customer. Numerical features. Some examples would be the + * height/weight of a product, or age of a customer. + * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + * }`. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * For indexable attribute, the key must match the pattern: + * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + * `KEY_1_LIKE_THIS`. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a non-empty UTF-8 encoded string with a + * length limit of 256 characters. + * * For number attributes, at most 400 values are allowed. + * + * Generated from protobuf field map attributes = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Highly encouraged. Extra product attributes to be included. For example, + * for 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 attributes here. + * Features that can take on one of a limited number of possible values. Two + * types of features can be set are: + * Textual features. some examples would be the brand/maker of a product, or + * country of a customer. Numerical features. Some examples would be the + * height/weight of a product, or age of a customer. + * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + * }`. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * For indexable attribute, the key must match the pattern: + * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + * `KEY_1_LIKE_THIS`. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a non-empty UTF-8 encoded string with a + * length limit of 256 characters. + * * For number attributes, at most 400 values are allowed. + * + * Generated from protobuf field map attributes = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Custom tags associated with the product. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 + * encoded string with a length limit of 1,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the + * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. + * Corresponding properties: Google Merchant Center property + * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + * + * Generated from protobuf field repeated string tags = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Custom tags associated with the product. + * At most 250 values are allowed per + * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 + * encoded string with a length limit of 1,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the + * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. + * Corresponding properties: Google Merchant Center property + * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + * + * Generated from protobuf field repeated string tags = 13; + * @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; + } + + /** + * Product price and cost information. + * Corresponding properties: Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; + * @return \Google\Cloud\Retail\V2\PriceInfo|null + */ + public function getPriceInfo() + { + return $this->price_info; + } + + public function hasPriceInfo() + { + return isset($this->price_info); + } + + public function clearPriceInfo() + { + unset($this->price_info); + } + + /** + * Product price and cost information. + * Corresponding properties: Google Merchant Center property + * [price](https://support.google.com/merchants/answer/6324371). + * + * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; + * @param \Google\Cloud\Retail\V2\PriceInfo $var + * @return $this + */ + public function setPriceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo::class); + $this->price_info = $var; + + return $this; + } + + /** + * The rating of this product. + * + * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; + * @return \Google\Cloud\Retail\V2\Rating|null + */ + public function getRating() + { + return $this->rating; + } + + public function hasRating() + { + return isset($this->rating); + } + + public function clearRating() + { + unset($this->rating); + } + + /** + * The rating of this product. + * + * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; + * @param \Google\Cloud\Retail\V2\Rating $var + * @return $this + */ + public function setRating($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rating::class); + $this->rating = $var; + + return $this; + } + + /** + * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes + * available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note + * that this is only applicable to + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and + * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * + * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAvailableTime() + { + return $this->available_time; + } + + public function hasAvailableTime() + { + return isset($this->available_time); + } + + public function clearAvailableTime() + { + unset($this->available_time); + } + + /** + * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes + * available for + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note + * that this is only applicable to + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and + * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * + * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAvailableTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->available_time = $var; + + return $this; + } + + /** + * The online availability of the [Product][google.cloud.retail.v2.Product]. + * Default to + * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. + * Corresponding properties: Google Merchant Center property + * [availability](https://support.google.com/merchants/answer/6324448). + * Schema.org property [Offer.availability](https://schema.org/availability). + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; + * @return int + */ + public function getAvailability() + { + return $this->availability; + } + + /** + * The online availability of the [Product][google.cloud.retail.v2.Product]. + * Default to + * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. + * Corresponding properties: Google Merchant Center property + * [availability](https://support.google.com/merchants/answer/6324448). + * Schema.org property [Offer.availability](https://schema.org/availability). + * + * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; + * @param int $var + * @return $this + */ + public function setAvailability($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Product\Availability::class); + $this->availability = $var; + + return $this; + } + + /** + * The available quantity of the item. + * + * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; + * @return \Google\Protobuf\Int32Value|null + */ + public function getAvailableQuantity() + { + return $this->available_quantity; + } + + public function hasAvailableQuantity() + { + return isset($this->available_quantity); + } + + public function clearAvailableQuantity() + { + unset($this->available_quantity); + } + + /** + * Returns the unboxed value from getAvailableQuantity() + + * The available quantity of the item. + * + * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; + * @return int|null + */ + public function getAvailableQuantityUnwrapped() + { + return $this->readWrapperValue("available_quantity"); + } + + /** + * The available quantity of the item. + * + * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setAvailableQuantity($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->available_quantity = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The available quantity of the item. + * + * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; + * @param int|null $var + * @return $this + */ + public function setAvailableQuantityUnwrapped($var) + { + $this->writeWrapperValue("available_quantity", $var); + return $this;} + + /** + * Fulfillment information, such as the store IDs for in-store pickup or + * region IDs for different shipping methods. + * All the elements must have distinct + * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFulfillmentInfo() + { + return $this->fulfillment_info; + } + + /** + * Fulfillment information, such as the store IDs for in-store pickup or + * region IDs for different shipping methods. + * All the elements must have distinct + * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + * @param array<\Google\Cloud\Retail\V2\FulfillmentInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFulfillmentInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\FulfillmentInfo::class); + $this->fulfillment_info = $arr; + + return $this; + } + + /** + * Canonical URL directly linking to the product detail page. + * It is strongly recommended to provide a valid uri for the product, + * otherwise the service performance could be significantly degraded. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [link](https://support.google.com/merchants/answer/6324416). Schema.org + * property [Offer.url](https://schema.org/url). + * + * Generated from protobuf field string uri = 22; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Canonical URL directly linking to the product detail page. + * It is strongly recommended to provide a valid uri for the product, + * otherwise the service performance could be significantly degraded. + * This field must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [link](https://support.google.com/merchants/answer/6324416). Schema.org + * property [Offer.url](https://schema.org/url). + * + * Generated from protobuf field string uri = 22; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Product images for the product. We highly recommend putting the main + * image first. + * A maximum of 300 images are allowed. + * Corresponding properties: Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImages() + { + return $this->images; + } + + /** + * Product images for the product. We highly recommend putting the main + * image first. + * A maximum of 300 images are allowed. + * Corresponding properties: Google Merchant Center property + * [image_link](https://support.google.com/merchants/answer/6324350). + * Schema.org property [Product.image](https://schema.org/image). + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; + * @param array<\Google\Cloud\Retail\V2\Image>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Image::class); + $this->images = $arr; + + return $this; + } + + /** + * The target group associated with a given audience (e.g. male, veterans, + * car owners, musicians, etc.) of the product. + * + * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; + * @return \Google\Cloud\Retail\V2\Audience|null + */ + public function getAudience() + { + return $this->audience; + } + + public function hasAudience() + { + return isset($this->audience); + } + + public function clearAudience() + { + unset($this->audience); + } + + /** + * The target group associated with a given audience (e.g. male, veterans, + * car owners, musicians, etc.) of the product. + * + * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; + * @param \Google\Cloud\Retail\V2\Audience $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Audience::class); + $this->audience = $var; + + return $this; + } + + /** + * The color of the product. + * Corresponding properties: Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; + * @return \Google\Cloud\Retail\V2\ColorInfo|null + */ + public function getColorInfo() + { + return $this->color_info; + } + + public function hasColorInfo() + { + return isset($this->color_info); + } + + public function clearColorInfo() + { + unset($this->color_info); + } + + /** + * The color of the product. + * Corresponding properties: Google Merchant Center property + * [color](https://support.google.com/merchants/answer/6324487). Schema.org + * property [Product.color](https://schema.org/color). + * + * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; + * @param \Google\Cloud\Retail\V2\ColorInfo $var + * @return $this + */ + public function setColorInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ColorInfo::class); + $this->color_info = $var; + + return $this; + } + + /** + * The size of the product. To represent different size systems or size types, + * consider using this format: [[[size_system:]size_type:]size_value]. + * For example, in "US:MENS:M", "US" represents size system; "MENS" represents + * size type; "M" represents size value. In "GIRLS:27", size system is empty; + * "GIRLS" represents size type; "27" represents size value. In "32 inches", + * both size system and size type are empty, while size value is "32 inches". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [size](https://support.google.com/merchants/answer/6324492), + * [size_type](https://support.google.com/merchants/answer/6324497), and + * [size_system](https://support.google.com/merchants/answer/6324502). + * Schema.org property [Product.size](https://schema.org/size). + * + * Generated from protobuf field repeated string sizes = 26; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSizes() + { + return $this->sizes; + } + + /** + * The size of the product. To represent different size systems or size types, + * consider using this format: [[[size_system:]size_type:]size_value]. + * For example, in "US:MENS:M", "US" represents size system; "MENS" represents + * size type; "M" represents size value. In "GIRLS:27", size system is empty; + * "GIRLS" represents size type; "27" represents size value. In "32 inches", + * both size system and size type are empty, while size value is "32 inches". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [size](https://support.google.com/merchants/answer/6324492), + * [size_type](https://support.google.com/merchants/answer/6324497), and + * [size_system](https://support.google.com/merchants/answer/6324502). + * Schema.org property [Product.size](https://schema.org/size). + * + * Generated from protobuf field repeated string sizes = 26; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSizes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->sizes = $arr; + + return $this; + } + + /** + * The material of the product. For example, "leather", "wooden". + * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 200 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [material](https://support.google.com/merchants/answer/6324410). Schema.org + * property [Product.material](https://schema.org/material). + * + * Generated from protobuf field repeated string materials = 27; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMaterials() + { + return $this->materials; + } + + /** + * The material of the product. For example, "leather", "wooden". + * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + * string with a length limit of 200 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [material](https://support.google.com/merchants/answer/6324410). Schema.org + * property [Product.material](https://schema.org/material). + * + * Generated from protobuf field repeated string materials = 27; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMaterials($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->materials = $arr; + + return $this; + } + + /** + * The pattern or graphic print of the product. For example, "striped", "polka + * dot", "paisley". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + * property [Product.pattern](https://schema.org/pattern). + * + * Generated from protobuf field repeated string patterns = 28; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPatterns() + { + return $this->patterns; + } + + /** + * The pattern or graphic print of the product. For example, "striped", "polka + * dot", "paisley". + * A maximum of 20 values are allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + * property [Product.pattern](https://schema.org/pattern). + * + * Generated from protobuf field repeated string patterns = 28; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->patterns = $arr; + + return $this; + } + + /** + * The condition of the product. Strongly encouraged to use the standard + * values: "new", "refurbished", "used". + * A maximum of 1 value is allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [condition](https://support.google.com/merchants/answer/6324469). + * Schema.org property + * [Offer.itemCondition](https://schema.org/itemCondition). + * + * Generated from protobuf field repeated string conditions = 29; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * The condition of the product. Strongly encouraged to use the standard + * values: "new", "refurbished", "used". + * A maximum of 1 value is allowed per + * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 + * encoded string with a length limit of 128 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. + * Corresponding properties: Google Merchant Center property + * [condition](https://support.google.com/merchants/answer/6324469). + * Schema.org property + * [Offer.itemCondition](https://schema.org/itemCondition). + * + * Generated from protobuf field repeated string conditions = 29; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->conditions = $arr; + + return $this; + } + + /** + * The promotions applied to the product. A maximum of 10 values are allowed + * per [Product][google.cloud.retail.v2.Product]. Only + * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] + * will be used, other fields will be ignored if set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPromotions() + { + return $this->promotions; + } + + /** + * The promotions applied to the product. A maximum of 10 values are allowed + * per [Product][google.cloud.retail.v2.Product]. Only + * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] + * will be used, other fields will be ignored if set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; + * @param array<\Google\Cloud\Retail\V2\Promotion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPromotions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Promotion::class); + $this->promotions = $arr; + + return $this; + } + + /** + * The timestamp when the product is published by the retailer for the first + * time, which indicates the freshness of the products. Note that this field + * is different from + * [available_time][google.cloud.retail.v2.Product.available_time], given it + * purely describes product freshness regardless of when it is available on + * search and recommendation. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPublishTime() + { + return $this->publish_time; + } + + public function hasPublishTime() + { + return isset($this->publish_time); + } + + public function clearPublishTime() + { + unset($this->publish_time); + } + + /** + * The timestamp when the product is published by the retailer for the first + * time, which indicates the freshness of the products. Note that this field + * is different from + * [available_time][google.cloud.retail.v2.Product.available_time], given it + * purely describes product freshness regardless of when it is available on + * search and recommendation. + * + * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPublishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->publish_time = $var; + + return $this; + } + + /** + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Note: Returning more fields in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase + * response payload size and serving latency. + * This field is deprecated. Use the retrievable site-wide control instead. + * + * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; + * @return \Google\Protobuf\FieldMask|null + * @deprecated + */ + public function getRetrievableFields() + { + @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); + return $this->retrievable_fields; + } + + public function hasRetrievableFields() + { + @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); + return isset($this->retrievable_fields); + } + + public function clearRetrievableFields() + { + @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); + unset($this->retrievable_fields); + } + + /** + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Note: Returning more fields in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase + * response payload size and serving latency. + * This field is deprecated. Use the retrievable site-wide control instead. + * + * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + * @deprecated + */ + public function setRetrievableFields($var) + { + @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->retrievable_fields = $var; + + return $this; + } + + /** + * Output only. Product variants grouped together on primary product which + * share similar product attributes. It's automatically grouped by + * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for + * all the product variants. Only populated for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVariants() + { + return $this->variants; + } + + /** + * Output only. Product variants grouped together on primary product which + * share similar product attributes. It's automatically grouped by + * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for + * all the product variants. Only populated for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s. + * Note: This field is OUTPUT_ONLY for + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. + * Do not set this field in API requests. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVariants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); + $this->variants = $arr; + + return $this; + } + + /** + * Output only. A list of local inventories specific to different places. + * This field can be managed by + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * and + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * APIs if fine-grained, high-volume updates are necessary. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocalInventories() + { + return $this->local_inventories; + } + + /** + * Output only. A list of local inventories specific to different places. + * This field can be managed by + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * and + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * APIs if fine-grained, high-volume updates are necessary. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocalInventories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\LocalInventory::class); + $this->local_inventories = $arr; + + return $this; + } + + /** + * @return string + */ + public function getExpiration() + { + return $this->whichOneof("expiration"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php new file mode 100644 index 00000000000..8030fad5f09 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php @@ -0,0 +1,81 @@ +google.cloud.retail.v2.Product.Availability + */ +class Availability +{ + /** + * Default product availability. Default to + * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK] + * if unset. + * + * Generated from protobuf enum AVAILABILITY_UNSPECIFIED = 0; + */ + const AVAILABILITY_UNSPECIFIED = 0; + /** + * Product in stock. + * + * Generated from protobuf enum IN_STOCK = 1; + */ + const IN_STOCK = 1; + /** + * Product out of stock. + * + * Generated from protobuf enum OUT_OF_STOCK = 2; + */ + const OUT_OF_STOCK = 2; + /** + * Product that is in pre-order state. + * + * Generated from protobuf enum PREORDER = 3; + */ + const PREORDER = 3; + /** + * Product that is back-ordered (i.e. temporarily out of stock). + * + * Generated from protobuf enum BACKORDER = 4; + */ + const BACKORDER = 4; + + private static $valueToName = [ + self::AVAILABILITY_UNSPECIFIED => 'AVAILABILITY_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(Availability::class, \Google\Cloud\Retail\V2\Product_Availability::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php new file mode 100644 index 00000000000..472fd58e920 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php @@ -0,0 +1,89 @@ +google.cloud.retail.v2.Product.Type + */ +class Type +{ + /** + * Default value. Default to + * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * if unset. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The primary type. + * As the primary unit for predicting, indexing and search serving, a + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] is grouped with multiple + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * The variant type. + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s usually share some common + * attributes on the same + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s, but they have variant + * attributes like different colors, sizes and prices, etc. + * + * Generated from protobuf enum VARIANT = 2; + */ + const VARIANT = 2; + /** + * The collection type. Collection products are bundled + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product]s or + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s that are sold together, such + * as a jewelry set with necklaces, earrings and rings, etc. + * + * Generated from protobuf enum COLLECTION = 3; + */ + const COLLECTION = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::VARIANT => 'VARIANT', + self::COLLECTION => 'COLLECTION', + ]; + + 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(Type::class, \Google\Cloud\Retail\V2\Product_Type::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php new file mode 100644 index 00000000000..d077bbd3ea7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php @@ -0,0 +1,111 @@ +google.cloud.retail.v2.ProductAttributeInterval + */ +class ProductAttributeInterval extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + */ + protected $interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The attribute name (e.g. "length") + * @type \Google\Cloud\Retail\V2\Interval $interval + * The numeric interval (e.g. [10, 20)) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @return \Google\Cloud\Retail\V2\Interval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @param \Google\Cloud\Retail\V2\Interval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); + $this->interval = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php new file mode 100644 index 00000000000..0e258e59b22 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php @@ -0,0 +1,103 @@ +google.cloud.retail.v2.ProductAttributeValue + */ +class ProductAttributeValue extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The attribute name. + * @type string $value + * The attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php new file mode 100644 index 00000000000..0722a467084 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php @@ -0,0 +1,206 @@ +google.cloud.retail.v2.ProductDetail + */ +class ProductDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [Product][google.cloud.retail.v2.Product] information. + * Required field(s): + * * [Product.id][google.cloud.retail.v2.Product.id] + * Optional override field(s): + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * If any supported optional fields are provided, we will treat them as a full + * override when looking up product information from the catalog. Thus, it is + * important to ensure that the overriding fields are accurate and + * complete. + * All other product fields are ignored and instead populated via catalog + * lookup after event ingestion. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product = null; + /** + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * + * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; + */ + protected $quantity = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Product $product + * Required. [Product][google.cloud.retail.v2.Product] information. + * Required field(s): + * * [Product.id][google.cloud.retail.v2.Product.id] + * Optional override field(s): + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * If any supported optional fields are provided, we will treat them as a full + * override when looking up product information from the catalog. Thus, it is + * important to ensure that the overriding fields are accurate and + * complete. + * All other product fields are ignored and instead populated via catalog + * lookup after event ingestion. + * @type \Google\Protobuf\Int32Value $quantity + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. [Product][google.cloud.retail.v2.Product] information. + * Required field(s): + * * [Product.id][google.cloud.retail.v2.Product.id] + * Optional override field(s): + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * If any supported optional fields are provided, we will treat them as a full + * override when looking up product information from the catalog. Thus, it is + * important to ensure that the overriding fields are accurate and + * complete. + * All other product fields are ignored and instead populated via catalog + * lookup after event ingestion. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Product|null + */ + public function getProduct() + { + return $this->product; + } + + public function hasProduct() + { + return isset($this->product); + } + + public function clearProduct() + { + unset($this->product); + } + + /** + * Required. [Product][google.cloud.retail.v2.Product] information. + * Required field(s): + * * [Product.id][google.cloud.retail.v2.Product.id] + * Optional override field(s): + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * If any supported optional fields are provided, we will treat them as a full + * override when looking up product information from the catalog. Thus, it is + * important to ensure that the overriding fields are accurate and + * complete. + * All other product fields are ignored and instead populated via catalog + * lookup after event ingestion. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Product $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); + $this->product = $var; + + return $this; + } + + /** + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * + * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; + * @return \Google\Protobuf\Int32Value|null + */ + public function getQuantity() + { + return $this->quantity; + } + + public function hasQuantity() + { + return isset($this->quantity); + } + + public function clearQuantity() + { + unset($this->quantity); + } + + /** + * Returns the unboxed value from getQuantity() + + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * + * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; + * @return int|null + */ + public function getQuantityUnwrapped() + { + return $this->readWrapperValue("quantity"); + } + + /** + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * + * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->quantity = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * 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 `purchase-complete` event. Required for `add-to-cart` and + * `purchase-complete` event types. + * + * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; + * @param int|null $var + * @return $this + */ + public function setQuantityUnwrapped($var) + { + $this->writeWrapperValue("quantity", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php new file mode 100644 index 00000000000..c09dcf1518a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.ProductInlineSource + */ +class ProductInlineSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of products to update/create. Each product must have a + * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of + * 100 items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $products; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $products + * Required. A list of products to update/create. Each product must have a + * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of + * 100 items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of products to update/create. Each product must have a + * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of + * 100 items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducts() + { + return $this->products; + } + + /** + * Required. A list of products to update/create. Each product must have a + * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of + * 100 items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); + $this->products = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php new file mode 100644 index 00000000000..11ca3288d35 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php @@ -0,0 +1,141 @@ +google.cloud.retail.v2.ProductInputConfig + */ +class ProductInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductInlineSource $product_inline_source + * The Inline source for the input content for products. + * @type \Google\Cloud\Retail\V2\GcsSource $gcs_source + * Google Cloud Storage location for the input content. + * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source + * BigQuery input source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * The Inline source for the input content for products. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductInlineSource product_inline_source = 1; + * @return \Google\Cloud\Retail\V2\ProductInlineSource|null + */ + public function getProductInlineSource() + { + return $this->readOneof(1); + } + + public function hasProductInlineSource() + { + return $this->hasOneof(1); + } + + /** + * The Inline source for the input content for products. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductInlineSource product_inline_source = 1; + * @param \Google\Cloud\Retail\V2\ProductInlineSource $var + * @return $this + */ + public function setProductInlineSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductInlineSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2; + * @return \Google\Cloud\Retail\V2\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.retail.v2.GcsSource gcs_source = 2; + * @param \Google\Cloud\Retail\V2\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GcsSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * BigQuery input source. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3; + * @return \Google\Cloud\Retail\V2\BigQuerySource|null + */ + public function getBigQuerySource() + { + return $this->readOneof(3); + } + + public function hasBigQuerySource() + { + return $this->hasOneof(3); + } + + /** + * BigQuery input source. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3; + * @param \Google\Cloud\Retail\V2\BigQuerySource $var + * @return $this + */ + public function setBigQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php new file mode 100644 index 00000000000..11b7d4524c3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php @@ -0,0 +1,246 @@ +google.cloud.retail.v2.ProductLevelConfig + */ +class ProductLevelConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The type of [Product][google.cloud.retail.v2.Product]s allowed to be + * ingested into the catalog. Acceptable values are: + * * `primary` (default): You can ingest + * [Product][google.cloud.retail.v2.Product]s of all types. When + * ingesting a [Product][google.cloud.retail.v2.Product], its type will + * default to + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if + * unset. + * * `variant` (incompatible with Retail Search): You can only + * ingest + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. This means + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * cannot be empty. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `variant` and + * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] + * is `itemGroupId`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string ingestion_product_type = 1; + */ + protected $ingestion_product_type = ''; + /** + * Which field of [Merchant Center + * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable + * values are: + * * `offerId` (default): Import `offerId` as the product ID. + * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + * API will choose one item from the ones with the same `itemGroupId`, and + * use it to represent the item group. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `itemGroupId` and + * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * is `variant`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string merchant_center_product_id_field = 2; + */ + protected $merchant_center_product_id_field = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ingestion_product_type + * The type of [Product][google.cloud.retail.v2.Product]s allowed to be + * ingested into the catalog. Acceptable values are: + * * `primary` (default): You can ingest + * [Product][google.cloud.retail.v2.Product]s of all types. When + * ingesting a [Product][google.cloud.retail.v2.Product], its type will + * default to + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if + * unset. + * * `variant` (incompatible with Retail Search): You can only + * ingest + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. This means + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * cannot be empty. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `variant` and + * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] + * is `itemGroupId`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * @type string $merchant_center_product_id_field + * Which field of [Merchant Center + * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable + * values are: + * * `offerId` (default): Import `offerId` as the product ID. + * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + * API will choose one item from the ones with the same `itemGroupId`, and + * use it to represent the item group. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `itemGroupId` and + * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * is `variant`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * The type of [Product][google.cloud.retail.v2.Product]s allowed to be + * ingested into the catalog. Acceptable values are: + * * `primary` (default): You can ingest + * [Product][google.cloud.retail.v2.Product]s of all types. When + * ingesting a [Product][google.cloud.retail.v2.Product], its type will + * default to + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if + * unset. + * * `variant` (incompatible with Retail Search): You can only + * ingest + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. This means + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * cannot be empty. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `variant` and + * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] + * is `itemGroupId`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string ingestion_product_type = 1; + * @return string + */ + public function getIngestionProductType() + { + return $this->ingestion_product_type; + } + + /** + * The type of [Product][google.cloud.retail.v2.Product]s allowed to be + * ingested into the catalog. Acceptable values are: + * * `primary` (default): You can ingest + * [Product][google.cloud.retail.v2.Product]s of all types. When + * ingesting a [Product][google.cloud.retail.v2.Product], its type will + * default to + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if + * unset. + * * `variant` (incompatible with Retail Search): You can only + * ingest + * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. This means + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * cannot be empty. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `variant` and + * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] + * is `itemGroupId`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string ingestion_product_type = 1; + * @param string $var + * @return $this + */ + public function setIngestionProductType($var) + { + GPBUtil::checkString($var, True); + $this->ingestion_product_type = $var; + + return $this; + } + + /** + * Which field of [Merchant Center + * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable + * values are: + * * `offerId` (default): Import `offerId` as the product ID. + * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + * API will choose one item from the ones with the same `itemGroupId`, and + * use it to represent the item group. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `itemGroupId` and + * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * is `variant`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string merchant_center_product_id_field = 2; + * @return string + */ + public function getMerchantCenterProductIdField() + { + return $this->merchant_center_product_id_field; + } + + /** + * Which field of [Merchant Center + * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable + * values are: + * * `offerId` (default): Import `offerId` as the product ID. + * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + * API will choose one item from the ones with the same `itemGroupId`, and + * use it to represent the item group. + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * If this field is `itemGroupId` and + * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] + * is `variant`, an INVALID_ARGUMENT error is returned. + * See [Product + * levels](https://cloud.google.com/retail/docs/catalog#product-levels) + * for more details. + * + * Generated from protobuf field string merchant_center_product_id_field = 2; + * @param string $var + * @return $this + */ + public function setMerchantCenterProductIdField($var) + { + GPBUtil::checkString($var, True); + $this->merchant_center_product_id_field = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php new file mode 100644 index 00000000000..dc46522a58e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php @@ -0,0 +1,91 @@ +google.cloud.retail.v2.Promotion + */ +class Promotion extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the promotion. For example, "free gift". + * The value must be a UTF-8 encoded string with a length limit of 128 + * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). + * + * Generated from protobuf field string promotion_id = 1; + */ + protected $promotion_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $promotion_id + * ID of the promotion. For example, "free gift". + * The value must be a UTF-8 encoded string with a length limit of 128 + * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Promotion::initOnce(); + parent::__construct($data); + } + + /** + * ID of the promotion. For example, "free gift". + * The value must be a UTF-8 encoded string with a length limit of 128 + * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). + * + * Generated from protobuf field string promotion_id = 1; + * @return string + */ + public function getPromotionId() + { + return $this->promotion_id; + } + + /** + * ID of the promotion. For example, "free gift". + * The value must be a UTF-8 encoded string with a length limit of 128 + * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + * returned. + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). + * + * Generated from protobuf field string promotion_id = 1; + * @param string $var + * @return $this + */ + public function setPromotionId($var) + { + GPBUtil::checkString($var, True); + $this->promotion_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php new file mode 100644 index 00000000000..d3671555baa --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php @@ -0,0 +1,235 @@ +google.cloud.retail.v2.PurchaseTransaction + */ +class PurchaseTransaction extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction ID with a length limit of 128 characters. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Required. Total non-zero 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. + * + * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $revenue = 0.0; + /** + * All the taxes associated with the transaction. + * + * Generated from protobuf field float tax = 3; + */ + protected $tax = 0.0; + /** + * All the costs associated with the products. These can be manufacturing + * costs, shipping expenses not borne by the end user, or any other costs, + * such that: + * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - + * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - + * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] + * + * Generated from protobuf field float cost = 4; + */ + protected $cost = 0.0; + /** + * Required. Currency code. Use three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $currency_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The transaction ID with a length limit of 128 characters. + * @type float $revenue + * Required. Total non-zero 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. + * @type float $tax + * All the taxes associated with the transaction. + * @type float $cost + * All the costs associated with the products. These can be manufacturing + * costs, shipping expenses not borne by the end user, or any other costs, + * such that: + * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - + * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - + * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] + * @type string $currency_code + * Required. Currency code. Use three-character ISO-4217 code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * The transaction ID with a length limit of 128 characters. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The transaction ID with a length limit of 128 characters. + * + * 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; + } + + /** + * Required. Total non-zero 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. + * + * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getRevenue() + { + return $this->revenue; + } + + /** + * Required. Total non-zero 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. + * + * 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; + } + + /** + * All the taxes associated with the transaction. + * + * Generated from protobuf field float tax = 3; + * @return float + */ + public function getTax() + { + return $this->tax; + } + + /** + * All the taxes associated with the transaction. + * + * Generated from protobuf field float tax = 3; + * @param float $var + * @return $this + */ + public function setTax($var) + { + GPBUtil::checkFloat($var); + $this->tax = $var; + + return $this; + } + + /** + * All the costs associated with the products. These can be manufacturing + * costs, shipping expenses not borne by the end user, or any other costs, + * such that: + * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - + * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - + * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] + * + * Generated from protobuf field float cost = 4; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * All the costs associated with the products. These can be manufacturing + * costs, shipping expenses not borne by the end user, or any other costs, + * such that: + * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - + * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - + * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] + * + * Generated from protobuf field float cost = 4; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkFloat($var); + $this->cost = $var; + + return $this; + } + + /** + * Required. Currency code. Use three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Required. Currency code. Use three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 5 [(.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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php new file mode 100644 index 00000000000..643f7812322 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php @@ -0,0 +1,34 @@ +google.cloud.retail.v2.PurgeMetadata + */ +class PurgeMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php new file mode 100644 index 00000000000..c2f32b10018 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php @@ -0,0 +1,194 @@ +google.cloud.retail.v2.PurgeProductsMetadata + */ +class PurgeProductsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + */ + protected $update_time = null; + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + */ + protected $success_count = 0; + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 4; + */ + protected $failure_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * @type \Google\Protobuf\Timestamp $update_time + * Operation last update time. If the operation is done, this is also the + * finish time. + * @type int|string $success_count + * Count of entries that were deleted successfully. + * @type int|string $failure_count + * Count of entries that encountered errors while processing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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 = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $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 = 2; + * @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 = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @return int|string + */ + public function getSuccessCount() + { + return $this->success_count; + } + + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @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 = 4; + * @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 = 4; + * @param int|string $var + * @return $this + */ + public function setFailureCount($var) + { + GPBUtil::checkInt64($var); + $this->failure_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php new file mode 100644 index 00000000000..40a07712926 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php @@ -0,0 +1,263 @@ +google.cloud.retail.v2.PurgeProductsRequest + */ +class PurgeProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * 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 products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * @type string $filter + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * @type bool $force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * 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 branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * 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 products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * 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 products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * 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; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php new file mode 100644 index 00000000000..d7d761c4980 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php @@ -0,0 +1,111 @@ +google.cloud.retail.v2.PurgeProductsResponse + */ +class PurgeProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + */ + protected $purge_count = 0; + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + */ + private $purge_sample; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $purge_count + * The total count of products purged as a result of the operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $purge_sample + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + * @return int|string + */ + public function getPurgeCount() + { + return $this->purge_count; + } + + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + * @param int|string $var + * @return $this + */ + public function setPurgeCount($var) + { + GPBUtil::checkInt64($var); + $this->purge_count = $var; + + return $this; + } + + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPurgeSample() + { + return $this->purge_sample; + } + + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPurgeSample($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->purge_sample = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php new file mode 100644 index 00000000000..64add727fa3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php @@ -0,0 +1,223 @@ +google.cloud.retail.v2.PurgeUserEventsRequest + */ +class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the catalog under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}` + * + * 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 with a + * length limit of 5,000 characters. Empty string filter is not allowed. The + * eligible fields for filtering are: + * * `eventType`: Double quoted + * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. + * * `eventTime`: in ISO 8601 "zulu" format. + * * `visitorId`: Double quoted string. Specifying this will delete all + * events associated with a visitor. + * * `userId`: Double quoted string. Specifying this will delete all events + * associated with a user. + * Examples: + * * Deleting all events in a time range: + * `eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z"` + * * Deleting specific eventType in time range: + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * * 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 = ''; + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any user events. + * + * Generated from protobuf field bool force = 3; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the catalog under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}` + * @type string $filter + * Required. The filter string to specify the events to be deleted with a + * length limit of 5,000 characters. Empty string filter is not allowed. The + * eligible fields for filtering are: + * * `eventType`: Double quoted + * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. + * * `eventTime`: in ISO 8601 "zulu" format. + * * `visitorId`: Double quoted string. Specifying this will delete all + * events associated with a visitor. + * * `userId`: Double quoted string. Specifying this will delete all events + * associated with a user. + * Examples: + * * Deleting all events in a time range: + * `eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z"` + * * Deleting specific eventType in time range: + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * * Deleting all events for a specific visitor: + * `visitorId = "visitor1024"` + * The filtering fields are assumed to have an implicit AND. + * @type bool $force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any user events. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the catalog under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}` + * + * 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 catalog under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}` + * + * 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 with a + * length limit of 5,000 characters. Empty string filter is not allowed. The + * eligible fields for filtering are: + * * `eventType`: Double quoted + * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. + * * `eventTime`: in ISO 8601 "zulu" format. + * * `visitorId`: Double quoted string. Specifying this will delete all + * events associated with a visitor. + * * `userId`: Double quoted string. Specifying this will delete all events + * associated with a user. + * Examples: + * * Deleting all events in a time range: + * `eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z"` + * * Deleting specific eventType in time range: + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * * 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 with a + * length limit of 5,000 characters. Empty string filter is not allowed. The + * eligible fields for filtering are: + * * `eventType`: Double quoted + * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. + * * `eventTime`: in ISO 8601 "zulu" format. + * * `visitorId`: Double quoted string. Specifying this will delete all + * events associated with a visitor. + * * `userId`: Double quoted string. Specifying this will delete all events + * associated with a user. + * Examples: + * * Deleting all events in a time range: + * `eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z"` + * * Deleting specific eventType in time range: + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * * 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; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any user events. + * + * Generated from protobuf field bool force = 3; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any user events. + * + * Generated from protobuf field bool force = 3; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php new file mode 100644 index 00000000000..4e26e6a1be9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php @@ -0,0 +1,69 @@ +google.cloud.retail.v2.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; + + /** + * 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::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; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php new file mode 100644 index 00000000000..4819a03e5ec --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php @@ -0,0 +1,175 @@ +google.cloud.retail.v2.Rating + */ +class Rating extends \Google\Protobuf\Internal\Message +{ + /** + * The total number of ratings. This value is independent of the value of + * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. + * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 rating_count = 1; + */ + protected $rating_count = 0; + /** + * The average rating of the [Product][google.cloud.retail.v2.Product]. + * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field float average_rating = 2; + */ + protected $average_rating = 0.0; + /** + * List of rating counts per rating value (index = rating - 1). The list is + * empty if there is no rating. If the list is non-empty, its size is + * always 5. Otherwise, an INVALID_ARGUMENT error is returned. + * For example, [41, 14, 13, 47, 303]. It means that the + * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 + * ratings with 2 star, and so on. + * + * Generated from protobuf field repeated int32 rating_histogram = 3; + */ + private $rating_histogram; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $rating_count + * The total number of ratings. This value is independent of the value of + * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. + * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * @type float $average_rating + * The average rating of the [Product][google.cloud.retail.v2.Product]. + * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + * returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $rating_histogram + * List of rating counts per rating value (index = rating - 1). The list is + * empty if there is no rating. If the list is non-empty, its size is + * always 5. Otherwise, an INVALID_ARGUMENT error is returned. + * For example, [41, 14, 13, 47, 303]. It means that the + * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 + * ratings with 2 star, and so on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The total number of ratings. This value is independent of the value of + * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. + * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 rating_count = 1; + * @return int + */ + public function getRatingCount() + { + return $this->rating_count; + } + + /** + * The total number of ratings. This value is independent of the value of + * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. + * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field int32 rating_count = 1; + * @param int $var + * @return $this + */ + public function setRatingCount($var) + { + GPBUtil::checkInt32($var); + $this->rating_count = $var; + + return $this; + } + + /** + * The average rating of the [Product][google.cloud.retail.v2.Product]. + * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field float average_rating = 2; + * @return float + */ + public function getAverageRating() + { + return $this->average_rating; + } + + /** + * The average rating of the [Product][google.cloud.retail.v2.Product]. + * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + * returned. + * + * Generated from protobuf field float average_rating = 2; + * @param float $var + * @return $this + */ + public function setAverageRating($var) + { + GPBUtil::checkFloat($var); + $this->average_rating = $var; + + return $this; + } + + /** + * List of rating counts per rating value (index = rating - 1). The list is + * empty if there is no rating. If the list is non-empty, its size is + * always 5. Otherwise, an INVALID_ARGUMENT error is returned. + * For example, [41, 14, 13, 47, 303]. It means that the + * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 + * ratings with 2 star, and so on. + * + * Generated from protobuf field repeated int32 rating_histogram = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRatingHistogram() + { + return $this->rating_histogram; + } + + /** + * List of rating counts per rating value (index = rating - 1). The list is + * empty if there is no rating. If the list is non-empty, its size is + * always 5. Otherwise, an INVALID_ARGUMENT error is returned. + * For example, [41, 14, 13, 47, 303]. It means that the + * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 + * ratings with 2 star, and so on. + * + * Generated from protobuf field repeated int32 rating_histogram = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRatingHistogram($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->rating_histogram = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php new file mode 100644 index 00000000000..980a1dd6324 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php @@ -0,0 +1,63 @@ +google.cloud.retail.v2.RecommendationsFilteringOption + */ +class RecommendationsFilteringOption +{ + /** + * Value used when unset. + * In this case, server behavior defaults to + * [RECOMMENDATIONS_FILTERING_DISABLED][google.cloud.retail.v2.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED]. + * + * Generated from protobuf enum RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0; + */ + const RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0; + /** + * Recommendation filtering is disabled. + * + * Generated from protobuf enum RECOMMENDATIONS_FILTERING_DISABLED = 1; + */ + const RECOMMENDATIONS_FILTERING_DISABLED = 1; + /** + * Recommendation filtering is enabled. + * + * Generated from protobuf enum RECOMMENDATIONS_FILTERING_ENABLED = 3; + */ + const RECOMMENDATIONS_FILTERING_ENABLED = 3; + + private static $valueToName = [ + self::RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED => 'RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED', + self::RECOMMENDATIONS_FILTERING_DISABLED => 'RECOMMENDATIONS_FILTERING_DISABLED', + self::RECOMMENDATIONS_FILTERING_ENABLED => 'RECOMMENDATIONS_FILTERING_ENABLED', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php new file mode 100644 index 00000000000..b5215c1b658 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php @@ -0,0 +1,33 @@ +google.cloud.retail.v2.RejoinUserEventsMetadata + */ +class RejoinUserEventsMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php new file mode 100644 index 00000000000..fd983b92ea2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php @@ -0,0 +1,117 @@ +google.cloud.retail.v2.RejoinUserEventsRequest + */ +class RejoinUserEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The type of the user event rejoin to define the scope and range of the user + * events to be rejoined with the latest product catalog. Defaults to + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. + * + * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + */ + protected $user_event_rejoin_scope = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * @type int $user_event_rejoin_scope + * The type of the user event rejoin to define the scope and range of the user + * events to be rejoined with the latest product catalog. Defaults to + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The type of the user event rejoin to define the scope and range of the user + * events to be rejoined with the latest product catalog. Defaults to + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. + * + * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * @return int + */ + public function getUserEventRejoinScope() + { + return $this->user_event_rejoin_scope; + } + + /** + * The type of the user event rejoin to define the scope and range of the user + * events to be rejoined with the latest product catalog. Defaults to + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. + * + * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * @param int $var + * @return $this + */ + public function setUserEventRejoinScope($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\RejoinUserEventsRequest\UserEventRejoinScope::class); + $this->user_event_rejoin_scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php new file mode 100644 index 00000000000..395f58b437e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php @@ -0,0 +1,71 @@ +google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope + */ +class UserEventRejoinScope +{ + /** + * Rejoin all events with the latest product catalog, including both joined + * events and unjoined events. + * + * Generated from protobuf enum USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + */ + const USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + /** + * Only rejoin joined events with the latest product catalog. + * + * Generated from protobuf enum JOINED_EVENTS = 1; + */ + const JOINED_EVENTS = 1; + /** + * Only rejoin unjoined events with the latest product catalog. + * + * Generated from protobuf enum UNJOINED_EVENTS = 2; + */ + const UNJOINED_EVENTS = 2; + + private static $valueToName = [ + self::USER_EVENT_REJOIN_SCOPE_UNSPECIFIED => 'USER_EVENT_REJOIN_SCOPE_UNSPECIFIED', + self::JOINED_EVENTS => 'JOINED_EVENTS', + self::UNJOINED_EVENTS => 'UNJOINED_EVENTS', + ]; + + 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(UserEventRejoinScope::class, \Google\Cloud\Retail\V2\RejoinUserEventsRequest_UserEventRejoinScope::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php new file mode 100644 index 00000000000..f3922ffe771 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.RejoinUserEventsResponse + */ +class RejoinUserEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Number of user events that were joined with latest product catalog. + * + * Generated from protobuf field int64 rejoined_user_events_count = 1; + */ + protected $rejoined_user_events_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $rejoined_user_events_count + * Number of user events that were joined with latest product catalog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Number of user events that were joined with latest product catalog. + * + * Generated from protobuf field int64 rejoined_user_events_count = 1; + * @return int|string + */ + public function getRejoinedUserEventsCount() + { + return $this->rejoined_user_events_count; + } + + /** + * Number of user events that were joined with latest product catalog. + * + * Generated from protobuf field int64 rejoined_user_events_count = 1; + * @param int|string $var + * @return $this + */ + public function setRejoinedUserEventsCount($var) + { + GPBUtil::checkInt64($var); + $this->rejoined_user_events_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php new file mode 100644 index 00000000000..0ecb718cdfe --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php @@ -0,0 +1,111 @@ +google.cloud.retail.v2.RemoveCatalogAttributeRequest + */ +class RemoveCatalogAttributeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $attributes_config = ''; + /** + * Required. The attribute name key of the + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attributes_config + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * @type string $key + * Required. The attribute name key of the + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAttributesConfig() + { + return $this->attributes_config; + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAttributesConfig($var) + { + GPBUtil::checkString($var, True); + $this->attributes_config = $var; + + return $this; + } + + /** + * Required. The attribute name key of the + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. The attribute name key of the + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php new file mode 100644 index 00000000000..0a68f06ee4e --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php @@ -0,0 +1,124 @@ +google.cloud.retail.v2.RemoveControlRequest + */ +class RemoveControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $serving_config = ''; + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control_id = ''; + + /** + * @param string $servingConfig Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\RemoveControlRequest + * + * @experimental + */ + public static function build(string $servingConfig): self + { + return (new self()) + ->setServingConfig($servingConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serving_config + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * @type string $control_id + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServingConfig() + { + return $this->serving_config; + } + + /** + * Required. The source ServingConfig resource name . Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->serving_config = $var; + + return $this; + } + + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getControlId() + { + return $this->control_id; + } + + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + * + * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setControlId($var) + { + GPBUtil::checkString($var, True); + $this->control_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php new file mode 100644 index 00000000000..11b8e831145 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + */ +class RemoveFulfillmentPlacesMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php new file mode 100644 index 00000000000..250f884eae9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php @@ -0,0 +1,375 @@ +google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + */ +class RemoveFulfillmentPlacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $product = ''; + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = ''; + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery", to be removed for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $place_ids; + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; + */ + protected $remove_time = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + */ + protected $allow_missing = false; + + /** + * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\RemoveFulfillmentPlacesRequest + * + * @experimental + */ + public static function build(string $product): self + { + return (new self()) + ->setProduct($product); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $product + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @type string $type + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids + * Required. The IDs for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery", to be removed for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * @type \Google\Protobuf\Timestamp $remove_time + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProduct() + { + return $this->product; + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkString($var, True); + $this->product = $var; + + return $this; + } + + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The fulfillment type, including commonly used types (such as + * pickup in store and same day delivery), and custom types. + * Supported values: + * * "pickup-in-store" + * * "ship-to-store" + * * "same-day-delivery" + * * "next-day-delivery" + * * "custom-type-1" + * * "custom-type-2" + * * "custom-type-3" + * * "custom-type-4" + * * "custom-type-5" + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * This field directly corresponds to + * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery", to be removed for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPlaceIds() + { + return $this->place_ids; + } + + /** + * Required. The IDs for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as + * the store IDs for "pickup-in-store" or the region IDs for + * "same-day-delivery", to be removed for this + * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. + * At least 1 value is required, and a maximum of 2000 values are allowed. + * Each value must be a string with a length limit of 10 characters, matching + * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPlaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->place_ids = $arr; + + return $this; + } + + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemoveTime() + { + return $this->remove_time; + } + + public function hasRemoveTime() + { + return isset($this->remove_time); + } + + public function clearRemoveTime() + { + unset($this->remove_time); + } + + /** + * The time when the fulfillment updates are issued, used to prevent + * out-of-order updates on fulfillment information. If not provided, the + * internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemoveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remove_time = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the fulfillment information will still be processed and retained for + * at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 5; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php new file mode 100644 index 00000000000..2b5bb6e073c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + */ +class RemoveFulfillmentPlacesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php new file mode 100644 index 00000000000..4af167b6dea --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.RemoveLocalInventoriesMetadata + */ +class RemoveLocalInventoriesMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php new file mode 100644 index 00000000000..b8620880c08 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php @@ -0,0 +1,253 @@ +google.cloud.retail.v2.RemoveLocalInventoriesRequest + */ +class RemoveLocalInventoriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $product = ''; + /** + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * + * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $place_ids; + /** + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; + */ + protected $remove_time = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + + /** + * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. Please see + * {@see ProductServiceClient::productName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\RemoveLocalInventoriesRequest + * + * @experimental + */ + public static function build(string $product): self + { + return (new self()) + ->setProduct($product); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $product + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * @type \Google\Protobuf\Timestamp $remove_time + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProduct() + { + return $this->product; + } + + /** + * Required. Full resource name of [Product][google.cloud.retail.v2.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkString($var, True); + $this->product = $var; + + return $this; + } + + /** + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * + * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPlaceIds() + { + return $this->place_ids; + } + + /** + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * + * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPlaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->place_ids = $arr; + + return $this; + } + + /** + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemoveTime() + { + return $this->remove_time; + } + + public function hasRemoveTime() + { + return isset($this->remove_time); + } + + public function clearRemoveTime() + { + unset($this->remove_time); + } + + /** + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemoveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remove_time = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * [Product][google.cloud.retail.v2.Product] is created. If set to false, a + * NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php new file mode 100644 index 00000000000..6d1aaa395e9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php @@ -0,0 +1,38 @@ +google.cloud.retail.v2.RemoveLocalInventoriesResponse + */ +class RemoveLocalInventoriesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php new file mode 100644 index 00000000000..d550c9f47f3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php @@ -0,0 +1,181 @@ +google.cloud.retail.v2.ReplaceCatalogAttributeRequest + */ +class ReplaceCatalogAttributeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $attributes_config = ''; + /** + * Required. The updated + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog_attribute = null; + /** + * Indicates which fields in the provided + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The + * following are NOT supported: + * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] + * If not set, all supported fields are updated. + * + * 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 $attributes_config + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * @type \Google\Cloud\Retail\V2\CatalogAttribute $catalog_attribute + * Required. The updated + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The + * following are NOT supported: + * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] + * If not set, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAttributesConfig() + { + return $this->attributes_config; + } + + /** + * Required. Full AttributesConfig resource name. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * + * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAttributesConfig($var) + { + GPBUtil::checkString($var, True); + $this->attributes_config = $var; + + return $this; + } + + /** + * Required. The updated + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\CatalogAttribute|null + */ + public function getCatalogAttribute() + { + return $this->catalog_attribute; + } + + public function hasCatalogAttribute() + { + return isset($this->catalog_attribute); + } + + public function clearCatalogAttribute() + { + unset($this->catalog_attribute); + } + + /** + * Required. The updated + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\CatalogAttribute $var + * @return $this + */ + public function setCatalogAttribute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute::class); + $this->catalog_attribute = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The + * following are NOT supported: + * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] + * If not set, all supported fields are updated. + * + * 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); + } + + /** + * Indicates which fields in the provided + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The + * following are NOT supported: + * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] + * If not set, all supported fields are updated. + * + * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php new file mode 100644 index 00000000000..2636dc2775a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php @@ -0,0 +1,90 @@ +google.cloud.retail.v2.ResumeModelRequest + */ +class ResumeModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the model to resume. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the model to resume. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * @return \Google\Cloud\Retail\V2\ResumeModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the model to resume. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the model to resume. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the model to resume. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php new file mode 100644 index 00000000000..b5cc2af929b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php @@ -0,0 +1,427 @@ +google.cloud.retail.v2.Rule + */ +class Rule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The condition that triggers the rule. + * If the condition is empty, the rule will always apply. + * + * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $condition = null; + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Rule\BoostAction $boost_action + * A boost action. + * @type \Google\Cloud\Retail\V2\Rule\RedirectAction $redirect_action + * Redirects a shopper to a specific page. + * @type \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction $oneway_synonyms_action + * Treats specific term as a synonym with a group of terms. + * Group of terms will not be treated as synonyms with the specific term. + * @type \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction $do_not_associate_action + * Prevents term from being associated with other terms. + * @type \Google\Cloud\Retail\V2\Rule\ReplacementAction $replacement_action + * Replaces specific terms in the query. + * @type \Google\Cloud\Retail\V2\Rule\IgnoreAction $ignore_action + * Ignores specific terms from query during search. + * @type \Google\Cloud\Retail\V2\Rule\FilterAction $filter_action + * Filters results. + * @type \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction $twoway_synonyms_action + * Treats a set of terms as synonyms of one another. + * @type \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $force_return_facet_action + * Force returns an attribute as a facet in the request. + * @type \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $remove_facet_action + * Remove an attribute as a facet in the request (if present). + * @type \Google\Cloud\Retail\V2\Condition $condition + * Required. The condition that triggers the rule. + * If the condition is empty, the rule will always apply. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * A boost action. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2; + * @return \Google\Cloud\Retail\V2\Rule\BoostAction|null + */ + public function getBoostAction() + { + return $this->readOneof(2); + } + + public function hasBoostAction() + { + return $this->hasOneof(2); + } + + /** + * A boost action. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2; + * @param \Google\Cloud\Retail\V2\Rule\BoostAction $var + * @return $this + */ + public function setBoostAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\BoostAction::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Redirects a shopper to a specific page. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3; + * @return \Google\Cloud\Retail\V2\Rule\RedirectAction|null + */ + public function getRedirectAction() + { + return $this->readOneof(3); + } + + public function hasRedirectAction() + { + return $this->hasOneof(3); + } + + /** + * Redirects a shopper to a specific page. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3; + * @param \Google\Cloud\Retail\V2\Rule\RedirectAction $var + * @return $this + */ + public function setRedirectAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\RedirectAction::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Treats specific term as a synonym with a group of terms. + * Group of terms will not be treated as synonyms with the specific term. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * @return \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction|null + */ + public function getOnewaySynonymsAction() + { + return $this->readOneof(6); + } + + public function hasOnewaySynonymsAction() + { + return $this->hasOneof(6); + } + + /** + * Treats specific term as a synonym with a group of terms. + * Group of terms will not be treated as synonyms with the specific term. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * @param \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction $var + * @return $this + */ + public function setOnewaySynonymsAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Prevents term from being associated with other terms. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7; + * @return \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction|null + */ + public function getDoNotAssociateAction() + { + return $this->readOneof(7); + } + + public function hasDoNotAssociateAction() + { + return $this->hasOneof(7); + } + + /** + * Prevents term from being associated with other terms. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7; + * @param \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction $var + * @return $this + */ + public function setDoNotAssociateAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Replaces specific terms in the query. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8; + * @return \Google\Cloud\Retail\V2\Rule\ReplacementAction|null + */ + public function getReplacementAction() + { + return $this->readOneof(8); + } + + public function hasReplacementAction() + { + return $this->hasOneof(8); + } + + /** + * Replaces specific terms in the query. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8; + * @param \Google\Cloud\Retail\V2\Rule\ReplacementAction $var + * @return $this + */ + public function setReplacementAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\ReplacementAction::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Ignores specific terms from query during search. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9; + * @return \Google\Cloud\Retail\V2\Rule\IgnoreAction|null + */ + public function getIgnoreAction() + { + return $this->readOneof(9); + } + + public function hasIgnoreAction() + { + return $this->hasOneof(9); + } + + /** + * Ignores specific terms from query during search. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9; + * @param \Google\Cloud\Retail\V2\Rule\IgnoreAction $var + * @return $this + */ + public function setIgnoreAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\IgnoreAction::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Filters results. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10; + * @return \Google\Cloud\Retail\V2\Rule\FilterAction|null + */ + public function getFilterAction() + { + return $this->readOneof(10); + } + + public function hasFilterAction() + { + return $this->hasOneof(10); + } + + /** + * Filters results. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10; + * @param \Google\Cloud\Retail\V2\Rule\FilterAction $var + * @return $this + */ + public function setFilterAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\FilterAction::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Treats a set of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * @return \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction|null + */ + public function getTwowaySynonymsAction() + { + return $this->readOneof(11); + } + + public function hasTwowaySynonymsAction() + { + return $this->hasOneof(11); + } + + /** + * Treats a set of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * @param \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction $var + * @return $this + */ + public function setTwowaySynonymsAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Force returns an attribute as a facet in the request. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; + * @return \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction|null + */ + public function getForceReturnFacetAction() + { + return $this->readOneof(12); + } + + public function hasForceReturnFacetAction() + { + return $this->hasOneof(12); + } + + /** + * Force returns an attribute as a facet in the request. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; + * @param \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $var + * @return $this + */ + public function setForceReturnFacetAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Remove an attribute as a facet in the request (if present). + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; + * @return \Google\Cloud\Retail\V2\Rule\RemoveFacetAction|null + */ + public function getRemoveFacetAction() + { + return $this->readOneof(13); + } + + public function hasRemoveFacetAction() + { + return $this->hasOneof(13); + } + + /** + * Remove an attribute as a facet in the request (if present). + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; + * @param \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $var + * @return $this + */ + public function setRemoveFacetAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\RemoveFacetAction::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Required. The condition that triggers the rule. + * If the condition is empty, the rule will always apply. + * + * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Condition|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Required. The condition that triggers the rule. + * If the condition is empty, the rule will always apply. + * + * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Condition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Condition::class); + $this->condition = $var; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php new file mode 100644 index 00000000000..d94136c84c9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php @@ -0,0 +1,200 @@ +google.cloud.retail.v2.Rule.BoostAction + */ +class BoostAction extends \Google\Protobuf\Internal\Message +{ + /** + * Strength of the condition boost, which must be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 1; + */ + protected $boost = 0.0; + /** + * The filter can have a max size of 5000 characters. + * An expression which specifies which products to apply an action to. + * The syntax and supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string products_filter = 2; + */ + protected $products_filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $boost + * Strength of the condition boost, which must be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * @type string $products_filter + * The filter can have a max size of 5000 characters. + * An expression which specifies which products to apply an action to. + * The syntax and supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Strength of the condition boost, which must be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 1; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Strength of the condition boost, which must be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 1; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + + /** + * The filter can have a max size of 5000 characters. + * An expression which specifies which products to apply an action to. + * The syntax and supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string products_filter = 2; + * @return string + */ + public function getProductsFilter() + { + return $this->products_filter; + } + + /** + * The filter can have a max size of 5000 characters. + * An expression which specifies which products to apply an action to. + * The syntax and supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string products_filter = 2; + * @param string $var + * @return $this + */ + public function setProductsFilter($var) + { + GPBUtil::checkString($var, True); + $this->products_filter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BoostAction::class, \Google\Cloud\Retail\V2\Rule_BoostAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php new file mode 100644 index 00000000000..875b17a8bb1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php @@ -0,0 +1,152 @@ +google.cloud.retail.v2.Rule.DoNotAssociateAction + */ +class DoNotAssociateAction extends \Google\Protobuf\Internal\Message +{ + /** + * Terms from the search query. + * Will not consider do_not_associate_terms for search if in search query. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + */ + private $query_terms; + /** + * Cannot contain duplicates or the query term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string do_not_associate_terms = 3; + */ + private $do_not_associate_terms; + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string terms = 1; + */ + private $terms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms + * Terms from the search query. + * Will not consider do_not_associate_terms for search if in search query. + * Can specify up to 100 terms. + * @type array|\Google\Protobuf\Internal\RepeatedField $do_not_associate_terms + * Cannot contain duplicates or the query term. + * Can specify up to 100 terms. + * @type array|\Google\Protobuf\Internal\RepeatedField $terms + * Will be [deprecated = true] post migration; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Terms from the search query. + * Will not consider do_not_associate_terms for search if in search query. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * Terms from the search query. + * Will not consider do_not_associate_terms for search if in search query. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_terms = $arr; + + return $this; + } + + /** + * Cannot contain duplicates or the query term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string do_not_associate_terms = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDoNotAssociateTerms() + { + return $this->do_not_associate_terms; + } + + /** + * Cannot contain duplicates or the query term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string do_not_associate_terms = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDoNotAssociateTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->do_not_associate_terms = $arr; + + return $this; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string terms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTerms() + { + return $this->terms; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string terms = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->terms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DoNotAssociateAction::class, \Google\Cloud\Retail\V2\Rule_DoNotAssociateAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php new file mode 100644 index 00000000000..2900427a372 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php @@ -0,0 +1,127 @@ +google.cloud.retail.v2.Rule.FilterAction + */ +class FilterAction extends \Google\Protobuf\Internal\Message +{ + /** + * A filter to apply on the matching condition results. Supported features: + * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. + * * Filter syntax is identical to + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For + * more + * information, see [Filter](/retail/docs/filter-and-order#filter). + * * To filter products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string filter = 1; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * A filter to apply on the matching condition results. Supported features: + * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. + * * Filter syntax is identical to + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For + * more + * information, see [Filter](/retail/docs/filter-and-order#filter). + * * To filter products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * A filter to apply on the matching condition results. Supported features: + * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. + * * Filter syntax is identical to + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For + * more + * information, see [Filter](/retail/docs/filter-and-order#filter). + * * To filter products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string filter = 1; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter to apply on the matching condition results. Supported features: + * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. + * * Filter syntax is identical to + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For + * more + * information, see [Filter](/retail/docs/filter-and-order#filter). + * * To filter products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue":
+ * *(id: ANY("product_1", "product_2"))
* + * *AND
* + * *(colorFamilies: ANY("Red", "Blue"))
* + * + * Generated from protobuf field string filter = 1; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FilterAction::class, \Google\Cloud\Retail\V2\Rule_FilterAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php new file mode 100644 index 00000000000..9582a3a8633 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php @@ -0,0 +1,95 @@ +google.cloud.retail.v2.Rule.ForceReturnFacetAction + */ +class ForceReturnFacetAction extends \Google\Protobuf\Internal\Message +{ + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 15 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + */ + private $facet_position_adjustments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $facet_position_adjustments + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 15 instances here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 15 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetPositionAdjustments() + { + return $this->facet_position_adjustments; + } + + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 15 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + * @param array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetPositionAdjustments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment::class); + $this->facet_position_adjustments = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ForceReturnFacetAction::class, \Google\Cloud\Retail\V2\Rule_ForceReturnFacetAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php new file mode 100644 index 00000000000..1c867f55610 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php @@ -0,0 +1,117 @@ +google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + */ +class FacetPositionAdjustment extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + */ + protected $attribute_name = ''; + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + */ + protected $position = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute_name + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * @type int $position + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + * @return string + */ + public function getAttributeName() + { + return $this->attribute_name; + } + + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + * @param string $var + * @return $this + */ + public function setAttributeName($var) + { + GPBUtil::checkString($var, True); + $this->attribute_name = $var; + + return $this; + } + + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + * @return int + */ + public function getPosition() + { + return $this->position; + } + + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + * @param int $var + * @return $this + */ + public function setPosition($var) + { + GPBUtil::checkInt32($var); + $this->position = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FacetPositionAdjustment::class, \Google\Cloud\Retail\V2\Rule_ForceReturnFacetAction_FacetPositionAdjustment::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php new file mode 100644 index 00000000000..4c478207402 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php @@ -0,0 +1,71 @@ +google.cloud.retail.v2.Rule.IgnoreAction + */ +class IgnoreAction extends \Google\Protobuf\Internal\Message +{ + /** + * Terms to ignore in the search query. + * + * Generated from protobuf field repeated string ignore_terms = 1; + */ + private $ignore_terms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_terms + * Terms to ignore in the search query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Terms to ignore in the search query. + * + * Generated from protobuf field repeated string ignore_terms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoreTerms() + { + return $this->ignore_terms; + } + + /** + * Terms to ignore in the search query. + * + * Generated from protobuf field repeated string ignore_terms = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoreTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ignore_terms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IgnoreAction::class, \Google\Cloud\Retail\V2\Rule_IgnoreAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php new file mode 100644 index 00000000000..551f236d7e5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php @@ -0,0 +1,162 @@ +google.cloud.retail.v2.Rule.OnewaySynonymsAction + */ +class OnewaySynonymsAction extends \Google\Protobuf\Internal\Message +{ + /** + * Terms from the search query. + * Will treat synonyms as their synonyms. + * Not themselves synonyms of the synonyms. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 3; + */ + private $query_terms; + /** + * Defines a set of synonyms. + * Cannot contain duplicates. + * Can specify up to 100 synonyms. + * + * Generated from protobuf field repeated string synonyms = 4; + */ + private $synonyms; + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string oneway_terms = 2; + */ + private $oneway_terms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms + * Terms from the search query. + * Will treat synonyms as their synonyms. + * Not themselves synonyms of the synonyms. + * Can specify up to 100 terms. + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Defines a set of synonyms. + * Cannot contain duplicates. + * Can specify up to 100 synonyms. + * @type array|\Google\Protobuf\Internal\RepeatedField $oneway_terms + * Will be [deprecated = true] post migration; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Terms from the search query. + * Will treat synonyms as their synonyms. + * Not themselves synonyms of the synonyms. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * Terms from the search query. + * Will treat synonyms as their synonyms. + * Not themselves synonyms of the synonyms. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_terms = $arr; + + return $this; + } + + /** + * Defines a set of synonyms. + * Cannot contain duplicates. + * Can specify up to 100 synonyms. + * + * Generated from protobuf field repeated string synonyms = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Defines a set of synonyms. + * Cannot contain duplicates. + * Can specify up to 100 synonyms. + * + * Generated from protobuf field repeated string synonyms = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string oneway_terms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOnewayTerms() + { + return $this->oneway_terms; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field repeated string oneway_terms = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOnewayTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->oneway_terms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OnewaySynonymsAction::class, \Google\Cloud\Retail\V2\Rule_OnewaySynonymsAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php new file mode 100644 index 00000000000..96e2d381638 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.Rule.RedirectAction + */ +class RedirectAction extends \Google\Protobuf\Internal\Message +{ + /** + * URL must have length equal or less than 2000 characters. + * + * Generated from protobuf field string redirect_uri = 1; + */ + protected $redirect_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $redirect_uri + * URL must have length equal or less than 2000 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * URL must have length equal or less than 2000 characters. + * + * Generated from protobuf field string redirect_uri = 1; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * URL must have length equal or less than 2000 characters. + * + * Generated from protobuf field string redirect_uri = 1; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RedirectAction::class, \Google\Cloud\Retail\V2\Rule_RedirectAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php new file mode 100644 index 00000000000..e92ba5dc554 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php @@ -0,0 +1,95 @@ +google.cloud.retail.v2.Rule.RemoveFacetAction + */ +class RemoveFacetAction extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + */ + private $attribute_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $attribute_names + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributeNames() + { + return $this->attribute_names; + } + + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->attribute_names = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RemoveFacetAction::class, \Google\Cloud\Retail\V2\Rule_RemoveFacetAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php new file mode 100644 index 00000000000..cbbeca753a3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php @@ -0,0 +1,148 @@ +google.cloud.retail.v2.Rule.ReplacementAction + */ +class ReplacementAction extends \Google\Protobuf\Internal\Message +{ + /** + * Terms from the search query. + * Will be replaced by replacement term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + */ + private $query_terms; + /** + * Term that will be used for replacement. + * + * Generated from protobuf field string replacement_term = 3; + */ + protected $replacement_term = ''; + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field string term = 1; + */ + protected $term = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms + * Terms from the search query. + * Will be replaced by replacement term. + * Can specify up to 100 terms. + * @type string $replacement_term + * Term that will be used for replacement. + * @type string $term + * Will be [deprecated = true] post migration; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Terms from the search query. + * Will be replaced by replacement term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * Terms from the search query. + * Will be replaced by replacement term. + * Can specify up to 100 terms. + * + * Generated from protobuf field repeated string query_terms = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_terms = $arr; + + return $this; + } + + /** + * Term that will be used for replacement. + * + * Generated from protobuf field string replacement_term = 3; + * @return string + */ + public function getReplacementTerm() + { + return $this->replacement_term; + } + + /** + * Term that will be used for replacement. + * + * Generated from protobuf field string replacement_term = 3; + * @param string $var + * @return $this + */ + public function setReplacementTerm($var) + { + GPBUtil::checkString($var, True); + $this->replacement_term = $var; + + return $this; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field string term = 1; + * @return string + */ + public function getTerm() + { + return $this->term; + } + + /** + * Will be [deprecated = true] post migration; + * + * Generated from protobuf field string term = 1; + * @param string $var + * @return $this + */ + public function setTerm($var) + { + GPBUtil::checkString($var, True); + $this->term = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReplacementAction::class, \Google\Cloud\Retail\V2\Rule_ReplacementAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php new file mode 100644 index 00000000000..6d6f51438ae --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php @@ -0,0 +1,81 @@ +google.cloud.retail.v2.Rule.TwowaySynonymsAction + */ +class TwowaySynonymsAction extends \Google\Protobuf\Internal\Message +{ + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. + * + * Generated from protobuf field repeated string synonyms = 1; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. + * + * Generated from protobuf field repeated string synonyms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. + * + * Generated from protobuf field repeated string synonyms = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TwowaySynonymsAction::class, \Google\Cloud\Retail\V2\Rule_TwowaySynonymsAction::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php new file mode 100644 index 00000000000..b948fc40243 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php @@ -0,0 +1,1625 @@ +google.cloud.retail.v2.SearchRequest + */ +class SearchRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Retail Search serving config, such as + * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + * or the name of the legacy placement resource, such as + * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + * This field is used to identify the serving config name and the set + * of models that are used to make the search. + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $placement = ''; + /** + * The branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. + * Use "default_branch" as the branch ID or leave this field empty, to search + * products under the default branch. + * + * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { + */ + protected $branch = ''; + /** + * Raw search query. + * If this field is empty, the request is considered a category browsing + * request and returned results are based on + * [filter][google.cloud.retail.v2.SearchRequest.filter] and + * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. + * + * Generated from protobuf field string query = 3; + */ + protected $query = ''; + /** + * Required. A unique identifier for tracking visitors. For example, this + * could be implemented with an HTTP cookie, which should be able to uniquely + * identify a visitor on a single device. This unique identifier should not + * change if the visitor logs in or out of the website. + * This should be the same identifier as + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $visitor_id = ''; + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; + */ + protected $user_info = null; + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to a reasonable value. The maximum allowed value is + * 120. Values above 120 will be coerced to 120. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 7; + */ + protected $page_size = 0; + /** + * A page token + * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], + * received from a previous + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must + * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + * error is returned. + * + * Generated from protobuf field string page_token = 8; + */ + protected $page_token = ''; + /** + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the [Product][google.cloud.retail.v2.Product]s + * deemed by the API as relevant) in search results. This field is only + * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] + * is unset. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 offset = 9; + */ + protected $offset = 0; + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. Filter + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string filter = 10; + */ + protected $filter = ''; + /** + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * The filter applied to every search request when quality improvement such as + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field string canonical_filter = 28; + */ + protected $canonical_filter = ''; + /** + * The order in which products are returned. Products can be ordered by + * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string order_by = 11; + */ + protected $order_by = ''; + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + private $facet_specs; + /** + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * @deprecated + */ + protected $dynamic_facet_spec = null; + /** + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + protected $boost_spec = null; + /** + * The query expansion specification that specifies the conditions under which + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + */ + protected $query_expansion_spec = null; + /** + * The keys to fetch and rollup the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s attributes, + * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The + * attributes from all the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a + * fulfillment type and a fulfillment ID must be provided in the format of + * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + * "pickupInStore" is fulfillment type and "store123" is the store ID. + * Supported keys are: + * * colorFamilies + * * price + * * originalPrice + * * discount + * * variantId + * * inventory(place_id,price) + * * inventory(place_id,original_price) + * * inventory(place_id,attributes.key), where key is any key in the + * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] + * map. + * * attributes.key, where key is any key in the + * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. + * * pickupInStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "pickup-in-store". + * * shipToStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "ship-to-store". + * * sameDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "same-day-delivery". + * * nextDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "next-day-delivery". + * * customFulfillment1.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-1". + * * customFulfillment2.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-2". + * * customFulfillment3.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-3". + * * customFulfillment4.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-4". + * * customFulfillment5.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-5". + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string variant_rollup_keys = 17; + */ + private $variant_rollup_keys; + /** + * The categories associated with a category page. Must be set for category + * navigation queries to achieve good search quality. The format should be + * the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated string page_categories = 23; + */ + private $page_categories; + /** + * The search mode of the search request. If not specified, a single search + * request triggers both product search and faceted search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; + */ + protected $search_mode = 0; + /** + * The specification for personalization. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; + */ + protected $personalization_spec = null; + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. + * + * Generated from protobuf field map labels = 34; + */ + private $labels; + /** + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * + * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; + */ + protected $spell_correction_spec = null; + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it should be exactly matched with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search + * results boosted by entity. + * + * Generated from protobuf field string entity = 38; + */ + protected $entity = ''; + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversational_search_spec = null; + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tile_navigation_spec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $placement + * Required. The resource name of the Retail Search serving config, such as + * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + * or the name of the legacy placement resource, such as + * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + * This field is used to identify the serving config name and the set + * of models that are used to make the search. + * @type string $branch + * The branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. + * Use "default_branch" as the branch ID or leave this field empty, to search + * products under the default branch. + * @type string $query + * Raw search query. + * If this field is empty, the request is considered a category browsing + * request and returned results are based on + * [filter][google.cloud.retail.v2.SearchRequest.filter] and + * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. + * @type string $visitor_id + * Required. A unique identifier for tracking visitors. For example, this + * could be implemented with an HTTP cookie, which should be able to uniquely + * identify a visitor on a single device. This unique identifier should not + * change if the visitor logs in or out of the website. + * This should be the same identifier as + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type \Google\Cloud\Retail\V2\UserInfo $user_info + * User information. + * @type int $page_size + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to a reasonable value. The maximum allowed value is + * 120. Values above 120 will be coerced to 120. + * If this field is negative, an INVALID_ARGUMENT is returned. + * @type string $page_token + * A page token + * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], + * received from a previous + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must + * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + * error is returned. + * @type int $offset + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the [Product][google.cloud.retail.v2.Product]s + * deemed by the API as relevant) in search results. This field is only + * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] + * is unset. + * If this field is negative, an INVALID_ARGUMENT is returned. + * @type string $filter + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. Filter + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * @type string $canonical_filter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * The filter applied to every search request when quality improvement such as + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * @type string $order_by + * The order in which products are returned. Products can be ordered by + * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * @type array<\Google\Cloud\Retail\V2\SearchRequest\FacetSpec>|\Google\Protobuf\Internal\RepeatedField $facet_specs + * Facet specifications for faceted search. If empty, no facets are returned. + * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * @type \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $dynamic_facet_spec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * @type \Google\Cloud\Retail\V2\SearchRequest\BoostSpec $boost_spec + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * @type \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $query_expansion_spec + * The query expansion specification that specifies the conditions under which + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + * @type array|\Google\Protobuf\Internal\RepeatedField $variant_rollup_keys + * The keys to fetch and rollup the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s attributes, + * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The + * attributes from all the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a + * fulfillment type and a fulfillment ID must be provided in the format of + * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + * "pickupInStore" is fulfillment type and "store123" is the store ID. + * Supported keys are: + * * colorFamilies + * * price + * * originalPrice + * * discount + * * variantId + * * inventory(place_id,price) + * * inventory(place_id,original_price) + * * inventory(place_id,attributes.key), where key is any key in the + * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] + * map. + * * attributes.key, where key is any key in the + * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. + * * pickupInStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "pickup-in-store". + * * shipToStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "ship-to-store". + * * sameDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "same-day-delivery". + * * nextDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "next-day-delivery". + * * customFulfillment1.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-1". + * * customFulfillment2.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-2". + * * customFulfillment3.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-3". + * * customFulfillment4.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-4". + * * customFulfillment5.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-5". + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories + * The categories associated with a category page. Must be set for category + * navigation queries to achieve good search quality. The format should be + * the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * @type int $search_mode + * The search mode of the search request. If not specified, a single search + * request triggers both product search and faceted search. + * @type \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $personalization_spec + * The specification for personalization. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. + * @type \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec $spell_correction_spec + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * @type string $entity + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it should be exactly matched with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search + * results boosted by entity. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $conversational_search_spec + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * @type \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $tile_navigation_spec + * Optional. This field specifies tile navigation related parameters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Retail Search serving config, such as + * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + * or the name of the legacy placement resource, such as + * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + * This field is used to identify the serving config name and the set + * of models that are used to make the search. + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPlacement() + { + return $this->placement; + } + + /** + * Required. The resource name of the Retail Search serving config, such as + * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + * or the name of the legacy placement resource, such as + * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + * This field is used to identify the serving config name and the set + * of models that are used to make the search. + * + * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPlacement($var) + { + GPBUtil::checkString($var, True); + $this->placement = $var; + + return $this; + } + + /** + * The branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. + * Use "default_branch" as the branch ID or leave this field empty, to search + * products under the default branch. + * + * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getBranch() + { + return $this->branch; + } + + /** + * The branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. + * Use "default_branch" as the branch ID or leave this field empty, to search + * products under the default branch. + * + * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBranch($var) + { + GPBUtil::checkString($var, True); + $this->branch = $var; + + return $this; + } + + /** + * Raw search query. + * If this field is empty, the request is considered a category browsing + * request and returned results are based on + * [filter][google.cloud.retail.v2.SearchRequest.filter] and + * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. + * + * Generated from protobuf field string query = 3; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Raw search query. + * If this field is empty, the request is considered a category browsing + * request and returned results are based on + * [filter][google.cloud.retail.v2.SearchRequest.filter] and + * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. + * + * Generated from protobuf field string query = 3; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Required. A unique identifier for tracking visitors. For example, this + * could be implemented with an HTTP cookie, which should be able to uniquely + * identify a visitor on a single device. This unique identifier should not + * change if the visitor logs in or out of the website. + * This should be the same identifier as + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVisitorId() + { + return $this->visitor_id; + } + + /** + * Required. A unique identifier for tracking visitors. For example, this + * could be implemented with an HTTP cookie, which should be able to uniquely + * identify a visitor on a single device. This unique identifier should not + * change if the visitor logs in or out of the website. + * This should be the same identifier as + * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVisitorId($var) + { + GPBUtil::checkString($var, True); + $this->visitor_id = $var; + + return $this; + } + + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; + * @return \Google\Cloud\Retail\V2\UserInfo|null + */ + public function getUserInfo() + { + return $this->user_info; + } + + public function hasUserInfo() + { + return isset($this->user_info); + } + + public function clearUserInfo() + { + unset($this->user_info); + } + + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; + * @param \Google\Cloud\Retail\V2\UserInfo $var + * @return $this + */ + public function setUserInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserInfo::class); + $this->user_info = $var; + + return $this; + } + + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to a reasonable value. The maximum allowed value is + * 120. Values above 120 will be coerced to 120. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 7; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + * unspecified, defaults to a reasonable value. The maximum allowed value is + * 120. Values above 120 will be coerced to 120. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 page_size = 7; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token + * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], + * received from a previous + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must + * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + * error is returned. + * + * Generated from protobuf field string page_token = 8; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token + * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], + * received from a previous + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must + * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + * error is returned. + * + * Generated from protobuf field string page_token = 8; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the [Product][google.cloud.retail.v2.Product]s + * deemed by the API as relevant) in search results. This field is only + * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] + * is unset. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 offset = 9; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the [Product][google.cloud.retail.v2.Product]s + * deemed by the API as relevant) in search results. This field is only + * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] + * is unset. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 offset = 9; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. Filter + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string filter = 10; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. Filter + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string filter = 10; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * The filter applied to every search request when quality improvement such as + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field string canonical_filter = 28; + * @return string + */ + public function getCanonicalFilter() + { + return $this->canonical_filter; + } + + /** + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * The filter applied to every search request when quality improvement such as + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field string canonical_filter = 28; + * @param string $var + * @return $this + */ + public function setCanonicalFilter($var) + { + GPBUtil::checkString($var, True); + $this->canonical_filter = $var; + + return $this; + } + + /** + * The order in which products are returned. Products can be ordered by + * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string order_by = 11; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The order in which products are returned. Products can be ordered by + * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + * If this field is unrecognizable, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field string order_by = 11; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetSpecs() + { + return $this->facet_specs; + } + + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + * @param array<\Google\Cloud\Retail\V2\SearchRequest\FacetSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\FacetSpec::class); + $this->facet_specs = $arr; + + return $this; + } + + /** + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * @return \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec|null + * @deprecated + */ + public function getDynamicFacetSpec() + { + @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); + return $this->dynamic_facet_spec; + } + + public function hasDynamicFacetSpec() + { + @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); + return isset($this->dynamic_facet_spec); + } + + public function clearDynamicFacetSpec() + { + @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); + unset($this->dynamic_facet_spec); + } + + /** + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * @param \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $var + * @return $this + * @deprecated + */ + public function setDynamicFacetSpec($var) + { + @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec::class); + $this->dynamic_facet_spec = $var; + + return $this; + } + + /** + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * @return \Google\Cloud\Retail\V2\SearchRequest\BoostSpec|null + */ + public function getBoostSpec() + { + return $this->boost_spec; + } + + public function hasBoostSpec() + { + return isset($this->boost_spec); + } + + public function clearBoostSpec() + { + unset($this->boost_spec); + } + + /** + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * @param \Google\Cloud\Retail\V2\SearchRequest\BoostSpec $var + * @return $this + */ + public function setBoostSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec::class); + $this->boost_spec = $var; + + return $this; + } + + /** + * The query expansion specification that specifies the conditions under which + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * @return \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec|null + */ + public function getQueryExpansionSpec() + { + return $this->query_expansion_spec; + } + + public function hasQueryExpansionSpec() + { + return isset($this->query_expansion_spec); + } + + public function clearQueryExpansionSpec() + { + unset($this->query_expansion_spec); + } + + /** + * The query expansion specification that specifies the conditions under which + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * @param \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $var + * @return $this + */ + public function setQueryExpansionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec::class); + $this->query_expansion_spec = $var; + + return $this; + } + + /** + * The keys to fetch and rollup the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s attributes, + * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The + * attributes from all the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a + * fulfillment type and a fulfillment ID must be provided in the format of + * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + * "pickupInStore" is fulfillment type and "store123" is the store ID. + * Supported keys are: + * * colorFamilies + * * price + * * originalPrice + * * discount + * * variantId + * * inventory(place_id,price) + * * inventory(place_id,original_price) + * * inventory(place_id,attributes.key), where key is any key in the + * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] + * map. + * * attributes.key, where key is any key in the + * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. + * * pickupInStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "pickup-in-store". + * * shipToStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "ship-to-store". + * * sameDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "same-day-delivery". + * * nextDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "next-day-delivery". + * * customFulfillment1.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-1". + * * customFulfillment2.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-2". + * * customFulfillment3.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-3". + * * customFulfillment4.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-4". + * * customFulfillment5.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-5". + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string variant_rollup_keys = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVariantRollupKeys() + { + return $this->variant_rollup_keys; + } + + /** + * The keys to fetch and rollup the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s attributes, + * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The + * attributes from all the matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s or + * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a + * fulfillment type and a fulfillment ID must be provided in the format of + * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + * "pickupInStore" is fulfillment type and "store123" is the store ID. + * Supported keys are: + * * colorFamilies + * * price + * * originalPrice + * * discount + * * variantId + * * inventory(place_id,price) + * * inventory(place_id,original_price) + * * inventory(place_id,attributes.key), where key is any key in the + * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] + * map. + * * attributes.key, where key is any key in the + * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. + * * pickupInStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "pickup-in-store". + * * shipToStore.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "ship-to-store". + * * sameDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "same-day-delivery". + * * nextDayDelivery.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "next-day-delivery". + * * customFulfillment1.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-1". + * * customFulfillment2.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-2". + * * customFulfillment3.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-3". + * * customFulfillment4.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-4". + * * customFulfillment5.id, where id is any + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] + * "custom-type-5". + * If this field is set to an invalid value other than these, an + * INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string variant_rollup_keys = 17; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVariantRollupKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->variant_rollup_keys = $arr; + + return $this; + } + + /** + * The categories associated with a category page. Must be set for category + * navigation queries to achieve good search quality. The format should be + * the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated string page_categories = 23; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageCategories() + { + return $this->page_categories; + } + + /** + * The categories associated with a category page. Must be set for category + * navigation queries to achieve good search quality. The format should be + * the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated string page_categories = 23; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->page_categories = $arr; + + return $this; + } + + /** + * The search mode of the search request. If not specified, a single search + * request triggers both product search and faceted search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; + * @return int + */ + public function getSearchMode() + { + return $this->search_mode; + } + + /** + * The search mode of the search request. If not specified, a single search + * request triggers both product search and faceted search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; + * @param int $var + * @return $this + */ + public function setSearchMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\SearchMode::class); + $this->search_mode = $var; + + return $this; + } + + /** + * The specification for personalization. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; + * @return \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec|null + */ + public function getPersonalizationSpec() + { + return $this->personalization_spec; + } + + public function hasPersonalizationSpec() + { + return isset($this->personalization_spec); + } + + public function clearPersonalizationSpec() + { + unset($this->personalization_spec); + } + + /** + * The specification for personalization. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; + * @param \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $var + * @return $this + */ + public function setPersonalizationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec::class); + $this->personalization_spec = $var; + + return $this; + } + + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. + * + * Generated from protobuf field map labels = 34; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. + * + * Generated from protobuf field map labels = 34; + * @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; + } + + /** + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * + * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; + * @return \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec|null + */ + public function getSpellCorrectionSpec() + { + return $this->spell_correction_spec; + } + + public function hasSpellCorrectionSpec() + { + return isset($this->spell_correction_spec); + } + + public function clearSpellCorrectionSpec() + { + unset($this->spell_correction_spec); + } + + /** + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * + * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; + * @param \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec $var + * @return $this + */ + public function setSpellCorrectionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec::class); + $this->spell_correction_spec = $var; + + return $this; + } + + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it should be exactly matched with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search + * results boosted by entity. + * + * Generated from protobuf field string entity = 38; + * @return string + */ + public function getEntity() + { + return $this->entity; + } + + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * If this is set, it should be exactly matched with + * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search + * results boosted by entity. + * + * Generated from protobuf field string entity = 38; + * @param string $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkString($var, True); + $this->entity = $var; + + return $this; + } + + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec|null + */ + public function getConversationalSearchSpec() + { + return $this->conversational_search_spec; + } + + public function hasConversationalSearchSpec() + { + return isset($this->conversational_search_spec); + } + + public function clearConversationalSearchSpec() + { + unset($this->conversational_search_spec); + } + + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $var + * @return $this + */ + public function setConversationalSearchSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec::class); + $this->conversational_search_spec = $var; + + return $this; + } + + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec|null + */ + public function getTileNavigationSpec() + { + return $this->tile_navigation_spec; + } + + public function hasTileNavigationSpec() + { + return isset($this->tile_navigation_spec); + } + + public function clearTileNavigationSpec() + { + unset($this->tile_navigation_spec); + } + + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $var + * @return $this + */ + public function setTileNavigationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec::class); + $this->tile_navigation_spec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php new file mode 100644 index 00000000000..c4a2c1c4db2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php @@ -0,0 +1,146 @@ +google.cloud.retail.v2.SearchRequest.BoostSpec + */ +class BoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifictions, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + */ + private $condition_boost_specs; + /** + * Whether to skip boostspec validation. If this field is set to true, + * invalid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will be ignored and valid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will still be applied. + * + * Generated from protobuf field optional bool skip_boost_spec_validation = 2; + */ + protected $skip_boost_spec_validation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $condition_boost_specs + * Condition boost specifications. If a product matches multiple conditions + * in the specifictions, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 20. + * @type bool $skip_boost_spec_validation + * Whether to skip boostspec validation. If this field is set to true, + * invalid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will be ignored and valid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will still be applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifictions, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditionBoostSpecs() + { + return $this->condition_boost_specs; + } + + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifictions, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * @param array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditionBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec::class); + $this->condition_boost_specs = $arr; + + return $this; + } + + /** + * Whether to skip boostspec validation. If this field is set to true, + * invalid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will be ignored and valid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will still be applied. + * + * Generated from protobuf field optional bool skip_boost_spec_validation = 2; + * @return bool + */ + public function getSkipBoostSpecValidation() + { + return isset($this->skip_boost_spec_validation) ? $this->skip_boost_spec_validation : false; + } + + public function hasSkipBoostSpecValidation() + { + return isset($this->skip_boost_spec_validation); + } + + public function clearSkipBoostSpecValidation() + { + unset($this->skip_boost_spec_validation); + } + + /** + * Whether to skip boostspec validation. If this field is set to true, + * invalid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will be ignored and valid + * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * will still be applied. + * + * Generated from protobuf field optional bool skip_boost_spec_validation = 2; + * @param bool $var + * @return $this + */ + public function setSkipBoostSpecValidation($var) + { + GPBUtil::checkBool($var); + $this->skip_boost_spec_validation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BoostSpec::class, \Google\Cloud\Retail\V2\SearchRequest_BoostSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php new file mode 100644 index 00000000000..2515f738bad --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php @@ -0,0 +1,192 @@ +google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + */ +class ConditionBoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * An expression which specifies a boost condition. The syntax and + * supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue": + * * (id: ANY("product_1", "product_2")) AND (colorFamilies: + * ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1; + */ + protected $condition = ''; + /** + * Strength of the condition boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2; + */ + protected $boost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $condition + * An expression which specifies a boost condition. The syntax and + * supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue": + * * (id: ANY("product_1", "product_2")) AND (colorFamilies: + * ANY("Red","Blue")) + * @type float $boost + * Strength of the condition boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * An expression which specifies a boost condition. The syntax and + * supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue": + * * (id: ANY("product_1", "product_2")) AND (colorFamilies: + * ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * An expression which specifies a boost condition. The syntax and + * supported fields are the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. + * Examples: + * * To boost products with product ID "product_1" or "product_2", and + * color + * "Red" or "Blue": + * * (id: ANY("product_1", "product_2")) AND (colorFamilies: + * ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Strength of the condition boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Strength of the condition boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0. + * Setting to 1.0 gives the item a big promotion. However, it does not + * necessarily mean that the boosted item will be the top result at all + * times, nor that other items will be excluded. Results could still be + * shown even when none of them matches the condition. And results that + * are significantly more relevant to the search query can still trump + * your heavily favored but irrelevant items. + * Setting to -1.0 gives the item a big demotion. However, results that + * are deeply relevant might still be shown. The item will have an + * upstream battle to get a fairly high ranking, but it is not blocked out + * completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConditionBoostSpec::class, \Google\Cloud\Retail\V2\SearchRequest_BoostSpec_ConditionBoostSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php new file mode 100644 index 00000000000..0c4780029c7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php @@ -0,0 +1,181 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec + */ +class ConversationalSearchSpec extends \Google\Protobuf\Internal\Message +{ + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + */ + protected $followup_conversation_requested = false; + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + */ + protected $conversation_id = ''; + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + */ + protected $user_answer = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $followup_conversation_requested + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * @type string $conversation_id + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $user_answer + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + * @return bool + */ + public function getFollowupConversationRequested() + { + return $this->followup_conversation_requested; + } + + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + * @param bool $var + * @return $this + */ + public function setFollowupConversationRequested($var) + { + GPBUtil::checkBool($var); + $this->followup_conversation_requested = $var; + + return $this; + } + + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer|null + */ + public function getUserAnswer() + { + return $this->user_answer; + } + + public function hasUserAnswer() + { + return isset($this->user_answer); + } + + public function clearUserAnswer() + { + unset($this->user_answer); + } + + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $var + * @return $this + */ + public function setUserAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer::class); + $this->user_answer = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConversationalSearchSpec::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php new file mode 100644 index 00000000000..9d204d2f005 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php @@ -0,0 +1,122 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer + */ +class UserAnswer extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text_answer + * This field specifies the incremental input text from the user during + * the conversational search. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $selected_answer + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies the incremental input text from the user during + * the conversational search. + * + * Generated from protobuf field string text_answer = 1; + * @return string + */ + public function getTextAnswer() + { + return $this->readOneof(1); + } + + public function hasTextAnswer() + { + return $this->hasOneof(1); + } + + /** + * This field specifies the incremental input text from the user during + * the conversational search. + * + * Generated from protobuf field string text_answer = 1; + * @param string $var + * @return $this + */ + public function setTextAnswer($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer|null + */ + public function getSelectedAnswer() + { + return $this->readOneof(2); + } + + public function hasSelectedAnswer() + { + return $this->hasOneof(2); + } + + /** + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $var + * @return $this + */ + public function setSelectedAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UserAnswer::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec_UserAnswer::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php new file mode 100644 index 00000000000..eec8e71a48b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php @@ -0,0 +1,124 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer + */ +class SelectedAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @deprecated + */ + private $product_attribute_values; + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $product_attribute_values + * This field is deprecated and should not be set. + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * This field specifies the selected answer which is a attribute + * key-value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getProductAttributeValues() + { + @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); + return $this->product_attribute_values; + } + + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @param array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setProductAttributeValues($var) + { + @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_values = $arr; + + return $this; + } + + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SelectedAnswer::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec_UserAnswer_SelectedAnswer::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php new file mode 100644 index 00000000000..fbbef52607b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php @@ -0,0 +1,82 @@ +google.cloud.retail.v2.SearchRequest.DynamicFacetSpec + */ +class DynamicFacetSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Mode of the DynamicFacet feature. + * Defaults to + * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + * if it's unset. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Mode of the DynamicFacet feature. + * Defaults to + * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + * if it's unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Mode of the DynamicFacet feature. + * Defaults to + * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + * if it's unset. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Mode of the DynamicFacet feature. + * Defaults to + * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + * if it's unset. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec\Mode::class); + $this->mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DynamicFacetSpec::class, \Google\Cloud\Retail\V2\SearchRequest_DynamicFacetSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php new file mode 100644 index 00000000000..c96db6f622c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode + */ +class Mode +{ + /** + * Default value. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Disable Dynamic Facet. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Automatic mode built by Google Retail Search. + * + * Generated from protobuf enum ENABLED = 2; + */ + const ENABLED = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::ENABLED => 'ENABLED', + ]; + + 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_DynamicFacetSpec_Mode::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php new file mode 100644 index 00000000000..9a3b56e9a3a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php @@ -0,0 +1,362 @@ +google.cloud.retail.v2.SearchRequest.FacetSpec + */ +class FacetSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The facet key specification. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $facet_key = null; + /** + * Maximum of facet values that should be returned for this facet. If + * unspecified, defaults to 50. The maximum allowed value is 300. Values + * above 300 will be coerced to 300. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 limit = 2; + */ + protected $limit = 0; + /** + * List of keys to exclude when faceting. + * By default, + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is not excluded from the filter unless it is listed in this field. + * Listing a facet key in this field allows its values to appear as facet + * results, even when they are filtered out of search results. Using this + * field does not affect what search results are returned. + * For example, suppose there are 100 products with the color facet "Red" + * and 200 products with the color facet "Blue". A query containing the + * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * would by default return only "Red" products in the search results, and + * also return "Red" with count 100 as the only color facet. Although there + * are also blue products available, "Blue" would not be shown as an + * available facet value. + * If "colorFamilies" is listed in "excludedFilterKeys", then the query + * returns the facet values "Red" with count 100 and "Blue" with count + * 200, because the "colorFamilies" key is now excluded from the filter. + * Because this field doesn't affect search results, the search results + * are still correctly filtered to return only "Red" products. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated string excluded_filter_keys = 3; + */ + private $excluded_filter_keys; + /** + * Enables dynamic position for this facet. If set to true, the position of + * this facet among all facets in the response is determined by Google + * Retail Search. It is ordered together with dynamic facets if dynamic + * facets is enabled. If set to false, the position of this facet in the + * response is the same as in the request, and it is ranked before + * the facets with dynamic position enable and all dynamic facets. + * For example, you may always want to have rating facet returned in + * the response, but it's not necessarily to always display the rating facet + * at the top. In that case, you can set enable_dynamic_position to true so + * that the position of rating facet in response is determined by + * Google Retail Search. + * Another example, assuming you have the following facets in the request: + * * "rating", enable_dynamic_position = true + * * "price", enable_dynamic_position = false + * * "brands", enable_dynamic_position = false + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be + * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + * "rating") depends on how Google Retail Search orders "gender" and + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. + * + * Generated from protobuf field bool enable_dynamic_position = 4; + */ + protected $enable_dynamic_position = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey $facet_key + * Required. The facet key specification. + * @type int $limit + * Maximum of facet values that should be returned for this facet. If + * unspecified, defaults to 50. The maximum allowed value is 300. Values + * above 300 will be coerced to 300. + * If this field is negative, an INVALID_ARGUMENT is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $excluded_filter_keys + * List of keys to exclude when faceting. + * By default, + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is not excluded from the filter unless it is listed in this field. + * Listing a facet key in this field allows its values to appear as facet + * results, even when they are filtered out of search results. Using this + * field does not affect what search results are returned. + * For example, suppose there are 100 products with the color facet "Red" + * and 200 products with the color facet "Blue". A query containing the + * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * would by default return only "Red" products in the search results, and + * also return "Red" with count 100 as the only color facet. Although there + * are also blue products available, "Blue" would not be shown as an + * available facet value. + * If "colorFamilies" is listed in "excludedFilterKeys", then the query + * returns the facet values "Red" with count 100 and "Blue" with count + * 200, because the "colorFamilies" key is now excluded from the filter. + * Because this field doesn't affect search results, the search results + * are still correctly filtered to return only "Red" products. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * @type bool $enable_dynamic_position + * Enables dynamic position for this facet. If set to true, the position of + * this facet among all facets in the response is determined by Google + * Retail Search. It is ordered together with dynamic facets if dynamic + * facets is enabled. If set to false, the position of this facet in the + * response is the same as in the request, and it is ranked before + * the facets with dynamic position enable and all dynamic facets. + * For example, you may always want to have rating facet returned in + * the response, but it's not necessarily to always display the rating facet + * at the top. In that case, you can set enable_dynamic_position to true so + * that the position of rating facet in response is determined by + * Google Retail Search. + * Another example, assuming you have the following facets in the request: + * * "rating", enable_dynamic_position = true + * * "price", enable_dynamic_position = false + * * "brands", enable_dynamic_position = false + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be + * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + * "rating") depends on how Google Retail Search orders "gender" and + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The facet key specification. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey|null + */ + public function getFacetKey() + { + return $this->facet_key; + } + + public function hasFacetKey() + { + return isset($this->facet_key); + } + + public function clearFacetKey() + { + unset($this->facet_key); + } + + /** + * Required. The facet key specification. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey $var + * @return $this + */ + public function setFacetKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey::class); + $this->facet_key = $var; + + return $this; + } + + /** + * Maximum of facet values that should be returned for this facet. If + * unspecified, defaults to 50. The maximum allowed value is 300. Values + * above 300 will be coerced to 300. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 limit = 2; + * @return int + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Maximum of facet values that should be returned for this facet. If + * unspecified, defaults to 50. The maximum allowed value is 300. Values + * above 300 will be coerced to 300. + * If this field is negative, an INVALID_ARGUMENT is returned. + * + * Generated from protobuf field int32 limit = 2; + * @param int $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkInt32($var); + $this->limit = $var; + + return $this; + } + + /** + * List of keys to exclude when faceting. + * By default, + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is not excluded from the filter unless it is listed in this field. + * Listing a facet key in this field allows its values to appear as facet + * results, even when they are filtered out of search results. Using this + * field does not affect what search results are returned. + * For example, suppose there are 100 products with the color facet "Red" + * and 200 products with the color facet "Blue". A query containing the + * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * would by default return only "Red" products in the search results, and + * also return "Red" with count 100 as the only color facet. Although there + * are also blue products available, "Blue" would not be shown as an + * available facet value. + * If "colorFamilies" is listed in "excludedFilterKeys", then the query + * returns the facet values "Red" with count 100 and "Blue" with count + * 200, because the "colorFamilies" key is now excluded from the filter. + * Because this field doesn't affect search results, the search results + * are still correctly filtered to return only "Red" products. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated string excluded_filter_keys = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExcludedFilterKeys() + { + return $this->excluded_filter_keys; + } + + /** + * List of keys to exclude when faceting. + * By default, + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is not excluded from the filter unless it is listed in this field. + * Listing a facet key in this field allows its values to appear as facet + * results, even when they are filtered out of search results. Using this + * field does not affect what search results are returned. + * For example, suppose there are 100 products with the color facet "Red" + * and 200 products with the color facet "Blue". A query containing the + * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * would by default return only "Red" products in the search results, and + * also return "Red" with count 100 as the only color facet. Although there + * are also blue products available, "Blue" would not be shown as an + * available facet value. + * If "colorFamilies" is listed in "excludedFilterKeys", then the query + * returns the facet values "Red" with count 100 and "Blue" with count + * 200, because the "colorFamilies" key is now excluded from the filter. + * Because this field doesn't affect search results, the search results + * are still correctly filtered to return only "Red" products. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field repeated string excluded_filter_keys = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExcludedFilterKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->excluded_filter_keys = $arr; + + return $this; + } + + /** + * Enables dynamic position for this facet. If set to true, the position of + * this facet among all facets in the response is determined by Google + * Retail Search. It is ordered together with dynamic facets if dynamic + * facets is enabled. If set to false, the position of this facet in the + * response is the same as in the request, and it is ranked before + * the facets with dynamic position enable and all dynamic facets. + * For example, you may always want to have rating facet returned in + * the response, but it's not necessarily to always display the rating facet + * at the top. In that case, you can set enable_dynamic_position to true so + * that the position of rating facet in response is determined by + * Google Retail Search. + * Another example, assuming you have the following facets in the request: + * * "rating", enable_dynamic_position = true + * * "price", enable_dynamic_position = false + * * "brands", enable_dynamic_position = false + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be + * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + * "rating") depends on how Google Retail Search orders "gender" and + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. + * + * Generated from protobuf field bool enable_dynamic_position = 4; + * @return bool + */ + public function getEnableDynamicPosition() + { + return $this->enable_dynamic_position; + } + + /** + * Enables dynamic position for this facet. If set to true, the position of + * this facet among all facets in the response is determined by Google + * Retail Search. It is ordered together with dynamic facets if dynamic + * facets is enabled. If set to false, the position of this facet in the + * response is the same as in the request, and it is ranked before + * the facets with dynamic position enable and all dynamic facets. + * For example, you may always want to have rating facet returned in + * the response, but it's not necessarily to always display the rating facet + * at the top. In that case, you can set enable_dynamic_position to true so + * that the position of rating facet in response is determined by + * Google Retail Search. + * Another example, assuming you have the following facets in the request: + * * "rating", enable_dynamic_position = true + * * "price", enable_dynamic_position = false + * * "brands", enable_dynamic_position = false + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be + * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + * "rating") depends on how Google Retail Search orders "gender" and + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. + * + * Generated from protobuf field bool enable_dynamic_position = 4; + * @param bool $var + * @return $this + */ + public function setEnableDynamicPosition($var) + { + GPBUtil::checkBool($var); + $this->enable_dynamic_position = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FacetSpec::class, \Google\Cloud\Retail\V2\SearchRequest_FacetSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php new file mode 100644 index 00000000000..cd776ccb742 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php @@ -0,0 +1,770 @@ +google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + */ +class FacetKey extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Supported textual and numerical facet keys in + * [Product][google.cloud.retail.v2.Product] object, over which the facet + * values are computed. Facet key is case-sensitive. + * Allowed facet keys when + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is not specified: + * * textual_field = + * * "brands" + * * "categories" + * * "genders" + * * "ageGroups" + * * "availability" + * * "colorFamilies" + * * "colors" + * * "sizes" + * * "materials" + * * "patterns" + * * "conditions" + * * "attributes.key" + * * "pickupInStore" + * * "shipToStore" + * * "sameDayDelivery" + * * "nextDayDelivery" + * * "customFulfillment1" + * * "customFulfillment2" + * * "customFulfillment3" + * * "customFulfillment4" + * * "customFulfillment5" + * * "inventory(place_id,attributes.key)" + * * numerical_field = + * * "price" + * * "discount" + * * "rating" + * * "ratingCount" + * * "attributes.key" + * * "inventory(place_id,price)" + * * "inventory(place_id,original_price)" + * * "inventory(place_id,attributes.key)" + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + /** + * Set only if values should be bucketized into intervals. Must be set + * for facets with numerical values. Must not be set for facet with text + * values. Maximum number of intervals is 40. + * For all numerical facet keys that appear in the list of products from + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are + * computed from their distribution weekly. If the model assigns a high + * score to a numerical facet key and its intervals are not specified in + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the + * facet key intervals are specified in the request, then the specified + * intervals are returned instead. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + private $intervals; + /** + * Only get facet for the given restricted values. For example, when using + * "pickupInStore" as key and set restricted values to + * ["store123", "store456"], only facets for "store123" and "store456" are + * returned. Only supported on predefined textual fields, custom textual + * attributes and fulfillments. Maximum is 20. + * Must be set for the fulfillment facet keys: + * * pickupInStore + * * shipToStore + * * sameDayDelivery + * * nextDayDelivery + * * customFulfillment1 + * * customFulfillment2 + * * customFulfillment3 + * * customFulfillment4 + * * customFulfillment5 + * + * Generated from protobuf field repeated string restricted_values = 3; + */ + private $restricted_values; + /** + * Only get facet values that start with the given string prefix. For + * example, suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + * "categories" facet gives only "Women > Shoe" and "Women > Dress". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string prefixes = 8; + */ + private $prefixes; + /** + * Only get facet values that contains the given strings. For example, + * suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string contains = 9; + */ + private $contains; + /** + * True to make facet keys case insensitive when getting faceting + * values with prefixes or contains; false otherwise. + * + * Generated from protobuf field bool case_insensitive = 10; + */ + protected $case_insensitive = false; + /** + * The order in which + * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] + * are returned. + * Allowed values are: + * * "count desc", which means order by + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * descending. + * * "value desc", which means order by + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * descending. + * Only applies to textual facets. + * If not set, textual values are sorted in [natural + * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + * intervals are sorted in the order given by + * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * are sorted in the order given by + * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. + * + * Generated from protobuf field string order_by = 4; + */ + protected $order_by = ''; + /** + * The query that is used to compute facet for the given facet key. + * When provided, it overrides the default behavior of facet + * computation. The query syntax is the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. Notice that there is no limitation on + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * when query is specified. + * In the response, + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * is always "1" and + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * is the number of results that match the query. + * For example, you can set a customized facet for "shipToStore", + * where + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is "customizedShipToStore", and + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + * Then the facet counts the products that are both in stock and ship + * to store "123". + * + * Generated from protobuf field string query = 5; + */ + protected $query = ''; + /** + * Returns the min and max value for each numerical facet intervals. + * Ignored for textual facets. + * + * Generated from protobuf field bool return_min_max = 11; + */ + protected $return_min_max = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Required. Supported textual and numerical facet keys in + * [Product][google.cloud.retail.v2.Product] object, over which the facet + * values are computed. Facet key is case-sensitive. + * Allowed facet keys when + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is not specified: + * * textual_field = + * * "brands" + * * "categories" + * * "genders" + * * "ageGroups" + * * "availability" + * * "colorFamilies" + * * "colors" + * * "sizes" + * * "materials" + * * "patterns" + * * "conditions" + * * "attributes.key" + * * "pickupInStore" + * * "shipToStore" + * * "sameDayDelivery" + * * "nextDayDelivery" + * * "customFulfillment1" + * * "customFulfillment2" + * * "customFulfillment3" + * * "customFulfillment4" + * * "customFulfillment5" + * * "inventory(place_id,attributes.key)" + * * numerical_field = + * * "price" + * * "discount" + * * "rating" + * * "ratingCount" + * * "attributes.key" + * * "inventory(place_id,price)" + * * "inventory(place_id,original_price)" + * * "inventory(place_id,attributes.key)" + * @type array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $intervals + * Set only if values should be bucketized into intervals. Must be set + * for facets with numerical values. Must not be set for facet with text + * values. Maximum number of intervals is 40. + * For all numerical facet keys that appear in the list of products from + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are + * computed from their distribution weekly. If the model assigns a high + * score to a numerical facet key and its intervals are not specified in + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the + * facet key intervals are specified in the request, then the specified + * intervals are returned instead. + * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_values + * Only get facet for the given restricted values. For example, when using + * "pickupInStore" as key and set restricted values to + * ["store123", "store456"], only facets for "store123" and "store456" are + * returned. Only supported on predefined textual fields, custom textual + * attributes and fulfillments. Maximum is 20. + * Must be set for the fulfillment facet keys: + * * pickupInStore + * * shipToStore + * * sameDayDelivery + * * nextDayDelivery + * * customFulfillment1 + * * customFulfillment2 + * * customFulfillment3 + * * customFulfillment4 + * * customFulfillment5 + * @type array|\Google\Protobuf\Internal\RepeatedField $prefixes + * Only get facet values that start with the given string prefix. For + * example, suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + * "categories" facet gives only "Women > Shoe" and "Women > Dress". + * Only supported on textual fields. Maximum is 10. + * @type array|\Google\Protobuf\Internal\RepeatedField $contains + * Only get facet values that contains the given strings. For example, + * suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". + * Only supported on textual fields. Maximum is 10. + * @type bool $case_insensitive + * True to make facet keys case insensitive when getting faceting + * values with prefixes or contains; false otherwise. + * @type string $order_by + * The order in which + * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] + * are returned. + * Allowed values are: + * * "count desc", which means order by + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * descending. + * * "value desc", which means order by + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * descending. + * Only applies to textual facets. + * If not set, textual values are sorted in [natural + * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + * intervals are sorted in the order given by + * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * are sorted in the order given by + * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. + * @type string $query + * The query that is used to compute facet for the given facet key. + * When provided, it overrides the default behavior of facet + * computation. The query syntax is the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. Notice that there is no limitation on + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * when query is specified. + * In the response, + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * is always "1" and + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * is the number of results that match the query. + * For example, you can set a customized facet for "shipToStore", + * where + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is "customizedShipToStore", and + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + * Then the facet counts the products that are both in stock and ship + * to store "123". + * @type bool $return_min_max + * Returns the min and max value for each numerical facet intervals. + * Ignored for textual facets. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Supported textual and numerical facet keys in + * [Product][google.cloud.retail.v2.Product] object, over which the facet + * values are computed. Facet key is case-sensitive. + * Allowed facet keys when + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is not specified: + * * textual_field = + * * "brands" + * * "categories" + * * "genders" + * * "ageGroups" + * * "availability" + * * "colorFamilies" + * * "colors" + * * "sizes" + * * "materials" + * * "patterns" + * * "conditions" + * * "attributes.key" + * * "pickupInStore" + * * "shipToStore" + * * "sameDayDelivery" + * * "nextDayDelivery" + * * "customFulfillment1" + * * "customFulfillment2" + * * "customFulfillment3" + * * "customFulfillment4" + * * "customFulfillment5" + * * "inventory(place_id,attributes.key)" + * * numerical_field = + * * "price" + * * "discount" + * * "rating" + * * "ratingCount" + * * "attributes.key" + * * "inventory(place_id,price)" + * * "inventory(place_id,original_price)" + * * "inventory(place_id,attributes.key)" + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. Supported textual and numerical facet keys in + * [Product][google.cloud.retail.v2.Product] object, over which the facet + * values are computed. Facet key is case-sensitive. + * Allowed facet keys when + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is not specified: + * * textual_field = + * * "brands" + * * "categories" + * * "genders" + * * "ageGroups" + * * "availability" + * * "colorFamilies" + * * "colors" + * * "sizes" + * * "materials" + * * "patterns" + * * "conditions" + * * "attributes.key" + * * "pickupInStore" + * * "shipToStore" + * * "sameDayDelivery" + * * "nextDayDelivery" + * * "customFulfillment1" + * * "customFulfillment2" + * * "customFulfillment3" + * * "customFulfillment4" + * * "customFulfillment5" + * * "inventory(place_id,attributes.key)" + * * numerical_field = + * * "price" + * * "discount" + * * "rating" + * * "ratingCount" + * * "attributes.key" + * * "inventory(place_id,price)" + * * "inventory(place_id,original_price)" + * * "inventory(place_id,attributes.key)" + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Set only if values should be bucketized into intervals. Must be set + * for facets with numerical values. Must not be set for facet with text + * values. Maximum number of intervals is 40. + * For all numerical facet keys that appear in the list of products from + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are + * computed from their distribution weekly. If the model assigns a high + * score to a numerical facet key and its intervals are not specified in + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the + * facet key intervals are specified in the request, then the specified + * intervals are returned instead. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntervals() + { + return $this->intervals; + } + + /** + * Set only if values should be bucketized into intervals. Must be set + * for facets with numerical values. Must not be set for facet with text + * values. Maximum number of intervals is 40. + * For all numerical facet keys that appear in the list of products from + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are + * computed from their distribution weekly. If the model assigns a high + * score to a numerical facet key and its intervals are not specified in + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the + * facet key intervals are specified in the request, then the specified + * intervals are returned instead. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; + * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntervals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Interval::class); + $this->intervals = $arr; + + return $this; + } + + /** + * Only get facet for the given restricted values. For example, when using + * "pickupInStore" as key and set restricted values to + * ["store123", "store456"], only facets for "store123" and "store456" are + * returned. Only supported on predefined textual fields, custom textual + * attributes and fulfillments. Maximum is 20. + * Must be set for the fulfillment facet keys: + * * pickupInStore + * * shipToStore + * * sameDayDelivery + * * nextDayDelivery + * * customFulfillment1 + * * customFulfillment2 + * * customFulfillment3 + * * customFulfillment4 + * * customFulfillment5 + * + * Generated from protobuf field repeated string restricted_values = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRestrictedValues() + { + return $this->restricted_values; + } + + /** + * Only get facet for the given restricted values. For example, when using + * "pickupInStore" as key and set restricted values to + * ["store123", "store456"], only facets for "store123" and "store456" are + * returned. Only supported on predefined textual fields, custom textual + * attributes and fulfillments. Maximum is 20. + * Must be set for the fulfillment facet keys: + * * pickupInStore + * * shipToStore + * * sameDayDelivery + * * nextDayDelivery + * * customFulfillment1 + * * customFulfillment2 + * * customFulfillment3 + * * customFulfillment4 + * * customFulfillment5 + * + * Generated from protobuf field repeated string restricted_values = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRestrictedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->restricted_values = $arr; + + return $this; + } + + /** + * Only get facet values that start with the given string prefix. For + * example, suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + * "categories" facet gives only "Women > Shoe" and "Women > Dress". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string prefixes = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrefixes() + { + return $this->prefixes; + } + + /** + * Only get facet values that start with the given string prefix. For + * example, suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + * "categories" facet gives only "Women > Shoe" and "Women > Dress". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string prefixes = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrefixes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->prefixes = $arr; + + return $this; + } + + /** + * Only get facet values that contains the given strings. For example, + * suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string contains = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContains() + { + return $this->contains; + } + + /** + * Only get facet values that contains the given strings. For example, + * suppose "categories" has three values "Women > Shoe", + * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". + * Only supported on textual fields. Maximum is 10. + * + * Generated from protobuf field repeated string contains = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContains($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->contains = $arr; + + return $this; + } + + /** + * True to make facet keys case insensitive when getting faceting + * values with prefixes or contains; false otherwise. + * + * Generated from protobuf field bool case_insensitive = 10; + * @return bool + */ + public function getCaseInsensitive() + { + return $this->case_insensitive; + } + + /** + * True to make facet keys case insensitive when getting faceting + * values with prefixes or contains; false otherwise. + * + * Generated from protobuf field bool case_insensitive = 10; + * @param bool $var + * @return $this + */ + public function setCaseInsensitive($var) + { + GPBUtil::checkBool($var); + $this->case_insensitive = $var; + + return $this; + } + + /** + * The order in which + * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] + * are returned. + * Allowed values are: + * * "count desc", which means order by + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * descending. + * * "value desc", which means order by + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * descending. + * Only applies to textual facets. + * If not set, textual values are sorted in [natural + * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + * intervals are sorted in the order given by + * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * are sorted in the order given by + * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. + * + * Generated from protobuf field string order_by = 4; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The order in which + * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] + * are returned. + * Allowed values are: + * * "count desc", which means order by + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * descending. + * * "value desc", which means order by + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * descending. + * Only applies to textual facets. + * If not set, textual values are sorted in [natural + * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + * intervals are sorted in the order given by + * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; + * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * are sorted in the order given by + * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. + * + * Generated from protobuf field string order_by = 4; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * The query that is used to compute facet for the given facet key. + * When provided, it overrides the default behavior of facet + * computation. The query syntax is the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. Notice that there is no limitation on + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * when query is specified. + * In the response, + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * is always "1" and + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * is the number of results that match the query. + * For example, you can set a customized facet for "shipToStore", + * where + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is "customizedShipToStore", and + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + * Then the facet counts the products that are both in stock and ship + * to store "123". + * + * Generated from protobuf field string query = 5; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query that is used to compute facet for the given facet key. + * When provided, it overrides the default behavior of facet + * computation. The query syntax is the same as a filter expression. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * detail syntax and limitations. Notice that there is no limitation on + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * when query is specified. + * In the response, + * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] + * is always "1" and + * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] + * is the number of results that match the query. + * For example, you can set a customized facet for "shipToStore", + * where + * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + * is "customizedShipToStore", and + * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + * Then the facet counts the products that are both in stock and ship + * to store "123". + * + * Generated from protobuf field string query = 5; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Returns the min and max value for each numerical facet intervals. + * Ignored for textual facets. + * + * Generated from protobuf field bool return_min_max = 11; + * @return bool + */ + public function getReturnMinMax() + { + return $this->return_min_max; + } + + /** + * Returns the min and max value for each numerical facet intervals. + * Ignored for textual facets. + * + * Generated from protobuf field bool return_min_max = 11; + * @param bool $var + * @return $this + */ + public function setReturnMinMax($var) + { + GPBUtil::checkBool($var); + $this->return_min_max = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FacetKey::class, \Google\Cloud\Retail\V2\SearchRequest_FacetSpec_FacetKey::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php new file mode 100644 index 00000000000..1d2699d2148 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php @@ -0,0 +1,74 @@ +google.cloud.retail.v2.SearchRequest.PersonalizationSpec + */ +class PersonalizationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec\Mode::class); + $this->mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PersonalizationSpec::class, \Google\Cloud\Retail\V2\SearchRequest_PersonalizationSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php new file mode 100644 index 00000000000..7b794c8e00c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php @@ -0,0 +1,66 @@ +google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode + */ +class Mode +{ + /** + * Default value. In this case, server behavior defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Let CRS decide whether to use personalization based on quality of user + * event data. + * + * Generated from protobuf enum AUTO = 1; + */ + const AUTO = 1; + /** + * Disable personalization. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::AUTO => 'AUTO', + self::DISABLED => 'DISABLED', + ]; + + 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_PersonalizationSpec_Mode::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php new file mode 100644 index 00000000000..27eeb0c4593 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php @@ -0,0 +1,117 @@ +google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + */ +class QueryExpansionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The condition under which query expansion should occur. Default to + * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + */ + protected $condition = 0; + /** + * Whether to pin unexpanded results. If this field is set to true, + * unexpanded products are always at the top of the search results, followed + * by the expanded results. + * + * Generated from protobuf field bool pin_unexpanded_results = 2; + */ + protected $pin_unexpanded_results = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $condition + * The condition under which query expansion should occur. Default to + * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + * @type bool $pin_unexpanded_results + * Whether to pin unexpanded results. If this field is set to true, + * unexpanded products are always at the top of the search results, followed + * by the expanded results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The condition under which query expansion should occur. Default to + * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * @return int + */ + public function getCondition() + { + return $this->condition; + } + + /** + * The condition under which query expansion should occur. Default to + * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * @param int $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec\Condition::class); + $this->condition = $var; + + return $this; + } + + /** + * Whether to pin unexpanded results. If this field is set to true, + * unexpanded products are always at the top of the search results, followed + * by the expanded results. + * + * Generated from protobuf field bool pin_unexpanded_results = 2; + * @return bool + */ + public function getPinUnexpandedResults() + { + return $this->pin_unexpanded_results; + } + + /** + * Whether to pin unexpanded results. If this field is set to true, + * unexpanded products are always at the top of the search results, followed + * by the expanded results. + * + * Generated from protobuf field bool pin_unexpanded_results = 2; + * @param bool $var + * @return $this + */ + public function setPinUnexpandedResults($var) + { + GPBUtil::checkBool($var); + $this->pin_unexpanded_results = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryExpansionSpec::class, \Google\Cloud\Retail\V2\SearchRequest_QueryExpansionSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php new file mode 100644 index 00000000000..ae6898a2bcd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php @@ -0,0 +1,68 @@ +google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition + */ +class Condition +{ + /** + * Unspecified query expansion condition. In this case, server behavior + * defaults to + * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + * + * Generated from protobuf enum CONDITION_UNSPECIFIED = 0; + */ + const CONDITION_UNSPECIFIED = 0; + /** + * Disabled query expansion. Only the exact search query is used, even if + * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size] + * is zero. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Automatic query expansion built by Google Retail Search. + * + * Generated from protobuf enum AUTO = 3; + */ + const AUTO = 3; + + private static $valueToName = [ + self::CONDITION_UNSPECIFIED => 'CONDITION_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::AUTO => 'AUTO', + ]; + + 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(Condition::class, \Google\Cloud\Retail\V2\SearchRequest_QueryExpansionSpec_Condition::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php new file mode 100644 index 00000000000..57c56dd2e48 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php @@ -0,0 +1,88 @@ +google.cloud.retail.v2.SearchRequest.SearchMode + */ +class SearchMode +{ + /** + * Default value. In this case both product search and faceted search will + * be performed. Both + * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] + * and [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] + * will be returned. + * + * Generated from protobuf enum SEARCH_MODE_UNSPECIFIED = 0; + */ + const SEARCH_MODE_UNSPECIFIED = 0; + /** + * Only product search will be performed. The faceted search will be + * disabled. + * Only + * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] + * will be returned. + * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will + * not be returned, even if + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * or + * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec] + * is set. + * + * Generated from protobuf enum PRODUCT_SEARCH_ONLY = 1; + */ + const PRODUCT_SEARCH_ONLY = 1; + /** + * Only faceted search will be performed. The product search will be + * disabled. + * When in this mode, one or both of + * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] + * and + * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec] + * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only + * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will + * be returned. + * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] + * will not be returned. + * + * Generated from protobuf enum FACETED_SEARCH_ONLY = 2; + */ + const FACETED_SEARCH_ONLY = 2; + + private static $valueToName = [ + self::SEARCH_MODE_UNSPECIFIED => 'SEARCH_MODE_UNSPECIFIED', + self::PRODUCT_SEARCH_ONLY => 'PRODUCT_SEARCH_ONLY', + self::FACETED_SEARCH_ONLY => 'FACETED_SEARCH_ONLY', + ]; + + 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(SearchMode::class, \Google\Cloud\Retail\V2\SearchRequest_SearchMode::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php new file mode 100644 index 00000000000..088213a9edf --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php @@ -0,0 +1,78 @@ +google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec + */ +class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The mode under which spell correction should take effect to + * replace the original search query. Default to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * The mode under which spell correction should take effect to + * replace the original search query. Default to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The mode under which spell correction should take effect to + * replace the original search query. Default to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * The mode under which spell correction should take effect to + * replace the original search query. Default to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec\Mode::class); + $this->mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SpellCorrectionSpec::class, \Google\Cloud\Retail\V2\SearchRequest_SpellCorrectionSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php new file mode 100644 index 00000000000..901386a58db --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php @@ -0,0 +1,70 @@ +google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode + */ +class Mode +{ + /** + * Unspecified spell correction mode. In this case, server behavior + * defaults to + * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Google Retail Search will try to find a spell suggestion if there + * is any and put in the + * [SearchResponse.corrected_query][google.cloud.retail.v2.SearchResponse.corrected_query]. + * The spell suggestion will not be used as the search query. + * + * Generated from protobuf enum SUGGESTION_ONLY = 1; + */ + const SUGGESTION_ONLY = 1; + /** + * Automatic spell correction built by Google Retail Search. Search will + * be based on the corrected query if found. + * + * Generated from protobuf enum AUTO = 2; + */ + const AUTO = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::SUGGESTION_ONLY => 'SUGGESTION_ONLY', + self::AUTO => 'AUTO', + ]; + + 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_SpellCorrectionSpec_Mode::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php new file mode 100644 index 00000000000..5609a305800 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php @@ -0,0 +1,120 @@ +google.cloud.retail.v2.SearchRequest.TileNavigationSpec + */ +class TileNavigationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + */ + protected $tile_navigation_requested = false; + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + */ + private $applied_tiles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $tile_navigation_requested + * This field specifies whether the customer would like to request tile + * navigation. + * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $applied_tiles + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + * @return bool + */ + public function getTileNavigationRequested() + { + return $this->tile_navigation_requested; + } + + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + * @param bool $var + * @return $this + */ + public function setTileNavigationRequested($var) + { + GPBUtil::checkBool($var); + $this->tile_navigation_requested = $var; + + return $this; + } + + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedTiles() + { + return $this->applied_tiles; + } + + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedTiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); + $this->applied_tiles = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TileNavigationSpec::class, \Google\Cloud\Retail\V2\SearchRequest_TileNavigationSpec::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php new file mode 100644 index 00000000000..f8508be2ccc --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php @@ -0,0 +1,590 @@ +google.cloud.retail.v2.SearchResponse + */ +class SearchResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of matched items. The order represents the ranking. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + private $results; + /** + * Results of facets requested by user. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + private $facets; + /** + * The estimated total count of matched items irrespective of pagination. The + * count of [results][google.cloud.retail.v2.SearchResponse.results] returned + * by pagination may be less than the + * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that + * matches. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + /** + * Contains the spell corrected query, if found. If the spell correction type + * is AUTOMATIC, then the search results are based on corrected_query. + * Otherwise the original query is used for search. + * + * Generated from protobuf field string corrected_query = 4; + */ + protected $corrected_query = ''; + /** + * A unique search token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * search, which enables accurate attribution of search model performance. + * + * Generated from protobuf field string attribution_token = 5; + */ + protected $attribution_token = ''; + /** + * A token that can be sent as + * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * Generated from protobuf field string next_page_token = 6; + */ + protected $next_page_token = ''; + /** + * Query expansion information for the returned results. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + */ + protected $query_expansion_info = null; + /** + * The URI of a customer-defined redirect page. If redirect action is + * triggered, no search is performed, and only + * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and + * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * are set in the response. + * + * Generated from protobuf field string redirect_uri = 10; + */ + protected $redirect_uri = ''; + /** + * The fully qualified resource name of applied + * [controls](https://cloud.google.com/retail/docs/serving-control-rules). + * + * Generated from protobuf field repeated string applied_controls = 12; + */ + private $applied_controls; + /** + * The invalid + * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * that are not applied during serving. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + */ + private $invalid_condition_boost_specs; + /** + * Metadata related to A/B testing [Experiment][] associated with this + * response. Only exists when an experiment is triggered. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; + */ + private $experiment_info; + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + */ + protected $conversational_search_result = null; + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + */ + protected $tile_navigation_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\SearchResponse\SearchResult>|\Google\Protobuf\Internal\RepeatedField $results + * A list of matched items. The order represents the ranking. + * @type array<\Google\Cloud\Retail\V2\SearchResponse\Facet>|\Google\Protobuf\Internal\RepeatedField $facets + * Results of facets requested by user. + * @type int $total_size + * The estimated total count of matched items irrespective of pagination. The + * count of [results][google.cloud.retail.v2.SearchResponse.results] returned + * by pagination may be less than the + * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that + * matches. + * @type string $corrected_query + * Contains the spell corrected query, if found. If the spell correction type + * is AUTOMATIC, then the search results are based on corrected_query. + * Otherwise the original query is used for search. + * @type string $attribution_token + * A unique search token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * search, which enables accurate attribution of search model performance. + * @type string $next_page_token + * A token that can be sent as + * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * @type \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo $query_expansion_info + * Query expansion information for the returned results. + * @type string $redirect_uri + * The URI of a customer-defined redirect page. If redirect action is + * triggered, no search is performed, and only + * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and + * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * are set in the response. + * @type array|\Google\Protobuf\Internal\RepeatedField $applied_controls + * The fully qualified resource name of applied + * [controls](https://cloud.google.com/retail/docs/serving-control-rules). + * @type array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $invalid_condition_boost_specs + * The invalid + * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * that are not applied during serving. + * @type array<\Google\Cloud\Retail\V2\ExperimentInfo>|\Google\Protobuf\Internal\RepeatedField $experiment_info + * Metadata related to A/B testing [Experiment][] associated with this + * response. Only exists when an experiment is triggered. + * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $conversational_search_result + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * @type \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $tile_navigation_result + * This field specifies all related information for tile navigation that will + * be used in client side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * A list of matched items. The order represents the ranking. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * A list of matched items. The order represents the ranking. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\SearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\SearchResult::class); + $this->results = $arr; + + return $this; + } + + /** + * Results of facets requested by user. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacets() + { + return $this->facets; + } + + /** + * Results of facets requested by user. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\Facet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\Facet::class); + $this->facets = $arr; + + return $this; + } + + /** + * The estimated total count of matched items irrespective of pagination. The + * count of [results][google.cloud.retail.v2.SearchResponse.results] returned + * by pagination may be less than the + * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that + * matches. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The estimated total count of matched items irrespective of pagination. The + * count of [results][google.cloud.retail.v2.SearchResponse.results] returned + * by pagination may be less than the + * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that + * matches. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + + /** + * Contains the spell corrected query, if found. If the spell correction type + * is AUTOMATIC, then the search results are based on corrected_query. + * Otherwise the original query is used for search. + * + * Generated from protobuf field string corrected_query = 4; + * @return string + */ + public function getCorrectedQuery() + { + return $this->corrected_query; + } + + /** + * Contains the spell corrected query, if found. If the spell correction type + * is AUTOMATIC, then the search results are based on corrected_query. + * Otherwise the original query is used for search. + * + * Generated from protobuf field string corrected_query = 4; + * @param string $var + * @return $this + */ + public function setCorrectedQuery($var) + { + GPBUtil::checkString($var, True); + $this->corrected_query = $var; + + return $this; + } + + /** + * A unique search token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * search, which enables accurate attribution of search model performance. + * + * Generated from protobuf field string attribution_token = 5; + * @return string + */ + public function getAttributionToken() + { + return $this->attribution_token; + } + + /** + * A unique search token. This should be included in the + * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + * search, which enables accurate attribution of search model performance. + * + * Generated from protobuf field string attribution_token = 5; + * @param string $var + * @return $this + */ + public function setAttributionToken($var) + { + GPBUtil::checkString($var, True); + $this->attribution_token = $var; + + return $this; + } + + /** + * A token that can be sent as + * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * Generated from protobuf field string next_page_token = 6; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as + * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] + * to retrieve the next page. If this field is omitted, there are no + * subsequent pages. + * + * 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; + } + + /** + * Query expansion information for the returned results. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * @return \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo|null + */ + public function getQueryExpansionInfo() + { + return $this->query_expansion_info; + } + + public function hasQueryExpansionInfo() + { + return isset($this->query_expansion_info); + } + + public function clearQueryExpansionInfo() + { + unset($this->query_expansion_info); + } + + /** + * Query expansion information for the returned results. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * @param \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo $var + * @return $this + */ + public function setQueryExpansionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo::class); + $this->query_expansion_info = $var; + + return $this; + } + + /** + * The URI of a customer-defined redirect page. If redirect action is + * triggered, no search is performed, and only + * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and + * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * are set in the response. + * + * Generated from protobuf field string redirect_uri = 10; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * The URI of a customer-defined redirect page. If redirect action is + * triggered, no search is performed, and only + * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and + * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * are set in the response. + * + * Generated from protobuf field string redirect_uri = 10; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + + /** + * The fully qualified resource name of applied + * [controls](https://cloud.google.com/retail/docs/serving-control-rules). + * + * Generated from protobuf field repeated string applied_controls = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedControls() + { + return $this->applied_controls; + } + + /** + * The fully qualified resource name of applied + * [controls](https://cloud.google.com/retail/docs/serving-control-rules). + * + * Generated from protobuf field repeated string applied_controls = 12; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedControls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applied_controls = $arr; + + return $this; + } + + /** + * The invalid + * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * that are not applied during serving. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInvalidConditionBoostSpecs() + { + return $this->invalid_condition_boost_specs; + } + + /** + * The invalid + * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + * that are not applied during serving. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * @param array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInvalidConditionBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec::class); + $this->invalid_condition_boost_specs = $arr; + + return $this; + } + + /** + * Metadata related to A/B testing [Experiment][] associated with this + * response. Only exists when an experiment is triggered. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExperimentInfo() + { + return $this->experiment_info; + } + + /** + * Metadata related to A/B testing [Experiment][] associated with this + * response. Only exists when an experiment is triggered. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; + * @param array<\Google\Cloud\Retail\V2\ExperimentInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExperimentInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ExperimentInfo::class); + $this->experiment_info = $arr; + + return $this; + } + + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult|null + */ + public function getConversationalSearchResult() + { + return $this->conversational_search_result; + } + + public function hasConversationalSearchResult() + { + return isset($this->conversational_search_result); + } + + public function clearConversationalSearchResult() + { + unset($this->conversational_search_result); + } + + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $var + * @return $this + */ + public function setConversationalSearchResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult::class); + $this->conversational_search_result = $var; + + return $this; + } + + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + * @return \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult|null + */ + public function getTileNavigationResult() + { + return $this->tile_navigation_result; + } + + public function hasTileNavigationResult() + { + return isset($this->tile_navigation_result); + } + + public function clearTileNavigationResult() + { + unset($this->tile_navigation_result); + } + + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + * @param \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $var + * @return $this + */ + public function setTileNavigationResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult::class); + $this->tile_navigation_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php new file mode 100644 index 00000000000..1b759d0c5b1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php @@ -0,0 +1,324 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult + */ +class ConversationalSearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + */ + protected $conversation_id = ''; + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + */ + protected $refined_query = ''; + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @deprecated + */ + private $additional_filters; + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + */ + protected $followup_question = ''; + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + */ + private $suggested_answers; + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + */ + protected $additional_filter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_id + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * @type string $refined_query + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $additional_filters + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * @type string $followup_question + * The follow-up question. e.g., `What is the color?` + * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $suggested_answers + * The answer options provided to client for the follow-up question. + * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $additional_filter + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + * @return string + */ + public function getRefinedQuery() + { + return $this->refined_query; + } + + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + * @param string $var + * @return $this + */ + public function setRefinedQuery($var) + { + GPBUtil::checkString($var, True); + $this->refined_query = $var; + + return $this; + } + + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getAdditionalFilters() + { + @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); + return $this->additional_filters; + } + + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setAdditionalFilters($var) + { + @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); + $this->additional_filters = $arr; + + return $this; + } + + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + * @return string + */ + public function getFollowupQuestion() + { + return $this->followup_question; + } + + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + * @param string $var + * @return $this + */ + public function setFollowupQuestion($var) + { + GPBUtil::checkString($var, True); + $this->followup_question = $var; + + return $this; + } + + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestedAnswers() + { + return $this->suggested_answers; + } + + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestedAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer::class); + $this->suggested_answers = $arr; + + return $this; + } + + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter|null + */ + public function getAdditionalFilter() + { + return $this->additional_filter; + } + + public function hasAdditionalFilter() + { + return isset($this->additional_filter); + } + + public function clearAdditionalFilter() + { + unset($this->additional_filter); + } + + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $var + * @return $this + */ + public function setAdditionalFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); + $this->additional_filter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConversationalSearchResult::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php new file mode 100644 index 00000000000..41e844d6766 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php @@ -0,0 +1,84 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter + */ +class AdditionalFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdditionalFilter::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult_AdditionalFilter::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php new file mode 100644 index 00000000000..85e543b644b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php @@ -0,0 +1,84 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer + */ +class SuggestedAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestedAnswer::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult_SuggestedAnswer::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php new file mode 100644 index 00000000000..071e7e64fe5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php @@ -0,0 +1,142 @@ +google.cloud.retail.v2.SearchResponse.Facet + */ +class Facet extends \Google\Protobuf\Internal\Message +{ + /** + * The key for this facet. E.g., "colorFamilies" or "price" or + * "attributes.attr1". + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The facet values for this field. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + private $values; + /** + * Whether the facet is dynamically generated. + * + * Generated from protobuf field bool dynamic_facet = 3; + */ + protected $dynamic_facet = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The key for this facet. E.g., "colorFamilies" or "price" or + * "attributes.attr1". + * @type array<\Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $values + * The facet values for this field. + * @type bool $dynamic_facet + * Whether the facet is dynamically generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The key for this facet. E.g., "colorFamilies" or "price" or + * "attributes.attr1". + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The key for this facet. E.g., "colorFamilies" or "price" or + * "attributes.attr1". + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The facet values for this field. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The facet values for this field. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue::class); + $this->values = $arr; + + return $this; + } + + /** + * Whether the facet is dynamically generated. + * + * Generated from protobuf field bool dynamic_facet = 3; + * @return bool + */ + public function getDynamicFacet() + { + return $this->dynamic_facet; + } + + /** + * Whether the facet is dynamically generated. + * + * Generated from protobuf field bool dynamic_facet = 3; + * @param bool $var + * @return $this + */ + public function setDynamicFacet($var) + { + GPBUtil::checkBool($var); + $this->dynamic_facet = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Facet::class, \Google\Cloud\Retail\V2\SearchResponse_Facet::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php new file mode 100644 index 00000000000..a958a437a91 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php @@ -0,0 +1,245 @@ +google.cloud.retail.v2.SearchResponse.Facet.FacetValue + */ +class FacetValue extends \Google\Protobuf\Internal\Message +{ + /** + * Number of items that have this facet value. + * + * Generated from protobuf field int64 count = 3; + */ + protected $count = 0; + /** + * The minimum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double min_value = 5; + */ + protected $min_value = 0.0; + /** + * The maximum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double max_value = 6; + */ + protected $max_value = 0.0; + protected $facet_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * Text value of a facet, such as "Black" for facet "colorFamilies". + * @type \Google\Cloud\Retail\V2\Interval $interval + * Interval value for a facet, such as [10, 20) for facet "price". + * @type int|string $count + * Number of items that have this facet value. + * @type float $min_value + * The minimum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * @type float $max_value + * The maximum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Text value of a facet, such as "Black" for facet "colorFamilies". + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->readOneof(1); + } + + public function hasValue() + { + return $this->hasOneof(1); + } + + /** + * Text value of a facet, such as "Black" for facet "colorFamilies". + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Interval value for a facet, such as [10, 20) for facet "price". + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @return \Google\Cloud\Retail\V2\Interval|null + */ + public function getInterval() + { + return $this->readOneof(2); + } + + public function hasInterval() + { + return $this->hasOneof(2); + } + + /** + * Interval value for a facet, such as [10, 20) for facet "price". + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @param \Google\Cloud\Retail\V2\Interval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Number of items that have this facet value. + * + * Generated from protobuf field int64 count = 3; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * Number of items that have this facet value. + * + * Generated from protobuf field int64 count = 3; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * The minimum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double min_value = 5; + * @return float + */ + public function getMinValue() + { + return $this->min_value; + } + + /** + * The minimum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double min_value = 5; + * @param float $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkDouble($var); + $this->min_value = $var; + + return $this; + } + + /** + * The maximum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double max_value = 6; + * @return float + */ + public function getMaxValue() + { + return $this->max_value; + } + + /** + * The maximum value in the + * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. + * Only supported on numerical facets and returned if + * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] + * is true. + * + * Generated from protobuf field double max_value = 6; + * @param float $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkDouble($var); + $this->max_value = $var; + + return $this; + } + + /** + * @return string + */ + public function getFacetValue() + { + return $this->whichOneof("facet_value"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FacetValue::class, \Google\Cloud\Retail\V2\SearchResponse_Facet_FacetValue::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php new file mode 100644 index 00000000000..dd4c806bd4d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php @@ -0,0 +1,117 @@ +google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + */ +class QueryExpansionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Bool describing whether query expansion has occurred. + * + * Generated from protobuf field bool expanded_query = 1; + */ + protected $expanded_query = false; + /** + * Number of pinned results. This field will only be set when expansion + * happens and + * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + * is set to true. + * + * Generated from protobuf field int64 pinned_result_count = 2; + */ + protected $pinned_result_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $expanded_query + * Bool describing whether query expansion has occurred. + * @type int|string $pinned_result_count + * Number of pinned results. This field will only be set when expansion + * happens and + * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + * is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Bool describing whether query expansion has occurred. + * + * Generated from protobuf field bool expanded_query = 1; + * @return bool + */ + public function getExpandedQuery() + { + return $this->expanded_query; + } + + /** + * Bool describing whether query expansion has occurred. + * + * Generated from protobuf field bool expanded_query = 1; + * @param bool $var + * @return $this + */ + public function setExpandedQuery($var) + { + GPBUtil::checkBool($var); + $this->expanded_query = $var; + + return $this; + } + + /** + * Number of pinned results. This field will only be set when expansion + * happens and + * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + * is set to true. + * + * Generated from protobuf field int64 pinned_result_count = 2; + * @return int|string + */ + public function getPinnedResultCount() + { + return $this->pinned_result_count; + } + + /** + * Number of pinned results. This field will only be set when expansion + * happens and + * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + * is set to true. + * + * Generated from protobuf field int64 pinned_result_count = 2; + * @param int|string $var + * @return $this + */ + public function setPinnedResultCount($var) + { + GPBUtil::checkInt64($var); + $this->pinned_result_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryExpansionInfo::class, \Google\Cloud\Retail\V2\SearchResponse_QueryExpansionInfo::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php new file mode 100644 index 00000000000..ecb713bf269 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php @@ -0,0 +1,486 @@ +google.cloud.retail.v2.SearchResponse.SearchResult + */ +class SearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * [Product.id][google.cloud.retail.v2.Product.id] of the searched + * [Product][google.cloud.retail.v2.Product]. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The product data snippet in the search response. Only + * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be + * populated. + * [Product.variants][google.cloud.retail.v2.Product.variants] contains the + * product variants that match the search query. If there are multiple + * product variants matching the query, top 5 most relevant product variants + * are returned and ordered by relevancy. + * If relevancy can be deternmined, use + * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] + * to look up matched product variants fields. If relevancy cannot be + * determined, e.g. when searching "shoe" all products in a shoe product can + * be a match, 5 product variants are returned but order is meaningless. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; + */ + protected $product = null; + /** + * The count of matched + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field int32 matching_variant_count = 3; + */ + protected $matching_variant_count = 0; + /** + * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] matches the search query, this + * map indicates which [Product][google.cloud.retail.v2.Product] fields are + * matched. The key is the + * [Product.name][google.cloud.retail.v2.Product.name], the value is a field + * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If + * matched attributes cannot be determined, this map will be empty. + * For example, a key "sku1" with field mask + * "products.color_info" indicates there is a match between + * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. + * + * Generated from protobuf field map matching_variant_fields = 4; + */ + private $matching_variant_fields; + /** + * The rollup matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] attributes. The key is one of + * the + * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. + * The values are the merged and de-duplicated + * [Product][google.cloud.retail.v2.Product] attributes. Notice that the + * rollup values are respect filter. For example, when filtering by + * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + * returned. + * For textual and numerical attributes, the rollup values is a list of + * string or double values with type + * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + * there are two variants with colors "red" and "blue", the rollup values + * are + * { key: "colorFamilies" + * value { + * list_value { + * values { string_value: "red" } + * values { string_value: "blue" } + * } + * } + * } + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup + * values is a double value with type + * [google.protobuf.Value][google.protobuf.Value]. For example, + * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there + * are 10 variants in this product are available in the store "store1". + * + * Generated from protobuf field map variant_rollup_values = 5; + */ + private $variant_rollup_values; + /** + * Specifies previous events related to this product for this user based on + * [UserEvent][google.cloud.retail.v2.UserEvent] with same + * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] + * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. + * This is set only when + * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] + * is + * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * Possible values: + * * `purchased`: Indicates that this product has been purchased before. + * + * Generated from protobuf field repeated string personal_labels = 7; + */ + private $personal_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Product.id][google.cloud.retail.v2.Product.id] of the searched + * [Product][google.cloud.retail.v2.Product]. + * @type \Google\Cloud\Retail\V2\Product $product + * The product data snippet in the search response. Only + * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be + * populated. + * [Product.variants][google.cloud.retail.v2.Product.variants] contains the + * product variants that match the search query. If there are multiple + * product variants matching the query, top 5 most relevant product variants + * are returned and ordered by relevancy. + * If relevancy can be deternmined, use + * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] + * to look up matched product variants fields. If relevancy cannot be + * determined, e.g. when searching "shoe" all products in a shoe product can + * be a match, 5 product variants are returned but order is meaningless. + * @type int $matching_variant_count + * The count of matched + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. + * @type array|\Google\Protobuf\Internal\MapField $matching_variant_fields + * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] matches the search query, this + * map indicates which [Product][google.cloud.retail.v2.Product] fields are + * matched. The key is the + * [Product.name][google.cloud.retail.v2.Product.name], the value is a field + * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If + * matched attributes cannot be determined, this map will be empty. + * For example, a key "sku1" with field mask + * "products.color_info" indicates there is a match between + * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. + * @type array|\Google\Protobuf\Internal\MapField $variant_rollup_values + * The rollup matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] attributes. The key is one of + * the + * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. + * The values are the merged and de-duplicated + * [Product][google.cloud.retail.v2.Product] attributes. Notice that the + * rollup values are respect filter. For example, when filtering by + * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + * returned. + * For textual and numerical attributes, the rollup values is a list of + * string or double values with type + * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + * there are two variants with colors "red" and "blue", the rollup values + * are + * { key: "colorFamilies" + * value { + * list_value { + * values { string_value: "red" } + * values { string_value: "blue" } + * } + * } + * } + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup + * values is a double value with type + * [google.protobuf.Value][google.protobuf.Value]. For example, + * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there + * are 10 variants in this product are available in the store "store1". + * @type array|\Google\Protobuf\Internal\RepeatedField $personal_labels + * Specifies previous events related to this product for this user based on + * [UserEvent][google.cloud.retail.v2.UserEvent] with same + * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] + * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. + * This is set only when + * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] + * is + * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * Possible values: + * * `purchased`: Indicates that this product has been purchased before. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * [Product.id][google.cloud.retail.v2.Product.id] of the searched + * [Product][google.cloud.retail.v2.Product]. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * [Product.id][google.cloud.retail.v2.Product.id] of the searched + * [Product][google.cloud.retail.v2.Product]. + * + * 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; + } + + /** + * The product data snippet in the search response. Only + * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be + * populated. + * [Product.variants][google.cloud.retail.v2.Product.variants] contains the + * product variants that match the search query. If there are multiple + * product variants matching the query, top 5 most relevant product variants + * are returned and ordered by relevancy. + * If relevancy can be deternmined, use + * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] + * to look up matched product variants fields. If relevancy cannot be + * determined, e.g. when searching "shoe" all products in a shoe product can + * be a match, 5 product variants are returned but order is meaningless. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; + * @return \Google\Cloud\Retail\V2\Product|null + */ + public function getProduct() + { + return $this->product; + } + + public function hasProduct() + { + return isset($this->product); + } + + public function clearProduct() + { + unset($this->product); + } + + /** + * The product data snippet in the search response. Only + * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be + * populated. + * [Product.variants][google.cloud.retail.v2.Product.variants] contains the + * product variants that match the search query. If there are multiple + * product variants matching the query, top 5 most relevant product variants + * are returned and ordered by relevancy. + * If relevancy can be deternmined, use + * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] + * to look up matched product variants fields. If relevancy cannot be + * determined, e.g. when searching "shoe" all products in a shoe product can + * be a match, 5 product variants are returned but order is meaningless. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; + * @param \Google\Cloud\Retail\V2\Product $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); + $this->product = $var; + + return $this; + } + + /** + * The count of matched + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field int32 matching_variant_count = 3; + * @return int + */ + public function getMatchingVariantCount() + { + return $this->matching_variant_count; + } + + /** + * The count of matched + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s. + * + * Generated from protobuf field int32 matching_variant_count = 3; + * @param int $var + * @return $this + */ + public function setMatchingVariantCount($var) + { + GPBUtil::checkInt32($var); + $this->matching_variant_count = $var; + + return $this; + } + + /** + * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] matches the search query, this + * map indicates which [Product][google.cloud.retail.v2.Product] fields are + * matched. The key is the + * [Product.name][google.cloud.retail.v2.Product.name], the value is a field + * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If + * matched attributes cannot be determined, this map will be empty. + * For example, a key "sku1" with field mask + * "products.color_info" indicates there is a match between + * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. + * + * Generated from protobuf field map matching_variant_fields = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMatchingVariantFields() + { + return $this->matching_variant_fields; + } + + /** + * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] matches the search query, this + * map indicates which [Product][google.cloud.retail.v2.Product] fields are + * matched. The key is the + * [Product.name][google.cloud.retail.v2.Product.name], the value is a field + * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If + * matched attributes cannot be determined, this map will be empty. + * For example, a key "sku1" with field mask + * "products.color_info" indicates there is a match between + * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. + * + * Generated from protobuf field map matching_variant_fields = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMatchingVariantFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\FieldMask::class); + $this->matching_variant_fields = $arr; + + return $this; + } + + /** + * The rollup matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] attributes. The key is one of + * the + * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. + * The values are the merged and de-duplicated + * [Product][google.cloud.retail.v2.Product] attributes. Notice that the + * rollup values are respect filter. For example, when filtering by + * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + * returned. + * For textual and numerical attributes, the rollup values is a list of + * string or double values with type + * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + * there are two variants with colors "red" and "blue", the rollup values + * are + * { key: "colorFamilies" + * value { + * list_value { + * values { string_value: "red" } + * values { string_value: "blue" } + * } + * } + * } + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup + * values is a double value with type + * [google.protobuf.Value][google.protobuf.Value]. For example, + * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there + * are 10 variants in this product are available in the store "store1". + * + * Generated from protobuf field map variant_rollup_values = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getVariantRollupValues() + { + return $this->variant_rollup_values; + } + + /** + * The rollup matching + * [variant][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product] attributes. The key is one of + * the + * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. + * The values are the merged and de-duplicated + * [Product][google.cloud.retail.v2.Product] attributes. Notice that the + * rollup values are respect filter. For example, when filtering by + * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + * returned. + * For textual and numerical attributes, the rollup values is a list of + * string or double values with type + * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + * there are two variants with colors "red" and "blue", the rollup values + * are + * { key: "colorFamilies" + * value { + * list_value { + * values { string_value: "red" } + * values { string_value: "blue" } + * } + * } + * } + * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup + * values is a double value with type + * [google.protobuf.Value][google.protobuf.Value]. For example, + * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there + * are 10 variants in this product are available in the store "store1". + * + * Generated from protobuf field map variant_rollup_values = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setVariantRollupValues($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->variant_rollup_values = $arr; + + return $this; + } + + /** + * Specifies previous events related to this product for this user based on + * [UserEvent][google.cloud.retail.v2.UserEvent] with same + * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] + * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. + * This is set only when + * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] + * is + * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * Possible values: + * * `purchased`: Indicates that this product has been purchased before. + * + * Generated from protobuf field repeated string personal_labels = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPersonalLabels() + { + return $this->personal_labels; + } + + /** + * Specifies previous events related to this product for this user based on + * [UserEvent][google.cloud.retail.v2.UserEvent] with same + * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] + * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. + * This is set only when + * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] + * is + * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + * Possible values: + * * `purchased`: Indicates that this product has been purchased before. + * + * Generated from protobuf field repeated string personal_labels = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPersonalLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->personal_labels = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SearchResult::class, \Google\Cloud\Retail\V2\SearchResponse_SearchResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php new file mode 100644 index 00000000000..a60faf38281 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.SearchResponse.TileNavigationResult + */ +class TileNavigationResult extends \Google\Protobuf\Internal\Message +{ + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + */ + private $tiles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $tiles + * The current tiles that are used for tile navigation, sorted by + * engagement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTiles() + { + return $this->tiles; + } + + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); + $this->tiles = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TileNavigationResult::class, \Google\Cloud\Retail\V2\SearchResponse_TileNavigationResult::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php new file mode 100644 index 00000000000..8c9ecd07a29 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.SearchSolutionUseCase + */ +class SearchSolutionUseCase +{ + /** + * The value when it's unspecified. In this case, server behavior defaults to + * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]. + * + * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + */ + const SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + /** + * Search use case. Expects the traffic has a non-empty + * [query][google.cloud.retail.v2.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + */ + const SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + /** + * Browse use case. Expects the traffic has an empty + * [query][google.cloud.retail.v2.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + */ + const SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + + private static $valueToName = [ + self::SEARCH_SOLUTION_USE_CASE_UNSPECIFIED => 'SEARCH_SOLUTION_USE_CASE_UNSPECIFIED', + self::SEARCH_SOLUTION_USE_CASE_SEARCH => 'SEARCH_SOLUTION_USE_CASE_SEARCH', + self::SEARCH_SOLUTION_USE_CASE_BROWSE => 'SEARCH_SOLUTION_USE_CASE_BROWSE', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php new file mode 100644 index 00000000000..b533b8d2bdb --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php @@ -0,0 +1,1258 @@ +google.cloud.retail.v2.ServingConfig + */ +class ServingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/servingConfig/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The human readable serving config display name. Used in Retail + * UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] + * to use at serving time. Currently only RecommendationModels are supported: + * https://cloud.google.com/retail/recommendations-ai/docs/create-models + * Can be changed but only to a compatible model (e.g. + * others-you-may-like CTR to others-you-may-like CVR). + * Required when + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string model_id = 3; + */ + protected $model_id = ''; + /** + * How much price ranking we want in serving results. + * Price reranking causes product items with a similar + * recommendation probability to be ordered by price, with the + * highest-priced items first. This setting could result in a decrease in + * click-through and conversion rates. + * Allowed values are: + * * `no-price-reranking` + * * `low-price-reranking` + * * `medium-price-reranking` + * * `high-price-reranking` + * If not specified, we choose default based on model type. Default value: + * `no-price-reranking`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string price_reranking_level = 4; + */ + protected $price_reranking_level = ''; + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] + * resources with only the Facet control set. These controls are assumed to be + * in the same [Catalog][google.cloud.retail.v2.Catalog] as the + * [ServingConfig][google.cloud.retail.v2.ServingConfig]. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string facet_control_ids = 5; + */ + private $facet_control_ids; + /** + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + */ + protected $dynamic_facet_spec = null; + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifications, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 100. + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string boost_control_ids = 7; + */ + private $boost_control_ids; + /** + * Condition filter specifications. If a product matches multiple conditions + * in the specifications, filters from these specifications are all + * applied and combined via the AND operator. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string filter_control_ids = 9; + */ + private $filter_control_ids; + /** + * Condition redirect specifications. Only the first triggered redirect action + * is applied, even if multiple apply. Maximum number of specifications is + * 1000. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string redirect_control_ids = 10; + */ + private $redirect_control_ids; + /** + * Condition synonyms specifications. If multiple syonyms conditions match, + * all matching synonyms control in the list will execute. Order of controls + * in the list will not matter. Maximum number of specifications is + * 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; + */ + private $twoway_synonyms_control_ids; + /** + * Condition oneway synonyms specifications. If multiple oneway synonyms + * conditions match, all matching oneway synonyms controls in the list will + * execute. Order of controls in the list will not matter. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; + */ + private $oneway_synonyms_control_ids; + /** + * Condition do not associate specifications. If multiple do not associate + * conditions match, all matching do not associate controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string do_not_associate_control_ids = 13; + */ + private $do_not_associate_control_ids; + /** + * Condition replacement specifications. + * - Applied according to the order in the list. + * - A previously replaced term can not be re-replaced. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string replacement_control_ids = 14; + */ + private $replacement_control_ids; + /** + * Condition ignore specifications. If multiple ignore + * conditions match, all matching ignore controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string ignore_control_ids = 15; + */ + private $ignore_control_ids; + /** + * How much diversity to use in recommendation model results e.g. + * `medium-diversity` or `high-diversity`. Currently supported values: + * * `no-diversity` + * * `low-diversity` + * * `medium-diversity` + * * `high-diversity` + * * `auto-diversity` + * If not specified, we choose default based on recommendation model + * type. Default value: `no-diversity`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string diversity_level = 8; + */ + protected $diversity_level = ''; + /** + * What kind of diversity to use - data driven or rule based. If unset, the + * server behavior defaults to + * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; + */ + protected $diversity_type = 0; + /** + * Whether to add additional category filters on the `similar-items` model. + * If not specified, we enable it by default. + * Allowed values are: + * * `no-category-match`: No additional filtering of original results from + * the model and the customer's filters. + * * `relaxed-category-match`: Only keep results with categories that match + * at least one item categories in the PredictRequests's context item. + * * If customer also sends filters in the PredictRequest, then the results + * will satisfy both conditions (user given and category match). + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string enable_category_filter_level = 16; + */ + protected $enable_category_filter_level = ''; + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + */ + protected $ignore_recs_denylist = false; + /** + * The specification for personalization spec. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; + */ + protected $personalization_spec = null; + /** + * Required. Immutable. Specifies the solution types that a serving config can + * be associated with. Currently we support setting only one type of solution. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + private $solution_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/servingConfig/*` + * @type string $display_name + * Required. The human readable serving config display name. Used in Retail + * UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $model_id + * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] + * to use at serving time. Currently only RecommendationModels are supported: + * https://cloud.google.com/retail/recommendations-ai/docs/create-models + * Can be changed but only to a compatible model (e.g. + * others-you-may-like CTR to others-you-may-like CVR). + * Required when + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * @type string $price_reranking_level + * How much price ranking we want in serving results. + * Price reranking causes product items with a similar + * recommendation probability to be ordered by price, with the + * highest-priced items first. This setting could result in a decrease in + * click-through and conversion rates. + * Allowed values are: + * * `no-price-reranking` + * * `low-price-reranking` + * * `medium-price-reranking` + * * `high-price-reranking` + * If not specified, we choose default based on model type. Default value: + * `no-price-reranking`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * @type array|\Google\Protobuf\Internal\RepeatedField $facet_control_ids + * Facet specifications for faceted search. If empty, no facets are returned. + * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] + * resources with only the Facet control set. These controls are assumed to be + * in the same [Catalog][google.cloud.retail.v2.Catalog] as the + * [ServingConfig][google.cloud.retail.v2.ServingConfig]. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $dynamic_facet_spec + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $boost_control_ids + * Condition boost specifications. If a product matches multiple conditions + * in the specifications, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 100. + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $filter_control_ids + * Condition filter specifications. If a product matches multiple conditions + * in the specifications, filters from these specifications are all + * applied and combined via the AND operator. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $redirect_control_ids + * Condition redirect specifications. Only the first triggered redirect action + * is applied, even if multiple apply. Maximum number of specifications is + * 1000. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $twoway_synonyms_control_ids + * Condition synonyms specifications. If multiple syonyms conditions match, + * all matching synonyms control in the list will execute. Order of controls + * in the list will not matter. Maximum number of specifications is + * 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $oneway_synonyms_control_ids + * Condition oneway synonyms specifications. If multiple oneway synonyms + * conditions match, all matching oneway synonyms controls in the list will + * execute. Order of controls in the list will not matter. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $do_not_associate_control_ids + * Condition do not associate specifications. If multiple do not associate + * conditions match, all matching do not associate controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $replacement_control_ids + * Condition replacement specifications. + * - Applied according to the order in the list. + * - A previously replaced term can not be re-replaced. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_control_ids + * Condition ignore specifications. If multiple ignore + * conditions match, all matching ignore controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type string $diversity_level + * How much diversity to use in recommendation model results e.g. + * `medium-diversity` or `high-diversity`. Currently supported values: + * * `no-diversity` + * * `low-diversity` + * * `medium-diversity` + * * `high-diversity` + * * `auto-diversity` + * If not specified, we choose default based on recommendation model + * type. Default value: `no-diversity`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * @type int $diversity_type + * What kind of diversity to use - data driven or rule based. If unset, the + * server behavior defaults to + * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. + * @type string $enable_category_filter_level + * Whether to add additional category filters on the `similar-items` model. + * If not specified, we enable it by default. + * Allowed values are: + * * `no-category-match`: No additional filtering of original results from + * the model and the customer's filters. + * * `relaxed-category-match`: Only keep results with categories that match + * at least one item categories in the PredictRequests's context item. + * * If customer also sends filters in the PredictRequest, then the results + * will satisfy both conditions (user given and category match). + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * @type bool $ignore_recs_denylist + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * @type \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $personalization_spec + * The specification for personalization spec. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * @type array|\Google\Protobuf\Internal\RepeatedField $solution_types + * Required. Immutable. Specifies the solution types that a serving config can + * be associated with. Currently we support setting only one type of solution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/servingConfig/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/catalogs/*/servingConfig/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The human readable serving config display name. Used in Retail + * UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The human readable serving config display name. Used in Retail + * UI. + * This field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] + * to use at serving time. Currently only RecommendationModels are supported: + * https://cloud.google.com/retail/recommendations-ai/docs/create-models + * Can be changed but only to a compatible model (e.g. + * others-you-may-like CTR to others-you-may-like CVR). + * Required when + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string model_id = 3; + * @return string + */ + public function getModelId() + { + return $this->model_id; + } + + /** + * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] + * to use at serving time. Currently only RecommendationModels are supported: + * https://cloud.google.com/retail/recommendations-ai/docs/create-models + * Can be changed but only to a compatible model (e.g. + * others-you-may-like CTR to others-you-may-like CVR). + * Required when + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string model_id = 3; + * @param string $var + * @return $this + */ + public function setModelId($var) + { + GPBUtil::checkString($var, True); + $this->model_id = $var; + + return $this; + } + + /** + * How much price ranking we want in serving results. + * Price reranking causes product items with a similar + * recommendation probability to be ordered by price, with the + * highest-priced items first. This setting could result in a decrease in + * click-through and conversion rates. + * Allowed values are: + * * `no-price-reranking` + * * `low-price-reranking` + * * `medium-price-reranking` + * * `high-price-reranking` + * If not specified, we choose default based on model type. Default value: + * `no-price-reranking`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string price_reranking_level = 4; + * @return string + */ + public function getPriceRerankingLevel() + { + return $this->price_reranking_level; + } + + /** + * How much price ranking we want in serving results. + * Price reranking causes product items with a similar + * recommendation probability to be ordered by price, with the + * highest-priced items first. This setting could result in a decrease in + * click-through and conversion rates. + * Allowed values are: + * * `no-price-reranking` + * * `low-price-reranking` + * * `medium-price-reranking` + * * `high-price-reranking` + * If not specified, we choose default based on model type. Default value: + * `no-price-reranking`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string price_reranking_level = 4; + * @param string $var + * @return $this + */ + public function setPriceRerankingLevel($var) + { + GPBUtil::checkString($var, True); + $this->price_reranking_level = $var; + + return $this; + } + + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] + * resources with only the Facet control set. These controls are assumed to be + * in the same [Catalog][google.cloud.retail.v2.Catalog] as the + * [ServingConfig][google.cloud.retail.v2.ServingConfig]. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string facet_control_ids = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetControlIds() + { + return $this->facet_control_ids; + } + + /** + * Facet specifications for faceted search. If empty, no facets are returned. + * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] + * resources with only the Facet control set. These controls are assumed to be + * in the same [Catalog][google.cloud.retail.v2.Catalog] as the + * [ServingConfig][google.cloud.retail.v2.ServingConfig]. + * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + * is returned. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string facet_control_ids = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->facet_control_ids = $arr; + + return $this; + } + + /** + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * @return \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec|null + */ + public function getDynamicFacetSpec() + { + return $this->dynamic_facet_spec; + } + + public function hasDynamicFacetSpec() + { + return isset($this->dynamic_facet_spec); + } + + public function clearDynamicFacetSpec() + { + unset($this->dynamic_facet_spec); + } + + /** + * The specification for dynamically generated facets. Notice that only + * textual facets can be dynamically generated. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * @param \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $var + * @return $this + */ + public function setDynamicFacetSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec::class); + $this->dynamic_facet_spec = $var; + + return $this; + } + + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifications, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 100. + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string boost_control_ids = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBoostControlIds() + { + return $this->boost_control_ids; + } + + /** + * Condition boost specifications. If a product matches multiple conditions + * in the specifications, boost scores from these specifications are all + * applied and combined in a non-linear way. Maximum number of + * specifications is 100. + * Notice that if both + * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] + * and + * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] + * are set, the boost conditions from both places are evaluated. If a search + * request matches multiple boost conditions, the final boost score is equal + * to the sum of the boost scores from all matched boost conditions. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string boost_control_ids = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBoostControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->boost_control_ids = $arr; + + return $this; + } + + /** + * Condition filter specifications. If a product matches multiple conditions + * in the specifications, filters from these specifications are all + * applied and combined via the AND operator. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string filter_control_ids = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilterControlIds() + { + return $this->filter_control_ids; + } + + /** + * Condition filter specifications. If a product matches multiple conditions + * in the specifications, filters from these specifications are all + * applied and combined via the AND operator. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string filter_control_ids = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilterControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->filter_control_ids = $arr; + + return $this; + } + + /** + * Condition redirect specifications. Only the first triggered redirect action + * is applied, even if multiple apply. Maximum number of specifications is + * 1000. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string redirect_control_ids = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRedirectControlIds() + { + return $this->redirect_control_ids; + } + + /** + * Condition redirect specifications. Only the first triggered redirect action + * is applied, even if multiple apply. Maximum number of specifications is + * 1000. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string redirect_control_ids = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRedirectControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->redirect_control_ids = $arr; + + return $this; + } + + /** + * Condition synonyms specifications. If multiple syonyms conditions match, + * all matching synonyms control in the list will execute. Order of controls + * in the list will not matter. Maximum number of specifications is + * 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTwowaySynonymsControlIds() + { + return $this->twoway_synonyms_control_ids; + } + + /** + * Condition synonyms specifications. If multiple syonyms conditions match, + * all matching synonyms control in the list will execute. Order of controls + * in the list will not matter. Maximum number of specifications is + * 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTwowaySynonymsControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->twoway_synonyms_control_ids = $arr; + + return $this; + } + + /** + * Condition oneway synonyms specifications. If multiple oneway synonyms + * conditions match, all matching oneway synonyms controls in the list will + * execute. Order of controls in the list will not matter. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOnewaySynonymsControlIds() + { + return $this->oneway_synonyms_control_ids; + } + + /** + * Condition oneway synonyms specifications. If multiple oneway synonyms + * conditions match, all matching oneway synonyms controls in the list will + * execute. Order of controls in the list will not matter. Maximum number of + * specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOnewaySynonymsControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->oneway_synonyms_control_ids = $arr; + + return $this; + } + + /** + * Condition do not associate specifications. If multiple do not associate + * conditions match, all matching do not associate controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string do_not_associate_control_ids = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDoNotAssociateControlIds() + { + return $this->do_not_associate_control_ids; + } + + /** + * Condition do not associate specifications. If multiple do not associate + * conditions match, all matching do not associate controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string do_not_associate_control_ids = 13; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDoNotAssociateControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->do_not_associate_control_ids = $arr; + + return $this; + } + + /** + * Condition replacement specifications. + * - Applied according to the order in the list. + * - A previously replaced term can not be re-replaced. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string replacement_control_ids = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplacementControlIds() + { + return $this->replacement_control_ids; + } + + /** + * Condition replacement specifications. + * - Applied according to the order in the list. + * - A previously replaced term can not be re-replaced. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string replacement_control_ids = 14; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplacementControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replacement_control_ids = $arr; + + return $this; + } + + /** + * Condition ignore specifications. If multiple ignore + * conditions match, all matching ignore controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string ignore_control_ids = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoreControlIds() + { + return $this->ignore_control_ids; + } + + /** + * Condition ignore specifications. If multiple ignore + * conditions match, all matching ignore controls in the list will + * execute. + * - Order does not matter. + * - Maximum number of specifications is 100. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated string ignore_control_ids = 15; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoreControlIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ignore_control_ids = $arr; + + return $this; + } + + /** + * How much diversity to use in recommendation model results e.g. + * `medium-diversity` or `high-diversity`. Currently supported values: + * * `no-diversity` + * * `low-diversity` + * * `medium-diversity` + * * `high-diversity` + * * `auto-diversity` + * If not specified, we choose default based on recommendation model + * type. Default value: `no-diversity`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string diversity_level = 8; + * @return string + */ + public function getDiversityLevel() + { + return $this->diversity_level; + } + + /** + * How much diversity to use in recommendation model results e.g. + * `medium-diversity` or `high-diversity`. Currently supported values: + * * `no-diversity` + * * `low-diversity` + * * `medium-diversity` + * * `high-diversity` + * * `auto-diversity` + * If not specified, we choose default based on recommendation model + * type. Default value: `no-diversity`. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string diversity_level = 8; + * @param string $var + * @return $this + */ + public function setDiversityLevel($var) + { + GPBUtil::checkString($var, True); + $this->diversity_level = $var; + + return $this; + } + + /** + * What kind of diversity to use - data driven or rule based. If unset, the + * server behavior defaults to + * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; + * @return int + */ + public function getDiversityType() + { + return $this->diversity_type; + } + + /** + * What kind of diversity to use - data driven or rule based. If unset, the + * server behavior defaults to + * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; + * @param int $var + * @return $this + */ + public function setDiversityType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\ServingConfig\DiversityType::class); + $this->diversity_type = $var; + + return $this; + } + + /** + * Whether to add additional category filters on the `similar-items` model. + * If not specified, we enable it by default. + * Allowed values are: + * * `no-category-match`: No additional filtering of original results from + * the model and the customer's filters. + * * `relaxed-category-match`: Only keep results with categories that match + * at least one item categories in the PredictRequests's context item. + * * If customer also sends filters in the PredictRequest, then the results + * will satisfy both conditions (user given and category match). + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string enable_category_filter_level = 16; + * @return string + */ + public function getEnableCategoryFilterLevel() + { + return $this->enable_category_filter_level; + } + + /** + * Whether to add additional category filters on the `similar-items` model. + * If not specified, we enable it by default. + * Allowed values are: + * * `no-category-match`: No additional filtering of original results from + * the model and the customer's filters. + * * `relaxed-category-match`: Only keep results with categories that match + * at least one item categories in the PredictRequests's context item. + * * If customer also sends filters in the PredictRequest, then the results + * will satisfy both conditions (user given and category match). + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * + * Generated from protobuf field string enable_category_filter_level = 16; + * @param string $var + * @return $this + */ + public function setEnableCategoryFilterLevel($var) + { + GPBUtil::checkString($var, True); + $this->enable_category_filter_level = $var; + + return $this; + } + + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + * @return bool + */ + public function getIgnoreRecsDenylist() + { + return $this->ignore_recs_denylist; + } + + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + * @param bool $var + * @return $this + */ + public function setIgnoreRecsDenylist($var) + { + GPBUtil::checkBool($var); + $this->ignore_recs_denylist = $var; + + return $this; + } + + /** + * The specification for personalization spec. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; + * @return \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec|null + */ + public function getPersonalizationSpec() + { + return $this->personalization_spec; + } + + public function hasPersonalizationSpec() + { + return isset($this->personalization_spec); + } + + public function clearPersonalizationSpec() + { + unset($this->personalization_spec); + } + + /** + * The specification for personalization spec. + * Can only be set if + * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + * Notice that if both + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] + * and + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * are set. + * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] + * will override + * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; + * @param \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $var + * @return $this + */ + public function setPersonalizationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec::class); + $this->personalization_spec = $var; + + return $this; + } + + /** + * Required. Immutable. Specifies the solution types that a serving config can + * be associated with. Currently we support setting only one type of solution. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSolutionTypes() + { + return $this->solution_types; + } + + /** + * Required. Immutable. Specifies the solution types that a serving config can + * be associated with. Currently we support setting only one type of solution. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSolutionTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SolutionType::class); + $this->solution_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php new file mode 100644 index 00000000000..dd7183c45df --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php @@ -0,0 +1,64 @@ +google.cloud.retail.v2.ServingConfig.DiversityType + */ +class DiversityType +{ + /** + * Default value. + * + * Generated from protobuf enum DIVERSITY_TYPE_UNSPECIFIED = 0; + */ + const DIVERSITY_TYPE_UNSPECIFIED = 0; + /** + * Rule based diversity. + * + * Generated from protobuf enum RULE_BASED_DIVERSITY = 2; + */ + const RULE_BASED_DIVERSITY = 2; + /** + * Data driven diversity. + * + * Generated from protobuf enum DATA_DRIVEN_DIVERSITY = 3; + */ + const DATA_DRIVEN_DIVERSITY = 3; + + private static $valueToName = [ + self::DIVERSITY_TYPE_UNSPECIFIED => 'DIVERSITY_TYPE_UNSPECIFIED', + self::RULE_BASED_DIVERSITY => 'RULE_BASED_DIVERSITY', + self::DATA_DRIVEN_DIVERSITY => 'DATA_DRIVEN_DIVERSITY', + ]; + + 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(DiversityType::class, \Google\Cloud\Retail\V2\ServingConfig_DiversityType::class); + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php new file mode 100644 index 00000000000..34c283f0ae3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php @@ -0,0 +1,231 @@ +google.cloud.retail.v2.SetDefaultBranchRequest + */ +class SetDefaultBranchRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + */ + protected $catalog = ''; + /** + * The final component of the resource name of a branch. + * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + * error is returned. + * If there are no sufficient active products in the targeted branch and + * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a + * FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { + */ + protected $branch_id = ''; + /** + * Some note on this request, this can be retrieved by + * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] + * before next valid default branch set occurs. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string note = 3; + */ + protected $note = ''; + /** + * If set to true, it permits switching to a branch with + * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even + * if it has no sufficient active products. + * + * Generated from protobuf field bool force = 4; + */ + protected $force = false; + + /** + * @param string $catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * @return \Google\Cloud\Retail\V2\SetDefaultBranchRequest + * + * @experimental + */ + public static function build(string $catalog): self + { + return (new self()) + ->setCatalog($catalog); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @type string $branch_id + * The final component of the resource name of a branch. + * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + * error is returned. + * If there are no sufficient active products in the targeted branch and + * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a + * FAILED_PRECONDITION error is returned. + * @type string $note + * Some note on this request, this can be retrieved by + * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] + * before next valid default branch set occurs. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type bool $force + * If set to true, it permits switching to a branch with + * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even + * if it has no sufficient active products. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * The final component of the resource name of a branch. + * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + * error is returned. + * If there are no sufficient active products in the targeted branch and + * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a + * FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getBranchId() + { + return $this->branch_id; + } + + /** + * The final component of the resource name of a branch. + * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + * error is returned. + * If there are no sufficient active products in the targeted branch and + * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a + * FAILED_PRECONDITION error is returned. + * + * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBranchId($var) + { + GPBUtil::checkString($var, True); + $this->branch_id = $var; + + return $this; + } + + /** + * Some note on this request, this can be retrieved by + * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] + * before next valid default branch set occurs. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string note = 3; + * @return string + */ + public function getNote() + { + return $this->note; + } + + /** + * Some note on this request, this can be retrieved by + * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] + * before next valid default branch set occurs. + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string note = 3; + * @param string $var + * @return $this + */ + public function setNote($var) + { + GPBUtil::checkString($var, True); + $this->note = $var; + + return $this; + } + + /** + * If set to true, it permits switching to a branch with + * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even + * if it has no sufficient active products. + * + * Generated from protobuf field bool force = 4; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * If set to true, it permits switching to a branch with + * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even + * if it has no sufficient active products. + * + * Generated from protobuf field bool force = 4; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php new file mode 100644 index 00000000000..5aa2ae4985f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.SetInventoryMetadata + */ +class SetInventoryMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php new file mode 100644 index 00000000000..80cbe2a78bd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php @@ -0,0 +1,507 @@ +google.cloud.retail.v2.SetInventoryRequest + */ +class SetInventoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The inventory information to update. The allowable fields to + * update are: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + * If + * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] + * is empty or invalid, an INVALID_ARGUMENT error is returned. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether + * or not it exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not have + * existing inventory information, the provided inventory information will be + * inserted. + * If the [Product][google.cloud.retail.v2.Product] to update has existing + * inventory information, the provided inventory information will be merged + * while respecting the last update time for each inventory field, using the + * provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * * Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * The last update time is recorded for the following inventory fields: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * If a full overwrite of inventory information while ignoring timestamps is + * needed, + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * should be invoked instead. + * + * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $inventory = null; + /** + * Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. + * At least one field must be provided. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; + */ + protected $set_mask = null; + /** + * The time when the request is issued, used to prevent + * out-of-order updates on inventory fields with the last update time + * recorded. If not provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; + */ + protected $set_time = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] with name + * [Product.name][google.cloud.retail.v2.Product.name] is not found, the + * inventory update will still be processed and retained for at most 1 day + * until the [Product][google.cloud.retail.v2.Product] is created. If set to + * false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 4; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Retail\V2\Product $inventory Required. The inventory information to update. The allowable fields to + * update are: + * + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + * + * If + * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] + * is empty or invalid, an INVALID_ARGUMENT error is returned. + * + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether + * or not it exists, a PERMISSION_DENIED error is returned. + * + * If the [Product][google.cloud.retail.v2.Product] to update does not have + * existing inventory information, the provided inventory information will be + * inserted. + * + * If the [Product][google.cloud.retail.v2.Product] to update has existing + * inventory information, the provided inventory information will be merged + * while respecting the last update time for each inventory field, using the + * provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. + * + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * * Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * + * The last update time is recorded for the following inventory fields: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * + * If a full overwrite of inventory information while ignoring timestamps is + * needed, + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * should be invoked instead. + * @param \Google\Protobuf\FieldMask $setMask Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. + * + * At least one field must be provided. + * + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * @return \Google\Cloud\Retail\V2\SetInventoryRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\Product $inventory, \Google\Protobuf\FieldMask $setMask): self + { + return (new self()) + ->setInventory($inventory) + ->setSetMask($setMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Product $inventory + * Required. The inventory information to update. The allowable fields to + * update are: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + * If + * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] + * is empty or invalid, an INVALID_ARGUMENT error is returned. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether + * or not it exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not have + * existing inventory information, the provided inventory information will be + * inserted. + * If the [Product][google.cloud.retail.v2.Product] to update has existing + * inventory information, the provided inventory information will be merged + * while respecting the last update time for each inventory field, using the + * provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * * Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * The last update time is recorded for the following inventory fields: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * If a full overwrite of inventory information while ignoring timestamps is + * needed, + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * should be invoked instead. + * @type \Google\Protobuf\FieldMask $set_mask + * Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. + * At least one field must be provided. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * @type \Google\Protobuf\Timestamp $set_time + * The time when the request is issued, used to prevent + * out-of-order updates on inventory fields with the last update time + * recorded. If not provided, the internal system time will be used. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] with name + * [Product.name][google.cloud.retail.v2.Product.name] is not found, the + * inventory update will still be processed and retained for at most 1 day + * until the [Product][google.cloud.retail.v2.Product] is created. If set to + * false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The inventory information to update. The allowable fields to + * update are: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + * If + * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] + * is empty or invalid, an INVALID_ARGUMENT error is returned. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether + * or not it exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not have + * existing inventory information, the provided inventory information will be + * inserted. + * If the [Product][google.cloud.retail.v2.Product] to update has existing + * inventory information, the provided inventory information will be merged + * while respecting the last update time for each inventory field, using the + * provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * * Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * The last update time is recorded for the following inventory fields: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * If a full overwrite of inventory information while ignoring timestamps is + * needed, + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * should be invoked instead. + * + * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Product|null + */ + public function getInventory() + { + return $this->inventory; + } + + public function hasInventory() + { + return isset($this->inventory); + } + + public function clearInventory() + { + unset($this->inventory); + } + + /** + * Required. The inventory information to update. The allowable fields to + * update are: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + * If + * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] + * is empty or invalid, an INVALID_ARGUMENT error is returned. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether + * or not it exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not have + * existing inventory information, the provided inventory information will be + * inserted. + * If the [Product][google.cloud.retail.v2.Product] to update has existing + * inventory information, the provided inventory information will be merged + * while respecting the last update time for each inventory field, using the + * provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + * * Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * * Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] + * The last update time is recorded for the following inventory fields: + * * [Product.price_info][google.cloud.retail.v2.Product.price_info] + * * [Product.availability][google.cloud.retail.v2.Product.availability] + * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + * If a full overwrite of inventory information while ignoring timestamps is + * needed, + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * should be invoked instead. + * + * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Product $var + * @return $this + */ + public function setInventory($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); + $this->inventory = $var; + + return $this; + } + + /** + * Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. + * At least one field must be provided. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getSetMask() + { + return $this->set_mask; + } + + public function hasSetMask() + { + return isset($this->set_mask); + } + + public function clearSetMask() + { + unset($this->set_mask); + } + + /** + * Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. + * At least one field must be provided. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * + * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setSetMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->set_mask = $var; + + return $this; + } + + /** + * The time when the request is issued, used to prevent + * out-of-order updates on inventory fields with the last update time + * recorded. If not provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSetTime() + { + return $this->set_time; + } + + public function hasSetTime() + { + return isset($this->set_time); + } + + public function clearSetTime() + { + unset($this->set_time); + } + + /** + * The time when the request is issued, used to prevent + * out-of-order updates on inventory fields with the last update time + * recorded. If not provided, the internal system time will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSetTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->set_time = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] with name + * [Product.name][google.cloud.retail.v2.Product.name] is not found, the + * inventory update will still be processed and retained for at most 1 day + * until the [Product][google.cloud.retail.v2.Product] is created. If set to + * false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 4; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] with name + * [Product.name][google.cloud.retail.v2.Product.name] is not found, the + * inventory update will still be processed and retained for at most 1 day + * until the [Product][google.cloud.retail.v2.Product] is created. If set to + * false, a NOT_FOUND error is returned if the + * [Product][google.cloud.retail.v2.Product] is not found. + * + * Generated from protobuf field bool allow_missing = 4; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php new file mode 100644 index 00000000000..b0f2e450044 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php @@ -0,0 +1,36 @@ +google.cloud.retail.v2.SetInventoryResponse + */ +class SetInventoryResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php new file mode 100644 index 00000000000..dd4badd652a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php @@ -0,0 +1,61 @@ +google.cloud.retail.v2.SolutionType + */ +class SolutionType +{ + /** + * Default value. + * + * Generated from protobuf enum SOLUTION_TYPE_UNSPECIFIED = 0; + */ + const SOLUTION_TYPE_UNSPECIFIED = 0; + /** + * Used for Recommendations AI. + * + * Generated from protobuf enum SOLUTION_TYPE_RECOMMENDATION = 1; + */ + const SOLUTION_TYPE_RECOMMENDATION = 1; + /** + * Used for Retail Search. + * + * Generated from protobuf enum SOLUTION_TYPE_SEARCH = 2; + */ + const SOLUTION_TYPE_SEARCH = 2; + + private static $valueToName = [ + self::SOLUTION_TYPE_UNSPECIFIED => 'SOLUTION_TYPE_UNSPECIFIED', + self::SOLUTION_TYPE_RECOMMENDATION => 'SOLUTION_TYPE_RECOMMENDATION', + self::SOLUTION_TYPE_SEARCH => 'SOLUTION_TYPE_SEARCH', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php new file mode 100644 index 00000000000..cd96719b01d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php @@ -0,0 +1,144 @@ +google.cloud.retail.v2.Tile + */ +class Tile extends \Google\Protobuf\Internal\Message +{ + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + */ + protected $representative_product_id = ''; + protected $product_attribute; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * The product attribute key-value. + * @type \Google\Cloud\Retail\V2\ProductAttributeInterval $product_attribute_interval + * The product attribute key-numeric interval. + * @type string $representative_product_id + * The representative product id for this tile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The product attribute key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->readOneof(1); + } + + public function hasProductAttributeValue() + { + return $this->hasOneof(1); + } + + /** + * The product attribute key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The product attribute key-numeric interval. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; + * @return \Google\Cloud\Retail\V2\ProductAttributeInterval|null + */ + public function getProductAttributeInterval() + { + return $this->readOneof(2); + } + + public function hasProductAttributeInterval() + { + return $this->hasOneof(2); + } + + /** + * The product attribute key-numeric interval. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; + * @param \Google\Cloud\Retail\V2\ProductAttributeInterval $var + * @return $this + */ + public function setProductAttributeInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeInterval::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + * @return string + */ + public function getRepresentativeProductId() + { + return $this->representative_product_id; + } + + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + * @param string $var + * @return $this + */ + public function setRepresentativeProductId($var) + { + GPBUtil::checkString($var, True); + $this->representative_product_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getProductAttribute() + { + return $this->whichOneof("product_attribute"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php new file mode 100644 index 00000000000..05da2dddcdf --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php @@ -0,0 +1,75 @@ +google.cloud.retail.v2.TuneModelMetadata + */ +class TuneModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the model that this tune applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * The resource name of the model that this tune applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the model that this tune applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * The resource name of the model that this tune applies to. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php new file mode 100644 index 00000000000..6c1ca5e1a04 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php @@ -0,0 +1,92 @@ +google.cloud.retail.v2.TuneModelRequest + */ +class TuneModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the model to tune. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the model to tune. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * Please see {@see ModelServiceClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\TuneModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the model to tune. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the model to tune. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The resource name of the model to tune. + * Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php new file mode 100644 index 00000000000..64f5b9a65e7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php @@ -0,0 +1,33 @@ +google.cloud.retail.v2.TuneModelResponse + */ +class TuneModelResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php new file mode 100644 index 00000000000..777010a2401 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php @@ -0,0 +1,165 @@ +google.cloud.retail.v2.UpdateAttributesConfigRequest + */ +class UpdateAttributesConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] + * to update. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $attributes_config = null; + /** + * Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The + * following is the only supported field: + * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\AttributesConfig $attributesConfig Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] + * to update. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The + * following is the only supported field: + * + * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] + * + * If not set, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateAttributesConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\AttributesConfig $attributesConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAttributesConfig($attributesConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\AttributesConfig $attributes_config + * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] + * to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The + * following is the only supported field: + * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] + * If not set, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] + * to update. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\AttributesConfig|null + */ + public function getAttributesConfig() + { + return $this->attributes_config; + } + + public function hasAttributesConfig() + { + return isset($this->attributes_config); + } + + public function clearAttributesConfig() + { + unset($this->attributes_config); + } + + /** + * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] + * to update. + * + * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\AttributesConfig $var + * @return $this + */ + public function setAttributesConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\AttributesConfig::class); + $this->attributes_config = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The + * following is the only supported field: + * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The + * following is the only supported field: + * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php new file mode 100644 index 00000000000..413fc68b109 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php @@ -0,0 +1,181 @@ +google.cloud.retail.v2.UpdateCatalogRequest + */ +class UpdateCatalogRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. + * If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, + * a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = null; + /** + * Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2.Catalog] to update. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\Catalog $catalog Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. + * + * If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, + * a NOT_FOUND error is returned. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2.Catalog] to update. + * + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * @return \Google\Cloud\Retail\V2\UpdateCatalogRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\Catalog $catalog, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCatalog($catalog) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Catalog $catalog + * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. + * If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, + * a NOT_FOUND error is returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2.Catalog] to update. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. + * If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, + * a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Catalog|null + */ + public function getCatalog() + { + return $this->catalog; + } + + public function hasCatalog() + { + return isset($this->catalog); + } + + public function clearCatalog() + { + unset($this->catalog); + } + + /** + * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. + * If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, + * a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Catalog $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Catalog::class); + $this->catalog = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2.Catalog] to update. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2.Catalog] to update. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php new file mode 100644 index 00000000000..103bc34a0cd --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php @@ -0,0 +1,207 @@ +google.cloud.retail.v2.UpdateCompletionConfigRequest + */ +class UpdateCompletionConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] + * to update. + * If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a + * PERMISSION_DENIED error is returned. + * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to + * update does not exist, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $completion_config = null; + /** + * Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The + * following are the only supported fields: + * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] + * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] + * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] + * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\CompletionConfig $completionConfig Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] + * to update. + * + * If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a + * PERMISSION_DENIED error is returned. + * + * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to + * update does not exist, a NOT_FOUND error is returned. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The + * following are the only supported fields: + * + * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] + * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] + * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] + * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] + * + * If not set, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateCompletionConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\CompletionConfig $completionConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCompletionConfig($completionConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\CompletionConfig $completion_config + * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] + * to update. + * If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a + * PERMISSION_DENIED error is returned. + * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to + * update does not exist, a NOT_FOUND error is returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The + * following are the only supported fields: + * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] + * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] + * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] + * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] + * If not set, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] + * to update. + * If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a + * PERMISSION_DENIED error is returned. + * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to + * update does not exist, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\CompletionConfig|null + */ + public function getCompletionConfig() + { + return $this->completion_config; + } + + public function hasCompletionConfig() + { + return isset($this->completion_config); + } + + public function clearCompletionConfig() + { + unset($this->completion_config); + } + + /** + * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] + * to update. + * If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a + * PERMISSION_DENIED error is returned. + * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to + * update does not exist, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\CompletionConfig $var + * @return $this + */ + public function setCompletionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionConfig::class); + $this->completion_config = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The + * following are the only supported fields: + * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] + * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] + * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] + * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The + * following are the only supported fields: + * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] + * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] + * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] + * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php new file mode 100644 index 00000000000..9d1a0a5f155 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php @@ -0,0 +1,158 @@ +google.cloud.retail.v2.UpdateControlRequest + */ +class UpdateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Indicates which fields in the provided + * [Control][google.cloud.retail.v2.Control] to update. The following are NOT + * supported: + * * [Control.name][google.cloud.retail.v2.Control.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\Control $control Required. The Control to update. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [Control][google.cloud.retail.v2.Control] to update. The following are NOT + * supported: + * + * * [Control.name][google.cloud.retail.v2.Control.name] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateControlRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\Control $control, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setControl($control) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Control $control + * Required. The Control to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [Control][google.cloud.retail.v2.Control] to update. The following are NOT + * supported: + * * [Control.name][google.cloud.retail.v2.Control.name] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [Control][google.cloud.retail.v2.Control] to update. The following are NOT + * supported: + * * [Control.name][google.cloud.retail.v2.Control.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [Control][google.cloud.retail.v2.Control] to update. The following are NOT + * supported: + * * [Control.name][google.cloud.retail.v2.Control.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php new file mode 100644 index 00000000000..63d052fd032 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php @@ -0,0 +1,158 @@ +google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest + */ +class UpdateGenerativeQuestionConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generative_question_config = null; + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig Required. The question to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerativeQuestionConfig($generativeQuestionConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generative_question_config + * Required. The question to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\GenerativeQuestionConfig|null + */ + public function getGenerativeQuestionConfig() + { + return $this->generative_question_config; + } + + public function hasGenerativeQuestionConfig() + { + return isset($this->generative_question_config); + } + + public function clearGenerativeQuestionConfig() + { + unset($this->generative_question_config); + } + + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $var + * @return $this + */ + public function setGenerativeQuestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_config = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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 + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php new file mode 100644 index 00000000000..29dfb439aa9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php @@ -0,0 +1,146 @@ +google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest + */ +class UpdateGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generative_questions_feature_config = null; + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig Required. The configuration managing the feature state. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionsFeatureConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generative_questions_feature_config + * Required. The configuration managing the feature state. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig|null + */ + public function getGenerativeQuestionsFeatureConfig() + { + return $this->generative_questions_feature_config; + } + + public function hasGenerativeQuestionsFeatureConfig() + { + return isset($this->generative_questions_feature_config); + } + + public function clearGenerativeQuestionsFeatureConfig() + { + unset($this->generative_questions_feature_config); + } + + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $var + * @return $this + */ + public function setGenerativeQuestionsFeatureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig::class); + $this->generative_questions_feature_config = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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 + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php new file mode 100644 index 00000000000..ad11b0cfb1a --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php @@ -0,0 +1,141 @@ +google.cloud.retail.v2.UpdateModelRequest + */ +class UpdateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + /** + * Optional. Indicates which fields in the provided 'model' to + * update. If not set, by default updates all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\Model $model Required. The body of the updated [Model][google.cloud.retail.v2.Model]. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided 'model' to + * update. If not set, by default updates all fields. + * + * @return \Google\Cloud\Retail\V2\UpdateModelRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\Model $model, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setModel($model) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Model $model + * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided 'model' to + * update. If not set, by default updates all fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model::class); + $this->model = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided 'model' to + * update. If not set, by default updates all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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 'model' to + * update. If not set, by default updates all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php new file mode 100644 index 00000000000..11f3ba45059 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php @@ -0,0 +1,264 @@ +google.cloud.retail.v2.UpdateProductRequest + */ +class UpdateProductRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The product to update/create. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product = null; + /** + * Indicates which fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. The immutable and + * output only fields are NOT supported. If not set, all supported fields (the + * fields that are neither immutable nor output only) are updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * The attribute key can be updated by setting the mask path as + * "attributes.${key_name}". If a key name is present in the mask but not in + * the patching product from the request, this key will be deleted after the + * update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, a new [Product][google.cloud.retail.v2.Product] will be created. In + * this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Retail\V2\Product $product Required. The product to update/create. + * + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. The immutable and + * output only fields are NOT supported. If not set, all supported fields (the + * fields that are neither immutable nor output only) are updated. + * + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * + * The attribute key can be updated by setting the mask path as + * "attributes.${key_name}". If a key name is present in the mask but not in + * the patching product from the request, this key will be deleted after the + * update. + * + * @return \Google\Cloud\Retail\V2\UpdateProductRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\Product $product, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setProduct($product) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Product $product + * Required. The product to update/create. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. The immutable and + * output only fields are NOT supported. If not set, all supported fields (the + * fields that are neither immutable nor output only) are updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * The attribute key can be updated by setting the mask path as + * "attributes.${key_name}". If a key name is present in the mask but not in + * the patching product from the request, this key will be deleted after the + * update. + * @type bool $allow_missing + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, a new [Product][google.cloud.retail.v2.Product] will be created. In + * this situation, `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The product to update/create. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\Product|null + */ + public function getProduct() + { + return $this->product; + } + + public function hasProduct() + { + return isset($this->product); + } + + public function clearProduct() + { + unset($this->product); + } + + /** + * Required. The product to update/create. + * If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\Product $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); + $this->product = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. The immutable and + * output only fields are NOT supported. If not set, all supported fields (the + * fields that are neither immutable nor output only) are updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * The attribute key can be updated by setting the mask path as + * "attributes.${key_name}". If a key name is present in the mask but not in + * the patching product from the request, this key will be deleted after the + * update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [Product][google.cloud.retail.v2.Product] to update. The immutable and + * output only fields are NOT supported. If not set, all supported fields (the + * fields that are neither immutable nor output only) are updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned. + * The attribute key can be updated by setting the mask path as + * "attributes.${key_name}". If a key name is present in the mask but not in + * the patching product from the request, this key will be deleted after the + * update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, a new [Product][google.cloud.retail.v2.Product] will be created. In + * this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the [Product][google.cloud.retail.v2.Product] is not + * found, a new [Product][google.cloud.retail.v2.Product] will be created. In + * this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php new file mode 100644 index 00000000000..62d43192355 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php @@ -0,0 +1,158 @@ +google.cloud.retail.v2.UpdateServingConfigRequest + */ +class UpdateServingConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ServingConfig to update. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $serving_config = null; + /** + * Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The + * following are NOT supported: + * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\ServingConfig $servingConfig Required. The ServingConfig to update. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The + * following are NOT supported: + * + * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] + * + * If not set, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateServingConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\ServingConfig $servingConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setServingConfig($servingConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ServingConfig $serving_config + * Required. The ServingConfig to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The + * following are NOT supported: + * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] + * If not set, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ServingConfig to update. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\ServingConfig|null + */ + public function getServingConfig() + { + return $this->serving_config; + } + + public function hasServingConfig() + { + return isset($this->serving_config); + } + + public function clearServingConfig() + { + unset($this->serving_config); + } + + /** + * Required. The ServingConfig to update. + * + * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\ServingConfig $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ServingConfig::class); + $this->serving_config = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The + * following are NOT supported: + * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The + * following are NOT supported: + * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] + * If not set, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php new file mode 100644 index 00000000000..40d8e34803c --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php @@ -0,0 +1,1360 @@ +google.cloud.retail.v2.UserEvent + */ +class UserEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. User event type. Allowed values are: + * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. + * * `category-page-view`: Special pages such as sale or promotion pages + * viewed. + * * `detail-page-view`: Products detail page viewed. + * * `home-page-view`: Homepage viewed. + * * `promotion-offered`: Promotion is offered to a user. + * * `promotion-not-offered`: Promotion is not offered to a user. + * * `purchase-complete`: User finishing a purchase. + * * `search`: Product search. + * * `shopping-cart-page-view`: User viewing a shopping cart. + * + * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $event_type = ''; + /** + * Required. A unique identifier for tracking visitors. + * For example, this could be implemented with an 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. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded model + * quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * The field should not contain PII or user-data. We recommend to use Google + * Analytics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. + * + * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $visitor_id = ''; + /** + * A unique identifier for tracking a visitor session with a length limit of + * 128 bytes. A session is an aggregation of an end user behavior in a time + * span. + * A general guideline to populate the sesion_id: + * 1. If user has no activity for 30 min, a new session_id should be assigned. + * 2. The session_id should be unique across users, suggest use uuid or add + * visitor_id as prefix. + * + * Generated from protobuf field string session_id = 21; + */ + protected $session_id = ''; + /** + * Only required for + * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] + * method. Timestamp of when the user event happened. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + */ + protected $event_time = null; + /** + * 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 Retail API, using different + * recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 4; + */ + private $experiment_ids; + /** + * Highly recommended for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * This field enables accurate attribution of recommendation model + * performance. + * The value must be a valid + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased product. If user clicks on product K in the + * recommendation results, pass + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * as a URL parameter to product K's page. When recording events on product + * K's page, log the + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * to this field. + * + * Generated from protobuf field string attribution_token = 5; + */ + protected $attribution_token = ''; + /** + * The main product details related to the event. + * This field is optional except for the following event types: + * * `add-to-cart` + * * `detail-page-view` + * * `purchase-complete` + * In a `search` event, this field represents the products returned to the end + * user on the current page (the end user may have not finished browsing the + * whole page yet). When a new page is returned to the end user, after + * pagination/filtering/ordering even for the same query, a new `search` event + * with different + * [product_details][google.cloud.retail.v2.UserEvent.product_details] is + * desired. The end user may have not finished browsing the whole page yet. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; + */ + private $product_details; + /** + * The main auto-completion details related to the event. + * This field should be set for `search` event when autocomplete function is + * enabled and the user clicks a suggestion for search. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + protected $completion_detail = null; + /** + * Extra user event features to include in the recommendation model. + * If you provide custom attributes for ingested user events, also include + * them in the user events that you associate with prediction requests. Custom + * attribute formatting must be consistent between imported events and events + * provided with prediction requests. This lets the Retail API use + * those custom attributes when training models and serving predictions, which + * helps improve recommendation quality. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * The key must be a UTF-8 encoded string with a length limit of 5,000 + * characters. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a UTF-8 encoded string with a length limit of + * 256 characters. + * * For number attributes, at most 400 values are allowed. + * For product recommendations, an example of extra user information is + * traffic_channel, which is how a user arrives at the site. Users can arrive + * at the site by coming to the site directly, coming through Google + * search, or in other ways. + * + * Generated from protobuf field map attributes = 7; + */ + private $attributes; + /** + * 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`, `purchase-complete`, or + * `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 8; + */ + protected $cart_id = ''; + /** + * A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; + */ + protected $purchase_transaction = null; + /** + * The user's search query. + * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for + * definition. + * The value must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string search_query = 10; + */ + protected $search_query = ''; + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string filter = 16; + */ + protected $filter = ''; + /** + * The order in which products are returned. + * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] + * for definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string order_by = 17; + */ + protected $order_by = ''; + /** + * An integer that specifies the current offset for pagination (the 0-indexed + * starting location, amongst the products deemed by the API as relevant). + * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for + * definition. + * If this field is negative, an INVALID_ARGUMENT is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 offset = 18; + */ + protected $offset = 0; + /** + * The categories associated with a category page. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string page_categories = 11; + */ + private $page_categories; + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; + */ + protected $user_info = null; + /** + * Complete URL (window.location.href) of the user's current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. Maximum length 5,000 + * characters. + * + * Generated from protobuf field string uri = 13; + */ + protected $uri = ''; + /** + * The referrer URL of the current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 14; + */ + protected $referrer_uri = ''; + /** + * 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. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string page_view_id = 15; + */ + protected $page_view_id = ''; + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. + * + * Generated from protobuf field string entity = 23; + */ + protected $entity = ''; + + /** + * 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. + * * `remove-from-cart`: Products being removed from cart. + * * `category-page-view`: Special pages such as sale or promotion pages + * viewed. + * * `detail-page-view`: Products detail page viewed. + * * `home-page-view`: Homepage viewed. + * * `promotion-offered`: Promotion is offered to a user. + * * `promotion-not-offered`: Promotion is not offered to a user. + * * `purchase-complete`: User finishing a purchase. + * * `search`: Product search. + * * `shopping-cart-page-view`: User viewing a shopping cart. + * @type string $visitor_id + * Required. A unique identifier for tracking visitors. + * For example, this could be implemented with an 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. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded model + * quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * The field should not contain PII or user-data. We recommend to use Google + * Analytics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. + * @type string $session_id + * A unique identifier for tracking a visitor session with a length limit of + * 128 bytes. A session is an aggregation of an end user behavior in a time + * span. + * A general guideline to populate the sesion_id: + * 1. If user has no activity for 30 min, a new session_id should be assigned. + * 2. The session_id should be unique across users, suggest use uuid or add + * visitor_id as prefix. + * @type \Google\Protobuf\Timestamp $event_time + * Only required for + * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] + * method. Timestamp of when the user event happened. + * @type array|\Google\Protobuf\Internal\RepeatedField $experiment_ids + * 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 Retail API, using different + * recommendation models). + * @type string $attribution_token + * Highly recommended for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * This field enables accurate attribution of recommendation model + * performance. + * The value must be a valid + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased product. If user clicks on product K in the + * recommendation results, pass + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * as a URL parameter to product K's page. When recording events on product + * K's page, log the + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * to this field. + * @type array<\Google\Cloud\Retail\V2\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $product_details + * The main product details related to the event. + * This field is optional except for the following event types: + * * `add-to-cart` + * * `detail-page-view` + * * `purchase-complete` + * In a `search` event, this field represents the products returned to the end + * user on the current page (the end user may have not finished browsing the + * whole page yet). When a new page is returned to the end user, after + * pagination/filtering/ordering even for the same query, a new `search` event + * with different + * [product_details][google.cloud.retail.v2.UserEvent.product_details] is + * desired. The end user may have not finished browsing the whole page yet. + * @type \Google\Cloud\Retail\V2\CompletionDetail $completion_detail + * The main auto-completion details related to the event. + * This field should be set for `search` event when autocomplete function is + * enabled and the user clicks a suggestion for search. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Extra user event features to include in the recommendation model. + * If you provide custom attributes for ingested user events, also include + * them in the user events that you associate with prediction requests. Custom + * attribute formatting must be consistent between imported events and events + * provided with prediction requests. This lets the Retail API use + * those custom attributes when training models and serving predictions, which + * helps improve recommendation quality. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * The key must be a UTF-8 encoded string with a length limit of 5,000 + * characters. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a UTF-8 encoded string with a length limit of + * 256 characters. + * * For number attributes, at most 400 values are allowed. + * For product recommendations, an example of extra user information is + * traffic_channel, which is how a user arrives at the site. Users can arrive + * at the site by coming to the site directly, coming through Google + * search, or in other ways. + * @type string $cart_id + * 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`, `purchase-complete`, or + * `shopping-cart-page-view` events. + * @type \Google\Cloud\Retail\V2\PurchaseTransaction $purchase_transaction + * A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $search_query + * The user's search query. + * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for + * definition. + * The value must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $filter + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $order_by + * The order in which products are returned. + * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] + * for definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * @type int $offset + * An integer that specifies the current offset for pagination (the 0-indexed + * starting location, amongst the products deemed by the API as relevant). + * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for + * definition. + * If this field is negative, an INVALID_ARGUMENT is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories + * The categories associated with a category page. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @type \Google\Cloud\Retail\V2\UserInfo $user_info + * User information. + * @type string $uri + * Complete URL (window.location.href) of the user's current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. Maximum length 5,000 + * characters. + * @type string $referrer_uri + * The referrer URL of the current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * @type string $page_view_id + * 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. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * @type string $entity + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. User event type. Allowed values are: + * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. + * * `category-page-view`: Special pages such as sale or promotion pages + * viewed. + * * `detail-page-view`: Products detail page viewed. + * * `home-page-view`: Homepage viewed. + * * `promotion-offered`: Promotion is offered to a user. + * * `promotion-not-offered`: Promotion is not offered to a user. + * * `purchase-complete`: User finishing a purchase. + * * `search`: Product search. + * * `shopping-cart-page-view`: User viewing a shopping cart. + * + * 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. + * * `remove-from-cart`: Products being removed from cart. + * * `category-page-view`: Special pages such as sale or promotion pages + * viewed. + * * `detail-page-view`: Products detail page viewed. + * * `home-page-view`: Homepage viewed. + * * `promotion-offered`: Promotion is offered to a user. + * * `promotion-not-offered`: Promotion is not offered to a user. + * * `purchase-complete`: User finishing a purchase. + * * `search`: Product search. + * * `shopping-cart-page-view`: User viewing a shopping cart. + * + * 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. A unique identifier for tracking visitors. + * For example, this could be implemented with an 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. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded model + * quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * The field should not contain PII or user-data. We recommend to use Google + * Analytics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. + * + * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVisitorId() + { + return $this->visitor_id; + } + + /** + * Required. A unique identifier for tracking visitors. + * For example, this could be implemented with an 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. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded model + * quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * The field should not contain PII or user-data. We recommend to use Google + * Analytics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. + * + * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVisitorId($var) + { + GPBUtil::checkString($var, True); + $this->visitor_id = $var; + + return $this; + } + + /** + * A unique identifier for tracking a visitor session with a length limit of + * 128 bytes. A session is an aggregation of an end user behavior in a time + * span. + * A general guideline to populate the sesion_id: + * 1. If user has no activity for 30 min, a new session_id should be assigned. + * 2. The session_id should be unique across users, suggest use uuid or add + * visitor_id as prefix. + * + * Generated from protobuf field string session_id = 21; + * @return string + */ + public function getSessionId() + { + return $this->session_id; + } + + /** + * A unique identifier for tracking a visitor session with a length limit of + * 128 bytes. A session is an aggregation of an end user behavior in a time + * span. + * A general guideline to populate the sesion_id: + * 1. If user has no activity for 30 min, a new session_id should be assigned. + * 2. The session_id should be unique across users, suggest use uuid or add + * visitor_id as prefix. + * + * Generated from protobuf field string session_id = 21; + * @param string $var + * @return $this + */ + public function setSessionId($var) + { + GPBUtil::checkString($var, True); + $this->session_id = $var; + + return $this; + } + + /** + * Only required for + * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] + * method. Timestamp of when the user event happened. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + * @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); + } + + /** + * Only required for + * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] + * method. Timestamp of when the user event happened. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * 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 Retail API, using different + * recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExperimentIds() + { + return $this->experiment_ids; + } + + /** + * 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 Retail API, using different + * recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 4; + * @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; + } + + /** + * Highly recommended for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * This field enables accurate attribution of recommendation model + * performance. + * The value must be a valid + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased product. If user clicks on product K in the + * recommendation results, pass + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * as a URL parameter to product K's page. When recording events on product + * K's page, log the + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * to this field. + * + * Generated from protobuf field string attribution_token = 5; + * @return string + */ + public function getAttributionToken() + { + return $this->attribution_token; + } + + /** + * Highly recommended for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * This field enables accurate attribution of recommendation model + * performance. + * The value must be a valid + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * for user events that are the result of + * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased product. If user clicks on product K in the + * recommendation results, pass + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * as a URL parameter to product K's page. When recording events on product + * K's page, log the + * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] + * to this field. + * + * Generated from protobuf field string attribution_token = 5; + * @param string $var + * @return $this + */ + public function setAttributionToken($var) + { + GPBUtil::checkString($var, True); + $this->attribution_token = $var; + + return $this; + } + + /** + * The main product details related to the event. + * This field is optional except for the following event types: + * * `add-to-cart` + * * `detail-page-view` + * * `purchase-complete` + * In a `search` event, this field represents the products returned to the end + * user on the current page (the end user may have not finished browsing the + * whole page yet). When a new page is returned to the end user, after + * pagination/filtering/ordering even for the same query, a new `search` event + * with different + * [product_details][google.cloud.retail.v2.UserEvent.product_details] is + * desired. The end user may have not finished browsing the whole page yet. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductDetails() + { + return $this->product_details; + } + + /** + * The main product details related to the event. + * This field is optional except for the following event types: + * * `add-to-cart` + * * `detail-page-view` + * * `purchase-complete` + * In a `search` event, this field represents the products returned to the end + * user on the current page (the end user may have not finished browsing the + * whole page yet). When a new page is returned to the end user, after + * pagination/filtering/ordering even for the same query, a new `search` event + * with different + * [product_details][google.cloud.retail.v2.UserEvent.product_details] is + * desired. The end user may have not finished browsing the whole page yet. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; + * @param array<\Google\Cloud\Retail\V2\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ProductDetail::class); + $this->product_details = $arr; + + return $this; + } + + /** + * The main auto-completion details related to the event. + * This field should be set for `search` event when autocomplete function is + * enabled and the user clicks a suggestion for search. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * @return \Google\Cloud\Retail\V2\CompletionDetail|null + */ + public function getCompletionDetail() + { + return $this->completion_detail; + } + + public function hasCompletionDetail() + { + return isset($this->completion_detail); + } + + public function clearCompletionDetail() + { + unset($this->completion_detail); + } + + /** + * The main auto-completion details related to the event. + * This field should be set for `search` event when autocomplete function is + * enabled and the user clicks a suggestion for search. + * + * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * @param \Google\Cloud\Retail\V2\CompletionDetail $var + * @return $this + */ + public function setCompletionDetail($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDetail::class); + $this->completion_detail = $var; + + return $this; + } + + /** + * Extra user event features to include in the recommendation model. + * If you provide custom attributes for ingested user events, also include + * them in the user events that you associate with prediction requests. Custom + * attribute formatting must be consistent between imported events and events + * provided with prediction requests. This lets the Retail API use + * those custom attributes when training models and serving predictions, which + * helps improve recommendation quality. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * The key must be a UTF-8 encoded string with a length limit of 5,000 + * characters. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a UTF-8 encoded string with a length limit of + * 256 characters. + * * For number attributes, at most 400 values are allowed. + * For product recommendations, an example of extra user information is + * traffic_channel, which is how a user arrives at the site. Users can arrive + * at the site by coming to the site directly, coming through Google + * search, or in other ways. + * + * Generated from protobuf field map attributes = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Extra user event features to include in the recommendation model. + * If you provide custom attributes for ingested user events, also include + * them in the user events that you associate with prediction requests. Custom + * attribute formatting must be consistent between imported events and events + * provided with prediction requests. This lets the Retail API use + * those custom attributes when training models and serving predictions, which + * helps improve recommendation quality. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * The key must be a UTF-8 encoded string with a length limit of 5,000 + * characters. + * * For text attributes, at most 400 values are allowed. Empty values are not + * allowed. Each value must be a UTF-8 encoded string with a length limit of + * 256 characters. + * * For number attributes, at most 400 values are allowed. + * For product recommendations, an example of extra user information is + * traffic_channel, which is how a user arrives at the site. Users can arrive + * at the site by coming to the site directly, coming through Google + * search, or in other ways. + * + * Generated from protobuf field map attributes = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * 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`, `purchase-complete`, or + * `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 8; + * @return string + */ + public function getCartId() + { + return $this->cart_id; + } + + /** + * 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`, `purchase-complete`, or + * `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 8; + * @param string $var + * @return $this + */ + public function setCartId($var) + { + GPBUtil::checkString($var, True); + $this->cart_id = $var; + + return $this; + } + + /** + * A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; + * @return \Google\Cloud\Retail\V2\PurchaseTransaction|null + */ + public function getPurchaseTransaction() + { + return $this->purchase_transaction; + } + + public function hasPurchaseTransaction() + { + return isset($this->purchase_transaction); + } + + public function clearPurchaseTransaction() + { + unset($this->purchase_transaction); + } + + /** + * A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; + * @param \Google\Cloud\Retail\V2\PurchaseTransaction $var + * @return $this + */ + public function setPurchaseTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PurchaseTransaction::class); + $this->purchase_transaction = $var; + + return $this; + } + + /** + * The user's search query. + * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for + * definition. + * The value must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string search_query = 10; + * @return string + */ + public function getSearchQuery() + { + return $this->search_query; + } + + /** + * The user's search query. + * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for + * definition. + * The value must be a UTF-8 encoded string with a length limit of 5,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string search_query = 10; + * @param string $var + * @return $this + */ + public function setSearchQuery($var) + { + GPBUtil::checkString($var, True); + $this->search_query = $var; + + return $this; + } + + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string filter = 16; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter syntax consists of an expression language for constructing a + * predicate from one or more fields of the products being filtered. + * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + * definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string filter = 16; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The order in which products are returned. + * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] + * for definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string order_by = 17; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The order in which products are returned. + * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] + * for definition and syntax. + * The value must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string order_by = 17; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * An integer that specifies the current offset for pagination (the 0-indexed + * starting location, amongst the products deemed by the API as relevant). + * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for + * definition. + * If this field is negative, an INVALID_ARGUMENT is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 offset = 18; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * An integer that specifies the current offset for pagination (the 0-indexed + * starting location, amongst the products deemed by the API as relevant). + * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for + * definition. + * If this field is negative, an INVALID_ARGUMENT is returned. + * This can only be set for `search` events. Other event types should not set + * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field int32 offset = 18; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * The categories associated with a category page. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string page_categories = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageCategories() + { + return $this->page_categories; + } + + /** + * The categories associated with a category page. + * To represent full path of category, use '>' sign to separate different + * hierarchies. If '>' is part of the category name, replace it with + * other character(s). + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field repeated string page_categories = 11; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->page_categories = $arr; + + return $this; + } + + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; + * @return \Google\Cloud\Retail\V2\UserInfo|null + */ + public function getUserInfo() + { + return $this->user_info; + } + + public function hasUserInfo() + { + return isset($this->user_info); + } + + public function clearUserInfo() + { + unset($this->user_info); + } + + /** + * User information. + * + * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; + * @param \Google\Cloud\Retail\V2\UserInfo $var + * @return $this + */ + public function setUserInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserInfo::class); + $this->user_info = $var; + + return $this; + } + + /** + * Complete URL (window.location.href) of the user's current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. Maximum length 5,000 + * characters. + * + * Generated from protobuf field string uri = 13; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Complete URL (window.location.href) of the user's current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. Maximum length 5,000 + * characters. + * + * Generated from protobuf field string uri = 13; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * The referrer URL of the current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 14; + * @return string + */ + public function getReferrerUri() + { + return $this->referrer_uri; + } + + /** + * The referrer URL of the current page. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 14; + * @param string $var + * @return $this + */ + public function setReferrerUri($var) + { + GPBUtil::checkString($var, True); + $this->referrer_uri = $var; + + return $this; + } + + /** + * 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. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string page_view_id = 15; + * @return string + */ + public function getPageViewId() + { + return $this->page_view_id; + } + + /** + * 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. + * When using the client side event reporting with JavaScript pixel and Google + * Tag Manager, this value is filled in automatically. + * + * Generated from protobuf field string page_view_id = 15; + * @param string $var + * @return $this + */ + public function setPageViewId($var) + { + GPBUtil::checkString($var, True); + $this->page_view_id = $var; + + return $this; + } + + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. + * + * Generated from protobuf field string entity = 23; + * @return string + */ + public function getEntity() + { + return $this->entity; + } + + /** + * The entity for customers that may run multiple different entities, domains, + * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * `google.com`, `youtube.com`, etc. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. + * + * Generated from protobuf field string entity = 23; + * @param string $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkString($var, True); + $this->entity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php new file mode 100644 index 00000000000..eaad6ecb75f --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php @@ -0,0 +1,106 @@ +google.cloud.retail.v2.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\Retail\V2\ImportConfig::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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php new file mode 100644 index 00000000000..ea0c781ba6d --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.UserEventInlineSource + */ +class UserEventInlineSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $user_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events + * Required. A list of user events to import. Recommended max of 10k items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserEvents() + { + return $this->user_events; + } + + /** + * Required. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Retail\V2\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UserEvent::class); + $this->user_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php new file mode 100644 index 00000000000..37beacfc140 --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php @@ -0,0 +1,141 @@ +google.cloud.retail.v2.UserEventInputConfig + */ +class UserEventInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\UserEventInlineSource $user_event_inline_source + * Required. The Inline source for the input content for UserEvents. + * @type \Google\Cloud\Retail\V2\GcsSource $gcs_source + * Required. Google Cloud Storage location for the input content. + * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source + * Required. BigQuery input source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Inline source for the input content for UserEvents. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\UserEventInlineSource|null + */ + public function getUserEventInlineSource() + { + return $this->readOneof(1); + } + + public function hasUserEventInlineSource() + { + return $this->hasOneof(1); + } + + /** + * Required. The Inline source for the input content for UserEvents. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\UserEventInlineSource $var + * @return $this + */ + public function setUserEventInlineSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventInlineSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Required. Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * Required. Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GcsSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. BigQuery input source. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\BigQuerySource|null + */ + public function getBigQuerySource() + { + return $this->readOneof(3); + } + + public function hasBigQuerySource() + { + return $this->hasOneof(3); + } + + /** + * Required. BigQuery input source. + * + * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\BigQuerySource $var + * @return $this + */ + public function setBigQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php new file mode 100644 index 00000000000..eab5a74504b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php @@ -0,0 +1,309 @@ +google.cloud.retail.v2.UserInfo + */ +class UserInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Highly recommended for logged-in users. Unique identifier for logged-in + * user, such as a user name. Don't set for anonymous users. + * Always use a hashed value for this ID. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded + * model quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string user_id = 1; + */ + protected $user_id = ''; + /** + * The end user's IP address. This field is used to extract location + * information for personalization. + * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + * INVALID_ARGUMENT error is returned. + * This should not be set when: + * * setting + * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. + * * using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string ip_address = 2; + */ + protected $ip_address = ''; + /** + * User agent as included in the HTTP header. Required for getting + * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. + * The field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This should not be set when using the client side event reporting with + * GTM or JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string user_agent = 3; + */ + protected $user_agent = ''; + /** + * True if the request is made directly from the end user, in which case the + * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and + * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated + * from the HTTP request. 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). + * This should not be set when using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. + * + * Generated from protobuf field bool direct_user_request = 4; + */ + protected $direct_user_request = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user_id + * Highly recommended for logged-in users. Unique identifier for logged-in + * user, such as a user name. Don't set for anonymous users. + * Always use a hashed value for this ID. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded + * model quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @type string $ip_address + * The end user's IP address. This field is used to extract location + * information for personalization. + * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + * INVALID_ARGUMENT error is returned. + * This should not be set when: + * * setting + * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. + * * using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * @type string $user_agent + * User agent as included in the HTTP header. Required for getting + * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. + * The field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This should not be set when using the client side event reporting with + * GTM or JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * @type bool $direct_user_request + * True if the request is made directly from the end user, in which case the + * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and + * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated + * from the HTTP request. 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). + * This should not be set when using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Highly recommended for logged-in users. Unique identifier for logged-in + * user, such as a user name. Don't set for anonymous users. + * Always use a hashed value for this ID. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded + * model quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string user_id = 1; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Highly recommended for logged-in users. Unique identifier for logged-in + * user, such as a user name. Don't set for anonymous users. + * Always use a hashed value for this ID. + * Don't set the field to the same fixed ID for different users. This mixes + * the event history of those users together, which results in degraded + * model quality. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * + * Generated from protobuf field string user_id = 1; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * The end user's IP address. This field is used to extract location + * information for personalization. + * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + * INVALID_ARGUMENT error is returned. + * This should not be set when: + * * setting + * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. + * * using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string ip_address = 2; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * The end user's IP address. This field is used to extract location + * information for personalization. + * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + * INVALID_ARGUMENT error is returned. + * This should not be set when: + * * setting + * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. + * * using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string ip_address = 2; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * User agent as included in the HTTP header. Required for getting + * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. + * The field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This should not be set when using the client side event reporting with + * GTM or JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string user_agent = 3; + * @return string + */ + public function getUserAgent() + { + return $this->user_agent; + } + + /** + * User agent as included in the HTTP header. Required for getting + * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. + * The field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This should not be set when using the client side event reporting with + * GTM or JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] + * or if + * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] + * is set. + * + * Generated from protobuf field string user_agent = 3; + * @param string $var + * @return $this + */ + public function setUserAgent($var) + { + GPBUtil::checkString($var, True); + $this->user_agent = $var; + + return $this; + } + + /** + * True if the request is made directly from the end user, in which case the + * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and + * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated + * from the HTTP request. 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). + * This should not be set when using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. + * + * Generated from protobuf field bool direct_user_request = 4; + * @return bool + */ + public function getDirectUserRequest() + { + return $this->direct_user_request; + } + + /** + * True if the request is made directly from the end user, in which case the + * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and + * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated + * from the HTTP request. 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). + * This should not be set when using the JavaScript tag in + * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. + * + * Generated from protobuf field bool direct_user_request = 4; + * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php new file mode 100644 index 00000000000..215b199d55b --- /dev/null +++ b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php @@ -0,0 +1,161 @@ +google.cloud.retail.v2.WriteUserEventRequest + */ +class WriteUserEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. User event to write. + * + * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = null; + /** + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. + * + * Generated from protobuf field bool write_async = 3; + */ + protected $write_async = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * @type \Google\Cloud\Retail\V2\UserEvent $user_event + * Required. User event to write. + * @type bool $write_async + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent catalog resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\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.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\UserEvent $var + * @return $this + */ + public function setUserEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEvent::class); + $this->user_event = $var; + + return $this; + } + + /** + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. + * + * Generated from protobuf field bool write_async = 3; + * @return bool + */ + public function getWriteAsync() + { + return $this->write_async; + } + + /** + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. + * + * Generated from protobuf field bool write_async = 3; + * @param bool $var + * @return $this + */ + public function setWriteAsync($var) + { + GPBUtil::checkBool($var); + $this->write_async = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php b/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php new file mode 100644 index 00000000000..10f1ac3a67d --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php @@ -0,0 +1,89 @@ +setCatalog($catalog) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $analyticsServiceClient->exportAnalyticsMetrics($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportAnalyticsMetricsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $catalog = '[CATALOG]'; + + export_analytics_metrics_sample($catalog); +} +// [END retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php new file mode 100644 index 00000000000..f687e458a6d --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php @@ -0,0 +1,99 @@ +setKey($catalogAttributeKey); + $request = (new AddCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + + // Call the API and handle any network failures. + try { + /** @var AttributesConfig $response */ + $response = $catalogServiceClient->addCatalogAttribute($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + $catalogAttributeKey = '[KEY]'; + + add_catalog_attribute_sample($formattedAttributesConfig, $catalogAttributeKey); +} +// [END retail_v2_generated_CatalogService_AddCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php new file mode 100644 index 00000000000..ea0756ae9ec --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AttributesConfig $response */ + $response = $catalogServiceClient->getAttributesConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CatalogServiceClient::attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + get_attributes_config_sample($formattedName); +} +// [END retail_v2_generated_CatalogService_GetAttributesConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php new file mode 100644 index 00000000000..458acf9c098 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CompletionConfig $response */ + $response = $catalogServiceClient->getCompletionConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CatalogServiceClient::completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + get_completion_config_sample($formattedName); +} +// [END retail_v2_generated_CatalogService_GetCompletionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php new file mode 100644 index 00000000000..8ef78d4eaf4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php @@ -0,0 +1,59 @@ +getDefaultBranch($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END retail_v2_generated_CatalogService_GetDefaultBranch_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php new file mode 100644 index 00000000000..1c0cf49cdee --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $catalogServiceClient->listCatalogs($request); + + /** @var Catalog $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_catalogs_sample($formattedParent); +} +// [END retail_v2_generated_CatalogService_ListCatalogs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php new file mode 100644 index 00000000000..fa8a20fdbd6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php @@ -0,0 +1,85 @@ +setAttributesConfig($formattedAttributesConfig) + ->setKey($key); + + // Call the API and handle any network failures. + try { + /** @var AttributesConfig $response */ + $response = $catalogServiceClient->removeCatalogAttribute($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + $key = '[KEY]'; + + remove_catalog_attribute_sample($formattedAttributesConfig, $key); +} +// [END retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php new file mode 100644 index 00000000000..bac6a61170b --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php @@ -0,0 +1,101 @@ +setKey($catalogAttributeKey); + $request = (new ReplaceCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + + // Call the API and handle any network failures. + try { + /** @var AttributesConfig $response */ + $response = $catalogServiceClient->replaceCatalogAttribute($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + $catalogAttributeKey = '[KEY]'; + + replace_catalog_attribute_sample($formattedAttributesConfig, $catalogAttributeKey); +} +// [END retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php new file mode 100644 index 00000000000..d515f8b8583 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php @@ -0,0 +1,87 @@ +setDefaultBranch($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END retail_v2_generated_CatalogService_SetDefaultBranch_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php new file mode 100644 index 00000000000..e5b9a6bb312 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php @@ -0,0 +1,80 @@ +setName($attributesConfigName); + $request = (new UpdateAttributesConfigRequest()) + ->setAttributesConfig($attributesConfig); + + // Call the API and handle any network failures. + try { + /** @var AttributesConfig $response */ + $response = $catalogServiceClient->updateAttributesConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $attributesConfigName = '[NAME]'; + + update_attributes_config_sample($attributesConfigName); +} +// [END retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php new file mode 100644 index 00000000000..47c6438b7f5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php @@ -0,0 +1,81 @@ +setName($catalogName) + ->setDisplayName($catalogDisplayName) + ->setProductLevelConfig($catalogProductLevelConfig); + $request = (new UpdateCatalogRequest()) + ->setCatalog($catalog); + + // Call the API and handle any network failures. + try { + /** @var Catalog $response */ + $response = $catalogServiceClient->updateCatalog($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $catalogName = '[NAME]'; + $catalogDisplayName = '[DISPLAY_NAME]'; + + update_catalog_sample($catalogName, $catalogDisplayName); +} +// [END retail_v2_generated_CatalogService_UpdateCatalog_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php new file mode 100644 index 00000000000..ec211a74b0c --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php @@ -0,0 +1,73 @@ +setName($completionConfigName); + $request = (new UpdateCompletionConfigRequest()) + ->setCompletionConfig($completionConfig); + + // Call the API and handle any network failures. + try { + /** @var CompletionConfig $response */ + $response = $catalogServiceClient->updateCompletionConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $completionConfigName = '[NAME]'; + + update_completion_config_sample($completionConfigName); +} +// [END retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php new file mode 100644 index 00000000000..ff5859941d1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php @@ -0,0 +1,82 @@ +setCatalog($formattedCatalog) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var CompleteQueryResponse $response */ + $response = $completionServiceClient->completeQuery($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedCatalog = CompletionServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $query = '[QUERY]'; + + complete_query_sample($formattedCatalog, $query); +} +// [END retail_v2_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php new file mode 100644 index 00000000000..8bacda58553 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php @@ -0,0 +1,114 @@ +setDatasetId($inputConfigBigQuerySourceDatasetId) + ->setTableId($inputConfigBigQuerySourceTableId); + $inputConfig = (new CompletionDataInputConfig()) + ->setBigQuerySource($inputConfigBigQuerySource); + $request = (new ImportCompletionDataRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $completionServiceClient->importCompletionData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportCompletionDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CompletionServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfigBigQuerySourceDatasetId = '[DATASET_ID]'; + $inputConfigBigQuerySourceTableId = '[TABLE_ID]'; + + import_completion_data_sample( + $formattedParent, + $inputConfigBigQuerySourceDatasetId, + $inputConfigBigQuerySourceTableId + ); +} +// [END retail_v2_generated_CompletionService_ImportCompletionData_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php new file mode 100644 index 00000000000..a44ad023558 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php @@ -0,0 +1,109 @@ +setDisplayName($controlDisplayName) + ->setSolutionTypes($controlSolutionTypes); + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->createControl($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ControlServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $controlId = '[CONTROL_ID]'; + + create_control_sample( + $formattedParent, + $controlDisplayName, + $controlSolutionTypesElement, + $controlId + ); +} +// [END retail_v2_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php new file mode 100644 index 00000000000..5f0e35af579 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $controlServiceClient->deleteControl($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[CONTROL]' + ); + + delete_control_sample($formattedName); +} +// [END retail_v2_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php new file mode 100644 index 00000000000..69a50ab3679 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->getControl($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[CONTROL]' + ); + + get_control_sample($formattedName); +} +// [END retail_v2_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php new file mode 100644 index 00000000000..b09cea51465 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $controlServiceClient->listControls($request); + + /** @var Control $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ControlServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + list_controls_sample($formattedParent); +} +// [END retail_v2_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php new file mode 100644 index 00000000000..6230a8dbfb5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php @@ -0,0 +1,90 @@ +setDisplayName($controlDisplayName) + ->setSolutionTypes($controlSolutionTypes); + $request = (new UpdateControlRequest()) + ->setControl($control); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->updateControl($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + + update_control_sample($controlDisplayName, $controlSolutionTypesElement); +} +// [END retail_v2_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php new file mode 100644 index 00000000000..80df18e6762 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php @@ -0,0 +1,86 @@ +setCatalog($requestsGenerativeQuestionConfigCatalog) + ->setFacet($requestsGenerativeQuestionConfigFacet); + $updateGenerativeQuestionConfigRequest = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($requestsGenerativeQuestionConfig); + $requests = [$updateGenerativeQuestionConfigRequest,]; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var BatchUpdateGenerativeQuestionConfigsResponse $response */ + $response = $generativeQuestionServiceClient->batchUpdateGenerativeQuestionConfigs($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $requestsGenerativeQuestionConfigCatalog = '[CATALOG]'; + $requestsGenerativeQuestionConfigFacet = '[FACET]'; + + batch_update_generative_question_configs_sample( + $requestsGenerativeQuestionConfigCatalog, + $requestsGenerativeQuestionConfigFacet + ); +} +// [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php new file mode 100644 index 00000000000..a2c319426e8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php @@ -0,0 +1,77 @@ +setCatalog($formattedCatalog); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionsFeatureConfig $response */ + $response = $generativeQuestionServiceClient->getGenerativeQuestionsFeatureConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedCatalog = GenerativeQuestionServiceClient::catalogName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + + get_generative_questions_feature_config_sample($formattedCatalog); +} +// [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php new file mode 100644 index 00000000000..75edd24a1c4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListGenerativeQuestionConfigsResponse $response */ + $response = $generativeQuestionServiceClient->listGenerativeQuestionConfigs($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GenerativeQuestionServiceClient::catalogName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + + list_generative_question_configs_sample($formattedParent); +} +// [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php new file mode 100644 index 00000000000..238fd35b1e2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php @@ -0,0 +1,81 @@ +setCatalog($generativeQuestionConfigCatalog) + ->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($generativeQuestionConfig); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionConfig $response */ + $response = $generativeQuestionServiceClient->updateGenerativeQuestionConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $generativeQuestionConfigCatalog = '[CATALOG]'; + $generativeQuestionConfigFacet = '[FACET]'; + + update_generative_question_config_sample( + $generativeQuestionConfigCatalog, + $generativeQuestionConfigFacet + ); +} +// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php new file mode 100644 index 00000000000..3bca45526e4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php @@ -0,0 +1,75 @@ +setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionsFeatureConfig $response */ + $response = $generativeQuestionServiceClient->updateGenerativeQuestionsFeatureConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $generativeQuestionsFeatureConfigCatalog = '[CATALOG]'; + + update_generative_questions_feature_config_sample($generativeQuestionsFeatureConfigCatalog); +} +// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php new file mode 100644 index 00000000000..98249a1fc4a --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php @@ -0,0 +1,123 @@ +setName($modelName) + ->setDisplayName($modelDisplayName) + ->setType($modelType); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $modelServiceClient->createModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Model $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ModelServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $modelName = '[NAME]'; + $modelDisplayName = '[DISPLAY_NAME]'; + $modelType = '[TYPE]'; + + create_model_sample($formattedParent, $modelName, $modelDisplayName, $modelType); +} +// [END retail_v2_generated_ModelService_CreateModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php new file mode 100644 index 00000000000..87c0791403e --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $modelServiceClient->deleteModel($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + + delete_model_sample($formattedName); +} +// [END retail_v2_generated_ModelService_DeleteModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php new file mode 100644 index 00000000000..426d4691ec2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $modelServiceClient->getModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + + get_model_sample($formattedName); +} +// [END retail_v2_generated_ModelService_GetModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php new file mode 100644 index 00000000000..7fbefb53063 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $modelServiceClient->listModels($request); + + /** @var Model $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ModelServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + list_models_sample($formattedParent); +} +// [END retail_v2_generated_ModelService_ListModels_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php new file mode 100644 index 00000000000..934db502dca --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $modelServiceClient->pauseModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + + pause_model_sample($formattedName); +} +// [END retail_v2_generated_ModelService_PauseModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php new file mode 100644 index 00000000000..a3808d2ce83 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php @@ -0,0 +1,72 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $modelServiceClient->resumeModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + resume_model_sample($name); +} +// [END retail_v2_generated_ModelService_ResumeModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php new file mode 100644 index 00000000000..abcde637d7c --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $modelServiceClient->tuneModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TuneModelResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + + tune_model_sample($formattedName); +} +// [END retail_v2_generated_ModelService_TuneModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php new file mode 100644 index 00000000000..f556aac16e4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php @@ -0,0 +1,105 @@ +setName($modelName) + ->setDisplayName($modelDisplayName) + ->setType($modelType); + $request = (new UpdateModelRequest()) + ->setModel($model); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $modelServiceClient->updateModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $modelName = '[NAME]'; + $modelDisplayName = '[DISPLAY_NAME]'; + $modelType = '[TYPE]'; + + update_model_sample($modelName, $modelDisplayName, $modelType); +} +// [END retail_v2_generated_ModelService_UpdateModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php b/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php new file mode 100644 index 00000000000..cce7afb2ac3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php @@ -0,0 +1,123 @@ +setEventType($userEventEventType) + ->setVisitorId($userEventVisitorId); + $request = (new PredictRequest()) + ->setPlacement($placement) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var PredictResponse $response */ + $response = $predictionServiceClient->predict($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $placement = '[PLACEMENT]'; + $userEventEventType = '[EVENT_TYPE]'; + $userEventVisitorId = '[VISITOR_ID]'; + + predict_sample($placement, $userEventEventType, $userEventVisitorId); +} +// [END retail_v2_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php new file mode 100644 index 00000000000..36371b2045e --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php @@ -0,0 +1,167 @@ +setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->addFulfillmentPlaces($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AddFulfillmentPlacesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProduct = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + $type = '[TYPE]'; + $placeIdsElement = '[PLACE_IDS]'; + + add_fulfillment_places_sample($formattedProduct, $type, $placeIdsElement); +} +// [END retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php new file mode 100644 index 00000000000..686c82fd578 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php @@ -0,0 +1,125 @@ +setProduct($formattedProduct) + ->setLocalInventories($localInventories); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->addLocalInventories($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AddLocalInventoriesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProduct = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + + add_local_inventories_sample($formattedProduct); +} +// [END retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php new file mode 100644 index 00000000000..07bd44e2d33 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php @@ -0,0 +1,109 @@ +setTitle($productTitle); + $request = (new CreateProductRequest()) + ->setParent($formattedParent) + ->setProduct($product) + ->setProductId($productId); + + // Call the API and handle any network failures. + try { + /** @var Product $response */ + $response = $productServiceClient->createProduct($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ProductServiceClient::branchName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]' + ); + $productTitle = '[TITLE]'; + $productId = '[PRODUCT_ID]'; + + create_product_sample($formattedParent, $productTitle, $productId); +} +// [END retail_v2_generated_ProductService_CreateProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php new file mode 100644 index 00000000000..8614f38c8c9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php @@ -0,0 +1,95 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $productServiceClient->deleteProduct($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + + delete_product_sample($formattedName); +} +// [END retail_v2_generated_ProductService_DeleteProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php new file mode 100644 index 00000000000..a1fd427b076 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Product $response */ + $response = $productServiceClient->getProduct($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + + get_product_sample($formattedName); +} +// [END retail_v2_generated_ProductService_GetProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php new file mode 100644 index 00000000000..f0cf4f7810a --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php @@ -0,0 +1,101 @@ +setParent($formattedParent) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->importProducts($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportProductsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ProductServiceClient::branchName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]' + ); + + import_products_sample($formattedParent); +} +// [END retail_v2_generated_ProductService_ImportProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php new file mode 100644 index 00000000000..2b07288ea5b --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php @@ -0,0 +1,88 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $productServiceClient->listProducts($request); + + /** @var Product $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ProductServiceClient::branchName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]' + ); + + list_products_sample($formattedParent); +} +// [END retail_v2_generated_ProductService_ListProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php new file mode 100644 index 00000000000..93a27488aa8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php @@ -0,0 +1,147 @@ +", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + */ +function purge_products_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $productServiceClient = new ProductServiceClient(); + + // Prepare the request message. + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->purgeProducts($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PurgeProductsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ProductServiceClient::branchName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]' + ); + $filter = '[FILTER]'; + + purge_products_sample($formattedParent, $filter); +} +// [END retail_v2_generated_ProductService_PurgeProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php new file mode 100644 index 00000000000..5ecfecae044 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php @@ -0,0 +1,162 @@ +setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->removeFulfillmentPlaces($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RemoveFulfillmentPlacesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProduct = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + $type = '[TYPE]'; + $placeIdsElement = '[PLACE_IDS]'; + + remove_fulfillment_places_sample($formattedProduct, $type, $placeIdsElement); +} +// [END retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php new file mode 100644 index 00000000000..aa8c98a473d --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php @@ -0,0 +1,125 @@ +setProduct($formattedProduct) + ->setPlaceIds($placeIds); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->removeLocalInventories($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RemoveLocalInventoriesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProduct = ProductServiceClient::productName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]', + '[PRODUCT]' + ); + $placeIdsElement = '[PLACE_IDS]'; + + remove_local_inventories_sample($formattedProduct, $placeIdsElement); +} +// [END retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php new file mode 100644 index 00000000000..e62730e4257 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php @@ -0,0 +1,140 @@ +setTitle($inventoryTitle); + $request = (new SetInventoryRequest()) + ->setInventory($inventory); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->setInventory($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SetInventoryResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $inventoryTitle = '[TITLE]'; + + set_inventory_sample($inventoryTitle); +} +// [END retail_v2_generated_ProductService_SetInventory_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php new file mode 100644 index 00000000000..2fb61fc5b77 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php @@ -0,0 +1,79 @@ +setTitle($productTitle); + $request = (new UpdateProductRequest()) + ->setProduct($product); + + // Call the API and handle any network failures. + try { + /** @var Product $response */ + $response = $productServiceClient->updateProduct($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $productTitle = '[TITLE]'; + + update_product_sample($productTitle); +} +// [END retail_v2_generated_ProductService_UpdateProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php b/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php new file mode 100644 index 00000000000..855ed0d905c --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php @@ -0,0 +1,95 @@ +setPlacement($placement) + ->setVisitorId($visitorId); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $searchServiceClient->search($request); + + /** @var SearchResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $placement = '[PLACEMENT]'; + $visitorId = '[VISITOR_ID]'; + + search_sample($placement, $visitorId); +} +// [END retail_v2_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php new file mode 100644 index 00000000000..f9b4ab46366 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php @@ -0,0 +1,87 @@ +setServingConfig($formattedServingConfig) + ->setControlId($controlId); + + // Call the API and handle any network failures. + try { + /** @var ServingConfig $response */ + $response = $servingConfigServiceClient->addControl($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedServingConfig = ServingConfigServiceClient::servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[SERVING_CONFIG]' + ); + $controlId = '[CONTROL_ID]'; + + add_control_sample($formattedServingConfig, $controlId); +} +// [END retail_v2_generated_ServingConfigService_AddControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php new file mode 100644 index 00000000000..9c5f2c7019d --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php @@ -0,0 +1,107 @@ +setDisplayName($servingConfigDisplayName) + ->setSolutionTypes($servingConfigSolutionTypes); + $request = (new CreateServingConfigRequest()) + ->setParent($formattedParent) + ->setServingConfig($servingConfig) + ->setServingConfigId($servingConfigId); + + // Call the API and handle any network failures. + try { + /** @var ServingConfig $response */ + $response = $servingConfigServiceClient->createServingConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServingConfigServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $servingConfigDisplayName = '[DISPLAY_NAME]'; + $servingConfigSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $servingConfigId = '[SERVING_CONFIG_ID]'; + + create_serving_config_sample( + $formattedParent, + $servingConfigDisplayName, + $servingConfigSolutionTypesElement, + $servingConfigId + ); +} +// [END retail_v2_generated_ServingConfigService_CreateServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php new file mode 100644 index 00000000000..06c4a133ffe --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $servingConfigServiceClient->deleteServingConfig($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServingConfigServiceClient::servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[SERVING_CONFIG]' + ); + + delete_serving_config_sample($formattedName); +} +// [END retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php new file mode 100644 index 00000000000..420b6333f81 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ServingConfig $response */ + $response = $servingConfigServiceClient->getServingConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServingConfigServiceClient::servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[SERVING_CONFIG]' + ); + + get_serving_config_sample($formattedName); +} +// [END retail_v2_generated_ServingConfigService_GetServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php new file mode 100644 index 00000000000..c20f11f6532 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $servingConfigServiceClient->listServingConfigs($request); + + /** @var ServingConfig $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServingConfigServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + + list_serving_configs_sample($formattedParent); +} +// [END retail_v2_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php new file mode 100644 index 00000000000..8117bc33ab1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php @@ -0,0 +1,84 @@ +setServingConfig($formattedServingConfig) + ->setControlId($controlId); + + // Call the API and handle any network failures. + try { + /** @var ServingConfig $response */ + $response = $servingConfigServiceClient->removeControl($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedServingConfig = ServingConfigServiceClient::servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[SERVING_CONFIG]' + ); + $controlId = '[CONTROL_ID]'; + + remove_control_sample($formattedServingConfig, $controlId); +} +// [END retail_v2_generated_ServingConfigService_RemoveControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php new file mode 100644 index 00000000000..59721bf94f5 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php @@ -0,0 +1,84 @@ +setDisplayName($servingConfigDisplayName) + ->setSolutionTypes($servingConfigSolutionTypes); + $request = (new UpdateServingConfigRequest()) + ->setServingConfig($servingConfig); + + // Call the API and handle any network failures. + try { + /** @var ServingConfig $response */ + $response = $servingConfigServiceClient->updateServingConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $servingConfigDisplayName = '[DISPLAY_NAME]'; + $servingConfigSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + + update_serving_config_sample($servingConfigDisplayName, $servingConfigSolutionTypesElement); +} +// [END retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php new file mode 100644 index 00000000000..0d78171e7f1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php @@ -0,0 +1,79 @@ +setParent($parent) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var HttpBody $response */ + $response = $userEventServiceClient->collectUserEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $userEvent = '[USER_EVENT]'; + + collect_user_event_sample($parent, $userEvent); +} +// [END retail_v2_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php new file mode 100644 index 00000000000..0ebd88dfd85 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php @@ -0,0 +1,140 @@ +setEventType($inputConfigUserEventInlineSourceUserEventsEventType) + ->setVisitorId($inputConfigUserEventInlineSourceUserEventsVisitorId); + $inputConfigUserEventInlineSourceUserEvents = [$userEvent,]; + $inputConfigUserEventInlineSource = (new UserEventInlineSource()) + ->setUserEvents($inputConfigUserEventInlineSourceUserEvents); + $inputConfig = (new UserEventInputConfig()) + ->setUserEventInlineSource($inputConfigUserEventInlineSource); + $request = (new ImportUserEventsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $userEventServiceClient->importUserEvents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportUserEventsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfigUserEventInlineSourceUserEventsEventType = '[EVENT_TYPE]'; + $inputConfigUserEventInlineSourceUserEventsVisitorId = '[VISITOR_ID]'; + + import_user_events_sample( + $formattedParent, + $inputConfigUserEventInlineSourceUserEventsEventType, + $inputConfigUserEventInlineSourceUserEventsVisitorId + ); +} +// [END retail_v2_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php new file mode 100644 index 00000000000..e97fa60dc97 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php @@ -0,0 +1,113 @@ + "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z"` + * * Deleting specific eventType in time range: + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * * Deleting all events for a specific visitor: + * `visitorId = "visitor1024"` + * + * The filtering fields are assumed to have an implicit AND. + */ +function purge_user_events_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $userEventServiceClient = new UserEventServiceClient(); + + // Prepare the request message. + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $userEventServiceClient->purgeUserEvents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PurgeUserEventsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = UserEventServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $filter = '[FILTER]'; + + purge_user_events_sample($formattedParent, $filter); +} +// [END retail_v2_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php new file mode 100644 index 00000000000..c7b843e74dd --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php @@ -0,0 +1,90 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $userEventServiceClient->rejoinUserEvents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RejoinUserEventsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + rejoin_user_events_sample($parent); +} +// [END retail_v2_generated_UserEventService_RejoinUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php new file mode 100644 index 00000000000..8a1b7bf0938 --- /dev/null +++ b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php @@ -0,0 +1,110 @@ +setEventType($userEventEventType) + ->setVisitorId($userEventVisitorId); + $request = (new WriteUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + + // Call the API and handle any network failures. + try { + /** @var UserEvent $response */ + $response = $userEventServiceClient->writeUserEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $userEventEventType = '[EVENT_TYPE]'; + $userEventVisitorId = '[VISITOR_ID]'; + + write_user_event_sample($parent, $userEventEventType, $userEventVisitorId); +} +// [END retail_v2_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php new file mode 100644 index 00000000000..b9b8dc8522c --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php @@ -0,0 +1,253 @@ + exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest $request, array $optionalArgs = []) + */ +final class AnalyticsServiceClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.AnalyticsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/analytics_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/analytics_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/analytics_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/analytics_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Exports analytics metrics. + * + * `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + * `Operation.metadata` is of type `ExportMetadata`. + * + * The async variant is + * {@see AnalyticsServiceClient::exportAnalyticsMetricsAsync()} . + * + * @example samples/V2/AnalyticsServiceClient/export_analytics_metrics.php + * + * @param ExportAnalyticsMetricsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportAnalyticsMetrics(ExportAnalyticsMetricsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportAnalyticsMetrics', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php new file mode 100644 index 00000000000..52d6e23be5d --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php @@ -0,0 +1,668 @@ + addCatalogAttributeAsync(AddCatalogAttributeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAttributesConfigAsync(GetAttributesConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getCompletionConfigAsync(GetCompletionConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDefaultBranchAsync(GetDefaultBranchRequest $request, array $optionalArgs = []) + * @method PromiseInterface listCatalogsAsync(ListCatalogsRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeCatalogAttributeAsync(RemoveCatalogAttributeRequest $request, array $optionalArgs = []) + * @method PromiseInterface replaceCatalogAttributeAsync(ReplaceCatalogAttributeRequest $request, array $optionalArgs = []) + * @method PromiseInterface setDefaultBranchAsync(SetDefaultBranchRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAttributesConfigAsync(UpdateAttributesConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateCatalogAsync(UpdateCatalogRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateCompletionConfigAsync(UpdateCompletionConfigRequest $request, array $optionalArgs = []) + */ +final class CatalogServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.CatalogService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * attributes_config resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * + * @return string The formatted attributes_config resource. + */ + public static function attributesConfigName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('attributesConfig')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a branch + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * + * @return string The formatted branch resource. + */ + public static function branchName(string $project, string $location, string $catalog, string $branch): string + { + return self::getPathTemplate('branch')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + ]); + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * completion_config resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * + * @return string The formatted completion_config resource. + */ + public static function completionConfigName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('completionConfig')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - attributesConfig: projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig + * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} + * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} + * - completionConfig: projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig + * - location: projects/{project}/locations/{location} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds the specified + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add + * already exists, an ALREADY_EXISTS error is returned. + * + * The async variant is {@see CatalogServiceClient::addCatalogAttributeAsync()} . + * + * @example samples/V2/CatalogServiceClient/add_catalog_attribute.php + * + * @param AddCatalogAttributeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AttributesConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function addCatalogAttribute(AddCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig + { + return $this->startApiCall('AddCatalogAttribute', $request, $callOptions)->wait(); + } + + /** + * Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + * The async variant is {@see CatalogServiceClient::getAttributesConfigAsync()} . + * + * @example samples/V2/CatalogServiceClient/get_attributes_config.php + * + * @param GetAttributesConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AttributesConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAttributesConfig(GetAttributesConfigRequest $request, array $callOptions = []): AttributesConfig + { + return $this->startApiCall('GetAttributesConfig', $request, $callOptions)->wait(); + } + + /** + * Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig]. + * + * The async variant is {@see CatalogServiceClient::getCompletionConfigAsync()} . + * + * @example samples/V2/CatalogServiceClient/get_completion_config.php + * + * @param GetCompletionConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CompletionConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCompletionConfig(GetCompletionConfigRequest $request, array $callOptions = []): CompletionConfig + { + return $this->startApiCall('GetCompletionConfig', $request, $callOptions)->wait(); + } + + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + * The async variant is {@see CatalogServiceClient::getDefaultBranchAsync()} . + * + * @example samples/V2/CatalogServiceClient/get_default_branch.php + * + * @param GetDefaultBranchRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 GetDefaultBranchResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDefaultBranch(GetDefaultBranchRequest $request, array $callOptions = []): GetDefaultBranchResponse + { + return $this->startApiCall('GetDefaultBranch', $request, $callOptions)->wait(); + } + + /** + * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with + * the project. + * + * The async variant is {@see CatalogServiceClient::listCatalogsAsync()} . + * + * @example samples/V2/CatalogServiceClient/list_catalogs.php + * + * @param ListCatalogsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCatalogs(ListCatalogsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCatalogs', $request, $callOptions); + } + + /** + * Removes the specified + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to + * remove does not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see CatalogServiceClient::removeCatalogAttributeAsync()} + * . + * + * @example samples/V2/CatalogServiceClient/remove_catalog_attribute.php + * + * @param RemoveCatalogAttributeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AttributesConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeCatalogAttribute(RemoveCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig + { + return $this->startApiCall('RemoveCatalogAttribute', $request, $callOptions)->wait(); + } + + /** + * Replaces the specified + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the + * catalog attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. + * + * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to + * replace does not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see CatalogServiceClient::replaceCatalogAttributeAsync()} + * . + * + * @example samples/V2/CatalogServiceClient/replace_catalog_attribute.php + * + * @param ReplaceCatalogAttributeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AttributesConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function replaceCatalogAttribute(ReplaceCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig + { + return $this->startApiCall('ReplaceCatalogAttribute', $request, $callOptions)->wait(); + } + + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + * will treat requests using "default_branch" to the actual branch id set as + * default. + * + * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + * default, setting + * [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + * to setting + * [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/1`. + * + * Using multiple branches can be useful when developers would like + * to have a staging branch to test and verify for future usage. When it + * becomes ready, developers switch on the staging branch using this API while + * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` + * as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + * route the traffic to this staging branch. + * + * CAUTION: If you have live predict/search traffic, switching the default + * branch could potentially cause outages if the ID space of the new branch is + * very different from the old one. + * + * More specifically: + * + * * PredictionService will only return product IDs from branch {newBranch}. + * * SearchService will only return product IDs from branch {newBranch} + * (if branch is not explicitly set). + * * UserEventService will only join events with products from branch + * {newBranch}. + * + * The async variant is {@see CatalogServiceClient::setDefaultBranchAsync()} . + * + * @example samples/V2/CatalogServiceClient/set_default_branch.php + * + * @param SetDefaultBranchRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function setDefaultBranch(SetDefaultBranchRequest $request, array $callOptions = []): void + { + $this->startApiCall('SetDefaultBranch', $request, $callOptions)->wait(); + } + + /** + * Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + * The catalog attributes in the request will be updated in the catalog, or + * inserted if they do not exist. Existing catalog attributes not included in + * the request will remain unchanged. Attributes that are assigned to + * products, but do not exist at the catalog level, are always included in the + * response. The product attribute is assigned default values for missing + * catalog attribute fields, e.g., searchable and dynamic facetable options. + * + * The async variant is {@see CatalogServiceClient::updateAttributesConfigAsync()} + * . + * + * @example samples/V2/CatalogServiceClient/update_attributes_config.php + * + * @param UpdateAttributesConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AttributesConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAttributesConfig(UpdateAttributesConfigRequest $request, array $callOptions = []): AttributesConfig + { + return $this->startApiCall('UpdateAttributesConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the [Catalog][google.cloud.retail.v2.Catalog]s. + * + * The async variant is {@see CatalogServiceClient::updateCatalogAsync()} . + * + * @example samples/V2/CatalogServiceClient/update_catalog.php + * + * @param UpdateCatalogRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Catalog + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCatalog(UpdateCatalogRequest $request, array $callOptions = []): Catalog + { + return $this->startApiCall('UpdateCatalog', $request, $callOptions)->wait(); + } + + /** + * Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s. + * + * The async variant is {@see CatalogServiceClient::updateCompletionConfigAsync()} + * . + * + * @example samples/V2/CatalogServiceClient/update_completion_config.php + * + * @param UpdateCompletionConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CompletionConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCompletionConfig(UpdateCompletionConfigRequest $request, array $callOptions = []): CompletionConfig + { + return $this->startApiCall('UpdateCompletionConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php new file mode 100644 index 00000000000..cfa9a0533eb --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php @@ -0,0 +1,340 @@ + completeQueryAsync(CompleteQueryRequest $request, array $optionalArgs = []) + * @method PromiseInterface importCompletionDataAsync(ImportCompletionDataRequest $request, array $optionalArgs = []) + */ +final class CompletionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.CompletionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/completion_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/completion_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/completion_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/completion_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * 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} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Completes the specified prefix with keyword suggestions. + * + * This feature is only available for users who have Retail Search enabled. + * Enable Retail Search on Cloud Console before using this feature. + * + * The async variant is {@see CompletionServiceClient::completeQueryAsync()} . + * + * @example samples/V2/CompletionServiceClient/complete_query.php + * + * @param CompleteQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CompleteQueryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function completeQuery(CompleteQueryRequest $request, array $callOptions = []): CompleteQueryResponse + { + return $this->startApiCall('CompleteQuery', $request, $callOptions)->wait(); + } + + /** + * Bulk import of processed completion dataset. + * + * Request processing is asynchronous. Partial updating is not supported. + * + * The operation is successfully finished only after the imported suggestions + * are indexed successfully and ready for serving. The process takes hours. + * + * This feature is only available for users who have Retail Search enabled. + * Enable Retail Search on Cloud Console before using this feature. + * + * The async variant is {@see CompletionServiceClient::importCompletionDataAsync()} + * . + * + * @example samples/V2/CompletionServiceClient/import_completion_data.php + * + * @param ImportCompletionDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importCompletionData(ImportCompletionDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportCompletionData', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php new file mode 100644 index 00000000000..af3facb1704 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php @@ -0,0 +1,388 @@ + createControlAsync(CreateControlRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteControlAsync(DeleteControlRequest $request, array $optionalArgs = []) + * @method PromiseInterface getControlAsync(GetControlRequest $request, array $optionalArgs = []) + * @method PromiseInterface listControlsAsync(ListControlsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateControlAsync(UpdateControlRequest $request, array $optionalArgs = []) + */ +final class ControlServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.ControlService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/control_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/control_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/control_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/control_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a control + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $control + * + * @return string The formatted control resource. + */ + public static function controlName(string $project, string $location, string $catalog, string $control): string + { + return self::getPathTemplate('control')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'control' => $control, + ]); + } + + /** + * 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} + * - control: projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Control. + * + * If the [Control][google.cloud.retail.v2.Control] to create already exists, + * an ALREADY_EXISTS error is returned. + * + * The async variant is {@see ControlServiceClient::createControlAsync()} . + * + * @example samples/V2/ControlServiceClient/create_control.php + * + * @param CreateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function createControl(CreateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('CreateControl', $request, $callOptions)->wait(); + } + + /** + * Deletes a Control. + * + * If the [Control][google.cloud.retail.v2.Control] to delete does not exist, + * a NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::deleteControlAsync()} . + * + * @example samples/V2/ControlServiceClient/delete_control.php + * + * @param DeleteControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteControl(DeleteControlRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteControl', $request, $callOptions)->wait(); + } + + /** + * Gets a Control. + * + * The async variant is {@see ControlServiceClient::getControlAsync()} . + * + * @example samples/V2/ControlServiceClient/get_control.php + * + * @param GetControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function getControl(GetControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('GetControl', $request, $callOptions)->wait(); + } + + /** + * Lists all Controls by their parent + * [Catalog][google.cloud.retail.v2.Catalog]. + * + * The async variant is {@see ControlServiceClient::listControlsAsync()} . + * + * @example samples/V2/ControlServiceClient/list_controls.php + * + * @param ListControlsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listControls(ListControlsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListControls', $request, $callOptions); + } + + /** + * Updates a Control. + * + * [Control][google.cloud.retail.v2.Control] cannot be set to a different + * oneof field, if so an INVALID_ARGUMENT is returned. If the + * [Control][google.cloud.retail.v2.Control] to update does not exist, a + * NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::updateControlAsync()} . + * + * @example samples/V2/ControlServiceClient/update_control.php + * + * @param UpdateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateControl(UpdateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('UpdateControl', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php new file mode 100644 index 00000000000..39b4b5e000b --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php @@ -0,0 +1,368 @@ + batchUpdateGenerativeQuestionConfigsAsync(BatchUpdateGenerativeQuestionConfigsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGenerativeQuestionsFeatureConfigAsync(GetGenerativeQuestionsFeatureConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGenerativeQuestionConfigsAsync(ListGenerativeQuestionConfigsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateGenerativeQuestionConfigAsync(UpdateGenerativeQuestionConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateGenerativeQuestionsFeatureConfigAsync(UpdateGenerativeQuestionsFeatureConfigRequest $request, array $optionalArgs = []) + */ +final class GenerativeQuestionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.GenerativeQuestionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generative_question_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generative_question_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generative_question_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generative_question_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * 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} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Allows management of multiple questions. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::batchUpdateGenerativeQuestionConfigsAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php + * + * @param BatchUpdateGenerativeQuestionConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 BatchUpdateGenerativeQuestionConfigsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateGenerativeQuestionConfigs(BatchUpdateGenerativeQuestionConfigsRequest $request, array $callOptions = []): BatchUpdateGenerativeQuestionConfigsResponse + { + return $this->startApiCall('BatchUpdateGenerativeQuestionConfigs', $request, $callOptions)->wait(); + } + + /** + * Manages overal generative question feature state -- enables toggling + * feature on and off. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::getGenerativeQuestionsFeatureConfigAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php + * + * @param GetGenerativeQuestionsFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 GenerativeQuestionsFeatureConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGenerativeQuestionsFeatureConfig(GetGenerativeQuestionsFeatureConfigRequest $request, array $callOptions = []): GenerativeQuestionsFeatureConfig + { + return $this->startApiCall('GetGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Returns all questions for a given catalog. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::listGenerativeQuestionConfigsAsync()} . + * + * @example samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php + * + * @param ListGenerativeQuestionConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ListGenerativeQuestionConfigsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGenerativeQuestionConfigs(ListGenerativeQuestionConfigsRequest $request, array $callOptions = []): ListGenerativeQuestionConfigsResponse + { + return $this->startApiCall('ListGenerativeQuestionConfigs', $request, $callOptions)->wait(); + } + + /** + * Allows management of individual questions. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionConfigAsync()} . + * + * @example samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php + * + * @param UpdateGenerativeQuestionConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 GenerativeQuestionConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerativeQuestionConfig(UpdateGenerativeQuestionConfigRequest $request, array $callOptions = []): GenerativeQuestionConfig + { + return $this->startApiCall('UpdateGenerativeQuestionConfig', $request, $callOptions)->wait(); + } + + /** + * Manages overal generative question feature state -- enables toggling + * feature on and off. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionsFeatureConfigAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php + * + * @param UpdateGenerativeQuestionsFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 GenerativeQuestionsFeatureConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerativeQuestionsFeatureConfig(UpdateGenerativeQuestionsFeatureConfigRequest $request, array $callOptions = []): GenerativeQuestionsFeatureConfig + { + return $this->startApiCall('UpdateGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php new file mode 100644 index 00000000000..7762a6ed486 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php @@ -0,0 +1,528 @@ + createModelAsync(CreateModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteModelAsync(DeleteModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getModelAsync(GetModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface listModelsAsync(ListModelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface pauseModelAsync(PauseModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeModelAsync(ResumeModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface tuneModelAsync(TuneModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateModelAsync(UpdateModelRequest $request, array $optionalArgs = []) + */ +final class ModelServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.ModelService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/model_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/model_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/model_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/model_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $catalog, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'model' => $model, + ]); + } + + /** + * 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} + * - model: projects/{project}/locations/{location}/catalogs/{catalog}/models/{model} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new model. + * + * The async variant is {@see ModelServiceClient::createModelAsync()} . + * + * @example samples/V2/ModelServiceClient/create_model.php + * + * @param CreateModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createModel(CreateModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateModel', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing model. + * + * The async variant is {@see ModelServiceClient::deleteModelAsync()} . + * + * @example samples/V2/ModelServiceClient/delete_model.php + * + * @param DeleteModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteModel(DeleteModelRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteModel', $request, $callOptions)->wait(); + } + + /** + * Gets a model. + * + * The async variant is {@see ModelServiceClient::getModelAsync()} . + * + * @example samples/V2/ModelServiceClient/get_model.php + * + * @param GetModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function getModel(GetModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('GetModel', $request, $callOptions)->wait(); + } + + /** + * Lists all the models linked to this event store. + * + * The async variant is {@see ModelServiceClient::listModelsAsync()} . + * + * @example samples/V2/ModelServiceClient/list_models.php + * + * @param ListModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listModels(ListModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListModels', $request, $callOptions); + } + + /** + * Pauses the training of an existing model. + * + * The async variant is {@see ModelServiceClient::pauseModelAsync()} . + * + * @example samples/V2/ModelServiceClient/pause_model.php + * + * @param PauseModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function pauseModel(PauseModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('PauseModel', $request, $callOptions)->wait(); + } + + /** + * Resumes the training of an existing model. + * + * The async variant is {@see ModelServiceClient::resumeModelAsync()} . + * + * @example samples/V2/ModelServiceClient/resume_model.php + * + * @param ResumeModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeModel(ResumeModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('ResumeModel', $request, $callOptions)->wait(); + } + + /** + * Tunes an existing model. + * + * The async variant is {@see ModelServiceClient::tuneModelAsync()} . + * + * @example samples/V2/ModelServiceClient/tune_model.php + * + * @param TuneModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function tuneModel(TuneModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TuneModel', $request, $callOptions)->wait(); + } + + /** + * Update of model metadata. Only fields that + * currently can be updated are: `filtering_option` and + * `periodic_tuning_state`. + * If other values are provided, this API method ignores them. + * + * The async variant is {@see ModelServiceClient::updateModelAsync()} . + * + * @example samples/V2/ModelServiceClient/update_model.php + * + * @param UpdateModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateModel(UpdateModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('UpdateModel', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php new file mode 100644 index 00000000000..c76b0674a7d --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php @@ -0,0 +1,247 @@ + predictAsync(PredictRequest $request, array $optionalArgs = []) + */ +final class PredictionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.PredictionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a product + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * @param string $product + * + * @return string The formatted product resource. + */ + public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string + { + return self::getPathTemplate('product')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + 'product' => $product, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Makes a recommendation prediction. + * + * The async variant is {@see PredictionServiceClient::predictAsync()} . + * + * @example samples/V2/PredictionServiceClient/predict.php + * + * @param PredictRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PredictResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function predict(PredictRequest $request, array $callOptions = []): PredictResponse + { + return $this->startApiCall('Predict', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php new file mode 100644 index 00000000000..53e15fe343d --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php @@ -0,0 +1,813 @@ + addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest $request, array $optionalArgs = []) + * @method PromiseInterface addLocalInventoriesAsync(AddLocalInventoriesRequest $request, array $optionalArgs = []) + * @method PromiseInterface createProductAsync(CreateProductRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteProductAsync(DeleteProductRequest $request, array $optionalArgs = []) + * @method PromiseInterface getProductAsync(GetProductRequest $request, array $optionalArgs = []) + * @method PromiseInterface importProductsAsync(ImportProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listProductsAsync(ListProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface purgeProductsAsync(PurgeProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeLocalInventoriesAsync(RemoveLocalInventoriesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setInventoryAsync(SetInventoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateProductAsync(UpdateProductRequest $request, array $optionalArgs = []) + */ +final class ProductServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.ProductService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/product_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/product_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/product_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/product_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a branch + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * + * @return string The formatted branch resource. + */ + public static function branchName(string $project, string $location, string $catalog, string $branch): string + { + return self::getPathTemplate('branch')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a product + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * @param string $product + * + * @return string The formatted product resource. + */ + public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string + { + return self::getPathTemplate('product')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + 'product' => $product, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} + * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * We recommend that you use the + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * method instead of the + * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + * method. + * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + * achieves the same results but provides more fine-grained control over + * ingesting local inventory data. + * + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. + * + * This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2.Product] to exist before updating + * fulfillment information. If the request is valid, the update will be + * enqueued and processed downstream. As a consequence, when a response is + * returned, the added place IDs are not immediately manifested in the + * [Product][google.cloud.retail.v2.Product] queried by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. + * + * The async variant is {@see ProductServiceClient::addFulfillmentPlacesAsync()} . + * + * @example samples/V2/ProductServiceClient/add_fulfillment_places.php + * + * @param AddFulfillmentPlacesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addFulfillmentPlaces(AddFulfillmentPlacesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddFulfillmentPlaces', $request, $callOptions)->wait(); + } + + /** + * Updates local inventory information for a + * [Product][google.cloud.retail.v2.Product] at a list of places, while + * respecting the last update timestamps of each inventory field. + * + * This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2.Product] to exist before updating + * inventory information. If the request is valid, the update will be enqueued + * and processed downstream. As a consequence, when a response is returned, + * updates are not immediately manifested in the + * [Product][google.cloud.retail.v2.Product] queried by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Local inventory information can only be modified using this method. + * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + * and + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * has no effect on local inventories. + * + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. + * + * The async variant is {@see ProductServiceClient::addLocalInventoriesAsync()} . + * + * @example samples/V2/ProductServiceClient/add_local_inventories.php + * + * @param AddLocalInventoriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addLocalInventories(AddLocalInventoriesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddLocalInventories', $request, $callOptions)->wait(); + } + + /** + * Creates a [Product][google.cloud.retail.v2.Product]. + * + * The async variant is {@see ProductServiceClient::createProductAsync()} . + * + * @example samples/V2/ProductServiceClient/create_product.php + * + * @param CreateProductRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Product + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProduct(CreateProductRequest $request, array $callOptions = []): Product + { + return $this->startApiCall('CreateProduct', $request, $callOptions)->wait(); + } + + /** + * Deletes a [Product][google.cloud.retail.v2.Product]. + * + * The async variant is {@see ProductServiceClient::deleteProductAsync()} . + * + * @example samples/V2/ProductServiceClient/delete_product.php + * + * @param DeleteProductRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteProduct(DeleteProductRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteProduct', $request, $callOptions)->wait(); + } + + /** + * Gets a [Product][google.cloud.retail.v2.Product]. + * + * The async variant is {@see ProductServiceClient::getProductAsync()} . + * + * @example samples/V2/ProductServiceClient/get_product.php + * + * @param GetProductRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Product + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProduct(GetProductRequest $request, array $callOptions = []): Product + { + return $this->startApiCall('GetProduct', $request, $callOptions)->wait(); + } + + /** + * Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. + * + * Request processing may be synchronous. + * Non-existing items are created. + * + * Note that it is possible for a subset of the + * [Product][google.cloud.retail.v2.Product]s to be successfully updated. + * + * The async variant is {@see ProductServiceClient::importProductsAsync()} . + * + * @example samples/V2/ProductServiceClient/import_products.php + * + * @param ImportProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importProducts(ImportProductsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportProducts', $request, $callOptions)->wait(); + } + + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + * The async variant is {@see ProductServiceClient::listProductsAsync()} . + * + * @example samples/V2/ProductServiceClient/list_products.php + * + * @param ListProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProducts(ListProductsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProducts', $request, $callOptions); + } + + /** + * Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s + * under a branch. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed offline. Depending on the number of + * [Product][google.cloud.retail.v2.Product]s, this operation could take hours + * to complete. Before the operation completes, some + * [Product][google.cloud.retail.v2.Product]s may still be returned by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Depending on the number of [Product][google.cloud.retail.v2.Product]s, this + * operation could take hours to complete. To get a sample of + * [Product][google.cloud.retail.v2.Product]s that would be deleted, set + * [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] + * to false. + * + * The async variant is {@see ProductServiceClient::purgeProductsAsync()} . + * + * @example samples/V2/ProductServiceClient/purge_products.php + * + * @param PurgeProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function purgeProducts(PurgeProductsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PurgeProducts', $request, $callOptions)->wait(); + } + + /** + * We recommend that you use the + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * method instead of the + * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + * method. + * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + * achieves the same results but provides more fine-grained control over + * ingesting local inventory data. + * + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. + * + * This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2.Product] to exist before updating + * fulfillment information. If the request is valid, the update will be + * enqueued and processed downstream. As a consequence, when a response is + * returned, the removed place IDs are not immediately manifested in the + * [Product][google.cloud.retail.v2.Product] queried by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. + * + * The async variant is {@see ProductServiceClient::removeFulfillmentPlacesAsync()} + * . + * + * @example samples/V2/ProductServiceClient/remove_fulfillment_places.php + * + * @param RemoveFulfillmentPlacesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeFulfillmentPlaces(RemoveFulfillmentPlacesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveFulfillmentPlaces', $request, $callOptions)->wait(); + } + + /** + * Remove local inventory information for a + * [Product][google.cloud.retail.v2.Product] at a list of places at a removal + * timestamp. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed downstream. As a consequence, when a response is + * returned, removals are not immediately manifested in the + * [Product][google.cloud.retail.v2.Product] queried by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Local inventory information can only be removed using this method. + * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + * and + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * has no effect on local inventories. + * + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. + * + * The async variant is {@see ProductServiceClient::removeLocalInventoriesAsync()} + * . + * + * @example samples/V2/ProductServiceClient/remove_local_inventories.php + * + * @param RemoveLocalInventoriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeLocalInventories(RemoveLocalInventoriesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveLocalInventories', $request, $callOptions)->wait(); + } + + /** + * Updates inventory information for a + * [Product][google.cloud.retail.v2.Product] while respecting the last update + * timestamps of each inventory field. + * + * This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2.Product] to exist before updating + * fulfillment information. If the request is valid, the update is enqueued + * and processed downstream. As a consequence, when a response is returned, + * updates are not immediately manifested in the + * [Product][google.cloud.retail.v2.Product] queried by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * When inventory is updated with + * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + * and + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], + * the specified inventory field value(s) overwrite any existing value(s) + * while ignoring the last update time for this field. Furthermore, the last + * update times for the specified inventory fields are overwritten by the + * times of the + * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + * or + * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + * request. + * + * If no inventory fields are set in + * [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], + * then any pre-existing inventory information for this product is used. + * + * If no inventory fields are set in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], + * then any existing inventory information is preserved. + * + * Pre-existing inventory information can only be updated with + * [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], + * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], + * and + * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + * + * The returned [Operation][google.longrunning.Operation]s is obsolete after + * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + * API returns `NOT_FOUND` afterwards. + * + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates are not marked as [done][google.longrunning.Operation.done] until + * they are obsolete. + * + * The async variant is {@see ProductServiceClient::setInventoryAsync()} . + * + * @example samples/V2/ProductServiceClient/set_inventory.php + * + * @param SetInventoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setInventory(SetInventoryRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetInventory', $request, $callOptions)->wait(); + } + + /** + * Updates a [Product][google.cloud.retail.v2.Product]. + * + * The async variant is {@see ProductServiceClient::updateProductAsync()} . + * + * @example samples/V2/ProductServiceClient/update_product.php + * + * @param UpdateProductRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Product + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateProduct(UpdateProductRequest $request, array $callOptions = []): Product + { + return $this->startApiCall('UpdateProduct', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php new file mode 100644 index 00000000000..12904e8aa63 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php @@ -0,0 +1,251 @@ + searchAsync(SearchRequest $request, array $optionalArgs = []) + */ +final class SearchServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.SearchService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/search_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/search_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/search_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/search_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a branch + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * + * @return string The formatted branch resource. + */ + public static function branchName(string $project, string $location, string $catalog, string $branch): string + { + return self::getPathTemplate('branch')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Performs a search. + * + * This feature is only available for users who have Retail Search enabled. + * Enable Retail Search on Cloud Console before using this feature. + * + * The async variant is {@see SearchServiceClient::searchAsync()} . + * + * @example samples/V2/SearchServiceClient/search.php + * + * @param SearchRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function search(SearchRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('Search', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php new file mode 100644 index 00000000000..7b375c917f1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php @@ -0,0 +1,454 @@ + addControlAsync(AddControlRequest $request, array $optionalArgs = []) + * @method PromiseInterface createServingConfigAsync(CreateServingConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteServingConfigAsync(DeleteServingConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getServingConfigAsync(GetServingConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface listServingConfigsAsync(ListServingConfigsRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeControlAsync(RemoveControlRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateServingConfigAsync(UpdateServingConfigRequest $request, array $optionalArgs = []) + */ +final class ServingConfigServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.ServingConfigService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/serving_config_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/serving_config_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/serving_config_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/serving_config_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * serving_config resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $servingConfig + * + * @return string The formatted serving_config resource. + */ + public static function servingConfigName(string $project, string $location, string $catalog, string $servingConfig): string + { + return self::getPathTemplate('servingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'serving_config' => $servingConfig, + ]); + } + + /** + * 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} + * - servingConfig: projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Enables a Control on the specified ServingConfig. + * The control is added in the last position of the list of controls + * it belongs to (e.g. if it's a facet spec control it will be applied + * in the last position of servingConfig.facetSpecIds) + * Returns a ALREADY_EXISTS error if the control has already been applied. + * Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + * The async variant is {@see ServingConfigServiceClient::addControlAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/add_control.php + * + * @param AddControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ServingConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function addControl(AddControlRequest $request, array $callOptions = []): ServingConfig + { + return $this->startApiCall('AddControl', $request, $callOptions)->wait(); + } + + /** + * Creates a ServingConfig. + * + * A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are + * allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a + * FAILED_PRECONDITION error is returned. + * + * The async variant is + * {@see ServingConfigServiceClient::createServingConfigAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/create_serving_config.php + * + * @param CreateServingConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ServingConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function createServingConfig(CreateServingConfigRequest $request, array $callOptions = []): ServingConfig + { + return $this->startApiCall('CreateServingConfig', $request, $callOptions)->wait(); + } + + /** + * Deletes a ServingConfig. + * + * Returns a NotFound error if the ServingConfig does not exist. + * + * The async variant is + * {@see ServingConfigServiceClient::deleteServingConfigAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/delete_serving_config.php + * + * @param DeleteServingConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteServingConfig(DeleteServingConfigRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteServingConfig', $request, $callOptions)->wait(); + } + + /** + * Gets a ServingConfig. + * + * Returns a NotFound error if the ServingConfig does not exist. + * + * The async variant is {@see ServingConfigServiceClient::getServingConfigAsync()} + * . + * + * @example samples/V2/ServingConfigServiceClient/get_serving_config.php + * + * @param GetServingConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ServingConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getServingConfig(GetServingConfigRequest $request, array $callOptions = []): ServingConfig + { + return $this->startApiCall('GetServingConfig', $request, $callOptions)->wait(); + } + + /** + * Lists all ServingConfigs linked to this catalog. + * + * The async variant is + * {@see ServingConfigServiceClient::listServingConfigsAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/list_serving_configs.php + * + * @param ListServingConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServingConfigs(ListServingConfigsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServingConfigs', $request, $callOptions); + } + + /** + * Disables a Control on the specified ServingConfig. + * The control is removed from the ServingConfig. + * Returns a NOT_FOUND error if the Control is not enabled for the + * ServingConfig. + * + * The async variant is {@see ServingConfigServiceClient::removeControlAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/remove_control.php + * + * @param RemoveControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ServingConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeControl(RemoveControlRequest $request, array $callOptions = []): ServingConfig + { + return $this->startApiCall('RemoveControl', $request, $callOptions)->wait(); + } + + /** + * Updates a ServingConfig. + * + * The async variant is + * {@see ServingConfigServiceClient::updateServingConfigAsync()} . + * + * @example samples/V2/ServingConfigServiceClient/update_serving_config.php + * + * @param UpdateServingConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ServingConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateServingConfig(UpdateServingConfigRequest $request, array $callOptions = []): ServingConfig + { + return $this->startApiCall('UpdateServingConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php new file mode 100644 index 00000000000..3ae967be368 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php @@ -0,0 +1,455 @@ + collectUserEventAsync(CollectUserEventRequest $request, array $optionalArgs = []) + * @method PromiseInterface importUserEventsAsync(ImportUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface purgeUserEventsAsync(PurgeUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface rejoinUserEventsAsync(RejoinUserEventsRequest $request, array $optionalArgs = []) + * @method PromiseInterface writeUserEventAsync(WriteUserEventRequest $request, array $optionalArgs = []) + */ +final class UserEventServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.retail.v2.UserEventService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'retail.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * 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. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a product + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $branch + * @param string $product + * + * @return string The formatted product resource. + */ + public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string + { + return self::getPathTemplate('product')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'branch' => $branch, + 'product' => $product, + ]); + } + + /** + * 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} + * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'retail.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * 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 Retail API JavaScript pixel and Google Tag + * Manager. Users should not call this method directly. + * + * The async variant is {@see UserEventServiceClient::collectUserEventAsync()} . + * + * @example samples/V2/UserEventServiceClient/collect_user_event.php + * + * @param CollectUserEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 HttpBody + * + * @throws ApiException Thrown if the API call fails. + */ + public function collectUserEvent(CollectUserEventRequest $request, array $callOptions = []): HttpBody + { + return $this->startApiCall('CollectUserEvent', $request, $callOptions)->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`. + * + * The async variant is {@see UserEventServiceClient::importUserEventsAsync()} . + * + * @example samples/V2/UserEventServiceClient/import_user_events.php + * + * @param ImportUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importUserEvents(ImportUserEventsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportUserEvents', $request, $callOptions)->wait(); + } + + /** + * 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. + * + * The async variant is {@see UserEventServiceClient::purgeUserEventsAsync()} . + * + * @example samples/V2/UserEventServiceClient/purge_user_events.php + * + * @param PurgeUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function purgeUserEvents(PurgeUserEventsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PurgeUserEvents', $request, $callOptions)->wait(); + } + + /** + * Starts a user-event rejoin operation with latest product catalog. Events + * are not annotated with detailed product information for products that are + * missing from the catalog when the user event is ingested. These + * events are stored as unjoined events with limited usage on training and + * serving. You can use this method to start a join operation on specified + * events with the latest version of product catalog. You can also use this + * method to correct events joined with the wrong product catalog. A rejoin + * operation can take hours or days to complete. + * + * The async variant is {@see UserEventServiceClient::rejoinUserEventsAsync()} . + * + * @example samples/V2/UserEventServiceClient/rejoin_user_events.php + * + * @param RejoinUserEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rejoinUserEvents(RejoinUserEventsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RejoinUserEvents', $request, $callOptions)->wait(); + } + + /** + * Writes a single user event. + * + * The async variant is {@see UserEventServiceClient::writeUserEventAsync()} . + * + * @example samples/V2/UserEventServiceClient/write_user_event.php + * + * @param WriteUserEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 UserEvent + * + * @throws ApiException Thrown if the API call fails. + */ + public function writeUserEvent(WriteUserEventRequest $request, array $callOptions = []): UserEvent + { + return $this->startApiCall('WriteUserEvent', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json new file mode 100644 index 00000000000..a4ab5df7982 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json @@ -0,0 +1,398 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.retail.v2", + "libraryPackage": "Google\\Cloud\\Retail\\V2", + "services": { + "AnalyticsService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsServiceGapicClient", + "rpcs": { + "ExportAnalyticsMetrics": { + "methods": [ + "exportAnalyticsMetrics" + ] + } + } + } + } + }, + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "CatalogServiceGapicClient", + "rpcs": { + "AddCatalogAttribute": { + "methods": [ + "addCatalogAttribute" + ] + }, + "GetAttributesConfig": { + "methods": [ + "getAttributesConfig" + ] + }, + "GetCompletionConfig": { + "methods": [ + "getCompletionConfig" + ] + }, + "GetDefaultBranch": { + "methods": [ + "getDefaultBranch" + ] + }, + "ListCatalogs": { + "methods": [ + "listCatalogs" + ] + }, + "RemoveCatalogAttribute": { + "methods": [ + "removeCatalogAttribute" + ] + }, + "ReplaceCatalogAttribute": { + "methods": [ + "replaceCatalogAttribute" + ] + }, + "SetDefaultBranch": { + "methods": [ + "setDefaultBranch" + ] + }, + "UpdateAttributesConfig": { + "methods": [ + "updateAttributesConfig" + ] + }, + "UpdateCatalog": { + "methods": [ + "updateCatalog" + ] + }, + "UpdateCompletionConfig": { + "methods": [ + "updateCompletionConfig" + ] + } + } + } + } + }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceGapicClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + }, + "ImportCompletionData": { + "methods": [ + "importCompletionData" + ] + } + } + } + } + }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceGapicClient", + "rpcs": { + "CreateControl": { + "methods": [ + "createControl" + ] + }, + "DeleteControl": { + "methods": [ + "deleteControl" + ] + }, + "GetControl": { + "methods": [ + "getControl" + ] + }, + "ListControls": { + "methods": [ + "listControls" + ] + }, + "UpdateControl": { + "methods": [ + "updateControl" + ] + } + } + } + } + }, + "GenerativeQuestionService": { + "clients": { + "grpc": { + "libraryClient": "GenerativeQuestionServiceGapicClient", + "rpcs": { + "BatchUpdateGenerativeQuestionConfigs": { + "methods": [ + "batchUpdateGenerativeQuestionConfigs" + ] + }, + "GetGenerativeQuestionsFeatureConfig": { + "methods": [ + "getGenerativeQuestionsFeatureConfig" + ] + }, + "ListGenerativeQuestionConfigs": { + "methods": [ + "listGenerativeQuestionConfigs" + ] + }, + "UpdateGenerativeQuestionConfig": { + "methods": [ + "updateGenerativeQuestionConfig" + ] + }, + "UpdateGenerativeQuestionsFeatureConfig": { + "methods": [ + "updateGenerativeQuestionsFeatureConfig" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceGapicClient", + "rpcs": { + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "ListModels": { + "methods": [ + "listModels" + ] + }, + "PauseModel": { + "methods": [ + "pauseModel" + ] + }, + "ResumeModel": { + "methods": [ + "resumeModel" + ] + }, + "TuneModel": { + "methods": [ + "tuneModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceGapicClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "ProductServiceGapicClient", + "rpcs": { + "AddFulfillmentPlaces": { + "methods": [ + "addFulfillmentPlaces" + ] + }, + "AddLocalInventories": { + "methods": [ + "addLocalInventories" + ] + }, + "CreateProduct": { + "methods": [ + "createProduct" + ] + }, + "DeleteProduct": { + "methods": [ + "deleteProduct" + ] + }, + "GetProduct": { + "methods": [ + "getProduct" + ] + }, + "ImportProducts": { + "methods": [ + "importProducts" + ] + }, + "ListProducts": { + "methods": [ + "listProducts" + ] + }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, + "RemoveFulfillmentPlaces": { + "methods": [ + "removeFulfillmentPlaces" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "removeLocalInventories" + ] + }, + "SetInventory": { + "methods": [ + "setInventory" + ] + }, + "UpdateProduct": { + "methods": [ + "updateProduct" + ] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceGapicClient", + "rpcs": { + "Search": { + "methods": [ + "search" + ] + } + } + } + } + }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "ServingConfigServiceGapicClient", + "rpcs": { + "AddControl": { + "methods": [ + "addControl" + ] + }, + "CreateServingConfig": { + "methods": [ + "createServingConfig" + ] + }, + "DeleteServingConfig": { + "methods": [ + "deleteServingConfig" + ] + }, + "GetServingConfig": { + "methods": [ + "getServingConfig" + ] + }, + "ListServingConfigs": { + "methods": [ + "listServingConfigs" + ] + }, + "RemoveControl": { + "methods": [ + "removeControl" + ] + }, + "UpdateServingConfig": { + "methods": [ + "updateServingConfig" + ] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventServiceGapicClient", + "rpcs": { + "CollectUserEvent": { + "methods": [ + "collectUserEvent" + ] + }, + "ImportUserEvents": { + "methods": [ + "importUserEvents" + ] + }, + "PurgeUserEvents": { + "methods": [ + "purgeUserEvents" + ] + }, + "RejoinUserEvents": { + "methods": [ + "rejoinUserEvents" + ] + }, + "WriteUserEvent": { + "methods": [ + "writeUserEvent" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json new file mode 100644 index 00000000000..aa40f9904b7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.retail.v2.AnalyticsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_4_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_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ExportAnalyticsMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php new file mode 100644 index 00000000000..c0885c7d573 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php @@ -0,0 +1,47 @@ + [ + 'google.cloud.retail.v2.AnalyticsService' => [ + 'ExportAnalyticsMetrics' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\ExportAnalyticsMetricsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\ExportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php new file mode 100644 index 00000000000..f15d33d89d3 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php @@ -0,0 +1,89 @@ + [ + 'google.cloud.retail.v2.AnalyticsService' => [ + 'ExportAnalyticsMetrics' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics', + 'body' => '*', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json new file mode 100644 index 00000000000..f1ab69f29a1 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.retail.v2.CatalogService": { + "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": 5000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "AddCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAttributesConfig": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetCompletionConfig": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDefaultBranch": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListCatalogs": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RemoveCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReplaceCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetDefaultBranch": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAttributesConfig": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateCatalog": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateCompletionConfig": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php new file mode 100644 index 00000000000..fc8dc2fece6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php @@ -0,0 +1,178 @@ + [ + 'google.cloud.retail.v2.CatalogService' => [ + 'AddCatalogAttribute' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', + 'headerParams' => [ + [ + 'keyName' => 'attributes_config', + 'fieldAccessors' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'GetAttributesConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCompletionConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\CompletionConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDefaultBranch' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GetDefaultBranchResponse', + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListCatalogs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCatalogs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListCatalogsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveCatalogAttribute' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', + 'headerParams' => [ + [ + 'keyName' => 'attributes_config', + 'fieldAccessors' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'ReplaceCatalogAttribute' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', + 'headerParams' => [ + [ + 'keyName' => 'attributes_config', + 'fieldAccessors' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'SetDefaultBranch' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + 'UpdateAttributesConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', + 'headerParams' => [ + [ + 'keyName' => 'attributes_config.name', + 'fieldAccessors' => [ + 'getAttributesConfig', + 'getName', + ], + ], + ], + ], + 'UpdateCatalog' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Catalog', + 'headerParams' => [ + [ + 'keyName' => 'catalog.name', + 'fieldAccessors' => [ + 'getCatalog', + 'getName', + ], + ], + ], + ], + 'UpdateCompletionConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\CompletionConfig', + 'headerParams' => [ + [ + 'keyName' => 'completion_config.name', + 'fieldAccessors' => [ + 'getCompletionConfig', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'attributesConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig', + 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'completionConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php new file mode 100644 index 00000000000..b0bb0fa62cd --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php @@ -0,0 +1,208 @@ + [ + 'google.cloud.retail.v2.CatalogService' => [ + 'AddCatalogAttribute' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute', + 'body' => '*', + 'placeholders' => [ + 'attributes_config' => [ + 'getters' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'GetAttributesConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCompletionConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDefaultBranch' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListCatalogs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/catalogs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveCatalogAttribute' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute', + 'body' => '*', + 'placeholders' => [ + 'attributes_config' => [ + 'getters' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'ReplaceCatalogAttribute' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute', + 'body' => '*', + 'placeholders' => [ + 'attributes_config' => [ + 'getters' => [ + 'getAttributesConfig', + ], + ], + ], + ], + 'SetDefaultBranch' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch', + 'body' => '*', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + 'UpdateAttributesConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}', + 'body' => 'attributes_config', + 'placeholders' => [ + 'attributes_config.name' => [ + 'getters' => [ + 'getAttributesConfig', + 'getName', + ], + ], + ], + ], + 'UpdateCatalog' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{catalog.name=projects/*/locations/*/catalogs/*}', + 'body' => 'catalog', + 'placeholders' => [ + 'catalog.name' => [ + 'getters' => [ + 'getCatalog', + 'getName', + ], + ], + ], + ], + 'UpdateCompletionConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}', + 'body' => 'completion_config', + 'placeholders' => [ + 'completion_config.name' => [ + 'getters' => [ + 'getCompletionConfig', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json new file mode 100644 index 00000000000..4d3bf0a8de9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.retail.v2.CompletionService": { + "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": 5000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "CompleteQuery": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportCompletionData": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php new file mode 100644 index 00000000000..09de7c3e467 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.retail.v2.CompletionService' => [ + 'ImportCompletionData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportCompletionDataResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CompleteQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\CompleteQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php new file mode 100644 index 00000000000..da7514c1838 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php @@ -0,0 +1,100 @@ + [ + 'google.cloud.retail.v2.CompletionService' => [ + 'CompleteQuery' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + 'ImportCompletionData' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json new file mode 100644 index 00000000000..6238fa9ab45 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.cloud.retail.v2.ControlService": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListControls": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php new file mode 100644 index 00000000000..56d55d39007 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php @@ -0,0 +1,101 @@ + [ + 'google.cloud.retail.v2.ControlService' => [ + 'CreateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Control', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Control', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getControls', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListControlsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Control', + 'headerParams' => [ + [ + 'keyName' => 'control.name', + 'fieldAccessors' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'control' => 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php new file mode 100644 index 00000000000..3c7844395f6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.retail.v2.ControlService' => [ + 'CreateControl' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/controls', + 'body' => 'control', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'control_id', + ], + ], + 'DeleteControl' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/controls/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/controls/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/controls', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}', + 'body' => 'control', + 'placeholders' => [ + 'control.name' => [ + 'getters' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json new file mode 100644 index 00000000000..a22e14095f7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.cloud.retail.v2.GenerativeQuestionService": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "BatchUpdateGenerativeQuestionConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetGenerativeQuestionsFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListGenerativeQuestionConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateGenerativeQuestionConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateGenerativeQuestionsFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php new file mode 100644 index 00000000000..56b813c7153 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php @@ -0,0 +1,93 @@ + [ + 'google.cloud.retail.v2.GenerativeQuestionService' => [ + 'BatchUpdateGenerativeQuestionConfigs' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetGenerativeQuestionsFeatureConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListGenerativeQuestionConfigs' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerativeQuestionConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionConfig', + 'headerParams' => [ + [ + 'keyName' => 'generative_question_config.catalog', + 'fieldAccessors' => [ + 'getGenerativeQuestionConfig', + 'getCatalog', + ], + ], + ], + ], + 'UpdateGenerativeQuestionsFeatureConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', + 'headerParams' => [ + [ + 'keyName' => 'generative_questions_feature_config.catalog', + 'fieldAccessors' => [ + 'getGenerativeQuestionsFeatureConfig', + 'getCatalog', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php new file mode 100644 index 00000000000..eef5c95d149 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php @@ -0,0 +1,137 @@ + [ + 'google.cloud.retail.v2.GenerativeQuestionService' => [ + 'BatchUpdateGenerativeQuestionConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetGenerativeQuestionsFeatureConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListGenerativeQuestionConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerativeQuestionConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion', + 'body' => 'generative_question_config', + 'placeholders' => [ + 'generative_question_config.catalog' => [ + 'getters' => [ + 'getGenerativeQuestionConfig', + 'getCatalog', + ], + ], + ], + ], + 'UpdateGenerativeQuestionsFeatureConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', + 'body' => 'generative_questions_feature_config', + 'placeholders' => [ + 'generative_questions_feature_config.catalog' => [ + 'getters' => [ + 'getGenerativeQuestionsFeatureConfig', + 'getCatalog', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json new file mode 100644 index 00000000000..0e96f5ce8c6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.retail.v2.ModelService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_4_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_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "DeleteModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "GetModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListModels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "PauseModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ResumeModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "TuneModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "UpdateModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php new file mode 100644 index 00000000000..6171fd3a107 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php @@ -0,0 +1,151 @@ + [ + 'google.cloud.retail.v2.ModelService' => [ + 'CreateModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\Model', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\CreateModelMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'TuneModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\TuneModelResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\TuneModelMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Model', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getModels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PauseModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Model', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResumeModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Model', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Model', + 'headerParams' => [ + [ + 'keyName' => 'model.name', + 'fieldAccessors' => [ + 'getModel', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'model' => 'projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php new file mode 100644 index 00000000000..98c6f0e7d57 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php @@ -0,0 +1,171 @@ + [ + 'google.cloud.retail.v2.ModelService' => [ + 'CreateModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/models', + 'body' => 'model', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/models', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TuneModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:tune', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateModel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{model.name=projects/*/locations/*/catalogs/*/models/*}', + 'body' => 'model', + 'placeholders' => [ + 'model.name' => [ + 'getters' => [ + 'getModel', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json new file mode 100644 index 00000000000..97e9893bed7 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.retail.v2.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": 5000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "Predict": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php new file mode 100644 index 00000000000..628c060ff11 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.retail.v2.PredictionService' => [ + 'Predict' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\PredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'placement', + 'fieldAccessors' => [ + 'getPlacement', + ], + ], + ], + ], + 'templateMap' => [ + 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php new file mode 100644 index 00000000000..5a66073b4f0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php @@ -0,0 +1,96 @@ + [ + 'google.cloud.retail.v2.PredictionService' => [ + 'Predict' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'placement' => [ + 'getters' => [ + 'getPlacement', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json new file mode 100644 index 00000000000..cd5260972f0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json @@ -0,0 +1,108 @@ +{ + "interfaces": { + "google.cloud.retail.v2.ProductService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_3_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "retry_policy_5_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_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 300000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + } + }, + "methods": { + "AddFulfillmentPlaces": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "AddLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "CreateProduct": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "DeleteProduct": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "GetProduct": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ImportProducts": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "ListProducts": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "PurgeProducts": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "RemoveFulfillmentPlaces": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "RemoveLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "SetInventory": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "UpdateProduct": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php new file mode 100644 index 00000000000..24cfd2c05de --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php @@ -0,0 +1,235 @@ + [ + 'google.cloud.retail.v2.ProductService' => [ + 'AddFulfillmentPlaces' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\AddFulfillmentPlacesResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\AddFulfillmentPlacesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'product', + 'fieldAccessors' => [ + 'getProduct', + ], + ], + ], + ], + 'AddLocalInventories' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\AddLocalInventoriesResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\AddLocalInventoriesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'product', + 'fieldAccessors' => [ + 'getProduct', + ], + ], + ], + ], + 'ImportProducts' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportProductsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeProducts' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveFulfillmentPlaces' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\RemoveFulfillmentPlacesResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\RemoveFulfillmentPlacesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'product', + 'fieldAccessors' => [ + 'getProduct', + ], + ], + ], + ], + 'RemoveLocalInventories' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\RemoveLocalInventoriesResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\RemoveLocalInventoriesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'product', + 'fieldAccessors' => [ + 'getProduct', + ], + ], + ], + ], + 'SetInventory' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\SetInventoryResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\SetInventoryMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'inventory.name', + 'fieldAccessors' => [ + 'getInventory', + 'getName', + ], + ], + ], + ], + 'CreateProduct' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Product', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteProduct' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProduct' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Product', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListProducts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProducts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListProductsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProduct' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\Product', + 'headerParams' => [ + [ + 'keyName' => 'product.name', + 'fieldAccessors' => [ + 'getProduct', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', + 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php new file mode 100644 index 00000000000..a7470a66da8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php @@ -0,0 +1,223 @@ + [ + 'google.cloud.retail.v2.ProductService' => [ + 'AddFulfillmentPlaces' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces', + 'body' => '*', + 'placeholders' => [ + 'product' => [ + 'getters' => [ + 'getProduct', + ], + ], + ], + ], + 'AddLocalInventories' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories', + 'body' => '*', + 'placeholders' => [ + 'product' => [ + 'getters' => [ + 'getProduct', + ], + ], + ], + ], + 'CreateProduct' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products', + 'body' => 'product', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'product_id', + ], + ], + 'DeleteProduct' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProduct' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportProducts' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProducts' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeProducts' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveFulfillmentPlaces' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces', + 'body' => '*', + 'placeholders' => [ + 'product' => [ + 'getters' => [ + 'getProduct', + ], + ], + ], + ], + 'RemoveLocalInventories' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories', + 'body' => '*', + 'placeholders' => [ + 'product' => [ + 'getters' => [ + 'getProduct', + ], + ], + ], + ], + 'SetInventory' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory', + 'body' => '*', + 'placeholders' => [ + 'inventory.name' => [ + 'getters' => [ + 'getInventory', + 'getName', + ], + ], + ], + ], + 'UpdateProduct' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}', + 'body' => 'product', + 'placeholders' => [ + 'product.name' => [ + 'getters' => [ + 'getProduct', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json new file mode 100644 index 00000000000..75b66324de6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.retail.v2.SearchService": { + "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": 5000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "Search": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php new file mode 100644 index 00000000000..051351283f4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php @@ -0,0 +1,51 @@ + [ + 'google.cloud.retail.v2.SearchService' => [ + 'Search' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\SearchResponse', + 'headerParams' => [ + [ + 'keyName' => 'placement', + 'fieldAccessors' => [ + 'getPlacement', + ], + ], + ], + ], + 'templateMap' => [ + 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php new file mode 100644 index 00000000000..8e70173e2f4 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php @@ -0,0 +1,96 @@ + [ + 'google.cloud.retail.v2.SearchService' => [ + 'Search' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'placement' => [ + 'getters' => [ + 'getPlacement', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json new file mode 100644 index 00000000000..3464c528f5d --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json @@ -0,0 +1,57 @@ +{ + "interfaces": { + "google.cloud.retail.v2.ServingConfigService": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "AddControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateServingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteServingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetServingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListServingConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "RemoveControl": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateServingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php new file mode 100644 index 00000000000..a1058834d03 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php @@ -0,0 +1,125 @@ + [ + 'google.cloud.retail.v2.ServingConfigService' => [ + 'AddControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', + 'headerParams' => [ + [ + 'keyName' => 'serving_config', + 'fieldAccessors' => [ + 'getServingConfig', + ], + ], + ], + ], + 'CreateServingConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteServingConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetServingConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListServingConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServingConfigs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListServingConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', + 'headerParams' => [ + [ + 'keyName' => 'serving_config', + 'fieldAccessors' => [ + 'getServingConfig', + ], + ], + ], + ], + 'UpdateServingConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', + 'headerParams' => [ + [ + 'keyName' => 'serving_config.name', + 'fieldAccessors' => [ + 'getServingConfig', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'servingConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php new file mode 100644 index 00000000000..c7021c644b2 --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php @@ -0,0 +1,162 @@ + [ + 'google.cloud.retail.v2.ServingConfigService' => [ + 'AddControl' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl', + 'body' => '*', + 'placeholders' => [ + 'serving_config' => [ + 'getters' => [ + 'getServingConfig', + ], + ], + ], + ], + 'CreateServingConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs', + 'body' => 'serving_config', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'serving_config_id', + ], + ], + 'DeleteServingConfig' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetServingConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListServingConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RemoveControl' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl', + 'body' => '*', + 'placeholders' => [ + 'serving_config' => [ + 'getters' => [ + 'getServingConfig', + ], + ], + ], + ], + 'UpdateServingConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}', + 'body' => 'serving_config', + 'placeholders' => [ + 'serving_config.name' => [ + 'getters' => [ + 'getServingConfig', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json new file mode 100644 index 00000000000..3715586469a --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json @@ -0,0 +1,86 @@ +{ + "interfaces": { + "google.cloud.retail.v2.UserEventService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "retry_policy_3_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "retry_policy_6_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_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 5000, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_6_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 300000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CollectUserEvent": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "ImportUserEvents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "PurgeUserEvents": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "RejoinUserEvents": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "WriteUserEvent": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php new file mode 100644 index 00000000000..d5aee057f1a --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php @@ -0,0 +1,113 @@ + [ + 'google.cloud.retail.v2.UserEventService' => [ + 'ImportUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\PurgeUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\PurgeMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RejoinUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\RejoinUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\RejoinUserEventsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CollectUserEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\HttpBody', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'WriteUserEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\UserEvent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php new file mode 100644 index 00000000000..8693b90c34d --- /dev/null +++ b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php @@ -0,0 +1,136 @@ + [ + 'google.cloud.retail.v2.UserEventService' => [ + 'CollectUserEvent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ImportUserEvents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeUserEvents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RejoinUserEvents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'WriteUserEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:write', + 'body' => 'user_event', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php new file mode 100644 index 00000000000..0980ca752f0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php @@ -0,0 +1,262 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AnalyticsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AnalyticsServiceClient($options); + } + + /** @test */ + public function exportAnalyticsMetricsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportAnalyticsMetricsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportAnalyticsMetricsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportAnalyticsMetricsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $catalog = 'catalog555704345'; + $outputConfig = new OutputConfig(); + $request = (new ExportAnalyticsMetricsRequest()) + ->setCatalog($catalog) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportAnalyticsMetrics($request); + $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.retail.v2.AnalyticsService/ExportAnalyticsMetrics', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCatalog(); + $this->assertProtobufEquals($catalog, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); + $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 exportAnalyticsMetricsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportAnalyticsMetricsTest'); + $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 + $catalog = 'catalog555704345'; + $outputConfig = new OutputConfig(); + $request = (new ExportAnalyticsMetricsRequest()) + ->setCatalog($catalog) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportAnalyticsMetrics($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); + 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 exportAnalyticsMetricsAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/exportAnalyticsMetricsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportAnalyticsMetricsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportAnalyticsMetricsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $catalog = 'catalog555704345'; + $outputConfig = new OutputConfig(); + $request = (new ExportAnalyticsMetricsRequest()) + ->setCatalog($catalog) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportAnalyticsMetricsAsync($request)->wait(); + $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.retail.v2.AnalyticsService/ExportAnalyticsMetrics', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCatalog(); + $this->assertProtobufEquals($catalog, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); + $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()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php new file mode 100644 index 00000000000..de88ff03be0 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php @@ -0,0 +1,885 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CatalogServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CatalogServiceClient($options); + } + + /** @test */ + public function addCatalogAttributeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogAttribute = new CatalogAttribute(); + $catalogAttributeKey = 'catalogAttributeKey-1525777188'; + $catalogAttribute->setKey($catalogAttributeKey); + $request = (new AddCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + $response = $gapicClient->addCatalogAttribute($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/AddCatalogAttribute', $actualFuncCall); + $actualValue = $actualRequestObject->getAttributesConfig(); + $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); + $actualValue = $actualRequestObject->getCatalogAttribute(); + $this->assertProtobufEquals($catalogAttribute, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addCatalogAttributeExceptionTest() + { + $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 + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogAttribute = new CatalogAttribute(); + $catalogAttributeKey = 'catalogAttributeKey-1525777188'; + $catalogAttribute->setKey($catalogAttributeKey); + $request = (new AddCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + try { + $gapicClient->addCatalogAttribute($request); + // 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 getAttributesConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetAttributesConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getAttributesConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/GetAttributesConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAttributesConfigExceptionTest() + { + $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->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetAttributesConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getAttributesConfig($request); + // 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 getCompletionConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $matchingOrder = 'matchingOrder1035789452'; + $maxSuggestions = 618824852; + $minPrefixLength = 96853510; + $autoLearning = true; + $lastSuggestionsImportOperation = 'lastSuggestionsImportOperation-470644314'; + $lastDenylistImportOperation = 'lastDenylistImportOperation-181585959'; + $lastAllowlistImportOperation = 'lastAllowlistImportOperation723854958'; + $expectedResponse = new CompletionConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setMatchingOrder($matchingOrder); + $expectedResponse->setMaxSuggestions($maxSuggestions); + $expectedResponse->setMinPrefixLength($minPrefixLength); + $expectedResponse->setAutoLearning($autoLearning); + $expectedResponse->setLastSuggestionsImportOperation($lastSuggestionsImportOperation); + $expectedResponse->setLastDenylistImportOperation($lastDenylistImportOperation); + $expectedResponse->setLastAllowlistImportOperation($lastAllowlistImportOperation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetCompletionConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getCompletionConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/GetCompletionConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCompletionConfigExceptionTest() + { + $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->completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetCompletionConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getCompletionConfig($request); + // 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 getDefaultBranchTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $branch = 'branch-1381030494'; + $note = 'note3387378'; + $expectedResponse = new GetDefaultBranchResponse(); + $expectedResponse->setBranch($branch); + $expectedResponse->setNote($note); + $transport->addResponse($expectedResponse); + $request = new GetDefaultBranchRequest(); + $response = $gapicClient->getDefaultBranch($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/GetDefaultBranch', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDefaultBranchExceptionTest() + { + $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); + $request = new GetDefaultBranchRequest(); + try { + $gapicClient->getDefaultBranch($request); + // 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 listCatalogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new ListCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCatalogsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCatalogs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/ListCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCatalogsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCatalogsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCatalogs($request); + // 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 removeCatalogAttributeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $key = 'key106079'; + $request = (new RemoveCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setKey($key); + $response = $gapicClient->removeCatalogAttribute($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/RemoveCatalogAttribute', $actualFuncCall); + $actualValue = $actualRequestObject->getAttributesConfig(); + $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); + $actualValue = $actualRequestObject->getKey(); + $this->assertProtobufEquals($key, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeCatalogAttributeExceptionTest() + { + $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 + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $key = 'key106079'; + $request = (new RemoveCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setKey($key); + try { + $gapicClient->removeCatalogAttribute($request); + // 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 replaceCatalogAttributeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogAttribute = new CatalogAttribute(); + $catalogAttributeKey = 'catalogAttributeKey-1525777188'; + $catalogAttribute->setKey($catalogAttributeKey); + $request = (new ReplaceCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + $response = $gapicClient->replaceCatalogAttribute($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/ReplaceCatalogAttribute', $actualFuncCall); + $actualValue = $actualRequestObject->getAttributesConfig(); + $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); + $actualValue = $actualRequestObject->getCatalogAttribute(); + $this->assertProtobufEquals($catalogAttribute, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function replaceCatalogAttributeExceptionTest() + { + $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 + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogAttribute = new CatalogAttribute(); + $catalogAttributeKey = 'catalogAttributeKey-1525777188'; + $catalogAttribute->setKey($catalogAttributeKey); + $request = (new ReplaceCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + try { + $gapicClient->replaceCatalogAttribute($request); + // 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 setDefaultBranchTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + $request = new SetDefaultBranchRequest(); + $gapicClient->setDefaultBranch($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/SetDefaultBranch', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setDefaultBranchExceptionTest() + { + $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); + $request = new SetDefaultBranchRequest(); + try { + $gapicClient->setDefaultBranch($request); + // 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 updateAttributesConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $attributesConfig = new AttributesConfig(); + $attributesConfigName = 'attributesConfigName-1073347164'; + $attributesConfig->setName($attributesConfigName); + $request = (new UpdateAttributesConfigRequest()) + ->setAttributesConfig($attributesConfig); + $response = $gapicClient->updateAttributesConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateAttributesConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getAttributesConfig(); + $this->assertProtobufEquals($attributesConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAttributesConfigExceptionTest() + { + $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 + $attributesConfig = new AttributesConfig(); + $attributesConfigName = 'attributesConfigName-1073347164'; + $attributesConfig->setName($attributesConfigName); + $request = (new UpdateAttributesConfigRequest()) + ->setAttributesConfig($attributesConfig); + try { + $gapicClient->updateAttributesConfig($request); + // 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 updateCatalogTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Catalog(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $catalog = new Catalog(); + $catalogName = 'catalogName-1007379900'; + $catalog->setName($catalogName); + $catalogDisplayName = 'catalogDisplayName1836270740'; + $catalog->setDisplayName($catalogDisplayName); + $catalogProductLevelConfig = new ProductLevelConfig(); + $catalog->setProductLevelConfig($catalogProductLevelConfig); + $request = (new UpdateCatalogRequest()) + ->setCatalog($catalog); + $response = $gapicClient->updateCatalog($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateCatalog', $actualFuncCall); + $actualValue = $actualRequestObject->getCatalog(); + $this->assertProtobufEquals($catalog, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCatalogExceptionTest() + { + $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 + $catalog = new Catalog(); + $catalogName = 'catalogName-1007379900'; + $catalog->setName($catalogName); + $catalogDisplayName = 'catalogDisplayName1836270740'; + $catalog->setDisplayName($catalogDisplayName); + $catalogProductLevelConfig = new ProductLevelConfig(); + $catalog->setProductLevelConfig($catalogProductLevelConfig); + $request = (new UpdateCatalogRequest()) + ->setCatalog($catalog); + try { + $gapicClient->updateCatalog($request); + // 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 updateCompletionConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $matchingOrder = 'matchingOrder1035789452'; + $maxSuggestions = 618824852; + $minPrefixLength = 96853510; + $autoLearning = true; + $lastSuggestionsImportOperation = 'lastSuggestionsImportOperation-470644314'; + $lastDenylistImportOperation = 'lastDenylistImportOperation-181585959'; + $lastAllowlistImportOperation = 'lastAllowlistImportOperation723854958'; + $expectedResponse = new CompletionConfig(); + $expectedResponse->setName($name); + $expectedResponse->setMatchingOrder($matchingOrder); + $expectedResponse->setMaxSuggestions($maxSuggestions); + $expectedResponse->setMinPrefixLength($minPrefixLength); + $expectedResponse->setAutoLearning($autoLearning); + $expectedResponse->setLastSuggestionsImportOperation($lastSuggestionsImportOperation); + $expectedResponse->setLastDenylistImportOperation($lastDenylistImportOperation); + $expectedResponse->setLastAllowlistImportOperation($lastAllowlistImportOperation); + $transport->addResponse($expectedResponse); + // Mock request + $completionConfig = new CompletionConfig(); + $completionConfigName = 'completionConfigName2129042921'; + $completionConfig->setName($completionConfigName); + $request = (new UpdateCompletionConfigRequest()) + ->setCompletionConfig($completionConfig); + $response = $gapicClient->updateCompletionConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateCompletionConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getCompletionConfig(); + $this->assertProtobufEquals($completionConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCompletionConfigExceptionTest() + { + $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 + $completionConfig = new CompletionConfig(); + $completionConfigName = 'completionConfigName2129042921'; + $completionConfig->setName($completionConfigName); + $request = (new UpdateCompletionConfigRequest()) + ->setCompletionConfig($completionConfig); + try { + $gapicClient->updateCompletionConfig($request); + // 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 addCatalogAttributeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AttributesConfig(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogAttribute = new CatalogAttribute(); + $catalogAttributeKey = 'catalogAttributeKey-1525777188'; + $catalogAttribute->setKey($catalogAttributeKey); + $request = (new AddCatalogAttributeRequest()) + ->setAttributesConfig($formattedAttributesConfig) + ->setCatalogAttribute($catalogAttribute); + $response = $gapicClient->addCatalogAttributeAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CatalogService/AddCatalogAttribute', $actualFuncCall); + $actualValue = $actualRequestObject->getAttributesConfig(); + $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); + $actualValue = $actualRequestObject->getCatalogAttribute(); + $this->assertProtobufEquals($catalogAttribute, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php new file mode 100644 index 00000000000..80eb6811827 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php @@ -0,0 +1,312 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CompletionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CompletionServiceClient($options); + } + + /** @test */ + public function completeQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attributionToken = 'attributionToken-729411015'; + $expectedResponse = new CompleteQueryResponse(); + $expectedResponse->setAttributionToken($attributionToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $query = 'query107944136'; + $request = (new CompleteQueryRequest()) + ->setCatalog($formattedCatalog) + ->setQuery($query); + $response = $gapicClient->completeQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CompletionService/CompleteQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getCatalog(); + $this->assertProtobufEquals($formattedCatalog, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeQueryExceptionTest() + { + $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 + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $query = 'query107944136'; + $request = (new CompleteQueryRequest()) + ->setCatalog($formattedCatalog) + ->setQuery($query); + try { + $gapicClient->completeQuery($request); + // 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 importCompletionDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importCompletionDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportCompletionDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importCompletionDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfig = new CompletionDataInputConfig(); + $inputConfigBigQuerySource = new BigQuerySource(); + $bigQuerySourceDatasetId = 'bigQuerySourceDatasetId-567522032'; + $inputConfigBigQuerySource->setDatasetId($bigQuerySourceDatasetId); + $bigQuerySourceTableId = 'bigQuerySourceTableId1074792998'; + $inputConfigBigQuerySource->setTableId($bigQuerySourceTableId); + $inputConfig->setBigQuerySource($inputConfigBigQuerySource); + $request = (new ImportCompletionDataRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importCompletionData($request); + $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.retail.v2.CompletionService/ImportCompletionData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importCompletionDataTest'); + $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 importCompletionDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importCompletionDataTest'); + $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 CompletionDataInputConfig(); + $inputConfigBigQuerySource = new BigQuerySource(); + $bigQuerySourceDatasetId = 'bigQuerySourceDatasetId-567522032'; + $inputConfigBigQuerySource->setDatasetId($bigQuerySourceDatasetId); + $bigQuerySourceTableId = 'bigQuerySourceTableId1074792998'; + $inputConfigBigQuerySource->setTableId($bigQuerySourceTableId); + $inputConfig->setBigQuerySource($inputConfigBigQuerySource); + $request = (new ImportCompletionDataRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importCompletionData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importCompletionDataTest'); + 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 completeQueryAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attributionToken = 'attributionToken-729411015'; + $expectedResponse = new CompleteQueryResponse(); + $expectedResponse->setAttributionToken($attributionToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $query = 'query107944136'; + $request = (new CompleteQueryRequest()) + ->setCatalog($formattedCatalog) + ->setQuery($query); + $response = $gapicClient->completeQueryAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.CompletionService/CompleteQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getCatalog(); + $this->assertProtobufEquals($formattedCatalog, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php new file mode 100644 index 00000000000..f6ef148c6f8 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php @@ -0,0 +1,470 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ControlServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ControlServiceClient($options); + } + + /** @test */ + public function createControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionTypes = []; + $control->setSolutionTypes($controlSolutionTypes); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createControlExceptionTest() + { + $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]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionTypes = []; + $control->setSolutionTypes($controlSolutionTypes); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + try { + $gapicClient->createControl($request); + // 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 deleteControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); + $request = (new DeleteControlRequest()) + ->setName($formattedName); + $gapicClient->deleteControl($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/DeleteControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteControlExceptionTest() + { + $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->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); + $request = (new DeleteControlRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteControl($request); + // 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 getControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); + $request = (new GetControlRequest()) + ->setName($formattedName); + $response = $gapicClient->getControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/GetControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getControlExceptionTest() + { + $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->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); + $request = (new GetControlRequest()) + ->setName($formattedName); + try { + $gapicClient->getControl($request); + // 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 listControlsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $controlsElement = new Control(); + $controls = [ + $controlsElement, + ]; + $expectedResponse = new ListControlsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setControls($controls); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListControlsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listControls($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getControls()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/ListControls', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listControlsExceptionTest() + { + $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]'); + $request = (new ListControlsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listControls($request); + // 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 updateControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionTypes = []; + $control->setSolutionTypes($controlSolutionTypes); + $request = (new UpdateControlRequest()) + ->setControl($control); + $response = $gapicClient->updateControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/UpdateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateControlExceptionTest() + { + $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 + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionTypes = []; + $control->setSolutionTypes($controlSolutionTypes); + $request = (new UpdateControlRequest()) + ->setControl($control); + try { + $gapicClient->updateControl($request); + // 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 createControlAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionTypes = []; + $control->setSolutionTypes($controlSolutionTypes); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControlAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php new file mode 100644 index 00000000000..150f4a82cab --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php @@ -0,0 +1,442 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GenerativeQuestionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GenerativeQuestionServiceClient($options); + } + + /** @test */ + public function batchUpdateGenerativeQuestionConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) + ->setRequests($requests); + $response = $gapicClient->batchUpdateGenerativeQuestionConfigs($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchUpdateGenerativeQuestionConfigsExceptionTest() + { + $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 + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) + ->setRequests($requests); + try { + $gapicClient->batchUpdateGenerativeQuestionConfigs($request); + // 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 getGenerativeQuestionsFeatureConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog2 = 'catalog21455933836'; + $featureEnabled = true; + $minimumProducts = 417095051; + $expectedResponse = new GenerativeQuestionsFeatureConfig(); + $expectedResponse->setCatalog($catalog2); + $expectedResponse->setFeatureEnabled($featureEnabled); + $expectedResponse->setMinimumProducts($minimumProducts); + $transport->addResponse($expectedResponse); + // Mock request + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetGenerativeQuestionsFeatureConfigRequest()) + ->setCatalog($formattedCatalog); + $response = $gapicClient->getGenerativeQuestionsFeatureConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/GetGenerativeQuestionsFeatureConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getCatalog(); + $this->assertProtobufEquals($formattedCatalog, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGenerativeQuestionsFeatureConfigExceptionTest() + { + $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 + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetGenerativeQuestionsFeatureConfigRequest()) + ->setCatalog($formattedCatalog); + try { + $gapicClient->getGenerativeQuestionsFeatureConfig($request); + // 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 listGenerativeQuestionConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListGenerativeQuestionConfigsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGenerativeQuestionConfigs($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/ListGenerativeQuestionConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGenerativeQuestionConfigsExceptionTest() + { + $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]'); + $request = (new ListGenerativeQuestionConfigsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGenerativeQuestionConfigs($request); + // 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 updateGenerativeQuestionConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog = 'catalog555704345'; + $facet = 'facet97187255'; + $generatedQuestion = 'generatedQuestion-1515248490'; + $finalQuestion = 'finalQuestion1509683343'; + $frequency = -7002384; + $allowedInConversation = true; + $expectedResponse = new GenerativeQuestionConfig(); + $expectedResponse->setCatalog($catalog); + $expectedResponse->setFacet($facet); + $expectedResponse->setGeneratedQuestion($generatedQuestion); + $expectedResponse->setFinalQuestion($finalQuestion); + $expectedResponse->setFrequency($frequency); + $expectedResponse->setAllowedInConversation($allowedInConversation); + $transport->addResponse($expectedResponse); + // Mock request + $generativeQuestionConfig = new GenerativeQuestionConfig(); + $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; + $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); + $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; + $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($generativeQuestionConfig); + $response = $gapicClient->updateGenerativeQuestionConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getGenerativeQuestionConfig(); + $this->assertProtobufEquals($generativeQuestionConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGenerativeQuestionConfigExceptionTest() + { + $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 + $generativeQuestionConfig = new GenerativeQuestionConfig(); + $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; + $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); + $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; + $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($generativeQuestionConfig); + try { + $gapicClient->updateGenerativeQuestionConfig($request); + // 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 updateGenerativeQuestionsFeatureConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog = 'catalog555704345'; + $featureEnabled = true; + $minimumProducts = 417095051; + $expectedResponse = new GenerativeQuestionsFeatureConfig(); + $expectedResponse->setCatalog($catalog); + $expectedResponse->setFeatureEnabled($featureEnabled); + $expectedResponse->setMinimumProducts($minimumProducts); + $transport->addResponse($expectedResponse); + // Mock request + $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); + $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; + $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); + $response = $gapicClient->updateGenerativeQuestionsFeatureConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionsFeatureConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getGenerativeQuestionsFeatureConfig(); + $this->assertProtobufEquals($generativeQuestionsFeatureConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGenerativeQuestionsFeatureConfigExceptionTest() + { + $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 + $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); + $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; + $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); + try { + $gapicClient->updateGenerativeQuestionsFeatureConfig($request); + // 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 batchUpdateGenerativeQuestionConfigsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) + ->setRequests($requests); + $response = $gapicClient->batchUpdateGenerativeQuestionConfigsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php new file mode 100644 index 00000000000..5dd7ad9cee6 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php @@ -0,0 +1,863 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ModelServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ModelServiceClient($options); + } + + /** @test */ + public function createModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $model = new Model(); + $modelName = 'modelName-2010829484'; + $model->setName($modelName); + $modelDisplayName = 'modelDisplayName1578770308'; + $model->setDisplayName($modelDisplayName); + $modelType = 'modelType-2010627581'; + $model->setType($modelType); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($request); + $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.retail.v2.ModelService/CreateModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + $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 createModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createModelTest'); + $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]'); + $model = new Model(); + $modelName = 'modelName-2010829484'; + $model->setName($modelName); + $modelDisplayName = 'modelDisplayName1578770308'; + $model->setDisplayName($modelDisplayName); + $modelType = 'modelType-2010627581'; + $model->setType($modelType); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + 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 deleteModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + $gapicClient->deleteModel($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/DeleteModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteModelExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteModel($request); + // 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 getModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + $response = $gapicClient->getModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/GetModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + try { + $gapicClient->getModel($request); + // 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 listModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $modelsElement = new Model(); + $models = [ + $modelsElement, + ]; + $expectedResponse = new ListModelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setModels($models); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListModelsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listModels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getModels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/ListModels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelsExceptionTest() + { + $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]'); + $request = (new ListModelsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listModels($request); + // 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 pauseModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new PauseModelRequest()) + ->setName($formattedName); + $response = $gapicClient->pauseModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/PauseModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseModelExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new PauseModelRequest()) + ->setName($formattedName); + try { + $gapicClient->pauseModel($request); + // 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 resumeModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new ResumeModelRequest()) + ->setName($name); + $response = $gapicClient->resumeModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/ResumeModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeModelExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new ResumeModelRequest()) + ->setName($name); + try { + $gapicClient->resumeModel($request); + // 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 tuneModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/tuneModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new TuneModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/tuneModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new TuneModelRequest()) + ->setName($formattedName); + $response = $gapicClient->tuneModel($request); + $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.retail.v2.ModelService/TuneModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/tuneModelTest'); + $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 tuneModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/tuneModelTest'); + $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 + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); + $request = (new TuneModelRequest()) + ->setName($formattedName); + $response = $gapicClient->tuneModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/tuneModelTest'); + 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 updateModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $transport->addResponse($expectedResponse); + // Mock request + $model = new Model(); + $modelName = 'modelName-2010829484'; + $model->setName($modelName); + $modelDisplayName = 'modelDisplayName1578770308'; + $model->setDisplayName($modelDisplayName); + $modelType = 'modelType-2010627581'; + $model->setType($modelType); + $request = (new UpdateModelRequest()) + ->setModel($model); + $response = $gapicClient->updateModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ModelService/UpdateModel', $actualFuncCall); + $actualValue = $actualRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateModelExceptionTest() + { + $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 + $model = new Model(); + $modelName = 'modelName-2010829484'; + $model->setName($modelName); + $modelDisplayName = 'modelDisplayName1578770308'; + $model->setDisplayName($modelDisplayName); + $modelType = 'modelType-2010627581'; + $model->setType($modelType); + $request = (new UpdateModelRequest()) + ->setModel($model); + try { + $gapicClient->updateModel($request); + // 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 createModelAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $type = 'type3575610'; + $optimizationObjective = 'optimizationObjective1167007975'; + $tuningOperation = 'tuningOperation1763651677'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setType($type); + $expectedResponse->setOptimizationObjective($optimizationObjective); + $expectedResponse->setTuningOperation($tuningOperation); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $model = new Model(); + $modelName = 'modelName-2010829484'; + $model->setName($modelName); + $modelDisplayName = 'modelDisplayName1578770308'; + $model->setDisplayName($modelDisplayName); + $modelType = 'modelType-2010627581'; + $model->setType($modelType); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModelAsync($request)->wait(); + $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.retail.v2.ModelService/CreateModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + $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()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php new file mode 100644 index 00000000000..01d2f155daf --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php @@ -0,0 +1,182 @@ +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 + $attributionToken = 'attributionToken-729411015'; + $validateOnly2 = true; + $expectedResponse = new PredictResponse(); + $expectedResponse->setAttributionToken($attributionToken); + $expectedResponse->setValidateOnly($validateOnly2); + $transport->addResponse($expectedResponse); + // Mock request + $placement = 'placement1792938725'; + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventVisitorId = 'userEventVisitorId-2104193702'; + $userEvent->setVisitorId($userEventVisitorId); + $request = (new PredictRequest()) + ->setPlacement($placement) + ->setUserEvent($userEvent); + $response = $gapicClient->predict($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.PredictionService/Predict', $actualFuncCall); + $actualValue = $actualRequestObject->getPlacement(); + $this->assertProtobufEquals($placement, $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 + $placement = 'placement1792938725'; + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventVisitorId = 'userEventVisitorId-2104193702'; + $userEvent->setVisitorId($userEventVisitorId); + $request = (new PredictRequest()) + ->setPlacement($placement) + ->setUserEvent($userEvent); + try { + $gapicClient->predict($request); + // 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 predictAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attributionToken = 'attributionToken-729411015'; + $validateOnly2 = true; + $expectedResponse = new PredictResponse(); + $expectedResponse->setAttributionToken($attributionToken); + $expectedResponse->setValidateOnly($validateOnly2); + $transport->addResponse($expectedResponse); + // Mock request + $placement = 'placement1792938725'; + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventVisitorId = 'userEventVisitorId-2104193702'; + $userEvent->setVisitorId($userEventVisitorId); + $request = (new PredictRequest()) + ->setPlacement($placement) + ->setUserEvent($userEvent); + $response = $gapicClient->predictAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.PredictionService/Predict', $actualFuncCall); + $actualValue = $actualRequestObject->getPlacement(); + $this->assertProtobufEquals($placement, $actualValue); + $actualValue = $actualRequestObject->getUserEvent(); + $this->assertProtobufEquals($userEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php new file mode 100644 index 00000000000..de4b554b847 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php @@ -0,0 +1,1447 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProductServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProductServiceClient($options); + } + + /** @test */ + public function addFulfillmentPlacesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/addFulfillmentPlacesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AddFulfillmentPlacesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/addFulfillmentPlacesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $type = 'type3575610'; + $placeIds = []; + $request = (new AddFulfillmentPlacesRequest()) + ->setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + $response = $gapicClient->addFulfillmentPlaces($request); + $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.retail.v2.ProductService/AddFulfillmentPlaces', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProduct(); + $this->assertProtobufEquals($formattedProduct, $actualValue); + $actualValue = $actualApiRequestObject->getType(); + $this->assertProtobufEquals($type, $actualValue); + $actualValue = $actualApiRequestObject->getPlaceIds(); + $this->assertProtobufEquals($placeIds, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); + $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 addFulfillmentPlacesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/addFulfillmentPlacesTest'); + $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 + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $type = 'type3575610'; + $placeIds = []; + $request = (new AddFulfillmentPlacesRequest()) + ->setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + $response = $gapicClient->addFulfillmentPlaces($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); + 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 addLocalInventoriesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/addLocalInventoriesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AddLocalInventoriesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/addLocalInventoriesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $localInventories = []; + $request = (new AddLocalInventoriesRequest()) + ->setProduct($formattedProduct) + ->setLocalInventories($localInventories); + $response = $gapicClient->addLocalInventories($request); + $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.retail.v2.ProductService/AddLocalInventories', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProduct(); + $this->assertProtobufEquals($formattedProduct, $actualValue); + $actualValue = $actualApiRequestObject->getLocalInventories(); + $this->assertProtobufEquals($localInventories, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/addLocalInventoriesTest'); + $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 addLocalInventoriesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/addLocalInventoriesTest'); + $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 + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $localInventories = []; + $request = (new AddLocalInventoriesRequest()) + ->setProduct($formattedProduct) + ->setLocalInventories($localInventories); + $response = $gapicClient->addLocalInventories($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/addLocalInventoriesTest'); + 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 createProductTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $id = 'id3355'; + $primaryProductId = 'primaryProductId-898851640'; + $gtin = 'gtin3183314'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $uri = 'uri116076'; + $expectedResponse = new Product(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setPrimaryProductId($primaryProductId); + $expectedResponse->setGtin($gtin); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setUri($uri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $product = new Product(); + $productTitle = 'productTitle1004085929'; + $product->setTitle($productTitle); + $productId = 'productId1753008747'; + $request = (new CreateProductRequest()) + ->setParent($formattedParent) + ->setProduct($product) + ->setProductId($productId); + $response = $gapicClient->createProduct($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/CreateProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProduct(); + $this->assertProtobufEquals($product, $actualValue); + $actualValue = $actualRequestObject->getProductId(); + $this->assertProtobufEquals($productId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProductExceptionTest() + { + $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $product = new Product(); + $productTitle = 'productTitle1004085929'; + $product->setTitle($productTitle); + $productId = 'productId1753008747'; + $request = (new CreateProductRequest()) + ->setParent($formattedParent) + ->setProduct($product) + ->setProductId($productId); + try { + $gapicClient->createProduct($request); + // 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 deleteProductTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $request = (new DeleteProductRequest()) + ->setName($formattedName); + $gapicClient->deleteProduct($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/DeleteProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProductExceptionTest() + { + $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->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $request = (new DeleteProductRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteProduct($request); + // 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 getProductTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $primaryProductId = 'primaryProductId-898851640'; + $gtin = 'gtin3183314'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $uri = 'uri116076'; + $expectedResponse = new Product(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setPrimaryProductId($primaryProductId); + $expectedResponse->setGtin($gtin); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setUri($uri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $request = (new GetProductRequest()) + ->setName($formattedName); + $response = $gapicClient->getProduct($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/GetProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProductExceptionTest() + { + $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->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $request = (new GetProductRequest()) + ->setName($formattedName); + try { + $gapicClient->getProduct($request); + // 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 importProductsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportProductsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importProductsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $inputConfig = new ProductInputConfig(); + $request = (new ImportProductsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importProducts($request); + $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.retail.v2.ProductService/ImportProducts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importProductsTest'); + $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 importProductsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/importProductsTest'); + $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $inputConfig = new ProductInputConfig(); + $request = (new ImportProductsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importProducts($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importProductsTest'); + 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 listProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [ + $productsElement, + ]; + $expectedResponse = new ListProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $request = (new ListProductsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProducts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/ListProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProductsExceptionTest() + { + $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $request = (new ListProductsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProducts($request); + // 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 purgeProductsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/purgeProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $purgeCount = 575305851; + $expectedResponse = new PurgeProductsResponse(); + $expectedResponse->setPurgeCount($purgeCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/purgeProductsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeProducts($request); + $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.retail.v2.ProductService/PurgeProducts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + $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 purgeProductsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/purgeProductsTest'); + $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeProducts($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + 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 removeFulfillmentPlacesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/removeFulfillmentPlacesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RemoveFulfillmentPlacesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/removeFulfillmentPlacesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $type = 'type3575610'; + $placeIds = []; + $request = (new RemoveFulfillmentPlacesRequest()) + ->setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + $response = $gapicClient->removeFulfillmentPlaces($request); + $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.retail.v2.ProductService/RemoveFulfillmentPlaces', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProduct(); + $this->assertProtobufEquals($formattedProduct, $actualValue); + $actualValue = $actualApiRequestObject->getType(); + $this->assertProtobufEquals($type, $actualValue); + $actualValue = $actualApiRequestObject->getPlaceIds(); + $this->assertProtobufEquals($placeIds, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/removeFulfillmentPlacesTest'); + $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 removeFulfillmentPlacesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/removeFulfillmentPlacesTest'); + $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 + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $type = 'type3575610'; + $placeIds = []; + $request = (new RemoveFulfillmentPlacesRequest()) + ->setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + $response = $gapicClient->removeFulfillmentPlaces($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/removeFulfillmentPlacesTest'); + 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 removeLocalInventoriesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/removeLocalInventoriesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RemoveLocalInventoriesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/removeLocalInventoriesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $placeIds = []; + $request = (new RemoveLocalInventoriesRequest()) + ->setProduct($formattedProduct) + ->setPlaceIds($placeIds); + $response = $gapicClient->removeLocalInventories($request); + $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.retail.v2.ProductService/RemoveLocalInventories', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProduct(); + $this->assertProtobufEquals($formattedProduct, $actualValue); + $actualValue = $actualApiRequestObject->getPlaceIds(); + $this->assertProtobufEquals($placeIds, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/removeLocalInventoriesTest'); + $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 removeLocalInventoriesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/removeLocalInventoriesTest'); + $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 + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $placeIds = []; + $request = (new RemoveLocalInventoriesRequest()) + ->setProduct($formattedProduct) + ->setPlaceIds($placeIds); + $response = $gapicClient->removeLocalInventories($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/removeLocalInventoriesTest'); + 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 setInventoryTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/setInventoryTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SetInventoryResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/setInventoryTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $inventory = new Product(); + $inventoryTitle = 'inventoryTitle-43609508'; + $inventory->setTitle($inventoryTitle); + $request = (new SetInventoryRequest()) + ->setInventory($inventory); + $response = $gapicClient->setInventory($request); + $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.retail.v2.ProductService/SetInventory', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInventory(); + $this->assertProtobufEquals($inventory, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setInventoryTest'); + $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 setInventoryExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/setInventoryTest'); + $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 + $inventory = new Product(); + $inventoryTitle = 'inventoryTitle-43609508'; + $inventory->setTitle($inventoryTitle); + $request = (new SetInventoryRequest()) + ->setInventory($inventory); + $response = $gapicClient->setInventory($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setInventoryTest'); + 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 updateProductTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $id = 'id3355'; + $primaryProductId = 'primaryProductId-898851640'; + $gtin = 'gtin3183314'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $uri = 'uri116076'; + $expectedResponse = new Product(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setPrimaryProductId($primaryProductId); + $expectedResponse->setGtin($gtin); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setUri($uri); + $transport->addResponse($expectedResponse); + // Mock request + $product = new Product(); + $productTitle = 'productTitle1004085929'; + $product->setTitle($productTitle); + $request = (new UpdateProductRequest()) + ->setProduct($product); + $response = $gapicClient->updateProduct($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/UpdateProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getProduct(); + $this->assertProtobufEquals($product, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProductExceptionTest() + { + $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 + $product = new Product(); + $productTitle = 'productTitle1004085929'; + $product->setTitle($productTitle); + $request = (new UpdateProductRequest()) + ->setProduct($product); + try { + $gapicClient->updateProduct($request); + // 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 addFulfillmentPlacesAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/addFulfillmentPlacesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AddFulfillmentPlacesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/addFulfillmentPlacesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); + $type = 'type3575610'; + $placeIds = []; + $request = (new AddFulfillmentPlacesRequest()) + ->setProduct($formattedProduct) + ->setType($type) + ->setPlaceIds($placeIds); + $response = $gapicClient->addFulfillmentPlacesAsync($request)->wait(); + $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.retail.v2.ProductService/AddFulfillmentPlaces', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProduct(); + $this->assertProtobufEquals($formattedProduct, $actualValue); + $actualValue = $actualApiRequestObject->getType(); + $this->assertProtobufEquals($type, $actualValue); + $actualValue = $actualApiRequestObject->getPlaceIds(); + $this->assertProtobufEquals($placeIds, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); + $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()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php new file mode 100644 index 00000000000..ef3baf51166 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php @@ -0,0 +1,198 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SearchServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SearchServiceClient($options); + } + + /** @test */ + public function searchTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $totalSize = 705419236; + $correctedQuery = 'correctedQuery107869074'; + $attributionToken = 'attributionToken-729411015'; + $nextPageToken = ''; + $redirectUri = 'redirectUri951230089'; + $resultsElement = new SearchResult(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new SearchResponse(); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCorrectedQuery($correctedQuery); + $expectedResponse->setAttributionToken($attributionToken); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRedirectUri($redirectUri); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $placement = 'placement1792938725'; + $visitorId = 'visitorId-1832599924'; + $request = (new SearchRequest()) + ->setPlacement($placement) + ->setVisitorId($visitorId); + $response = $gapicClient->search($request); + $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.retail.v2.SearchService/Search', $actualFuncCall); + $actualValue = $actualRequestObject->getPlacement(); + $this->assertProtobufEquals($placement, $actualValue); + $actualValue = $actualRequestObject->getVisitorId(); + $this->assertProtobufEquals($visitorId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchExceptionTest() + { + $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 + $placement = 'placement1792938725'; + $visitorId = 'visitorId-1832599924'; + $request = (new SearchRequest()) + ->setPlacement($placement) + ->setVisitorId($visitorId); + try { + $gapicClient->search($request); + // 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 searchAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $totalSize = 705419236; + $correctedQuery = 'correctedQuery107869074'; + $attributionToken = 'attributionToken-729411015'; + $nextPageToken = ''; + $redirectUri = 'redirectUri951230089'; + $resultsElement = new SearchResult(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new SearchResponse(); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCorrectedQuery($correctedQuery); + $expectedResponse->setAttributionToken($attributionToken); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRedirectUri($redirectUri); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $placement = 'placement1792938725'; + $visitorId = 'visitorId-1832599924'; + $request = (new SearchRequest()) + ->setPlacement($placement) + ->setVisitorId($visitorId); + $response = $gapicClient->searchAsync($request)->wait(); + $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.retail.v2.SearchService/Search', $actualFuncCall); + $actualValue = $actualRequestObject->getPlacement(); + $this->assertProtobufEquals($placement, $actualValue); + $actualValue = $actualRequestObject->getVisitorId(); + $this->assertProtobufEquals($visitorId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php new file mode 100644 index 00000000000..d810ba23992 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php @@ -0,0 +1,668 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ServingConfigServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServingConfigServiceClient($options); + } + + /** @test */ + public function addControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $controlId = 'controlId637416253'; + $request = (new AddControlRequest()) + ->setServingConfig($formattedServingConfig) + ->setControlId($controlId); + $response = $gapicClient->addControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/AddControl', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($formattedServingConfig, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addControlExceptionTest() + { + $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 + $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $controlId = 'controlId637416253'; + $request = (new AddControlRequest()) + ->setServingConfig($formattedServingConfig) + ->setControlId($controlId); + try { + $gapicClient->addControl($request); + // 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 createServingConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $servingConfig = new ServingConfig(); + $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; + $servingConfig->setDisplayName($servingConfigDisplayName); + $servingConfigSolutionTypes = []; + $servingConfig->setSolutionTypes($servingConfigSolutionTypes); + $servingConfigId = 'servingConfigId-600821051'; + $request = (new CreateServingConfigRequest()) + ->setParent($formattedParent) + ->setServingConfig($servingConfig) + ->setServingConfigId($servingConfigId); + $response = $gapicClient->createServingConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/CreateServingConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($servingConfig, $actualValue); + $actualValue = $actualRequestObject->getServingConfigId(); + $this->assertProtobufEquals($servingConfigId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServingConfigExceptionTest() + { + $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]'); + $servingConfig = new ServingConfig(); + $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; + $servingConfig->setDisplayName($servingConfigDisplayName); + $servingConfigSolutionTypes = []; + $servingConfig->setSolutionTypes($servingConfigSolutionTypes); + $servingConfigId = 'servingConfigId-600821051'; + $request = (new CreateServingConfigRequest()) + ->setParent($formattedParent) + ->setServingConfig($servingConfig) + ->setServingConfigId($servingConfigId); + try { + $gapicClient->createServingConfig($request); + // 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 deleteServingConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $request = (new DeleteServingConfigRequest()) + ->setName($formattedName); + $gapicClient->deleteServingConfig($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/DeleteServingConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServingConfigExceptionTest() + { + $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->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $request = (new DeleteServingConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteServingConfig($request); + // 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 getServingConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $request = (new GetServingConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getServingConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/GetServingConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServingConfigExceptionTest() + { + $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->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $request = (new GetServingConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getServingConfig($request); + // 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 listServingConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servingConfigsElement = new ServingConfig(); + $servingConfigs = [ + $servingConfigsElement, + ]; + $expectedResponse = new ListServingConfigsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServingConfigs($servingConfigs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListServingConfigsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServingConfigs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServingConfigs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/ListServingConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServingConfigsExceptionTest() + { + $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]'); + $request = (new ListServingConfigsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServingConfigs($request); + // 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 removeControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $controlId = 'controlId637416253'; + $request = (new RemoveControlRequest()) + ->setServingConfig($formattedServingConfig) + ->setControlId($controlId); + $response = $gapicClient->removeControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/RemoveControl', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($formattedServingConfig, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeControlExceptionTest() + { + $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 + $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $controlId = 'controlId637416253'; + $request = (new RemoveControlRequest()) + ->setServingConfig($formattedServingConfig) + ->setControlId($controlId); + try { + $gapicClient->removeControl($request); + // 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 updateServingConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $servingConfig = new ServingConfig(); + $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; + $servingConfig->setDisplayName($servingConfigDisplayName); + $servingConfigSolutionTypes = []; + $servingConfig->setSolutionTypes($servingConfigSolutionTypes); + $request = (new UpdateServingConfigRequest()) + ->setServingConfig($servingConfig); + $response = $gapicClient->updateServingConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/UpdateServingConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($servingConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServingConfigExceptionTest() + { + $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 + $servingConfig = new ServingConfig(); + $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; + $servingConfig->setDisplayName($servingConfigDisplayName); + $servingConfigSolutionTypes = []; + $servingConfig->setSolutionTypes($servingConfigSolutionTypes); + $request = (new UpdateServingConfigRequest()) + ->setServingConfig($servingConfig); + try { + $gapicClient->updateServingConfig($request); + // 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 addControlAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $modelId = 'modelId-619038223'; + $priceRerankingLevel = 'priceRerankingLevel1240955890'; + $diversityLevel = 'diversityLevel1294448926'; + $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; + $expectedResponse = new ServingConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelId($modelId); + $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); + $expectedResponse->setDiversityLevel($diversityLevel); + $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); + $transport->addResponse($expectedResponse); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); + $controlId = 'controlId637416253'; + $request = (new AddControlRequest()) + ->setServingConfig($formattedServingConfig) + ->setControlId($controlId); + $response = $gapicClient->addControlAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ServingConfigService/AddControl', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($formattedServingConfig, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php new file mode 100644 index 00000000000..8845e40faa9 --- /dev/null +++ b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php @@ -0,0 +1,672 @@ +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 + $parent = 'parent-995424086'; + $userEvent = 'userEvent1921940774'; + $request = (new CollectUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + $response = $gapicClient->collectUserEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.UserEventService/CollectUserEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $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 + $parent = 'parent-995424086'; + $userEvent = 'userEvent1921940774'; + $request = (new CollectUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + try { + $gapicClient->collectUserEvent($request); + // 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([ + 'apiEndpoint' => '', + '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfig = new UserEventInputConfig(); + $inputConfigUserEventInlineSource = new UserEventInlineSource(); + $userEventInlineSourceUserEvents = []; + $inputConfigUserEventInlineSource->setUserEvents($userEventInlineSourceUserEvents); + $inputConfig->setUserEventInlineSource($inputConfigUserEventInlineSource); + $request = (new ImportUserEventsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importUserEvents($request); + $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.retail.v2.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([ + 'apiEndpoint' => '', + '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfig = new UserEventInputConfig(); + $inputConfigUserEventInlineSource = new UserEventInlineSource(); + $userEventInlineSourceUserEvents = []; + $inputConfigUserEventInlineSource->setUserEvents($userEventInlineSourceUserEvents); + $inputConfig->setUserEventInlineSource($inputConfigUserEventInlineSource); + $request = (new ImportUserEventsRequest()) + ->setParent($formattedParent) + ->setInputConfig($inputConfig); + $response = $gapicClient->importUserEvents($request); + $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 purgeUserEventsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $filter = 'filter-1274492040'; + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeUserEvents($request); + $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.retail.v2.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([ + 'apiEndpoint' => '', + '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $filter = 'filter-1274492040'; + $request = (new PurgeUserEventsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeUserEvents($request); + $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 rejoinUserEventsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/rejoinUserEventsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $rejoinedUserEventsCount = 1152281574; + $expectedResponse = new RejoinUserEventsResponse(); + $expectedResponse->setRejoinedUserEventsCount($rejoinedUserEventsCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/rejoinUserEventsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $request = (new RejoinUserEventsRequest()) + ->setParent($parent); + $response = $gapicClient->rejoinUserEvents($request); + $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.retail.v2.UserEventService/RejoinUserEvents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/rejoinUserEventsTest'); + $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 rejoinUserEventsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/rejoinUserEventsTest'); + $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 + $parent = 'parent-995424086'; + $request = (new RejoinUserEventsRequest()) + ->setParent($parent); + $response = $gapicClient->rejoinUserEvents($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/rejoinUserEventsTest'); + 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'; + $visitorId = 'visitorId-1832599924'; + $sessionId = 'sessionId1661853540'; + $attributionToken = 'attributionToken-729411015'; + $cartId = 'cartId554410650'; + $searchQuery = 'searchQuery461177713'; + $filter = 'filter-1274492040'; + $orderBy = 'orderBy1234304744'; + $offset = 1019779949; + $uri = 'uri116076'; + $referrerUri = 'referrerUri-2093856436'; + $pageViewId = 'pageViewId948896581'; + $entity = 'entity-1298275357'; + $expectedResponse = new UserEvent(); + $expectedResponse->setEventType($eventType); + $expectedResponse->setVisitorId($visitorId); + $expectedResponse->setSessionId($sessionId); + $expectedResponse->setAttributionToken($attributionToken); + $expectedResponse->setCartId($cartId); + $expectedResponse->setSearchQuery($searchQuery); + $expectedResponse->setFilter($filter); + $expectedResponse->setOrderBy($orderBy); + $expectedResponse->setOffset($offset); + $expectedResponse->setUri($uri); + $expectedResponse->setReferrerUri($referrerUri); + $expectedResponse->setPageViewId($pageViewId); + $expectedResponse->setEntity($entity); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventVisitorId = 'userEventVisitorId-2104193702'; + $userEvent->setVisitorId($userEventVisitorId); + $request = (new WriteUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + $response = $gapicClient->writeUserEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.UserEventService/WriteUserEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $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 + $parent = 'parent-995424086'; + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventVisitorId = 'userEventVisitorId-2104193702'; + $userEvent->setVisitorId($userEventVisitorId); + $request = (new WriteUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + try { + $gapicClient->writeUserEvent($request); + // 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 collectUserEventAsyncTest() + { + $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 + $parent = 'parent-995424086'; + $userEvent = 'userEvent1921940774'; + $request = (new CollectUserEventRequest()) + ->setParent($parent) + ->setUserEvent($userEvent); + $response = $gapicClient->collectUserEventAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.UserEventService/CollectUserEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUserEvent(); + $this->assertProtobufEquals($userEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php new file mode 100644 index 0000000000000000000000000000000000000000..d54649f835f7a54acab79d2e68ebac1315f85d5f GIT binary patch literal 2450 zcmb7G&u<$=6lR^qO~y$hHiEboh`|lSiP~M^N(DI$Xx$`jRUjd$ii9k!X4hkT$a-g) znROH*AK+i$#DzbFKY$}hoQuSX8&^)uk6nB7OHFfdRy*%~^WOK~_ufAIEEy!=4t$Jb z%#grc7@R;cz%XG{(2zzjNP9iZU`U4vi7;~@+}?v#{UT7636CVxFK7!^ivWFR(yeBv9wEcI!M+Zk>ZP?!0Jj0uV-s zbJ$ky;1odlm!v^NLdXRY^4}`qK8cASC?em>sJCDbMI1}di?+Qq4h5kxR1SM_h#TwB zU@F_ygvu?Z6N?a!0c^V7MVia|@F%KC@1ZDfuwAJckF`-MnX{=}0Dmc=E4HILl zbs@+tC|HV%w?oLVNLjq8<5mFU$y4VNn!JQ`yf~(c1sd~KYnsy(;wr~S5y7!|J)d2I zqi!1y(1=j>daegJYmI9M`8kdIvU6e*_d9!uYRIdT)OEY}Daoqjb-Rbkvln~k5ia^uPwH!_z^b|{ekkOPG+%9;sjEn5( zPIeSc6L#q&VPjPPxeV;XG#C=0b#Q>cOEDMrGAJjA$vCPOv>Nm6nU`M4_P{MJ8x-}i zZ%D6}*cP`1vIW(q+TDcnF$s6|DV4e&WK*~sUW(s`(mb8qea*urdRK20GKfWCM zLd1>^U%7Mr^u)5CfrTy&k1)#sXEosc>jG|T-yG~6u*5MNkr4YR3~4HvDd*u^l9|de zW$G#=^y*E0a`&ZY{pWoMR&}X$QrX?In%t4Y&iz_DDSg{-f*S($d36rX7{0CABB&IC zsQp<2OXsqbb-F2ANRT1U3RS9Fwv06&N4`KzjuKrcT}6EwqHuuyOA2AxD*yzDXNS55 znOh3p!tsbO8V_Y#_#?y!3L?y_vohdH^Q-I9dM*QJXA1fv$J~hpJ5eoT*&l!^j@3mz zN(CLNx$LKj9P09BRe(8dR@(%(uLQCyVCD#)7=r9YFgrp~iVY>L(kE7X4wOwlw-;pg zY909EB*FC`EUKGU})wfWb=aW+~$tFat@oGauSN-9SfBgMZ=|TM?wX9FgSlN>6TE)xV4L72pnZfSH z*erA2;#%M>YooUNn`f&jX+})0oZmfXAVk7ju6ulZeD2Vdtuip*2=|f*i5_Lc_OBLL zk&?SC>Ne19=%u`GeY0*-&u5yHX`kwE4SBiDKn9ZpoBH=3k6csT-X!1C>}g!c`!uIu q?3yv6CIWX)3o~ULl%=Df_tz#n=dM}wh3|qZzX`OZ+1+C>2H<}@%pJM_ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php new file mode 100644 index 0000000000000000000000000000000000000000..7d7617e7aa8761e1228820dc4126e8daf75f83de GIT binary patch literal 2428 zcma)8+iu%N5RD_>G`=x((kMyOY#alz+eQYQmsV+7P}E9hEs+FCIdLF>psBS(Kqd*2 zGMW}aKcv6Vr+!AiqR;(`&MrmDas;G)u*lt+*)wO(?C^)5;`cE;BOMm9#LL)_oP8kK zdq(0U$|64+k+bpnIZKEiUB*e;jfV%x zI6SyIJn*A%7-T^d)pz%w~^e-q6duK}Wa_RPH*k#^K=P@D+eR^3s&3 zMF{u}2>!+6vr*uaH1jh2*$q-R2=NGS6#R^bEs0{V9*ZOXxL=$y{jNf8jWdI(;)L)%fy@j zYms@E@qAxF$crC?N&3ogSZ3QsCG3^>INIm%?*=^k9}{IW8)hZ&&cW@W=mbqEtg{jc2%R$r@ad++TVG*=ISTEU=zlYV7U9lv{KGc>3gu(N| z{CbwxF-+{`CM+k+OQW#1EIhyYjH4P|UPhrMT$+`Cl*-X9xd&Sby9!d2wmS({6~SJ7 zCYUwxnhj@w#C~D^n72w1Z%xFjeVw=l9@_?I;d)`?_sXRcmXsCEb#7 zSv7RLO*BJyO^Q!?M_P~{z`g0RMe$kHx_s-ld>5qYR$I}!7^foNhwbUA-B(pgTez{f z(}q>MAiM^5ZF)j2%{jdRqY6vZvJ4B4UW1i4ilyg=t-_+Fw+*SX^H&AduNOdm1ou^= z*F)GARc!p}>n+;WbdeSY>FdY3@kYmp+puNP6V2u+mVm#4ho)t8ENa_siz+S5j=J=1 zfqO!Xqu{dT_B7k(fR^Pa@CfsqESuC4I~cb`bx!DtOyJ9@f!0$xoN=Y^92u7O4lP#Y zI(&W8qS#kN8Pp@H9v4Wf@-7gntJbM0Hjn8k*6HTCz=7ScnhCSU4Q#4f)UjO!%Y$jp z7_9S}zfn*KddF=WmTTZC0*|!88Ps|`96DS;7{WT0Hu<7y*p6u+<&(uNyd73G-JzDQ zbR}u$@7u6BD|GoWJSdAXzi?9(VimDI)H$FM zmUs=0sM2+gCMizo&PBG&IaT|%WAu1UTvI_)JPA{=Y1suU@>6)+({xwUv2%2!%*D~` zqH1z2iDIIOqB`0Mr)46suGZ5Wd{vO&mQ#{z8K=yDlVOy5$qFQhStPR#RXqv`U_@7pe?Qd2QQqsyDwEn4mi zkag7XJ8Bu&0tj9;TAcC?y!UzH-Mq(<=E-YLJ65DcyVOD8OU){*internalAddGeneratedFile( + ' +� +#google/cloud/run/v2/execution.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto\'google/cloud/run/v2/task_template.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto"I +GetExecutionRequest2 +name ( B$�A�A +run.googleapis.com/Execution"� +ListExecutionsRequest4 +parent ( B$�A�Arun.googleapis.com/Execution + page_size ( + +page_token (  + show_deleted ("e +ListExecutionsResponse2 + +executions ( 2.google.cloud.run.v2.Execution +next_page_token ( "q +DeleteExecutionRequest2 +name ( B$�A�A +run.googleapis.com/Execution + validate_only ( +etag ( "q +CancelExecutionRequest2 +name ( B$�A�A +run.googleapis.com/Execution + validate_only ( +etag ( "� + + Execution +name ( B�A +uid ( B�A + +generation (B�A? +labels ( 2*.google.cloud.run.v2.Execution.LabelsEntryB�AI + annotations ( 2/.google.cloud.run.v2.Execution.AnnotationsEntryB�A4 + create_time ( 2.google.protobuf.TimestampB�A3 + +start_time ( 2.google.protobuf.TimestampB�A8 +completion_time ( 2.google.protobuf.TimestampB�A4 + update_time ( 2.google.protobuf.TimestampB�A4 + delete_time ( 2.google.protobuf.TimestampB�A4 + expire_time + ( 2.google.protobuf.TimestampB�A- + launch_stage (2.google.api.LaunchStage+ +job ( B�A�A +run.googleapis.com/Job + parallelism (B�A + +task_count (B�A8 +template ( 2!.google.cloud.run.v2.TaskTemplateB�A + reconciling (B�A7 + +conditions ( 2.google.cloud.run.v2.ConditionB�A +observed_generation (B�A + running_count (B�A +succeeded_count (B�A + failed_count (B�A +cancelled_count (B�A + retried_count (B�A +log_uri ( B�A + satisfies_pzs (B�A +etagc ( B�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:o�Al +run.googleapis.com/ExecutionIprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}R2� + +Executions� + GetExecution(.google.cloud.run.v2.GetExecutionRequest.google.cloud.run.v2.Execution"D�Aname���75/v2/{name=projects/*/locations/*/jobs/*/executions/*}� +ListExecutions*.google.cloud.run.v2.ListExecutionsRequest+.google.cloud.run.v2.ListExecutionsResponse"F�Aparent���75/v2/{parent=projects/*/locations/*/jobs/*}/executions� +DeleteExecution+.google.cloud.run.v2.DeleteExecutionRequest.google.longrunning.Operation"]�A + Execution Execution�Aname���7*5/v2/{name=projects/*/locations/*/jobs/*/executions/*}� +CancelExecution+.google.cloud.run.v2.CancelExecutionRequest.google.longrunning.Operation"g�A + Execution Execution�Aname���A"internalAddGeneratedFile( + ' +� +,google/cloud/run/v2/execution_template.protogoogle.cloud.run.v2\'google/cloud/run/v2/task_template.proto"� +ExecutionTemplateB +labels ( 22.google.cloud.run.v2.ExecutionTemplate.LabelsEntryL + annotations ( 27.google.cloud.run.v2.ExecutionTemplate.AnnotationsEntry + parallelism ( + +task_count (8 +template ( 2!.google.cloud.run.v2.TaskTemplateB�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8B^ +com.google.cloud.run.v2BExecutionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php new file mode 100644 index 0000000000000000000000000000000000000000..f04aa7b7517d80a67f221929ccd91e2fa22497c3 GIT binary patch literal 6807 zcmcIp&2t+`6<=AlW3~Jtx086H-DJnwu(5?bBFa_~6r7a4Y#bb0<&P8vs+t;&+VZSN zGqW=zIZnzPC@w5iap1-uz=b2lpTH$>f(xXIf&(Z1gq(QYJzt6?TQZQUSkk=r`n`Vd z_ddGkyU(m+3wlpQy`6mdey5czEbF+coAQApqorbQdqT?zqeB9R@Su-?OQ*`Y$SiCMC zDY`>I?jr9|$536(G(;+}Yp7&-MdWKz-uspbJ6soiGir3xu;Kca;S$?W^m>Ijs;ybB zY1e?YP-qc1a20*ByyB^)%V|gAGPki%xM1YE=-M3;)h>!QaXYs0gxO6OI1j$n`#7m+ zY4xIEnA8iV;S>ttp28&t36^z@8185?8yeA@C338EHPaqVbXx((AMd+Li;O0?M?5@@ zw7WgC<7!50cvVrr)yt;Q1UQ+-HRY?Xhzk1ud-(&>wsgqCYufSs$NMj|>u%yDF`A~m zPh9HA5x}*jwCgV)*5RXOLXw^hZ@VWss@S$^w4l5gU}k;SqE&0OYzUIP(&4hhTO5cU zXi&^trET?>Wp!okspeIYVzU_(jSVQG%R!pcqoO+dr;o?9+Ha+RNp`&?@wk`zai2VPq_$>wEGzw3x(x5K;{o1dz2~uNN;}tm zn1c`5VzBn;>0Wvd&G&#F0yJj^0R2D#>x$57a!n6~9^H>!KzDtpafZyVV<=U&2~-K_ zk9*{+4ge8LXwp(_K!6YvW6O!sy?++R-WLUYn?i+~46$}3=;ApL!&wxE)+~$xb22Y@ z96jigfUOjVW$*%;1YTKd3URhJdw2`YbfNu14=1u|=x4$>(55o$Xl9eRAnF^oipFW< z?==ezFe~#FN*!8s&BzL#sdQggntH)1YVj0KqZvil%~QFpIS!N!ZY!#B~ia|}i_iB4e9@;tVWQlWmwg1%1h z=V%-}?ts(cm+cuZqB(=Sa^;9B8qq|Cpj3rviTH7(NZ=qWOy} zgHOUd!t-ccv0Dykh(oed9OGpaCq@^bMj`XDzk0M^NL8czQn9I#s!kMJW=pWV<*D#K zf#MKL>i>wY6pD8s_ZhG#Uz{$`;>QJOybRoNPWS>%>Pmy?G)~lv`+dy-71B0is~WC- zhM%IO5>Boi7x%?L>sj_+~Qx^-9;Pqra?aK%L4O+HuYqG;i4VStxv=mQY zE;Ti@6nSN7HsMl<;iPV&8*E>uEg+C!agNhk28Sb8ZktUFdb=$oL)t8wRRxL0Cw~r#Z$oPMPaI)^A#o_dPtaUApz!R!32IsP$MFsl z=u{6;<3Mf70kd$MSyzA1*Sx?Jdj!tl1dgxVP5~ut0+yqIL7q za)ckDIeNJQLjhzcuMo8JT`mM#qJ?PUN`ZYeAJGCha67!6&gLHvi9Kj|zM1<>KJ!~T zi+=DBFQL2T-50g(>cQ6Tj=Xs7u7)q4=5gLD^@Ad<_Hx;Ju`fQQ$UJA~inV-ep77_2Cw28he&hvqM6);Et!~Fb{ zzx?Z0W4X*Sy%>ALsp|oLvk}~8IbI8NM*o@$t>JI_13q5rD-u9`J$sIS7ekYL496MY z>YnP{Goz;m&i|Q{cSSY|Fw3);TTW+#0e15=%bqi%CA`XW2j9Qa)pes1V3_w>v_jhsyx_huqq$5Ar4gxa|KIaDRg|;fIC+Y0`6| zxT*mB971#(CBjA!evM|)!wiqtFtLI@Q;21+l}x{gp=rqS;8rf&AzW!l-G@??=tt_7 zUo1QxelwRTGN3)d-(f)WFNCfr0raLk)c#8_2d);w2SHu(R7Htbm{VcqJk5+|4&3tu z+QF&#_c4SIU?igt>C6Zh190}n!8GgHb&FKE##^A<>j_v%t%o@F3J~HigsfHF|9`FMm?GB}>=Vqfu z--Og+KV0Dyeuc!Yk6I>sxdV$s8v{$M#uN6pF$q=PH6J|)E;m>C8;{5f5;}HhYM+-Q NjFZ2_I7jCQ{Rd^~s=NRI literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php new file mode 100644 index 0000000000000000000000000000000000000000..41d418de4e9098803c8c743234a3263e691f4371 GIT binary patch literal 3770 zcmb7H>vG#f6t3gMagK9UZ*I$gqNX%~)&`eC>hyx0J0XcDPBR1J8I3Hhoh7oQtX2lo z$xHB)r(lL(ya5lu1MrtVLVs~~B{_DY($XL4S~}miXV2w3tEVr#V-N1Co5Uf^;KWj! zJ(V95)nhJqP1jbNL90cWYPubd+JqHUb!}hW+dov-*R~Jm5$d}EGf7!(yKdViMbmZz ztH=VU*ew-LmiJ1K_|FTPHZ@hB8yx>zpuSEW%Bf+~pV9GWYRj;Fg3!yht-vukbsbdz_8pTf zE~z1>uwC$6Jm@nu_M|4xj^}P{JDf1bup4W{HyQP~%W7y^F1HEqM@&3fT#B|8bhM=| zhCY_dmz;d2au$%m-Bpzl9x!J``Yi~~`m07loGKn|Y*1obRdQ@}smsdc^HZIZybXFl zqJ$-)WGEg!r_sSHmeoJ!2Bv?p@0sxPKK!1C`FG}Bxf+@jWN8$zGz#6)?OPGf@Mw`m zK81Cn{g#G_RoCGL#iCRuVN}#jKBcA>Clm$7Xvb)i{D}BjP5)gPQD$Hq%d=xRRz9t! z(Fh?1Yy0_8`D+o<#Odb8@JFt6r;y-GVcqE-8BBQ!6R|6PK7$+NN=u3MaS#v4X+Rn2 z5QqE9=P>5EjQjamAG|>vz{^wSfQGQj2SA(0=QR@&qO& zfgZMz+%i|1PdrvgTbBa4b)}kxjD-5y9!w6tQ=Y@LPfXMS9X-_P7>(X?G z^ydgdwGVgl4VX6LCf7yd$WV@HParo~=?OWx2_V}=_Y8h4 zQK1lMe~myU#3~7}C;e~;?Z}lH_x~fhAx)e*Wfc^uUb=s3ROq~r0PY}rxiL$bWA3#&ECE;#WB(oV}qArsy&B<{MmQNIjoo3WZDgEm($ zfT~lF>xR0-dmhmkC}C9$a-#+fmzUIH6hX>K$H$@(a+@rIQH313HB6v#4JIwpG6I{U z3R+=Q$FvGe4Vz&`WxnMch?{e`MuqSXP~3yri&?f1>b3RN?TzjAwb?5O z%IvQ1?jL+No6@QDC!#nYBZh_2Z1-e=X0;udxsYPP(G1KJ z!Xu6$lpx9~*I_E`GS?GVCm+d#(*HREW8vt~;Cgib(k)^eJsq{d#i<}E$3%uw$_FsR zX@|H0@4pr7(c3#P?GZ*@tN&66c=Yl^m}?o-4j9q-F^=V9*S2t?_usET_Ly@|$Gce6 z63NB3b$D3YB)lRofYK{$#TNkF^iacP48l>L+#H9iwYsz#CintI+srd@){AERD6uj& z4{EDJsOltu9L&0Gt5cX7a!!cWaEYgsGEB--9%D{XSLK!FZTktbEom19U(g9%6@n24 zReJ<*Zj~gGc)uE$kCI1QfSC(Xke&)^(ToxGV}SDmCm3L#kBhpcD4eoXC3*FqG~C3o zlN7*eZfDuY>pzwocWbHdm%;D#aGeltZ2I?eqLa`7hlE8vm#FA1H5bDGdZ7ec~&%I8hjeA z#qd6RUHRty2JGF0&BN)6gy90otp77|l`r3evxv$e#yaj2t>iXZ*E0>%#Jl6Ac)5-v zuNlho1o}8gNEa_LHZerRCSIR4Gl=Kzqx=1@hzH@<(7?yjTR)tnW%zk>24?{O0internalAddGeneratedFile( + ' +� +"google/cloud/run/v2/revision.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto google/cloud/run/v2/status.proto)google/cloud/run/v2/vendor_settings.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.proto"G +GetRevisionRequest1 +name ( B#�A�A +run.googleapis.com/Revision"� +ListRevisionsRequest3 +parent ( B#�A�Arun.googleapis.com/Revision + page_size ( + +page_token (  + show_deleted ("b +ListRevisionsResponse0 + revisions ( 2.google.cloud.run.v2.Revision +next_page_token ( "o +DeleteRevisionRequest1 +name ( B#�A�A +run.googleapis.com/Revision + validate_only ( +etag ( "� +Revision +name ( B�A +uid ( B�A + +generation (B�A> +labels ( 2).google.cloud.run.v2.Revision.LabelsEntryB�AH + annotations ( 2..google.cloud.run.v2.Revision.AnnotationsEntryB�A4 + create_time ( 2.google.protobuf.TimestampB�A4 + update_time ( 2.google.protobuf.TimestampB�A4 + delete_time ( 2.google.protobuf.TimestampB�A4 + expire_time ( 2.google.protobuf.TimestampB�A- + launch_stage + (2.google.api.LaunchStage3 +service ( B"�A�A +run.googleapis.com/Service5 +scaling ( 2$.google.cloud.run.v2.RevisionScaling2 + +vpc_access ( 2.google.cloud.run.v2.VpcAccess( + max_instance_request_concurrency" (* +timeout ( 2.google.protobuf.Duration +service_account ( 2 + +containers ( 2.google.cloud.run.v2.Container, +volumes ( 2.google.cloud.run.v2.VolumeH +execution_environment (2).google.cloud.run.v2.ExecutionEnvironment> +encryption_key ( B&�A# +!cloudkms.googleapis.com/CryptoKey6 + service_mesh ( 2 .google.cloud.run.v2.ServiceMesh\\ + encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionC + encryption_key_shutdown_duration ( 2.google.protobuf.Duration + reconciling (B�A7 + +conditions ( 2.google.cloud.run.v2.ConditionB�A +observed_generation (B�A +log_uri! ( B�A + satisfies_pzs% (B�A +session_affinity& (G +scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusB�A8 + node_selector( ( 2!.google.cloud.run.v2.NodeSelector +etagc ( B�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:t�Aq +run.googleapis.com/RevisionOprojects/{project}/locations/{location}/services/{service}/revisions/{revision}R2� + Revisions� + GetRevision\'.google.cloud.run.v2.GetRevisionRequest.google.cloud.run.v2.Revision"{�Aname���:8/v2/{name=projects/*/locations/*/services/*/revisions/*}���., +name$projects/*/locations/{location=*}/**� + ListRevisions).google.cloud.run.v2.ListRevisionsRequest*.google.cloud.run.v2.ListRevisionsResponse"�Aparent���:8/v2/{parent=projects/*/locations/*/services/*}/revisions���0. +parent$projects/*/locations/{location=*}/**� +DeleteRevision*.google.cloud.run.v2.DeleteRevisionRequest.google.longrunning.Operation"��A +RevisionRevision�Aname���:*8/v2/{name=projects/*/locations/*/services/*/revisions/*}���., +name$projects/*/locations/{location=*}/**F�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBU +com.google.cloud.run.v2B RevisionProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php new file mode 100644 index 00000000000..0df8acbe163 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php @@ -0,0 +1,62 @@ +internalAddGeneratedFile( + ' +� ++google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"� +RevisionTemplate5 +revision ( B#�A�A +run.googleapis.com/RevisionF +labels ( 21.google.cloud.run.v2.RevisionTemplate.LabelsEntryB�AP + annotations ( 26.google.cloud.run.v2.RevisionTemplate.AnnotationsEntryB�A: +scaling ( 2$.google.cloud.run.v2.RevisionScalingB�A7 + +vpc_access ( 2.google.cloud.run.v2.VpcAccessB�A/ +timeout ( 2.google.protobuf.DurationB�A +service_account ( B�A2 + +containers + ( 2.google.cloud.run.v2.Container1 +volumes ( 2.google.cloud.run.v2.VolumeB�AM +execution_environment (2).google.cloud.run.v2.ExecutionEnvironmentB�A> +encryption_key ( B&�A# +!cloudkms.googleapis.com/CryptoKey- + max_instance_request_concurrency (B�A; + service_mesh ( 2 .google.cloud.run.v2.ServiceMeshB�Aa + encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionB�AH + encryption_key_shutdown_duration ( 2.google.protobuf.DurationB�A +session_affinity (B�A" +health_check_disabled (B�A= + node_selector ( 2!.google.cloud.run.v2.NodeSelectorB�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8B] +com.google.cloud.run.v2BRevisionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php new file mode 100644 index 00000000000..784370ba87d --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php @@ -0,0 +1,135 @@ +internalAddGeneratedFile( + ' +�% +!google/cloud/run/v2/service.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto+google/cloud/run/v2/revision_template.proto(google/cloud/run/v2/traffic_target.proto)google/cloud/run/v2/vendor_settings.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� +CreateServiceRequest2 +parent ( B"�A�Arun.googleapis.com/Service2 +service ( 2.google.cloud.run.v2.ServiceB�A + +service_id ( B�A + validate_only ("� +UpdateServiceRequest4 + update_mask ( 2.google.protobuf.FieldMaskB�A2 +service ( 2.google.cloud.run.v2.ServiceB�A + validate_only ( + allow_missing (B�A"� +ListServicesRequest2 +parent ( B"�A�Arun.googleapis.com/Service + page_size ( + +page_token (  + show_deleted ("_ +ListServicesResponse. +services ( 2.google.cloud.run.v2.Service +next_page_token ( "E +GetServiceRequest0 +name ( B"�A�A +run.googleapis.com/Service"m +DeleteServiceRequest0 +name ( B"�A�A +run.googleapis.com/Service + validate_only ( +etag ( "� +Service +name (  + description (  +uid ( B�A + +generation (B�A= +labels ( 2(.google.cloud.run.v2.Service.LabelsEntryB�AG + annotations ( 2-.google.cloud.run.v2.Service.AnnotationsEntryB�A4 + create_time ( 2.google.protobuf.TimestampB�A4 + update_time ( 2.google.protobuf.TimestampB�A4 + delete_time ( 2.google.protobuf.TimestampB�A4 + expire_time + ( 2.google.protobuf.TimestampB�A +creator ( B�A + last_modifier ( B�A +client (  +client_version ( 9 +ingress (2#.google.cloud.run.v2.IngressTrafficB�A2 + launch_stage (2.google.api.LaunchStageB�AK +binary_authorization ( 2(.google.cloud.run.v2.BinaryAuthorizationB�A< +template ( 2%.google.cloud.run.v2.RevisionTemplateB�A8 +traffic ( 2".google.cloud.run.v2.TrafficTargetB�A9 +scaling ( 2#.google.cloud.run.v2.ServiceScalingB�A! +invoker_iam_disabled (B�A! +default_uri_disabled (B�A +urls ( B�A +custom_audiences% (  +observed_generation (B�A? +terminal_condition ( 2.google.cloud.run.v2.ConditionB�A7 + +conditions ( 2.google.cloud.run.v2.ConditionB�AB +latest_ready_revision! ( B#�A�A +run.googleapis.com/RevisionD +latest_created_revision" ( B#�A�A +run.googleapis.com/RevisionG +traffic_statuses# ( 2(.google.cloud.run.v2.TrafficTargetStatusB�A +uri$ ( B�A + satisfies_pzs& (B�A + reconcilingb (B�A +etagc ( B�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:^�A[ +run.googleapis.com/Service:projects/{project}/locations/{location}/services/{service}R2� +Services� + CreateService).google.cloud.run.v2.CreateServiceRequest.google.longrunning.Operation"��A +ServiceService�Aparent,service,service_id���7",/v2/{parent=projects/*/locations/*}/services:service���-+ +parent!projects/*/locations/{location=*}� + +GetService&.google.cloud.run.v2.GetServiceRequest.google.cloud.run.v2.Service"o�Aname���.,/v2/{name=projects/*/locations/*/services/*}���., +name$projects/*/locations/{location=*}/**� + ListServices(.google.cloud.run.v2.ListServicesRequest).google.cloud.run.v2.ListServicesResponse"p�Aparent���.,/v2/{parent=projects/*/locations/*}/services���-+ +parent!projects/*/locations/{location=*}� + UpdateService).google.cloud.run.v2.UpdateServiceRequest.google.longrunning.Operation"��A +ServiceService�Aservice�Aservice,update_mask���?24/v2/{service.name=projects/*/locations/*/services/*}:service���64 + service.name$projects/*/locations/{location=*}/**� + DeleteService).google.cloud.run.v2.DeleteServiceRequest.google.longrunning.Operation"��A +ServiceService�Aname���.*,/v2/{name=projects/*/locations/*/services/*}���., +name$projects/*/locations/{location=*}/**� + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"E���?=/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy� + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"H���B"=/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy:*� +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"N���H"C/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions:*F�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBT +com.google.cloud.run.v2B ServiceProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php new file mode 100644 index 00000000000..2b1ce742f01 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +� + google/cloud/run/v2/status.protogoogle.cloud.run.v2"; +RevisionScalingStatus" +desired_min_instance_count (BS +com.google.cloud.run.v2B StatusProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php new file mode 100644 index 00000000000..868016cd657 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php @@ -0,0 +1,103 @@ +internalAddGeneratedFile( + ' +� +google/cloud/run/v2/task.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.protogoogle/rpc/status.proto"? +GetTaskRequest- +name ( B�A�A +run.googleapis.com/Task"� +ListTasksRequest/ +parent ( B�A�Arun.googleapis.com/Task + page_size ( + +page_token (  + show_deleted ("V +ListTasksResponse( +tasks ( 2.google.cloud.run.v2.Task +next_page_token ( "� +Task +name ( B�A +uid ( B�A + +generation (B�A: +labels ( 2%.google.cloud.run.v2.Task.LabelsEntryB�AD + annotations ( 2*.google.cloud.run.v2.Task.AnnotationsEntryB�A4 + create_time ( 2.google.protobuf.TimestampB�A7 +scheduled_time" ( 2.google.protobuf.TimestampB�A3 + +start_time ( 2.google.protobuf.TimestampB�A8 +completion_time ( 2.google.protobuf.TimestampB�A4 + update_time ( 2.google.protobuf.TimestampB�A4 + delete_time ( 2.google.protobuf.TimestampB�A4 + expire_time + ( 2.google.protobuf.TimestampB�A+ +job ( B�A�A +run.googleapis.com/Job7 + execution ( B$�A�A +run.googleapis.com/Execution2 + +containers ( 2.google.cloud.run.v2.Container, +volumes ( 2.google.cloud.run.v2.Volume + max_retries (* +timeout ( 2.google.protobuf.Duration +service_account ( H +execution_environment (2).google.cloud.run.v2.ExecutionEnvironment + reconciling (B�A7 + +conditions ( 2.google.cloud.run.v2.ConditionB�A +observed_generation (B�A +index (B�A +retried (B�AH +last_attempt_result ( 2&.google.cloud.run.v2.TaskAttemptResultB�AA +encryption_key ( B)�A�A# +!cloudkms.googleapis.com/CryptoKey7 + +vpc_access ( 2.google.cloud.run.v2.VpcAccessB�A +log_uri ( B�A + satisfies_pzs! (B�A +etagc ( B�A- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:w�At +run.googleapis.com/TaskVprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}R"T +TaskAttemptResult\' +status ( 2.google.rpc.StatusB�A + exit_code (B�A2� +Tasks� +GetTask#.google.cloud.run.v2.GetTaskRequest.google.cloud.run.v2.Task"L�Aname���?=/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}� + ListTasks%.google.cloud.run.v2.ListTasksRequest&.google.cloud.run.v2.ListTasksResponse"N�Aparent���?=/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasksF�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBQ +com.google.cloud.run.v2B TaskProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php new file mode 100644 index 0000000000000000000000000000000000000000..75bcf93617ef9dc602423b9df478aafd2ecd206c GIT binary patch literal 1579 zcma)6(M}UV6tz~Y3gbb4DR-JRLY%r;cR zFZn~h_#HkuJG)y-C<%RNo85EH+KH1-#BWm8LASYq)^2JAqF0lsVBl-S%$nks+2WR!;S_&@Qk)& zH4);(2Ne(s_^??&0Zn>D6Zg>4-MxtJo`u|PSGEzN9#IOnj7%$0LB9|-pCIgdjAEsU zHa{Cobr@%w5s&>eP3+)4@e~+=+t_}{sb+%Xh;Yg&6iYbPjIbMlFir2^w4P?Hz-v0A-ViCbM1SUxyLrzE&cBF(jvaN! zjJh+btSl#N60ovNe2pi5Wo?%5a7#Hp;|ZiR3o^16byVU}0$oj@_BNTxEcX&4;`eWU zXVKH?3zM&yYb3ZP%v^C*$lz>op|a}4DmQv?_EK2>1Imqr7n+M&cxVZ)W)j*KQ_udb zW%5gC!6%m;Gr*D=S{7%Db6+3i%P6Or4sg5tjENf;fh8{u4r@fJTLaQiUhB!P(xn16s2vdvJXo zB1tuFQnYc_=}PYIYQ3&h zP(OwT_yWF;C&qS~HngZb;s@U}=ggToGyDF7JeKGM?omz^(R7BVXILLoES1nA5D}gx zVMrAY#EE1PRTjpb0qzex>~vi3IY48PsDRe-T!?u@t3f1^Syd&xdRnV$MZ%B;6HU~d zYAYi}h?5f?XbtG)y}I zUGQD5sp2H^J2VaylUk@Dgx2d&+OmJ?pK@i9Hl<@BF6SES^=l%VSgV9y&5p66I#Ill z=}rmGmv8$JA>%|MS<3^Vu9hCY+DXkerKxc1h%0cEWq>?jfe_$s&uIJ1WCD|*Ue_%5yi z$AcFBWj{mPX~LX~NETZ#qt($O&U}LINeY9>b#Waao908buF1T(k>YoL8fa@J;~2&$ ziT^*Psq93t;$|v)@4JDvS7iUuC=2a*BfHym+Y`?o^&D?v9~=zYw&xD|6YulTnSAPx zhfdq=x=yEX$E={2x5OXVo-_6ehWQHlrCVZ0&Y?SoOog@95qb)4++=jiTqz*iuAy;M z$w%m7GQi2X$W9S(77h|{T233;eR?-LM&6Z{gZnz)qAN@H*M-X>^W8W{=Lr1<&5@7> literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php new file mode 100644 index 0000000000000000000000000000000000000000..5504bca48fbb4fb082ec617d7bef602dfd51f869 GIT binary patch literal 2510 zcmb7GUvt_<5Dz$Yfecu!#FDFp}gg)k;qZ^!5n#DTz^?~l|y@~|rl|q1CD-gZz?n3~> z(mjuKB~UxYftNt==LCJrG>GTxK0fZ6o@NTuH+9QA#zgkWP`5me5NB$n+mx{fuH}o!KCXS&?n_Ps2P+krN zoG(r7l|5MGBZT+TN%UOZ&Bmsuxa4NR!Z#-Eiwl3#gwg~>aQ|1^eU6etO$<@XUV4En zWS4jI{{f{&j#5jZpG4g3Kx%$LxdtD`QR4h$>*LlEx}6)^2MDYP-ow)%_|fr!FaLuuN+;t<$3W`_)n^p=`iYjNNAoL|+a(t_}E54=i62z9M-&x}=m~(Xp{r zkFZ1`-3M61H}nhG?n@y3U7-0rYf481xd-XK%k}4@a3E;U0?#*xrXhpNO^i}5UWK&~ z6(NtcF-L}jOdHl(d}4Y?vu)sX5F_O?P{yXf&BMmT_SXzM5E1DQqGE;y`ipsku-cJ9 zhQV^1yA#vkb?zN1-@;{_X@~JfW#7019?)7USxm!q?c9i&EUc&q-R72TY9$TJVISkEqrdHO z?1ALYp9xs43fYhyS0ADda7S+<7b)#n#dDNU(enl}OUw=u{i3 z#?)@L)lln9?aU?cDQuo^R$=M`%;VqIcT>q72W~N8xJOPH|1m$pp0K0-q4F?PzJmKq zEw!FDC6UMMsn%lMMhW*2dC`)5oEaNUvm+`zlXGt`xre;L1> zgoogle.cloud.run.v2.BinaryAuthorization + */ +class BinaryAuthorization extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $breakglass_justification = ''; + protected $binauthz_method; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $use_default + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * @type string $policy + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * @type string $breakglass_justification + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * + * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseDefault() + { + return $this->readOneof(1); + } + + public function hasUseDefault() + { + return $this->hasOneof(1); + } + + /** + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * + * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseDefault($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPolicy() + { + return $this->readOneof(3); + } + + public function hasPolicy() + { + return $this->hasOneof(3); + } + + /** + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBreakglassJustification() + { + return $this->breakglass_justification; + } + + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBreakglassJustification($var) + { + GPBUtil::checkString($var, True); + $this->breakglass_justification = $var; + + return $this; + } + + /** + * @return string + */ + public function getBinauthzMethod() + { + return $this->whichOneof("binauthz_method"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php new file mode 100644 index 00000000000..771e535b0e3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php @@ -0,0 +1,172 @@ +google.cloud.run.v2.CancelExecutionRequest + */ +class CancelExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\CancelExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * cancelling any resources. + * @type string $etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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 name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php new file mode 100644 index 00000000000..93ca08a9f46 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php @@ -0,0 +1,86 @@ +google.cloud.run.v2.CloudSqlInstance + */ +class CloudSqlInstance extends \Google\Protobuf\Internal\Message +{ + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php new file mode 100644 index 00000000000..e15712d24b3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php @@ -0,0 +1,337 @@ +google.cloud.run.v2.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + */ + protected $state = 0; + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + */ + protected $message = ''; + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + */ + protected $last_transition_time = null; + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + */ + protected $severity = 0; + protected $reasons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * @type int $state + * State of the condition. + * @type string $message + * Human readable message indicating details about the current status. + * @type \Google\Protobuf\Timestamp $last_transition_time + * Last time the condition transitioned from one status to another. + * @type int $severity + * How to interpret failures of this condition, one of Error, Warning, Info + * @type int $reason + * Output only. A common (service-level) reason for this condition. + * @type int $revision_reason + * Output only. A reason for the revision condition. + * @type int $execution_reason + * Output only. A reason for the execution condition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Condition::initOnce(); + parent::__construct($data); + } + + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\State::class); + $this->state = $var; + + return $this; + } + + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastTransitionTime() + { + return $this->last_transition_time; + } + + public function hasLastTransitionTime() + { + return isset($this->last_transition_time); + } + + public function clearLastTransitionTime() + { + unset($this->last_transition_time); + } + + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastTransitionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_transition_time = $var; + + return $this; + } + + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Output only. A common (service-level) reason for this condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReason() + { + return $this->readOneof(6); + } + + public function hasReason() + { + return $this->hasOneof(6); + } + + /** + * Output only. A common (service-level) reason for this condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\CommonReason::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. A reason for the revision condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRevisionReason() + { + return $this->readOneof(9); + } + + public function hasRevisionReason() + { + return $this->hasOneof(9); + } + + /** + * Output only. A reason for the revision condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRevisionReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\RevisionReason::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. A reason for the execution condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExecutionReason() + { + return $this->readOneof(11); + } + + public function hasExecutionReason() + { + return $this->hasOneof(11); + } + + /** + * Output only. A reason for the execution condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExecutionReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\ExecutionReason::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * @return string + */ + public function getReasons() + { + return $this->whichOneof("reasons"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php new file mode 100644 index 00000000000..b7883e34e0a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php @@ -0,0 +1,148 @@ +google.cloud.run.v2.Condition.CommonReason + */ +class CommonReason +{ + /** + * Default value. + * + * Generated from protobuf enum COMMON_REASON_UNDEFINED = 0; + */ + const COMMON_REASON_UNDEFINED = 0; + /** + * Reason unknown. Further details will be in message. + * + * Generated from protobuf enum UNKNOWN = 1; + */ + const UNKNOWN = 1; + /** + * Revision creation process failed. + * + * Generated from protobuf enum REVISION_FAILED = 3; + */ + const REVISION_FAILED = 3; + /** + * Timed out waiting for completion. + * + * Generated from protobuf enum PROGRESS_DEADLINE_EXCEEDED = 4; + */ + const PROGRESS_DEADLINE_EXCEEDED = 4; + /** + * The container image path is incorrect. + * + * Generated from protobuf enum CONTAINER_MISSING = 6; + */ + const CONTAINER_MISSING = 6; + /** + * Insufficient permissions on the container image. + * + * Generated from protobuf enum CONTAINER_PERMISSION_DENIED = 7; + */ + const CONTAINER_PERMISSION_DENIED = 7; + /** + * Container image is not authorized by policy. + * + * Generated from protobuf enum CONTAINER_IMAGE_UNAUTHORIZED = 8; + */ + const CONTAINER_IMAGE_UNAUTHORIZED = 8; + /** + * Container image policy authorization check failed. + * + * Generated from protobuf enum CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; + */ + const CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; + /** + * Insufficient permissions on encryption key. + * + * Generated from protobuf enum ENCRYPTION_KEY_PERMISSION_DENIED = 10; + */ + const ENCRYPTION_KEY_PERMISSION_DENIED = 10; + /** + * Permission check on encryption key failed. + * + * Generated from protobuf enum ENCRYPTION_KEY_CHECK_FAILED = 11; + */ + const ENCRYPTION_KEY_CHECK_FAILED = 11; + /** + * At least one Access check on secrets failed. + * + * Generated from protobuf enum SECRETS_ACCESS_CHECK_FAILED = 12; + */ + const SECRETS_ACCESS_CHECK_FAILED = 12; + /** + * Waiting for operation to complete. + * + * Generated from protobuf enum WAITING_FOR_OPERATION = 13; + */ + const WAITING_FOR_OPERATION = 13; + /** + * System will retry immediately. + * + * Generated from protobuf enum IMMEDIATE_RETRY = 14; + */ + const IMMEDIATE_RETRY = 14; + /** + * System will retry later; current attempt failed. + * + * Generated from protobuf enum POSTPONED_RETRY = 15; + */ + const POSTPONED_RETRY = 15; + /** + * An internal error occurred. Further information may be in the message. + * + * Generated from protobuf enum INTERNAL = 16; + */ + const INTERNAL = 16; + + private static $valueToName = [ + self::COMMON_REASON_UNDEFINED => 'COMMON_REASON_UNDEFINED', + self::UNKNOWN => 'UNKNOWN', + self::REVISION_FAILED => 'REVISION_FAILED', + self::PROGRESS_DEADLINE_EXCEEDED => 'PROGRESS_DEADLINE_EXCEEDED', + self::CONTAINER_MISSING => 'CONTAINER_MISSING', + self::CONTAINER_PERMISSION_DENIED => 'CONTAINER_PERMISSION_DENIED', + self::CONTAINER_IMAGE_UNAUTHORIZED => 'CONTAINER_IMAGE_UNAUTHORIZED', + self::CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED => 'CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED', + self::ENCRYPTION_KEY_PERMISSION_DENIED => 'ENCRYPTION_KEY_PERMISSION_DENIED', + self::ENCRYPTION_KEY_CHECK_FAILED => 'ENCRYPTION_KEY_CHECK_FAILED', + self::SECRETS_ACCESS_CHECK_FAILED => 'SECRETS_ACCESS_CHECK_FAILED', + self::WAITING_FOR_OPERATION => 'WAITING_FOR_OPERATION', + self::IMMEDIATE_RETRY => 'IMMEDIATE_RETRY', + self::POSTPONED_RETRY => 'POSTPONED_RETRY', + self::INTERNAL => 'INTERNAL', + ]; + + 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(CommonReason::class, \Google\Cloud\Run\V2\Condition_CommonReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php new file mode 100644 index 00000000000..11956647ed4 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php @@ -0,0 +1,86 @@ +google.cloud.run.v2.Condition.ExecutionReason + */ +class ExecutionReason +{ + /** + * Default value. + * + * Generated from protobuf enum EXECUTION_REASON_UNDEFINED = 0; + */ + const EXECUTION_REASON_UNDEFINED = 0; + /** + * Internal system error getting execution status. System will retry. + * + * Generated from protobuf enum JOB_STATUS_SERVICE_POLLING_ERROR = 1; + */ + const JOB_STATUS_SERVICE_POLLING_ERROR = 1; + /** + * A task reached its retry limit and the last attempt failed due to the + * user container exiting with a non-zero exit code. + * + * Generated from protobuf enum NON_ZERO_EXIT_CODE = 2; + */ + const NON_ZERO_EXIT_CODE = 2; + /** + * The execution was cancelled by users. + * + * Generated from protobuf enum CANCELLED = 3; + */ + const CANCELLED = 3; + /** + * The execution is in the process of being cancelled. + * + * Generated from protobuf enum CANCELLING = 4; + */ + const CANCELLING = 4; + /** + * The execution was deleted. + * + * Generated from protobuf enum DELETED = 5; + */ + const DELETED = 5; + + private static $valueToName = [ + self::EXECUTION_REASON_UNDEFINED => 'EXECUTION_REASON_UNDEFINED', + self::JOB_STATUS_SERVICE_POLLING_ERROR => 'JOB_STATUS_SERVICE_POLLING_ERROR', + self::NON_ZERO_EXIT_CODE => 'NON_ZERO_EXIT_CODE', + self::CANCELLED => 'CANCELLED', + self::CANCELLING => 'CANCELLING', + self::DELETED => 'DELETED', + ]; + + 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(ExecutionReason::class, \Google\Cloud\Run\V2\Condition_ExecutionReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php new file mode 100644 index 00000000000..26765337581 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php @@ -0,0 +1,141 @@ +google.cloud.run.v2.Condition.RevisionReason + */ +class RevisionReason +{ + /** + * Default value. + * + * Generated from protobuf enum REVISION_REASON_UNDEFINED = 0; + */ + const REVISION_REASON_UNDEFINED = 0; + /** + * Revision in Pending state. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Revision is in Reserve state. + * + * Generated from protobuf enum RESERVE = 2; + */ + const RESERVE = 2; + /** + * Revision is Retired. + * + * Generated from protobuf enum RETIRED = 3; + */ + const RETIRED = 3; + /** + * Revision is being retired. + * + * Generated from protobuf enum RETIRING = 4; + */ + const RETIRING = 4; + /** + * Revision is being recreated. + * + * Generated from protobuf enum RECREATING = 5; + */ + const RECREATING = 5; + /** + * There was a health check error. + * + * Generated from protobuf enum HEALTH_CHECK_CONTAINER_ERROR = 6; + */ + const HEALTH_CHECK_CONTAINER_ERROR = 6; + /** + * Health check failed due to user error from customized path of the + * container. System will retry. + * + * Generated from protobuf enum CUSTOMIZED_PATH_RESPONSE_PENDING = 7; + */ + const CUSTOMIZED_PATH_RESPONSE_PENDING = 7; + /** + * A revision with min_instance_count > 0 was created and is reserved, but + * it was not configured to serve traffic, so it's not live. This can also + * happen momentarily during traffic migration. + * + * Generated from protobuf enum MIN_INSTANCES_NOT_PROVISIONED = 8; + */ + const MIN_INSTANCES_NOT_PROVISIONED = 8; + /** + * The maximum allowed number of active revisions has been reached. + * + * Generated from protobuf enum ACTIVE_REVISION_LIMIT_REACHED = 9; + */ + const ACTIVE_REVISION_LIMIT_REACHED = 9; + /** + * There was no deployment defined. + * This value is no longer used, but Services created in older versions of + * the API might contain this value. + * + * Generated from protobuf enum NO_DEPLOYMENT = 10; + */ + const NO_DEPLOYMENT = 10; + /** + * A revision's container has no port specified since the revision is of a + * manually scaled service with 0 instance count + * + * Generated from protobuf enum HEALTH_CHECK_SKIPPED = 11; + */ + const HEALTH_CHECK_SKIPPED = 11; + /** + * A revision with min_instance_count > 0 was created and is waiting for + * enough instances to begin a traffic migration. + * + * Generated from protobuf enum MIN_INSTANCES_WARMING = 12; + */ + const MIN_INSTANCES_WARMING = 12; + + private static $valueToName = [ + self::REVISION_REASON_UNDEFINED => 'REVISION_REASON_UNDEFINED', + self::PENDING => 'PENDING', + self::RESERVE => 'RESERVE', + self::RETIRED => 'RETIRED', + self::RETIRING => 'RETIRING', + self::RECREATING => 'RECREATING', + self::HEALTH_CHECK_CONTAINER_ERROR => 'HEALTH_CHECK_CONTAINER_ERROR', + self::CUSTOMIZED_PATH_RESPONSE_PENDING => 'CUSTOMIZED_PATH_RESPONSE_PENDING', + self::MIN_INSTANCES_NOT_PROVISIONED => 'MIN_INSTANCES_NOT_PROVISIONED', + self::ACTIVE_REVISION_LIMIT_REACHED => 'ACTIVE_REVISION_LIMIT_REACHED', + self::NO_DEPLOYMENT => 'NO_DEPLOYMENT', + self::HEALTH_CHECK_SKIPPED => 'HEALTH_CHECK_SKIPPED', + self::MIN_INSTANCES_WARMING => 'MIN_INSTANCES_WARMING', + ]; + + 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(RevisionReason::class, \Google\Cloud\Run\V2\Condition_RevisionReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php new file mode 100644 index 00000000000..eb2c0967fd4 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php @@ -0,0 +1,71 @@ +google.cloud.run.v2.Condition.Severity + */ +class Severity +{ + /** + * Unspecified severity + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * Error severity. + * + * Generated from protobuf enum ERROR = 1; + */ + const ERROR = 1; + /** + * Warning severity. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * Info severity. + * + * Generated from protobuf enum INFO = 3; + */ + const INFO = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::ERROR => 'ERROR', + self::WARNING => 'WARNING', + self::INFO => 'INFO', + ]; + + 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(Severity::class, \Google\Cloud\Run\V2\Condition_Severity::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php new file mode 100644 index 00000000000..3ca42a0f1e3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php @@ -0,0 +1,78 @@ +google.cloud.run.v2.Condition.State + */ +class State +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Transient state: Reconciliation has not started yet. + * + * Generated from protobuf enum CONDITION_PENDING = 1; + */ + const CONDITION_PENDING = 1; + /** + * Transient state: reconciliation is still in progress. + * + * Generated from protobuf enum CONDITION_RECONCILING = 2; + */ + const CONDITION_RECONCILING = 2; + /** + * Terminal state: Reconciliation did not succeed. + * + * Generated from protobuf enum CONDITION_FAILED = 3; + */ + const CONDITION_FAILED = 3; + /** + * Terminal state: Reconciliation completed successfully. + * + * Generated from protobuf enum CONDITION_SUCCEEDED = 4; + */ + const CONDITION_SUCCEEDED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CONDITION_PENDING => 'CONDITION_PENDING', + self::CONDITION_RECONCILING => 'CONDITION_RECONCILING', + self::CONDITION_FAILED => 'CONDITION_FAILED', + self::CONDITION_SUCCEEDED => 'CONDITION_SUCCEEDED', + ]; + + 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(State::class, \Google\Cloud\Run\V2\Condition_State::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php new file mode 100644 index 00000000000..1dc5d80d18b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php @@ -0,0 +1,531 @@ +google.cloud.run.v2.Container + */ +class Container extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + */ + private $command; + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + */ + private $args; + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + */ + private $env; + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + */ + protected $resources = null; + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + */ + private $ports; + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + */ + private $volume_mounts; + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + */ + protected $working_dir = ''; + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + */ + protected $liveness_probe = null; + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + */ + protected $startup_probe = null; + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + */ + private $depends_on; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the container specified as a DNS_LABEL (RFC 1123). + * @type string $image + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * @type array|\Google\Protobuf\Internal\RepeatedField $command + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * @type array|\Google\Protobuf\Internal\RepeatedField $args + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env + * List of environment variables to set in the container. + * @type \Google\Cloud\Run\V2\ResourceRequirements $resources + * Compute Resource requirements by this container. + * @type array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $ports + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * @type array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $volume_mounts + * Volume to mount into the container's filesystem. + * @type string $working_dir + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * @type \Google\Cloud\Run\V2\Probe $liveness_probe + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * @type \Google\Cloud\Run\V2\Probe $startup_probe + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * @type array|\Google\Protobuf\Internal\RepeatedField $depends_on + * Names of the containers that must start before this container. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $var; + + return $this; + } + + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCommand() + { + return $this->command; + } + + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCommand($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->command = $arr; + + return $this; + } + + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArgs() + { + return $this->args; + } + + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArgs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->args = $arr; + + return $this; + } + + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnv() + { + return $this->env; + } + + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnv($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); + $this->env = $arr; + + return $this; + } + + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + * @return \Google\Cloud\Run\V2\ResourceRequirements|null + */ + public function getResources() + { + return $this->resources; + } + + public function hasResources() + { + return isset($this->resources); + } + + public function clearResources() + { + unset($this->resources); + } + + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + * @param \Google\Cloud\Run\V2\ResourceRequirements $var + * @return $this + */ + public function setResources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ResourceRequirements::class); + $this->resources = $var; + + return $this; + } + + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + * @param array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\ContainerPort::class); + $this->ports = $arr; + + return $this; + } + + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumeMounts() + { + return $this->volume_mounts; + } + + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + * @param array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumeMounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VolumeMount::class); + $this->volume_mounts = $arr; + + return $this; + } + + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + * @return string + */ + public function getWorkingDir() + { + return $this->working_dir; + } + + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + * @param string $var + * @return $this + */ + public function setWorkingDir($var) + { + GPBUtil::checkString($var, True); + $this->working_dir = $var; + + return $this; + } + + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + * @return \Google\Cloud\Run\V2\Probe|null + */ + public function getLivenessProbe() + { + return $this->liveness_probe; + } + + public function hasLivenessProbe() + { + return isset($this->liveness_probe); + } + + public function clearLivenessProbe() + { + unset($this->liveness_probe); + } + + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + * @param \Google\Cloud\Run\V2\Probe $var + * @return $this + */ + public function setLivenessProbe($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); + $this->liveness_probe = $var; + + return $this; + } + + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + * @return \Google\Cloud\Run\V2\Probe|null + */ + public function getStartupProbe() + { + return $this->startup_probe; + } + + public function hasStartupProbe() + { + return isset($this->startup_probe); + } + + public function clearStartupProbe() + { + unset($this->startup_probe); + } + + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + * @param \Google\Cloud\Run\V2\Probe $var + * @return $this + */ + public function setStartupProbe($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); + $this->startup_probe = $var; + + return $this; + } + + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDependsOn() + { + return $this->depends_on; + } + + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDependsOn($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->depends_on = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php new file mode 100644 index 00000000000..9fad73b12ee --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php @@ -0,0 +1,109 @@ +google.cloud.run.v2.ContainerPort + */ +class ContainerPort extends \Google\Protobuf\Internal\Message +{ + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + */ + protected $container_port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * @type int $container_port + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + * @return int + */ + public function getContainerPort() + { + return $this->container_port; + } + + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + * @param int $var + * @return $this + */ + public function setContainerPort($var) + { + GPBUtil::checkInt32($var); + $this->container_port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php new file mode 100644 index 00000000000..f201e0ba2b8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php @@ -0,0 +1,216 @@ +google.cloud.run.v2.CreateJobRequest + */ +class CreateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job_id = ''; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Please see + * {@see JobsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Run\V2\Job $job Required. The Job instance to create. + * @param string $jobId Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * @return \Google\Cloud\Run\V2\CreateJobRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Run\V2\Job $job, string $jobId): self + { + return (new self()) + ->setParent($parent) + ->setJob($job) + ->setJobId($jobId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @type \Google\Cloud\Run\V2\Job $job + * Required. The Job instance to create. + * @type string $job_id + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * 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 location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * 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 Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php new file mode 100644 index 00000000000..7a5677b8d35 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php @@ -0,0 +1,221 @@ +google.cloud.run.v2.CreateServiceRequest + */ +class CreateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_id = ''; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. Please see + * {@see ServicesClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Run\V2\Service $service Required. The Service instance to create. + * @param string $serviceId Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * @return \Google\Cloud\Run\V2\CreateServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Run\V2\Service $service, string $serviceId): self + { + return (new self()) + ->setParent($parent) + ->setService($service) + ->setServiceId($serviceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * @type \Google\Cloud\Run\V2\Service $service + * Required. The Service instance to create. + * @type string $service_id + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * 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 location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * 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 Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceId() + { + return $this->service_id; + } + + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceId($var) + { + GPBUtil::checkString($var, True); + $this->service_id = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php new file mode 100644 index 00000000000..ea7d31e245f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php @@ -0,0 +1,172 @@ +google.cloud.run.v2.DeleteExecutionRequest + */ +class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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 name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php new file mode 100644 index 00000000000..0c4f53d9768 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php @@ -0,0 +1,167 @@ +google.cloud.run.v2.DeleteJobRequest + */ +class DeleteJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + */ + protected $etag = ''; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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 full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php new file mode 100644 index 00000000000..0b7bb2e7693 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php @@ -0,0 +1,169 @@ +google.cloud.run.v2.DeleteRevisionRequest + */ +class DeleteRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * Please see {@see RevisionsClient::revisionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * 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 name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php new file mode 100644 index 00000000000..16182d4a160 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php @@ -0,0 +1,167 @@ +google.cloud.run.v2.DeleteServiceRequest + */ +class DeleteServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. Please see + * {@see ServicesClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * 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 full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php new file mode 100644 index 00000000000..be49c7f974b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php @@ -0,0 +1,143 @@ +google.cloud.run.v2.EmptyDirVolumeSource + */ +class EmptyDirVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + */ + protected $medium = 0; + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + */ + protected $size_limit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $medium + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * @type string $size_limit + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + * @return int + */ + public function getMedium() + { + return $this->medium; + } + + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + * @param int $var + * @return $this + */ + public function setMedium($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource\Medium::class); + $this->medium = $var; + + return $this; + } + + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + * @return string + */ + public function getSizeLimit() + { + return $this->size_limit; + } + + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + * @param string $var + * @return $this + */ + public function setSizeLimit($var) + { + GPBUtil::checkString($var, True); + $this->size_limit = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php new file mode 100644 index 00000000000..f226a6c0cdd --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php @@ -0,0 +1,58 @@ +google.cloud.run.v2.EmptyDirVolumeSource.Medium + */ +class Medium +{ + /** + * When not specified, falls back to the default implementation which + * is currently in memory (this may change over time). + * + * Generated from protobuf enum MEDIUM_UNSPECIFIED = 0; + */ + const MEDIUM_UNSPECIFIED = 0; + /** + * Explicitly set the EmptyDir to be in memory. Uses tmpfs. + * + * Generated from protobuf enum MEMORY = 1; + */ + const MEMORY = 1; + + private static $valueToName = [ + self::MEDIUM_UNSPECIFIED => 'MEDIUM_UNSPECIFIED', + self::MEMORY => 'MEMORY', + ]; + + 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(Medium::class, \Google\Cloud\Run\V2\EmptyDirVolumeSource_Medium::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php new file mode 100644 index 00000000000..0b07b810a08 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.EncryptionKeyRevocationAction + */ +class EncryptionKeyRevocationAction +{ + /** + * Unspecified + * + * Generated from protobuf enum ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; + */ + const ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; + /** + * Prevents the creation of new instances. + * + * Generated from protobuf enum PREVENT_NEW = 1; + */ + const PREVENT_NEW = 1; + /** + * Shuts down existing instances, and prevents creation of new ones. + * + * Generated from protobuf enum SHUTDOWN = 2; + */ + const SHUTDOWN = 2; + + private static $valueToName = [ + self::ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED => 'ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED', + self::PREVENT_NEW => 'PREVENT_NEW', + self::SHUTDOWN => 'SHUTDOWN', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php new file mode 100644 index 00000000000..2073c4252a5 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php @@ -0,0 +1,152 @@ +google.cloud.run.v2.EnvVar + */ +class EnvVar extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + protected $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * @type string $value + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * @type \Google\Cloud\Run\V2\EnvVarSource $value_source + * Source for the environment variable's value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->readOneof(2); + } + + public function hasValue() + { + return $this->hasOneof(2); + } + + /** + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Source for the environment variable's value. + * + * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; + * @return \Google\Cloud\Run\V2\EnvVarSource|null + */ + public function getValueSource() + { + return $this->readOneof(3); + } + + public function hasValueSource() + { + return $this->hasOneof(3); + } + + /** + * Source for the environment variable's value. + * + * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; + * @param \Google\Cloud\Run\V2\EnvVarSource $var + * @return $this + */ + public function setValueSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EnvVarSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getValues() + { + return $this->whichOneof("values"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php new file mode 100644 index 00000000000..99ffb8e651c --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php @@ -0,0 +1,77 @@ +google.cloud.run.v2.EnvVarSource + */ +class EnvVarSource extends \Google\Protobuf\Internal\Message +{ + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + */ + protected $secret_key_ref = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Run\V2\SecretKeySelector $secret_key_ref + * Selects a secret and a specific version from Cloud Secret Manager. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + * @return \Google\Cloud\Run\V2\SecretKeySelector|null + */ + public function getSecretKeyRef() + { + return $this->secret_key_ref; + } + + public function hasSecretKeyRef() + { + return isset($this->secret_key_ref); + } + + public function clearSecretKeyRef() + { + unset($this->secret_key_ref); + } + + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + * @param \Google\Cloud\Run\V2\SecretKeySelector $var + * @return $this + */ + public function setSecretKeyRef($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretKeySelector::class); + $this->secret_key_ref = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php new file mode 100644 index 00000000000..b72c09e5f96 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php @@ -0,0 +1,1183 @@ +google.cloud.run.v2.Execution + */ +class Execution extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $completion_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + */ + protected $launch_stage = 0; + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $job = ''; + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parallelism = 0; + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $task_count = 0; + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $template = null; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $running_count = 0; + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $succeeded_count = 0; + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $failed_count = 0; + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cancelled_count = 0; + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retried_count = 0; + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Execution. + * @type string $uid + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $completion_time + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type int $launch_stage + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * @type string $job + * Output only. The name of the parent Job. + * @type int $parallelism + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * @type int $task_count + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * @type \Google\Cloud\Run\V2\TaskTemplate $template + * Output only. The template used to create tasks for this execution. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * @type int|string $observed_generation + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * @type int $running_count + * Output only. The number of actively running tasks. + * @type int $succeeded_count + * Output only. The number of tasks which reached phase Succeeded. + * @type int $failed_count + * Output only. The number of tasks which reached phase Failed. + * @type int $cancelled_count + * Output only. The number of tasks which reached phase Cancelled. + * @type int $retried_count + * Output only. The number of tasks which have retried at least once. + * @type string $log_uri + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getJob() + { + return $this->job; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkString($var, True); + $this->job = $var; + + return $this; + } + + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt32($var); + $this->parallelism = $var; + + return $this; + } + + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\TaskTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\TaskTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRunningCount() + { + return $this->running_count; + } + + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRunningCount($var) + { + GPBUtil::checkInt32($var); + $this->running_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSucceededCount() + { + return $this->succeeded_count; + } + + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSucceededCount($var) + { + GPBUtil::checkInt32($var); + $this->succeeded_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFailedCount() + { + return $this->failed_count; + } + + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFailedCount($var) + { + GPBUtil::checkInt32($var); + $this->failed_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCancelledCount() + { + return $this->cancelled_count; + } + + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCancelledCount($var) + { + GPBUtil::checkInt32($var); + $this->cancelled_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetriedCount() + { + return $this->retried_count; + } + + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetriedCount($var) + { + GPBUtil::checkInt32($var); + $this->retried_count = $var; + + return $this; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php new file mode 100644 index 00000000000..da77efe77d8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.ExecutionEnvironment + */ +class ExecutionEnvironment +{ + /** + * Unspecified + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; + */ + const EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; + /** + * Uses the First Generation environment. + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN1 = 1; + */ + const EXECUTION_ENVIRONMENT_GEN1 = 1; + /** + * Uses Second Generation environment. + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN2 = 2; + */ + const EXECUTION_ENVIRONMENT_GEN2 = 2; + + private static $valueToName = [ + self::EXECUTION_ENVIRONMENT_UNSPECIFIED => 'EXECUTION_ENVIRONMENT_UNSPECIFIED', + self::EXECUTION_ENVIRONMENT_GEN1 => 'EXECUTION_ENVIRONMENT_GEN1', + self::EXECUTION_ENVIRONMENT_GEN2 => 'EXECUTION_ENVIRONMENT_GEN2', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php new file mode 100644 index 00000000000..4de3dd33dde --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php @@ -0,0 +1,238 @@ +google.cloud.run.v2.ExecutionReference + */ +class ExecutionReference extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + */ + protected $create_time = null; + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + */ + protected $completion_time = null; + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + */ + protected $delete_time = null; + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + */ + protected $completion_status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the execution. + * @type \Google\Protobuf\Timestamp $create_time + * Creation timestamp of the execution. + * @type \Google\Protobuf\Timestamp $completion_time + * Creation timestamp of the execution. + * @type \Google\Protobuf\Timestamp $delete_time + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * @type int $completion_status + * Status for the execution completion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Creation timestamp of the execution. + * + * 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); + } + + /** + * Creation timestamp of the execution. + * + * 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; + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + * @return int + */ + public function getCompletionStatus() + { + return $this->completion_status; + } + + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + * @param int $var + * @return $this + */ + public function setCompletionStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionReference\CompletionStatus::class); + $this->completion_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php new file mode 100644 index 00000000000..329e05e4330 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php @@ -0,0 +1,85 @@ +google.cloud.run.v2.ExecutionReference.CompletionStatus + */ +class CompletionStatus +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum COMPLETION_STATUS_UNSPECIFIED = 0; + */ + const COMPLETION_STATUS_UNSPECIFIED = 0; + /** + * Job execution has succeeded. + * + * Generated from protobuf enum EXECUTION_SUCCEEDED = 1; + */ + const EXECUTION_SUCCEEDED = 1; + /** + * Job execution has failed. + * + * Generated from protobuf enum EXECUTION_FAILED = 2; + */ + const EXECUTION_FAILED = 2; + /** + * Job execution is running normally. + * + * Generated from protobuf enum EXECUTION_RUNNING = 3; + */ + const EXECUTION_RUNNING = 3; + /** + * Waiting for backing resources to be provisioned. + * + * Generated from protobuf enum EXECUTION_PENDING = 4; + */ + const EXECUTION_PENDING = 4; + /** + * Job execution has been cancelled by the user. + * + * Generated from protobuf enum EXECUTION_CANCELLED = 5; + */ + const EXECUTION_CANCELLED = 5; + + private static $valueToName = [ + self::COMPLETION_STATUS_UNSPECIFIED => 'COMPLETION_STATUS_UNSPECIFIED', + self::EXECUTION_SUCCEEDED => 'EXECUTION_SUCCEEDED', + self::EXECUTION_FAILED => 'EXECUTION_FAILED', + self::EXECUTION_RUNNING => 'EXECUTION_RUNNING', + self::EXECUTION_PENDING => 'EXECUTION_PENDING', + self::EXECUTION_CANCELLED => 'EXECUTION_CANCELLED', + ]; + + 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(CompletionStatus::class, \Google\Cloud\Run\V2\ExecutionReference_CompletionStatus::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php new file mode 100644 index 00000000000..18ee4a6bffb --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php @@ -0,0 +1,322 @@ +google.cloud.run.v2.ExecutionTemplate + */ +class ExecutionTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + */ + private $labels; + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + */ + private $annotations; + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + */ + protected $parallelism = 0; + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + */ + protected $task_count = 0; + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $labels + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type int $parallelism + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * @type int $task_count + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * @type \Google\Cloud\Run\V2\TaskTemplate $template + * Required. Describes the task(s) that will be created when executing an + * execution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\ExecutionTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + * @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; + } + + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + * @return int + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + * @param int $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt32($var); + $this->parallelism = $var; + + return $this; + } + + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\TaskTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\TaskTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); + $this->template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php new file mode 100644 index 00000000000..659846b4e6b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php @@ -0,0 +1,140 @@ +google.cloud.run.v2.GCSVolumeSource + */ +class GCSVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + */ + protected $bucket = ''; + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + */ + protected $read_only = false; + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + */ + private $mount_options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Cloud Storage Bucket name. + * @type bool $read_only + * If true, the volume will be mounted as read only for all mounts. + * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + * @return bool + */ + public function getReadOnly() + { + return $this->read_only; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + * @param bool $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkBool($var); + $this->read_only = $var; + + return $this; + } + + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMountOptions() + { + return $this->mount_options; + } + + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMountOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->mount_options = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php new file mode 100644 index 00000000000..826f06cb471 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php @@ -0,0 +1,121 @@ +google.cloud.run.v2.GRPCAction + */ +class GRPCAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * @type string $service + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php new file mode 100644 index 00000000000..8ecf98e5ef5 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php @@ -0,0 +1,96 @@ +google.cloud.run.v2.GetExecutionRequest + */ +class GetExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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 full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php new file mode 100644 index 00000000000..8d43efd711f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetJobRequest + */ +class GetJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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 full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php new file mode 100644 index 00000000000..23fa3012691 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetRevisionRequest + */ +class GetRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * Please see {@see RevisionsClient::revisionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * 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 full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php new file mode 100644 index 00000000000..4a5aeb399c0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetServiceRequest + */ +class GetServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. Please see + * {@see ServicesClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * 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 full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php new file mode 100644 index 00000000000..925a9bb9839 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * Please see {@see TasksClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * 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 full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php new file mode 100644 index 00000000000..371a24d2a13 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php @@ -0,0 +1,147 @@ +google.cloud.run.v2.HTTPGetAction + */ +class HTTPGetAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $http_headers; + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Path to access on the HTTP server. Defaults to '/'. + * @type array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $http_headers + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * @type int $port + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHttpHeaders() + { + return $this->http_headers; + } + + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHttpHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\HTTPHeader::class); + $this->http_headers = $arr; + + return $this; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php new file mode 100644 index 00000000000..036332d24bb --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php @@ -0,0 +1,101 @@ +google.cloud.run.v2.HTTPHeader + */ +class HTTPHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The header field name + * @type string $value + * Optional. The header field value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php new file mode 100644 index 00000000000..c9e391f2e46 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php @@ -0,0 +1,75 @@ +google.cloud.run.v2.IngressTraffic + */ +class IngressTraffic +{ + /** + * Unspecified + * + * Generated from protobuf enum INGRESS_TRAFFIC_UNSPECIFIED = 0; + */ + const INGRESS_TRAFFIC_UNSPECIFIED = 0; + /** + * All inbound traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_ALL = 1; + */ + const INGRESS_TRAFFIC_ALL = 1; + /** + * Only internal traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_ONLY = 2; + */ + const INGRESS_TRAFFIC_INTERNAL_ONLY = 2; + /** + * Both internal and Google Cloud Load Balancer traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + */ + const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + /** + * No ingress traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_NONE = 4; + */ + const INGRESS_TRAFFIC_NONE = 4; + + private static $valueToName = [ + self::INGRESS_TRAFFIC_UNSPECIFIED => 'INGRESS_TRAFFIC_UNSPECIFIED', + self::INGRESS_TRAFFIC_ALL => 'INGRESS_TRAFFIC_ALL', + self::INGRESS_TRAFFIC_INTERNAL_ONLY => 'INGRESS_TRAFFIC_INTERNAL_ONLY', + self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER => 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER', + self::INGRESS_TRAFFIC_NONE => 'INGRESS_TRAFFIC_NONE', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php new file mode 100644 index 00000000000..c38afcf3c49 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php @@ -0,0 +1,1249 @@ +google.cloud.run.v2.Job + */ +class Job extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creator = ''; + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modifier = ''; + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + */ + protected $client = ''; + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + */ + protected $client_version = ''; + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + */ + protected $launch_stage = 0; + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + */ + protected $binary_authorization = null; + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $terminal_condition = null; + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $execution_count = 0; + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $latest_created_execution = null; + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + protected $create_execution; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * @type string $uid + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * @type string $creator + * Output only. Email address of the authenticated creator. + * @type string $last_modifier + * Output only. Email address of the last authenticated modifier. + * @type string $client + * Arbitrary identifier for the API client. + * @type string $client_version + * Arbitrary version identifier for the API client. + * @type int $launch_stage + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization + * Settings for the Binary Authorization feature. + * @type \Google\Cloud\Run\V2\ExecutionTemplate $template + * Required. The template used to create executions for this Job. + * @type int|string $observed_generation + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * @type \Google\Cloud\Run\V2\Condition $terminal_condition + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * @type int $execution_count + * Output only. Number of executions created for this job. + * @type \Google\Cloud\Run\V2\ExecutionReference $latest_created_execution + * Output only. Name of the last created execution. + * @type bool $reconciling + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $start_execution_token + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * @type string $run_execution_token + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + * @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; + } + + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastModifier() + { + return $this->last_modifier; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastModifier($var) + { + GPBUtil::checkString($var, True); + $this->last_modifier = $var; + + return $this; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + * @param string $var + * @return $this + */ + public function setClient($var) + { + GPBUtil::checkString($var, True); + $this->client = $var; + + return $this; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + * @return string + */ + public function getClientVersion() + { + return $this->client_version; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + * @param string $var + * @return $this + */ + public function setClientVersion($var) + { + GPBUtil::checkString($var, True); + $this->client_version = $var; + + return $this; + } + + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + * @return \Google\Cloud\Run\V2\BinaryAuthorization|null + */ + public function getBinaryAuthorization() + { + return $this->binary_authorization; + } + + public function hasBinaryAuthorization() + { + return isset($this->binary_authorization); + } + + public function clearBinaryAuthorization() + { + unset($this->binary_authorization); + } + + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + * @param \Google\Cloud\Run\V2\BinaryAuthorization $var + * @return $this + */ + public function setBinaryAuthorization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); + $this->binary_authorization = $var; + + return $this; + } + + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\ExecutionTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\ExecutionTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\Condition|null + */ + public function getTerminalCondition() + { + return $this->terminal_condition; + } + + public function hasTerminalCondition() + { + return isset($this->terminal_condition); + } + + public function clearTerminalCondition() + { + unset($this->terminal_condition); + } + + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\Condition $var + * @return $this + */ + public function setTerminalCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); + $this->terminal_condition = $var; + + return $this; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExecutionCount() + { + return $this->execution_count; + } + + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExecutionCount($var) + { + GPBUtil::checkInt32($var); + $this->execution_count = $var; + + return $this; + } + + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\ExecutionReference|null + */ + public function getLatestCreatedExecution() + { + return $this->latest_created_execution; + } + + public function hasLatestCreatedExecution() + { + return isset($this->latest_created_execution); + } + + public function clearLatestCreatedExecution() + { + unset($this->latest_created_execution); + } + + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\ExecutionReference $var + * @return $this + */ + public function setLatestCreatedExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionReference::class); + $this->latest_created_execution = $var; + + return $this; + } + + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string start_execution_token = 26; + * @return string + */ + public function getStartExecutionToken() + { + return $this->readOneof(26); + } + + public function hasStartExecutionToken() + { + return $this->hasOneof(26); + } + + /** + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string start_execution_token = 26; + * @param string $var + * @return $this + */ + public function setStartExecutionToken($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string run_execution_token = 27; + * @return string + */ + public function getRunExecutionToken() + { + return $this->readOneof(27); + } + + public function hasRunExecutionToken() + { + return $this->hasOneof(27); + } + + /** + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string run_execution_token = 27; + * @param string $var + * @return $this + */ + public function setRunExecutionToken($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * @return string + */ + public function getCreateExecution() + { + return $this->whichOneof("create_execution"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php new file mode 100644 index 00000000000..909879ad84e --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListExecutionsRequest + */ +class ListExecutionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. Please see + * {@see ExecutionsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListExecutionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * @type int $page_size + * Maximum number of Executions to return in this call. + * @type string $page_token + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * 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 Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * 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; + } + + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php new file mode 100644 index 00000000000..66ffa08a98f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListExecutionsResponse + */ +class ListExecutionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + */ + private $executions; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * 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\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $executions + * The resulting list of Executions. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutions() + { + return $this->executions; + } + + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + * @param array<\Google\Cloud\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Execution::class); + $this->executions = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php new file mode 100644 index 00000000000..076ac55e2e8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php @@ -0,0 +1,197 @@ +google.cloud.run.v2.ListJobsRequest + */ +class ListJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Please see + * {@see JobsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @type int $page_size + * Maximum number of Jobs to return in this call. + * @type string $page_token + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * 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 location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * 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; + } + + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php new file mode 100644 index 00000000000..1d0b4c4b6c6 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListJobsResponse + */ +class ListJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + */ + private $jobs; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * 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\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $jobs + * The resulting list of Jobs. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + * @param array<\Google\Cloud\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Job::class); + $this->jobs = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php new file mode 100644 index 00000000000..01cde2b85c9 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListRevisionsRequest + */ +class ListRevisionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * Please see {@see RevisionsClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListRevisionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * @type int $page_size + * Maximum number of revisions to return in this call. + * @type string $page_token + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * 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 Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * 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; + } + + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php new file mode 100644 index 00000000000..e4a2db90f4f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListRevisionsResponse + */ +class ListRevisionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + */ + private $revisions; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * 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\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions + * The resulting list of Revisions. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRevisions() + { + return $this->revisions; + } + + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + * @param array<\Google\Cloud\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRevisions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Revision::class); + $this->revisions = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php new file mode 100644 index 00000000000..1cd78b61933 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListServicesRequest + */ +class ListServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. Please see + * {@see ServicesClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * @type int $page_size + * Maximum number of Services to return in this call. + * @type string $page_token + * A page token received from a previous call to ListServices. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * 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 location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * 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; + } + + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php new file mode 100644 index 00000000000..06cdb054df8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListServicesResponse + */ +class ListServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + */ + private $services; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * 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\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $services + * The resulting list of Services. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + * @param array<\Google\Cloud\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php new file mode 100644 index 00000000000..421799f3819 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * Please see {@see TasksClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @type int $page_size + * Maximum number of Tasks to return in this call. + * @type string $page_token + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * 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 Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * 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; + } + + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php new file mode 100644 index 00000000000..17804baa0f8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + */ + private $tasks; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * 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\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The resulting list of Tasks. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + * @param array<\Google\Cloud\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * 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/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php new file mode 100644 index 00000000000..d77c34e73b2 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php @@ -0,0 +1,135 @@ +google.cloud.run.v2.NFSVolumeSource + */ +class NFSVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + */ + protected $server = ''; + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + */ + protected $path = ''; + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + */ + protected $read_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $server + * Hostname or IP address of the NFS server + * @type string $path + * Path that is exported by the NFS server. + * @type bool $read_only + * If true, the volume will be mounted as read only for all mounts. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + * @return string + */ + public function getServer() + { + return $this->server; + } + + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + * @param string $var + * @return $this + */ + public function setServer($var) + { + GPBUtil::checkString($var, True); + $this->server = $var; + + return $this; + } + + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + * @return bool + */ + public function getReadOnly() + { + return $this->read_only; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + * @param bool $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkBool($var); + $this->read_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php new file mode 100644 index 00000000000..54fd94337d5 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.NodeSelector + */ +class NodeSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accelerator = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator + * Required. GPU accelerator type to attach to an instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccelerator() + { + return $this->accelerator; + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccelerator($var) + { + GPBUtil::checkString($var, True); + $this->accelerator = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php new file mode 100644 index 00000000000..07da4f964c3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php @@ -0,0 +1,319 @@ +google.cloud.run.v2.Probe + */ +class Probe extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initial_delay_seconds = 0; + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout_seconds = 0; + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $period_seconds = 0; + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $failure_threshold = 0; + protected $probe_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $initial_delay_seconds + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * @type int $timeout_seconds + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * @type int $period_seconds + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * @type int $failure_threshold + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * @type \Google\Cloud\Run\V2\HTTPGetAction $http_get + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * @type \Google\Cloud\Run\V2\TCPSocketAction $tcp_socket + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * @type \Google\Cloud\Run\V2\GRPCAction $grpc + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInitialDelaySeconds() + { + return $this->initial_delay_seconds; + } + + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInitialDelaySeconds($var) + { + GPBUtil::checkInt32($var); + $this->initial_delay_seconds = $var; + + return $this; + } + + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimeoutSeconds() + { + return $this->timeout_seconds; + } + + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimeoutSeconds($var) + { + GPBUtil::checkInt32($var); + $this->timeout_seconds = $var; + + return $this; + } + + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPeriodSeconds() + { + return $this->period_seconds; + } + + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPeriodSeconds($var) + { + GPBUtil::checkInt32($var); + $this->period_seconds = $var; + + return $this; + } + + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFailureThreshold() + { + return $this->failure_threshold; + } + + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFailureThreshold($var) + { + GPBUtil::checkInt32($var); + $this->failure_threshold = $var; + + return $this; + } + + /** + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\HTTPGetAction|null + */ + public function getHttpGet() + { + return $this->readOneof(5); + } + + public function hasHttpGet() + { + return $this->hasOneof(5); + } + + /** + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\HTTPGetAction $var + * @return $this + */ + public function setHttpGet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\HTTPGetAction::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\TCPSocketAction|null + */ + public function getTcpSocket() + { + return $this->readOneof(6); + } + + public function hasTcpSocket() + { + return $this->hasOneof(6); + } + + /** + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\TCPSocketAction $var + * @return $this + */ + public function setTcpSocket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TCPSocketAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\GRPCAction|null + */ + public function getGrpc() + { + return $this->readOneof(7); + } + + public function hasGrpc() + { + return $this->hasOneof(7); + } + + /** + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\GRPCAction $var + * @return $this + */ + public function setGrpc($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GRPCAction::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getProbeType() + { + return $this->whichOneof("probe_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php new file mode 100644 index 00000000000..9ba7760c502 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php @@ -0,0 +1,175 @@ +google.cloud.run.v2.ResourceRequirements + */ +class ResourceRequirements extends \Google\Protobuf\Internal\Message +{ + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + */ + private $limits; + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + */ + protected $cpu_idle = false; + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + */ + protected $startup_cpu_boost = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $limits + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * @type bool $cpu_idle + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * @type bool $startup_cpu_boost + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLimits() + { + return $this->limits; + } + + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLimits($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->limits = $arr; + + return $this; + } + + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + * @return bool + */ + public function getCpuIdle() + { + return $this->cpu_idle; + } + + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + * @param bool $var + * @return $this + */ + public function setCpuIdle($var) + { + GPBUtil::checkBool($var); + $this->cpu_idle = $var; + + return $this; + } + + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + * @return bool + */ + public function getStartupCpuBoost() + { + return $this->startup_cpu_boost; + } + + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + * @param bool $var + * @return $this + */ + public function setStartupCpuBoost($var) + { + GPBUtil::checkBool($var); + $this->startup_cpu_boost = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php new file mode 100644 index 00000000000..f3bdf65355a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php @@ -0,0 +1,1373 @@ +google.cloud.run.v2.Revision + */ +class Revision extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + */ + protected $launch_stage = 0; + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $service = ''; + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + */ + protected $scaling = null; + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + */ + protected $vpc_access = null; + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + */ + protected $max_instance_request_concurrency = 0; + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + */ + protected $timeout = null; + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + */ + protected $service_account = ''; + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + */ + private $containers; + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + */ + private $volumes; + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + */ + protected $service_mesh = null; + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + */ + protected $encryption_key_revocation_action = 0; + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + */ + protected $encryption_key_shutdown_duration = null; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + */ + protected $session_affinity = false; + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $scaling_status = null; + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + */ + protected $node_selector = null; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Revision. + * @type string $uid + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type int $launch_stage + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * @type string $service + * Output only. The name of the parent service. + * @type \Google\Cloud\Run\V2\RevisionScaling $scaling + * Scaling settings for this revision. + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type int $max_instance_request_concurrency + * Sets the maximum number of requests that each serving instance can receive. + * @type \Google\Protobuf\Duration $timeout + * Max allowed time for an instance to respond to a request. + * @type string $service_account + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * Revision. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * A list of Volumes to make available to containers. + * @type int $execution_environment + * The execution environment being used to host this Revision. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Enables service mesh connectivity. + * @type int $encryption_key_revocation_action + * The action to take if the encryption key is revoked. + * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * @type int|string $observed_generation + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $log_uri + * Output only. The Google Console URI to obtain logs for the Revision. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $session_affinity + * Enable session affinity. + * @type \Google\Cloud\Run\V2\RevisionScalingStatus $scaling_status + * Output only. The current effective scaling settings for the revision. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * The node selector for the revision. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + * @return \Google\Cloud\Run\V2\RevisionScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + * @param \Google\Cloud\Run\V2\RevisionScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + * @return int + */ + public function getMaxInstanceRequestConcurrency() + { + return $this->max_instance_request_concurrency; + } + + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + * @param int $var + * @return $this + */ + public function setMaxInstanceRequestConcurrency($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_request_concurrency = $var; + + return $this; + } + + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + * @return int + */ + public function getEncryptionKeyRevocationAction() + { + return $this->encryption_key_revocation_action; + } + + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + * @param int $var + * @return $this + */ + public function setEncryptionKeyRevocationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); + $this->encryption_key_revocation_action = $var; + + return $this; + } + + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + * @return \Google\Protobuf\Duration|null + */ + public function getEncryptionKeyShutdownDuration() + { + return $this->encryption_key_shutdown_duration; + } + + public function hasEncryptionKeyShutdownDuration() + { + return isset($this->encryption_key_shutdown_duration); + } + + public function clearEncryptionKeyShutdownDuration() + { + unset($this->encryption_key_shutdown_duration); + } + + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEncryptionKeyShutdownDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->encryption_key_shutdown_duration = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + * @return bool + */ + public function getSessionAffinity() + { + return $this->session_affinity; + } + + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + * @param bool $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkBool($var); + $this->session_affinity = $var; + + return $this; + } + + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\RevisionScalingStatus|null + */ + public function getScalingStatus() + { + return $this->scaling_status; + } + + public function hasScalingStatus() + { + return isset($this->scaling_status); + } + + public function clearScalingStatus() + { + unset($this->scaling_status); + } + + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\RevisionScalingStatus $var + * @return $this + */ + public function setScalingStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScalingStatus::class); + $this->scaling_status = $var; + + return $this; + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php new file mode 100644 index 00000000000..5536c70fe0a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php @@ -0,0 +1,117 @@ +google.cloud.run.v2.RevisionScaling + */ +class RevisionScaling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_instance_count = 0; + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_instance_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_instance_count + * Optional. Minimum number of serving instances that this resource should + * have. + * @type int $max_instance_count + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinInstanceCount() + { + return $this->min_instance_count; + } + + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->min_instance_count = $var; + + return $this; + } + + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxInstanceCount() + { + return $this->max_instance_count; + } + + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php new file mode 100644 index 00000000000..fff365b91e7 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.RevisionScalingStatus + */ +class RevisionScalingStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + */ + protected $desired_min_instance_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $desired_min_instance_count + * The current number of min instances provisioned for this revision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Status::initOnce(); + parent::__construct($data); + } + + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + * @return int + */ + public function getDesiredMinInstanceCount() + { + return $this->desired_min_instance_count; + } + + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + * @param int $var + * @return $this + */ + public function setDesiredMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->desired_min_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php new file mode 100644 index 00000000000..36d1686c1e8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php @@ -0,0 +1,822 @@ +google.cloud.run.v2.RevisionTemplate + */ +class RevisionTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling = null; + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vpc_access = null; + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + */ + private $containers; + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $volumes; + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_instance_request_concurrency = 0; + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_mesh = null; + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_key_revocation_action = 0; + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_key_shutdown_duration = null; + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $session_affinity = false; + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $health_check_disabled = false; + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_selector = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $revision + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type \Google\Cloud\Run\V2\RevisionScaling $scaling + * Optional. Scaling settings for this Revision. + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type \Google\Protobuf\Duration $timeout + * Optional. Max allowed time for an instance to respond to a request. + * @type string $service_account + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * Revision. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Optional. A list of Volumes to make available to containers. + * @type int $execution_environment + * Optional. The sandbox environment to host this Revision. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type int $max_instance_request_concurrency + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Optional. Enables service mesh connectivity. + * @type int $encryption_key_revocation_action + * Optional. The action to take if the encryption key is revoked. + * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * @type bool $session_affinity + * Optional. Enable session affinity. + * @type bool $health_check_disabled + * Optional. Disables health checking containers during deployment. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * Optional. The node selector for the revision template. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\RevisionTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.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; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\RevisionScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\RevisionScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxInstanceRequestConcurrency() + { + return $this->max_instance_request_concurrency; + } + + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxInstanceRequestConcurrency($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_request_concurrency = $var; + + return $this; + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEncryptionKeyRevocationAction() + { + return $this->encryption_key_revocation_action; + } + + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEncryptionKeyRevocationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); + $this->encryption_key_revocation_action = $var; + + return $this; + } + + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getEncryptionKeyShutdownDuration() + { + return $this->encryption_key_shutdown_duration; + } + + public function hasEncryptionKeyShutdownDuration() + { + return isset($this->encryption_key_shutdown_duration); + } + + public function clearEncryptionKeyShutdownDuration() + { + unset($this->encryption_key_shutdown_duration); + } + + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEncryptionKeyShutdownDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->encryption_key_shutdown_duration = $var; + + return $this; + } + + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSessionAffinity() + { + return $this->session_affinity; + } + + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkBool($var); + $this->session_affinity = $var; + + return $this; + } + + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getHealthCheckDisabled() + { + return $this->health_check_disabled; + } + + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setHealthCheckDisabled($var) + { + GPBUtil::checkBool($var); + $this->health_check_disabled = $var; + + return $this; + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php new file mode 100644 index 00000000000..bf51806e3bc --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php @@ -0,0 +1,215 @@ +google.cloud.run.v2.RunJobRequest + */ +class RunJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + */ + protected $overrides = null; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\RunJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @type \Google\Cloud\Run\V2\RunJobRequest\Overrides $overrides + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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 full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * 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; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + * @return \Google\Cloud\Run\V2\RunJobRequest\Overrides|null + */ + public function getOverrides() + { + return $this->overrides; + } + + public function hasOverrides() + { + return isset($this->overrides); + } + + public function clearOverrides() + { + unset($this->overrides); + } + + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + * @param \Google\Cloud\Run\V2\RunJobRequest\Overrides $var + * @return $this + */ + public function setOverrides($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RunJobRequest\Overrides::class); + $this->overrides = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php new file mode 100644 index 00000000000..60098e2ce07 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php @@ -0,0 +1,160 @@ +google.cloud.run.v2.RunJobRequest.Overrides + */ +class Overrides extends \Google\Protobuf\Internal\Message +{ + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + */ + private $container_overrides; + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $task_count = 0; + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + */ + protected $timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $container_overrides + * Per container override specification. + * @type int $task_count + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * @type \Google\Protobuf\Duration $timeout + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainerOverrides() + { + return $this->container_overrides; + } + + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + * @param array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainerOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride::class); + $this->container_overrides = $arr; + + return $this; + } + + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Overrides::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php new file mode 100644 index 00000000000..9d002dff8c0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php @@ -0,0 +1,180 @@ +google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + */ +class ContainerOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $args; + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + */ + private $env; + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $clear_args = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the container specified as a DNS_LABEL. + * @type array|\Google\Protobuf\Internal\RepeatedField $args + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * @type bool $clear_args + * Optional. True if the intention is to clear out existing args list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArgs() + { + return $this->args; + } + + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArgs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->args = $arr; + + return $this; + } + + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnv() + { + return $this->env; + } + + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnv($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); + $this->env = $arr; + + return $this; + } + + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getClearArgs() + { + return $this->clear_args; + } + + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setClearArgs($var) + { + GPBUtil::checkBool($var); + $this->clear_args = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContainerOverride::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides_ContainerOverride::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php new file mode 100644 index 00000000000..060822bb245 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php @@ -0,0 +1,121 @@ +google.cloud.run.v2.SecretKeySelector + */ +class SecretKeySelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $secret = ''; + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * @type string $version + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkString($var, True); + $this->secret = $var; + + return $this; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php new file mode 100644 index 00000000000..1007b817c05 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php @@ -0,0 +1,217 @@ +google.cloud.run.v2.SecretVolumeSource + */ +class SecretVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $secret = ''; + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + */ + private $items; + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + */ + protected $default_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * @type array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $items + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * @type int $default_mode + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkString($var, True); + $this->secret = $var; + + return $this; + } + + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + * @param array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VersionToPath::class); + $this->items = $arr; + + return $this; + } + + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + * @return int + */ + public function getDefaultMode() + { + return $this->default_mode; + } + + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + * @param int $var + * @return $this + */ + public function setDefaultMode($var) + { + GPBUtil::checkInt32($var); + $this->default_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php new file mode 100644 index 00000000000..685077c47a2 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php @@ -0,0 +1,1609 @@ +google.cloud.run.v2.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creator = ''; + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modifier = ''; + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + */ + protected $client = ''; + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + */ + protected $client_version = ''; + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ingress = 0; + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $launch_stage = 0; + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $binary_authorization = null; + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $traffic; + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling = null; + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $invoker_iam_disabled = false; + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_uri_disabled = false; + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $urls; + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + */ + private $custom_audiences; + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $terminal_condition = null; + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $latest_ready_revision = ''; + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $latest_created_revision = ''; + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $traffic_statuses; + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * @type string $description + * User-provided description of the Service. This field currently has a + * 512-character limit. + * @type string $uid + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * @type string $creator + * Output only. Email address of the authenticated creator. + * @type string $last_modifier + * Output only. Email address of the last authenticated modifier. + * @type string $client + * Arbitrary identifier for the API client. + * @type string $client_version + * Arbitrary version identifier for the API client. + * @type int $ingress + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * @type int $launch_stage + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization + * Optional. Settings for the Binary Authorization feature. + * @type \Google\Cloud\Run\V2\RevisionTemplate $template + * Required. The template used to create revisions for this Service. + * @type array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $traffic + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * @type \Google\Cloud\Run\V2\ServiceScaling $scaling + * Optional. Specifies service-level scaling settings + * @type bool $invoker_iam_disabled + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * @type bool $default_uri_disabled + * Optional. Disables public resolution of the default URI of this service. + * @type array|\Google\Protobuf\Internal\RepeatedField $urls + * Output only. All URLs serving traffic for this Service. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * @type int|string $observed_generation + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * @type \Google\Cloud\Run\V2\Condition $terminal_condition + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * @type string $latest_ready_revision + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $latest_created_revision + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * @type array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $traffic_statuses + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $uri + * Output only. The main URI in which this Service is serving traffic. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $reconciling + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.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; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastModifier() + { + return $this->last_modifier; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastModifier($var) + { + GPBUtil::checkString($var, True); + $this->last_modifier = $var; + + return $this; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + * @param string $var + * @return $this + */ + public function setClient($var) + { + GPBUtil::checkString($var, True); + $this->client = $var; + + return $this; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + * @return string + */ + public function getClientVersion() + { + return $this->client_version; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + * @param string $var + * @return $this + */ + public function setClientVersion($var) + { + GPBUtil::checkString($var, True); + $this->client_version = $var; + + return $this; + } + + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIngress() + { + return $this->ingress; + } + + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIngress($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\IngressTraffic::class); + $this->ingress = $var; + + return $this; + } + + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\BinaryAuthorization|null + */ + public function getBinaryAuthorization() + { + return $this->binary_authorization; + } + + public function hasBinaryAuthorization() + { + return isset($this->binary_authorization); + } + + public function clearBinaryAuthorization() + { + unset($this->binary_authorization); + } + + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\BinaryAuthorization $var + * @return $this + */ + public function setBinaryAuthorization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); + $this->binary_authorization = $var; + + return $this; + } + + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\RevisionTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\RevisionTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTraffic() + { + return $this->traffic; + } + + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTraffic($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTarget::class); + $this->traffic = $arr; + + return $this; + } + + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getInvokerIamDisabled() + { + return $this->invoker_iam_disabled; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setInvokerIamDisabled($var) + { + GPBUtil::checkBool($var); + $this->invoker_iam_disabled = $var; + + return $this; + } + + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDefaultUriDisabled() + { + return $this->default_uri_disabled; + } + + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDefaultUriDisabled($var) + { + GPBUtil::checkBool($var); + $this->default_uri_disabled = $var; + + return $this; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUrls() + { + return $this->urls; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUrls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->urls = $arr; + + return $this; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAudiences() + { + return $this->custom_audiences; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAudiences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_audiences = $arr; + + return $this; + } + + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\Condition|null + */ + public function getTerminalCondition() + { + return $this->terminal_condition; + } + + public function hasTerminalCondition() + { + return isset($this->terminal_condition); + } + + public function clearTerminalCondition() + { + unset($this->terminal_condition); + } + + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\Condition $var + * @return $this + */ + public function setTerminalCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); + $this->terminal_condition = $var; + + return $this; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestReadyRevision() + { + return $this->latest_ready_revision; + } + + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestReadyRevision($var) + { + GPBUtil::checkString($var, True); + $this->latest_ready_revision = $var; + + return $this; + } + + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestCreatedRevision() + { + return $this->latest_created_revision; + } + + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestCreatedRevision($var) + { + GPBUtil::checkString($var, True); + $this->latest_created_revision = $var; + + return $this; + } + + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrafficStatuses() + { + return $this->traffic_statuses; + } + + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrafficStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTargetStatus::class); + $this->traffic_statuses = $arr; + + return $this; + } + + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php new file mode 100644 index 00000000000..19cd1b0263c --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php @@ -0,0 +1,76 @@ +google.cloud.run.v2.ServiceMesh + */ +class ServiceMesh extends \Google\Protobuf\Internal\Message +{ + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + */ + protected $mesh = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getMesh() + { + return $this->mesh; + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkString($var, True); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php new file mode 100644 index 00000000000..7fa643373a0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php @@ -0,0 +1,162 @@ +google.cloud.run.v2.ServiceScaling + */ +class ServiceScaling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_instance_count = 0; + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling_mode = 0; + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $manual_instance_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_instance_count + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * @type int $scaling_mode + * Optional. The scaling mode for the service. + * @type int $manual_instance_count + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinInstanceCount() + { + return $this->min_instance_count; + } + + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->min_instance_count = $var; + + return $this; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getScalingMode() + { + return $this->scaling_mode; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setScalingMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ServiceScaling\ScalingMode::class); + $this->scaling_mode = $var; + + return $this; + } + + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getManualInstanceCount() + { + return isset($this->manual_instance_count) ? $this->manual_instance_count : 0; + } + + public function hasManualInstanceCount() + { + return isset($this->manual_instance_count); + } + + public function clearManualInstanceCount() + { + unset($this->manual_instance_count); + } + + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setManualInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->manual_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php new file mode 100644 index 00000000000..58d181ecc82 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php @@ -0,0 +1,65 @@ +google.cloud.run.v2.ServiceScaling.ScalingMode + */ +class ScalingMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum SCALING_MODE_UNSPECIFIED = 0; + */ + const SCALING_MODE_UNSPECIFIED = 0; + /** + * Scale based on traffic between min and max instances. + * + * Generated from protobuf enum AUTOMATIC = 1; + */ + const AUTOMATIC = 1; + /** + * Scale to exactly min instances and ignore max instances. + * + * Generated from protobuf enum MANUAL = 2; + */ + const MANUAL = 2; + + private static $valueToName = [ + self::SCALING_MODE_UNSPECIFIED => 'SCALING_MODE_UNSPECIFIED', + self::AUTOMATIC => 'AUTOMATIC', + self::MANUAL => 'MANUAL', + ]; + + 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(ScalingMode::class, \Google\Cloud\Run\V2\ServiceScaling_ScalingMode::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php new file mode 100644 index 00000000000..a577d719f1a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php @@ -0,0 +1,155 @@ +google.cloud.run.v2.StorageSource + */ +class StorageSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = ''; + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object = ''; + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * @type string $object + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * @type int|string $generation + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObject() + { + return $this->object; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObject($var) + { + GPBUtil::checkString($var, True); + $this->object = $var; + + return $this; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php new file mode 100644 index 00000000000..cb260e21eed --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php @@ -0,0 +1,356 @@ +google.cloud.run.v2.SubmitBuildRequest + */ +class SubmitBuildRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_uri = ''; + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $worker_pool = ''; + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + protected $source; + protected $build_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * @type \Google\Cloud\Run\V2\StorageSource $storage_source + * Required. Source for the build. + * @type string $image_uri + * Required. Artifact Registry URI to store the built image. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $buildpack_build + * Build the source using Buildpacks. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $docker_build + * Build the source using Docker. This means the source has a Dockerfile. + * @type string $service_account + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * @type string $worker_pool + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Additional tags to annotate the build. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\StorageSource|null + */ + public function getStorageSource() + { + return $this->readOneof(2); + } + + public function hasStorageSource() + { + return $this->hasOneof(2); + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\StorageSource $var + * @return $this + */ + public function setStorageSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\StorageSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild|null + */ + public function getBuildpackBuild() + { + return $this->readOneof(4); + } + + public function hasBuildpackBuild() + { + return $this->hasOneof(4); + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $var + * @return $this + */ + public function setBuildpackBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild|null + */ + public function getDockerBuild() + { + return $this->readOneof(5); + } + + public function hasDockerBuild() + { + return $this->hasOneof(5); + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $var + * @return $this + */ + public function setDockerBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWorkerPool() + { + return $this->worker_pool; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWorkerPool($var) + { + GPBUtil::checkString($var, True); + $this->worker_pool = $var; + + return $this; + } + + /** + * Optional. Additional tags to annotate the build. + * + * 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. Additional tags to annotate the build. + * + * 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; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getBuildType() + { + return $this->whichOneof("build_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php new file mode 100644 index 00000000000..7cedb432a08 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php @@ -0,0 +1,273 @@ +google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + */ +class BuildpacksBuild extends \Google\Protobuf\Internal\Message +{ + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @deprecated + */ + protected $runtime = ''; + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function_target = ''; + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cache_image_uri = ''; + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_image = ''; + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $environment_variables; + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_automatic_updates = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $runtime + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * @type string $function_target + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * @type string $cache_image_uri + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * @type string $base_image + * Optional. The base image used to opt into automatic base image updates. + * @type array|\Google\Protobuf\Internal\MapField $environment_variables + * Optional. User-provided build-time environment variables. + * @type bool $enable_automatic_updates + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRuntime() + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + return $this->runtime; + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRuntime($var) + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->runtime = $var; + + return $this; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFunctionTarget() + { + return $this->function_target; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFunctionTarget($var) + { + GPBUtil::checkString($var, True); + $this->function_target = $var; + + return $this; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCacheImageUri() + { + return $this->cache_image_uri; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCacheImageUri($var) + { + GPBUtil::checkString($var, True); + $this->cache_image_uri = $var; + + return $this; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseImage() + { + return $this->base_image; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseImage($var) + { + GPBUtil::checkString($var, True); + $this->base_image = $var; + + return $this; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getEnvironmentVariables() + { + return $this->environment_variables; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setEnvironmentVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environment_variables = $arr; + + return $this; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutomaticUpdates() + { + return $this->enable_automatic_updates; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticUpdates($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_updates = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BuildpacksBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_BuildpacksBuild::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php new file mode 100644 index 00000000000..9089c3fd5f0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php @@ -0,0 +1,36 @@ +google.cloud.run.v2.SubmitBuildRequest.DockerBuild + */ +class DockerBuild extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DockerBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_DockerBuild::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php new file mode 100644 index 00000000000..42440dbfebd --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php @@ -0,0 +1,149 @@ +google.cloud.run.v2.SubmitBuildResponse + */ +class SubmitBuildResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + */ + protected $build_operation = null; + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + */ + protected $base_image_uri = ''; + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + */ + protected $base_image_warning = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\LongRunning\Operation $build_operation + * Cloud Build operation to be polled via CloudBuild API. + * @type string $base_image_uri + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * @type string $base_image_warning + * Warning message for the base image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @return \Google\LongRunning\Operation|null + */ + public function getBuildOperation() + { + return $this->build_operation; + } + + public function hasBuildOperation() + { + return isset($this->build_operation); + } + + public function clearBuildOperation() + { + unset($this->build_operation); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setBuildOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->build_operation = $var; + + return $this; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @return string + */ + public function getBaseImageUri() + { + return $this->base_image_uri; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @param string $var + * @return $this + */ + public function setBaseImageUri($var) + { + GPBUtil::checkString($var, True); + $this->base_image_uri = $var; + + return $this; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @return string + */ + public function getBaseImageWarning() + { + return $this->base_image_warning; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @param string $var + * @return $this + */ + public function setBaseImageWarning($var) + { + GPBUtil::checkString($var, True); + $this->base_image_warning = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php new file mode 100644 index 00000000000..52828310dc6 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php @@ -0,0 +1,75 @@ +google.cloud.run.v2.TCPSocketAction + */ +class TCPSocketAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php new file mode 100644 index 00000000000..6fe2768394c --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php @@ -0,0 +1,1339 @@ +google.cloud.run.v2.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $scheduled_time = null; + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $completion_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $job = ''; + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $execution = ''; + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + */ + private $containers; + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + */ + private $volumes; + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + */ + protected $max_retries = 0; + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + */ + protected $timeout = null; + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + */ + protected $service_account = ''; + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + */ + protected $execution_environment = 0; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $index = 0; + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retried = 0; + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_attempt_result = null; + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vpc_access = null; + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Task. + * @type string $uid + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $scheduled_time + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $completion_time + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type string $job + * Output only. The name of the parent Job. + * @type string $execution + * Output only. The name of the parent Execution. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * task. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * A list of Volumes to make available to containers. + * @type int $max_retries + * Number of retries allowed per Task, before marking this Task failed. + * @type \Google\Protobuf\Duration $timeout + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * @type string $service_account + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * @type int $execution_environment + * The execution environment being used to host this Task. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * @type int|string $observed_generation + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * @type int $index + * Output only. Index of the Task, unique per execution, and beginning at 0. + * @type int $retried + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * @type \Google\Cloud\Run\V2\TaskAttemptResult $last_attempt_result + * Output only. Result of the last attempt of this Task. + * @type string $encryption_key + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type string $log_uri + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduledTime() + { + return $this->scheduled_time; + } + + public function hasScheduledTime() + { + return isset($this->scheduled_time); + } + + public function clearScheduledTime() + { + unset($this->scheduled_time); + } + + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduledTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->scheduled_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getJob() + { + return $this->job; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkString($var, True); + $this->job = $var; + + return $this; + } + + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getExecution() + { + return $this->execution; + } + + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setExecution($var) + { + GPBUtil::checkString($var, True); + $this->execution = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + * @return int + */ + public function getMaxRetries() + { + return $this->max_retries; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + * @param int $var + * @return $this + */ + public function setMaxRetries($var) + { + GPBUtil::checkInt32($var); + $this->max_retries = $var; + + return $this; + } + + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetried() + { + return $this->retried; + } + + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetried($var) + { + GPBUtil::checkInt32($var); + $this->retried = $var; + + return $this; + } + + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\TaskAttemptResult|null + */ + public function getLastAttemptResult() + { + return $this->last_attempt_result; + } + + public function hasLastAttemptResult() + { + return isset($this->last_attempt_result); + } + + public function clearLastAttemptResult() + { + unset($this->last_attempt_result); + } + + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\TaskAttemptResult $var + * @return $this + */ + public function setLastAttemptResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskAttemptResult::class); + $this->last_attempt_result = $var; + + return $this; + } + + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php new file mode 100644 index 00000000000..26a5923b91a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php @@ -0,0 +1,127 @@ +google.cloud.run.v2.TaskAttemptResult + */ +class TaskAttemptResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = null; + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $exit_code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $status + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * @type int $exit_code + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExitCode() + { + return $this->exit_code; + } + + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExitCode($var) + { + GPBUtil::checkInt32($var); + $this->exit_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php new file mode 100644 index 00000000000..900f4f9ed2b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php @@ -0,0 +1,381 @@ +google.cloud.run.v2.TaskTemplate + */ +class TaskTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + */ + private $containers; + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $volumes; + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vpc_access = null; + protected $retries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * task. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Optional. A list of Volumes to make available to containers. + * @type int $max_retries + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * @type \Google\Protobuf\Duration $timeout + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * @type string $service_account + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * @type int $execution_environment + * Optional. The execution environment being used to host this Task. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TaskTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * + * Generated from protobuf field int32 max_retries = 3; + * @return int + */ + public function getMaxRetries() + { + return $this->readOneof(3); + } + + public function hasMaxRetries() + { + return $this->hasOneof(3); + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * + * Generated from protobuf field int32 max_retries = 3; + * @param int $var + * @return $this + */ + public function setMaxRetries($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * @return string + */ + public function getRetries() + { + return $this->whichOneof("retries"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php new file mode 100644 index 00000000000..b4264dd3a66 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php @@ -0,0 +1,182 @@ +google.cloud.run.v2.TrafficTarget + */ +class TrafficTarget extends \Google\Protobuf\Internal\Message +{ + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + */ + protected $type = 0; + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + */ + protected $percent = 0; + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + */ + protected $tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The allocation type for this traffic target. + * @type string $revision + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * @type int $percent + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * @type string $tag + * Indicates a string to be part of the URI to exclusively reference this + * target. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); + parent::__construct($data); + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); + $this->type = $var; + + return $this; + } + + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + * @return int + */ + public function getPercent() + { + return $this->percent; + } + + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + * @param int $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkInt32($var); + $this->percent = $var; + + return $this; + } + + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php new file mode 100644 index 00000000000..f8b35045a42 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.TrafficTargetAllocationType + */ +class TrafficTargetAllocationType +{ + /** + * Unspecified instance allocation type. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; + /** + * Allocates instances to the Service's latest ready Revision. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; + /** + * Allocates instances to a Revision by name. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; + + private static $valueToName = [ + self::TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED => 'TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED', + self::TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST => 'TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST', + self::TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION => 'TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php new file mode 100644 index 00000000000..b03251c15e8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php @@ -0,0 +1,203 @@ +google.cloud.run.v2.TrafficTargetStatus + */ +class TrafficTargetStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + */ + protected $type = 0; + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + */ + protected $percent = 0; + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + */ + protected $tag = ''; + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The allocation type for this traffic target. + * @type string $revision + * Revision to which this traffic is sent. + * @type int $percent + * Specifies percent of the traffic to this Revision. + * @type string $tag + * Indicates the string used in the URI to exclusively reference this target. + * @type string $uri + * Displays the target URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); + parent::__construct($data); + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); + $this->type = $var; + + return $this; + } + + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + * @return int + */ + public function getPercent() + { + return $this->percent; + } + + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + * @param int $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkInt32($var); + $this->percent = $var; + + return $this; + } + + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php new file mode 100644 index 00000000000..69d8b8afba1 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php @@ -0,0 +1,170 @@ +google.cloud.run.v2.UpdateJobRequest + */ +class UpdateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Run\V2\Job $job Required. The Job to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateJobRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Run\V2\Job $job): self + { + return (new self()) + ->setJob($job); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Run\V2\Job $job + * Required. The Job to be updated. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @type bool $allow_missing + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php new file mode 100644 index 00000000000..0aa1548695f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php @@ -0,0 +1,229 @@ +google.cloud.run.v2.UpdateServiceRequest + */ +class UpdateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Run\V2\Service $service): self + { + return (new self()) + ->setService($service); + } + + /** + * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateServiceRequest + * + * @experimental + */ + public static function buildFromServiceUpdateMask(\Google\Cloud\Run\V2\Service $service, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setService($service) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to be updated. + * @type \Google\Cloud\Run\V2\Service $service + * Required. The Service to be updated. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @type bool $allow_missing + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php new file mode 100644 index 00000000000..0bb46774d60 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php @@ -0,0 +1,188 @@ +google.cloud.run.v2.VersionToPath + */ +class VersionToPath extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $path = ''; + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Required. The relative path of the secret in the container. + * @type string $version + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * @type int $mode + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkInt32($var); + $this->mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php new file mode 100644 index 00000000000..0614cda4f01 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php @@ -0,0 +1,247 @@ +google.cloud.run.v2.Volume + */ +class Volume extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + protected $volume_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Volume's name. + * @type \Google\Cloud\Run\V2\SecretVolumeSource $secret + * Secret represents a secret that should populate this volume. + * @type \Google\Cloud\Run\V2\CloudSqlInstance $cloud_sql_instance + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * @type \Google\Cloud\Run\V2\EmptyDirVolumeSource $empty_dir + * Ephemeral storage used as a shared volume. + * @type \Google\Cloud\Run\V2\NFSVolumeSource $nfs + * For NFS Voumes, contains the path to the nfs Volume + * @type \Google\Cloud\Run\V2\GCSVolumeSource $gcs + * Persistent storage backed by a Google Cloud Storage bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Secret represents a secret that should populate this volume. + * + * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; + * @return \Google\Cloud\Run\V2\SecretVolumeSource|null + */ + public function getSecret() + { + return $this->readOneof(2); + } + + public function hasSecret() + { + return $this->hasOneof(2); + } + + /** + * Secret represents a secret that should populate this volume. + * + * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; + * @param \Google\Cloud\Run\V2\SecretVolumeSource $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretVolumeSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; + * @return \Google\Cloud\Run\V2\CloudSqlInstance|null + */ + public function getCloudSqlInstance() + { + return $this->readOneof(3); + } + + public function hasCloudSqlInstance() + { + return $this->hasOneof(3); + } + + /** + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; + * @param \Google\Cloud\Run\V2\CloudSqlInstance $var + * @return $this + */ + public function setCloudSqlInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\CloudSqlInstance::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Ephemeral storage used as a shared volume. + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; + * @return \Google\Cloud\Run\V2\EmptyDirVolumeSource|null + */ + public function getEmptyDir() + { + return $this->readOneof(4); + } + + public function hasEmptyDir() + { + return $this->hasOneof(4); + } + + /** + * Ephemeral storage used as a shared volume. + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; + * @param \Google\Cloud\Run\V2\EmptyDirVolumeSource $var + * @return $this + */ + public function setEmptyDir($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * For NFS Voumes, contains the path to the nfs Volume + * + * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; + * @return \Google\Cloud\Run\V2\NFSVolumeSource|null + */ + public function getNfs() + { + return $this->readOneof(5); + } + + public function hasNfs() + { + return $this->hasOneof(5); + } + + /** + * For NFS Voumes, contains the path to the nfs Volume + * + * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; + * @param \Google\Cloud\Run\V2\NFSVolumeSource $var + * @return $this + */ + public function setNfs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NFSVolumeSource::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Persistent storage backed by a Google Cloud Storage bucket. + * + * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; + * @return \Google\Cloud\Run\V2\GCSVolumeSource|null + */ + public function getGcs() + { + return $this->readOneof(6); + } + + public function hasGcs() + { + return $this->hasOneof(6); + } + + /** + * Persistent storage backed by a Google Cloud Storage bucket. + * + * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; + * @param \Google\Cloud\Run\V2\GCSVolumeSource $var + * @return $this + */ + public function setGcs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GCSVolumeSource::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getVolumeType() + { + return $this->whichOneof("volume_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php new file mode 100644 index 00000000000..979b27f2084 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php @@ -0,0 +1,117 @@ +google.cloud.run.v2.VolumeMount + */ +class VolumeMount extends \Google\Protobuf\Internal\Message +{ + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mount_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. This must match the Name of a Volume. + * @type string $mount_path + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMountPath() + { + return $this->mount_path; + } + + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMountPath($var) + { + GPBUtil::checkString($var, True); + $this->mount_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php new file mode 100644 index 00000000000..2edc5d9e89b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php @@ -0,0 +1,160 @@ +google.cloud.run.v2.VpcAccess + */ +class VpcAccess extends \Google\Protobuf\Internal\Message +{ + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + */ + protected $connector = ''; + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $egress = 0; + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connector + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * @type int $egress + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * @type array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConnector() + { + return $this->connector; + } + + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnector($var) + { + GPBUtil::checkString($var, True); + $this->connector = $var; + + return $this; + } + + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEgress() + { + return $this->egress; + } + + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEgress($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\VpcAccess\VpcEgress::class); + $this->egress = $var; + + return $this; + } + + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VpcAccess\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php new file mode 100644 index 00000000000..41428271a60 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php @@ -0,0 +1,170 @@ +google.cloud.run.v2.VpcAccess.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = ''; + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork = ''; + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * @type string $subnetwork + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Network tags applied to this Cloud Run resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkInterface::class, \Google\Cloud\Run\V2\VpcAccess_NetworkInterface::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php new file mode 100644 index 00000000000..b6178c267b9 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php @@ -0,0 +1,64 @@ +google.cloud.run.v2.VpcAccess.VpcEgress + */ +class VpcEgress +{ + /** + * Unspecified + * + * Generated from protobuf enum VPC_EGRESS_UNSPECIFIED = 0; + */ + const VPC_EGRESS_UNSPECIFIED = 0; + /** + * All outbound traffic is routed through the VPC connector. + * + * Generated from protobuf enum ALL_TRAFFIC = 1; + */ + const ALL_TRAFFIC = 1; + /** + * Only private IP ranges are routed through the VPC connector. + * + * Generated from protobuf enum PRIVATE_RANGES_ONLY = 2; + */ + const PRIVATE_RANGES_ONLY = 2; + + private static $valueToName = [ + self::VPC_EGRESS_UNSPECIFIED => 'VPC_EGRESS_UNSPECIFIED', + self::ALL_TRAFFIC => 'ALL_TRAFFIC', + self::PRIVATE_RANGES_ONLY => 'PRIVATE_RANGES_ONLY', + ]; + + 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(VpcEgress::class, \Google\Cloud\Run\V2\VpcAccess_VpcEgress::class); + diff --git a/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php b/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php new file mode 100644 index 00000000000..efba1314213 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php @@ -0,0 +1,94 @@ +setBucket($storageSourceBucket) + ->setObject($storageSourceObject); + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + + // Call the API and handle any network failures. + try { + /** @var SubmitBuildResponse $response */ + $response = $buildsClient->submitBuild($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $storageSourceBucket = '[BUCKET]'; + $storageSourceObject = '[OBJECT]'; + $imageUri = '[IMAGE_URI]'; + + submit_build_sample($parent, $storageSourceBucket, $storageSourceObject, $imageUri); +} +// [END run_v2_generated_Builds_SubmitBuild_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php new file mode 100644 index 00000000000..64c82c0f877 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $executionsClient->cancelExecution($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + cancel_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php new file mode 100644 index 00000000000..1e5eeab289d --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $executionsClient->deleteExecution($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + delete_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_DeleteExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php new file mode 100644 index 00000000000..1151abf84be --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Execution $response */ + $response = $executionsClient->getExecution($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + get_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php new file mode 100644 index 00000000000..9e3230df26c --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $executionsClient->listExecutions($request); + + /** @var Execution $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ExecutionsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + list_executions_sample($formattedParent); +} +// [END run_v2_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php new file mode 100644 index 00000000000..40327f792c0 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php @@ -0,0 +1,97 @@ +setTemplate($jobTemplateTemplate); + $job = (new Job()) + ->setTemplate($jobTemplate); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->createJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); + $jobId = '[JOB_ID]'; + + create_job_sample($formattedParent, $jobId); +} +// [END run_v2_generated_Jobs_CreateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php new file mode 100644 index 00000000000..c62edc4aa31 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->deleteJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + delete_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_DeleteJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php new file mode 100644 index 00000000000..ec63bee9b4e --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $jobsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END run_v2_generated_Jobs_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php new file mode 100644 index 00000000000..e7913654919 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $jobsClient->getJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_GetJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php new file mode 100644 index 00000000000..5098a79046c --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $jobsClient->listJobs($request); + + /** @var Job $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_jobs_sample($formattedParent); +} +// [END run_v2_generated_Jobs_ListJobs_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php new file mode 100644 index 00000000000..839082beaab --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->runJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + run_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_RunJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php new file mode 100644 index 00000000000..cd9a9bfc4f4 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $jobsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END run_v2_generated_Jobs_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php new file mode 100644 index 00000000000..49060c33d08 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $jobsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END run_v2_generated_Jobs_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php new file mode 100644 index 00000000000..2851843e2e3 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php @@ -0,0 +1,77 @@ +setTemplate($jobTemplateTemplate); + $job = (new Job()) + ->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->updateJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END run_v2_generated_Jobs_UpdateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php new file mode 100644 index 00000000000..396f1693cfb --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $revisionsClient->deleteRevision($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Revision $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RevisionsClient::revisionName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]', + '[REVISION]' + ); + + delete_revision_sample($formattedName); +} +// [END run_v2_generated_Revisions_DeleteRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php new file mode 100644 index 00000000000..02c8bdec4ba --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Revision $response */ + $response = $revisionsClient->getRevision($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RevisionsClient::revisionName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]', + '[REVISION]' + ); + + get_revision_sample($formattedName); +} +// [END run_v2_generated_Revisions_GetRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php new file mode 100644 index 00000000000..3326bafd47d --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $revisionsClient->listRevisions($request); + + /** @var Revision $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RevisionsClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + list_revisions_sample($formattedParent); +} +// [END run_v2_generated_Revisions_ListRevisions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php new file mode 100644 index 00000000000..4fc72ae86ea --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php @@ -0,0 +1,95 @@ +setTemplate($serviceTemplate); + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->createService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $serviceId = '[SERVICE_ID]'; + + create_service_sample($formattedParent, $serviceId); +} +// [END run_v2_generated_Services_CreateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php new file mode 100644 index 00000000000..483cd74a586 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->deleteService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + delete_service_sample($formattedName); +} +// [END run_v2_generated_Services_DeleteService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php new file mode 100644 index 00000000000..b7b0f1d416b --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $servicesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END run_v2_generated_Services_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php new file mode 100644 index 00000000000..c76820b3ff8 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $servicesClient->getService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + get_service_sample($formattedName); +} +// [END run_v2_generated_Services_GetService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php new file mode 100644 index 00000000000..2d88c7f1c0a --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $servicesClient->listServices($request); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_services_sample($formattedParent); +} +// [END run_v2_generated_Services_ListServices_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php new file mode 100644 index 00000000000..90386eccb59 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $servicesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END run_v2_generated_Services_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php new file mode 100644 index 00000000000..5b5144e3f93 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $servicesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END run_v2_generated_Services_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php new file mode 100644 index 00000000000..ca153e68ad3 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php @@ -0,0 +1,74 @@ +setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->updateService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END run_v2_generated_Services_UpdateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php new file mode 100644 index 00000000000..bb37335118e --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $tasksClient->getTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TasksClient::taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END run_v2_generated_Tasks_GetTask_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php new file mode 100644 index 00000000000..1b4ebdbc40d --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tasksClient->listTasks($request); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = TasksClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + list_tasks_sample($formattedParent); +} +// [END run_v2_generated_Tasks_ListTasks_sync] diff --git a/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php new file mode 100644 index 00000000000..ea072eb07f2 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php @@ -0,0 +1,243 @@ + submitBuildAsync(SubmitBuildRequest $request, array $optionalArgs = []) + */ +final class BuildsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Builds'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/builds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/builds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/builds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/builds_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a worker_pool + * resource. + * + * @param string $project + * @param string $location + * @param string $workerPool + * + * @return string The formatted worker_pool resource. + */ + public static function workerPoolName(string $project, string $location, string $workerPool): string + { + return self::getPathTemplate('workerPool')->render([ + 'project' => $project, + 'location' => $location, + 'worker_pool' => $workerPool, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Submits a build in a given project. + * + * The async variant is {@see BuildsClient::submitBuildAsync()} . + * + * @example samples/V2/BuildsClient/submit_build.php + * + * @param SubmitBuildRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 SubmitBuildResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function submitBuild(SubmitBuildRequest $request, array $callOptions = []): SubmitBuildResponse + { + return $this->startApiCall('SubmitBuild', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php new file mode 100644 index 00000000000..725af0be60d --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php @@ -0,0 +1,405 @@ + cancelExecutionAsync(CancelExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteExecutionAsync(DeleteExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getExecutionAsync(GetExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listExecutionsAsync(ListExecutionsRequest $request, array $optionalArgs = []) + */ +final class ExecutionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Executions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/executions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/executions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/executions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/executions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - job: projects/{project}/locations/{location}/jobs/{job} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Cancels an Execution. + * + * The async variant is {@see ExecutionsClient::cancelExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/cancel_execution.php + * + * @param CancelExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelExecution(CancelExecutionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CancelExecution', $request, $callOptions)->wait(); + } + + /** + * Deletes an Execution. + * + * The async variant is {@see ExecutionsClient::deleteExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/delete_execution.php + * + * @param DeleteExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteExecution(DeleteExecutionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteExecution', $request, $callOptions)->wait(); + } + + /** + * Gets information about an Execution. + * + * The async variant is {@see ExecutionsClient::getExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/get_execution.php + * + * @param GetExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Execution + * + * @throws ApiException Thrown if the API call fails. + */ + public function getExecution(GetExecutionRequest $request, array $callOptions = []): Execution + { + return $this->startApiCall('GetExecution', $request, $callOptions)->wait(); + } + + /** + * Lists Executions from a Job. Results are sorted by creation time, + * descending. + * + * The async variant is {@see ExecutionsClient::listExecutionsAsync()} . + * + * @example samples/V2/ExecutionsClient/list_executions.php + * + * @param ListExecutionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listExecutions(ListExecutionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListExecutions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php new file mode 100644 index 00000000000..27566391f6c --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php @@ -0,0 +1,697 @@ + createJobAsync(CreateJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) + * @method PromiseInterface runJobAsync(RunJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateJobAsync(UpdateJobRequest $request, array $optionalArgs = []) + */ +final class JobsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Jobs'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/jobs_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/jobs_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/jobs_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/jobs_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connector + * resource. + * + * @param string $project + * @param string $location + * @param string $connector + * + * @return string The formatted connector resource. + */ + public static function connectorName(string $project, string $location, string $connector): string + { + return self::getPathTemplate('connector')->render([ + 'project' => $project, + 'location' => $location, + 'connector' => $connector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a secret + * resource. + * + * @param string $project + * @param string $secret + * + * @return string The formatted secret resource. + */ + public static function secretName(string $project, string $secret): string + { + return self::getPathTemplate('secret')->render([ + 'project' => $project, + 'secret' => $secret, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $version + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $version): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - connector: projects/{project}/locations/{location}/connectors/{connector} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - job: projects/{project}/locations/{location}/jobs/{job} + * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy + * - secret: projects/{project}/secrets/{secret} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Job. + * + * The async variant is {@see JobsClient::createJobAsync()} . + * + * @example samples/V2/JobsClient/create_job.php + * + * @param CreateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createJob(CreateJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); + } + + /** + * Deletes a Job. + * + * The async variant is {@see JobsClient::deleteJobAsync()} . + * + * @example samples/V2/JobsClient/delete_job.php + * + * @param DeleteJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteJob(DeleteJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM Access Control policy currently in effect for the given Job. + * This result does not include any inherited policies. + * + * The async variant is {@see JobsClient::getIamPolicyAsync()} . + * + * @example samples/V2/JobsClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Job. + * + * The async variant is {@see JobsClient::getJobAsync()} . + * + * @example samples/V2/JobsClient/get_job.php + * + * @param GetJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function getJob(GetJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('GetJob', $request, $callOptions)->wait(); + } + + /** + * Lists Jobs. Results are sorted by creation time, descending. + * + * The async variant is {@see JobsClient::listJobsAsync()} . + * + * @example samples/V2/JobsClient/list_jobs.php + * + * @param ListJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListJobs', $request, $callOptions); + } + + /** + * Triggers creation of a new Execution of this Job. + * + * The async variant is {@see JobsClient::runJobAsync()} . + * + * @example samples/V2/JobsClient/run_job.php + * + * @param RunJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runJob(RunJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RunJob', $request, $callOptions)->wait(); + } + + /** + * Sets the IAM Access control policy for the specified Job. Overwrites + * any existing policy. + * + * The async variant is {@see JobsClient::setIamPolicyAsync()} . + * + * @example samples/V2/JobsClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * The async variant is {@see JobsClient::testIamPermissionsAsync()} . + * + * @example samples/V2/JobsClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates a Job. + * + * The async variant is {@see JobsClient::updateJobAsync()} . + * + * @example samples/V2/JobsClient/update_job.php + * + * @param UpdateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateJob(UpdateJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateJob', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php new file mode 100644 index 00000000000..1970bae447c --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php @@ -0,0 +1,377 @@ + deleteRevisionAsync(DeleteRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRevisionAsync(GetRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRevisionsAsync(ListRevisionsRequest $request, array $optionalArgs = []) + */ +final class RevisionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Revisions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/revisions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/revisions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/revisions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/revisions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a revision + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $revision + * + * @return string The formatted revision resource. + */ + public static function revisionName(string $project, string $location, string $service, string $revision): string + { + return self::getPathTemplate('revision')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'revision' => $revision, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * - service: projects/{project}/locations/{location}/services/{service} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes a Revision. + * + * The async variant is {@see RevisionsClient::deleteRevisionAsync()} . + * + * @example samples/V2/RevisionsClient/delete_revision.php + * + * @param DeleteRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteRevision(DeleteRevisionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteRevision', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Revision. + * + * The async variant is {@see RevisionsClient::getRevisionAsync()} . + * + * @example samples/V2/RevisionsClient/get_revision.php + * + * @param GetRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Revision + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRevision(GetRevisionRequest $request, array $callOptions = []): Revision + { + return $this->startApiCall('GetRevision', $request, $callOptions)->wait(); + } + + /** + * Lists Revisions from a given Service, or from a given location. Results + * are sorted by creation time, descending. + * + * The async variant is {@see RevisionsClient::listRevisionsAsync()} . + * + * @example samples/V2/RevisionsClient/list_revisions.php + * + * @param ListRevisionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRevisions(ListRevisionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRevisions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php new file mode 100644 index 00000000000..e2315b7670b --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php @@ -0,0 +1,690 @@ + createServiceAsync(CreateServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteServiceAsync(DeleteServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getServiceAsync(GetServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listServicesAsync(ListServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateServiceAsync(UpdateServiceRequest $request, array $optionalArgs = []) + */ +final class ServicesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Services'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/services_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/services_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/services_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + 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 + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connector + * resource. + * + * @param string $project + * @param string $location + * @param string $connector + * + * @return string The formatted connector resource. + */ + public static function connectorName(string $project, string $location, string $connector): string + { + return self::getPathTemplate('connector')->render([ + 'project' => $project, + 'location' => $location, + 'connector' => $connector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a mesh + * resource. + * + * @param string $project + * @param string $location + * @param string $mesh + * + * @return string The formatted mesh resource. + */ + public static function meshName(string $project, string $location, string $mesh): string + { + return self::getPathTemplate('mesh')->render([ + 'project' => $project, + 'location' => $location, + 'mesh' => $mesh, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a revision + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $revision + * + * @return string The formatted revision resource. + */ + public static function revisionName(string $project, string $location, string $service, string $revision): string + { + return self::getPathTemplate('revision')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'revision' => $revision, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a secret + * resource. + * + * @param string $project + * @param string $secret + * + * @return string The formatted secret resource. + */ + public static function secretName(string $project, string $secret): string + { + return self::getPathTemplate('secret')->render([ + 'project' => $project, + 'secret' => $secret, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $version + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $version): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - connector: projects/{project}/locations/{location}/connectors/{connector} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - mesh: projects/{project}/locations/{location}/meshes/{mesh} + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy + * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * - secret: projects/{project}/secrets/{secret} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} + * - service: projects/{project}/locations/{location}/services/{service} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Service in a given project and location. + * + * The async variant is {@see ServicesClient::createServiceAsync()} . + * + * @example samples/V2/ServicesClient/create_service.php + * + * @param CreateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createService(CreateServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateService', $request, $callOptions)->wait(); + } + + /** + * Deletes a Service. + * This will cause the Service to stop serving traffic and will delete all + * revisions. + * + * The async variant is {@see ServicesClient::deleteServiceAsync()} . + * + * @example samples/V2/ServicesClient/delete_service.php + * + * @param DeleteServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteService(DeleteServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteService', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM Access Control policy currently in effect for the given + * Cloud Run Service. This result does not include any inherited policies. + * + * The async variant is {@see ServicesClient::getIamPolicyAsync()} . + * + * @example samples/V2/ServicesClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Service. + * + * The async variant is {@see ServicesClient::getServiceAsync()} . + * + * @example samples/V2/ServicesClient/get_service.php + * + * @param GetServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function getService(GetServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('GetService', $request, $callOptions)->wait(); + } + + /** + * Lists Services. Results are sorted by creation time, descending. + * + * The async variant is {@see ServicesClient::listServicesAsync()} . + * + * @example samples/V2/ServicesClient/list_services.php + * + * @param ListServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServices', $request, $callOptions); + } + + /** + * Sets the IAM Access control policy for the specified Service. Overwrites + * any existing policy. + * + * The async variant is {@see ServicesClient::setIamPolicyAsync()} . + * + * @example samples/V2/ServicesClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * The async variant is {@see ServicesClient::testIamPermissionsAsync()} . + * + * @example samples/V2/ServicesClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates a Service. + * + * The async variant is {@see ServicesClient::updateServiceAsync()} . + * + * @example samples/V2/ServicesClient/update_service.php + * + * @param UpdateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateService(UpdateServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php b/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php new file mode 100644 index 00000000000..e0f0369c6f2 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php @@ -0,0 +1,298 @@ + getTaskAsync(GetTaskRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTasksAsync(ListTasksRequest $request, array $optionalArgs = []) + */ +final class TasksClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Tasks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tasks_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName(string $project, string $location, string $job, string $execution, string $task): string + { + return self::getPathTemplate('task')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - task: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets information about a Task. + * + * The async variant is {@see TasksClient::getTaskAsync()} . + * + * @example samples/V2/TasksClient/get_task.php + * + * @param GetTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTask(GetTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('GetTask', $request, $callOptions)->wait(); + } + + /** + * Lists Tasks from an Execution of a Job. + * + * The async variant is {@see TasksClient::listTasksAsync()} . + * + * @example samples/V2/TasksClient/list_tasks.php + * + * @param ListTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTasks', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json new file mode 100644 index 00000000000..2bf7b36f81c --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json @@ -0,0 +1,198 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.run.v2", + "libraryPackage": "Google\\Cloud\\Run\\V2", + "services": { + "Builds": { + "clients": { + "grpc": { + "libraryClient": "BuildsGapicClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + } + } + }, + "Executions": { + "clients": { + "grpc": { + "libraryClient": "ExecutionsGapicClient", + "rpcs": { + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions" + ] + } + } + } + } + }, + "Jobs": { + "clients": { + "grpc": { + "libraryClient": "JobsGapicClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs" + ] + }, + "RunJob": { + "methods": [ + "runJob" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + } + } + } + } + }, + "Revisions": { + "clients": { + "grpc": { + "libraryClient": "RevisionsGapicClient", + "rpcs": { + "DeleteRevision": { + "methods": [ + "deleteRevision" + ] + }, + "GetRevision": { + "methods": [ + "getRevision" + ] + }, + "ListRevisions": { + "methods": [ + "listRevisions" + ] + } + } + } + } + }, + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesGapicClient", + "rpcs": { + "CreateService": { + "methods": [ + "createService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetService": { + "methods": [ + "getService" + ] + }, + "ListServices": { + "methods": [ + "listServices" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + } + } + } + } + }, + "Tasks": { + "clients": { + "grpc": { + "libraryClient": "TasksGapicClient", + "rpcs": { + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json new file mode 100644 index 00000000000..b09e6e72184 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.cloud.run.v2.Builds": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "SubmitBuild": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php new file mode 100644 index 00000000000..5cb8ed8624c --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\SubmitBuildResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php new file mode 100644 index 00000000000..5654061ec5f --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php @@ -0,0 +1,88 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/builds:submit', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json new file mode 100644 index 00000000000..2ca1a996052 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.run.v2.Executions": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CancelExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListExecutions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php new file mode 100644 index 00000000000..eef9c8872f7 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php @@ -0,0 +1,102 @@ + [ + 'google.cloud.run.v2.Executions' => [ + 'CancelExecution' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteExecution' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetExecution' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Execution', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getExecutions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListExecutionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php new file mode 100644 index 00000000000..d057b806912 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php @@ -0,0 +1,121 @@ + [ + 'google.cloud.run.v2.Executions' => [ + 'CancelExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteExecution' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetExecution' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*}/executions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json new file mode 100644 index 00000000000..c5f5321be6c --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.run.v2.Jobs": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "RunJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php new file mode 100644 index 00000000000..dabd773405a --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.run.v2.Jobs' => [ + 'CreateJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'DeleteJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'RunJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'UpdateJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getJob', + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Job', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', + 'secret' => 'projects/{project}/secrets/{secret}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php new file mode 100644 index 00000000000..51959869ee1 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.run.v2.Jobs' => [ + 'CreateJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', + 'body' => 'job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'job_id', + ], + ], + 'DeleteJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RunJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateJob' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{job.name=projects/*/locations/*/jobs/*}', + 'body' => 'job', + 'placeholders' => [ + 'job.name' => [ + 'getters' => [ + 'getJob', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json new file mode 100644 index 00000000000..ba39cada8bc --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.run.v2.Revisions": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "DeleteRevision": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetRevision": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php new file mode 100644 index 00000000000..a2b139922fc --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php @@ -0,0 +1,86 @@ + [ + 'google.cloud.run.v2.Revisions' => [ + 'DeleteRevision' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Revision', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Revision', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Revision', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListRevisions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRevisions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListRevisionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'templateMap' => [ + 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php new file mode 100644 index 00000000000..525cc8b3139 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php @@ -0,0 +1,109 @@ + [ + 'google.cloud.run.v2.Revisions' => [ + 'DeleteRevision' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRevision' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListRevisions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/services/*}/revisions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json new file mode 100644 index 00000000000..53e3bc1d5fa --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.cloud.run.v2.Services": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [], + "no_retry_2_codes": [] + }, + "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": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + } + }, + "methods": { + "CreateService": { + "timeout_millis": 15000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteService": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetService": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListServices": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateService": { + "timeout_millis": 15000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php new file mode 100644 index 00000000000..3264c3a5d62 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.run.v2.Services' => [ + 'CreateService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'DeleteService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'UpdateService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getService', + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Service', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'mesh' => 'projects/{project}/locations/{location}/meshes/{mesh}', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', + 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', + 'secret' => 'projects/{project}/secrets/{secret}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php new file mode 100644 index 00000000000..4ab42dd2248 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.run.v2.Services' => [ + 'CreateService' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', + 'body' => 'service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'service_id', + ], + ], + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{service.name=projects/*/locations/*/services/*}', + 'body' => 'service', + 'placeholders' => [ + 'service.name' => [ + 'getters' => [ + 'getService', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json new file mode 100644 index 00000000000..60a75305960 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.cloud.run.v2.Tasks": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php new file mode 100644 index 00000000000..4a057bedbd7 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.cloud.run.v2.Tasks' => [ + 'GetTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Task', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'task' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php new file mode 100644 index 00000000000..b822ceb4435 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.run.v2.Tasks' => [ + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php new file mode 100644 index 00000000000..da407d67506 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php @@ -0,0 +1,192 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BuildsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BuildsClient($options); + } + + /** @test */ + public function submitBuildTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuild($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildExceptionTest() + { + $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 + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + try { + $gapicClient->submitBuild($request); + // 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 submitBuildAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuildAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php new file mode 100644 index 00000000000..16abbe3de83 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php @@ -0,0 +1,638 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExecutionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExecutionsClient($options); + } + + /** @test */ + public function cancelExecutionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/cancelExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecution($request); + $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.run.v2.Executions/CancelExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + $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 cancelExecutionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/cancelExecutionTest'); + $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 + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + 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 deleteExecutionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new DeleteExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteExecution($request); + $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.run.v2.Executions/DeleteExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); + $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 deleteExecutionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteExecutionTest'); + $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 + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new DeleteExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); + 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 getExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->getExecution($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/GetExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExecutionExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + try { + $gapicClient->getExecution($request); + // 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 listExecutionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $executionsElement = new Execution(); + $executions = [ + $executionsElement, + ]; + $expectedResponse = new ListExecutionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setExecutions($executions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listExecutions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/ListExecutions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExecutionsExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listExecutions($request); + // 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 cancelExecutionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/cancelExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecutionAsync($request)->wait(); + $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.run.v2.Executions/CancelExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + $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()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php new file mode 100644 index 00000000000..d8b665ac446 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php @@ -0,0 +1,1170 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return JobsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new JobsClient($options); + } + + /** @test */ + public function createJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJob($request); + $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.run.v2.Jobs/CreateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $actualValue = $actualApiRequestObject->getJobId(); + $this->assertProtobufEquals($jobId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + $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 createJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createJobTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + 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 deleteJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteJob($request); + $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.run.v2.Jobs/DeleteJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + $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 deleteJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteJobTest'); + $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 + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + $response = $gapicClient->getJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/GetJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + try { + $gapicClient->getJob($request); + // 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 listJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $jobsElement = new Job(); + $jobs = [ + $jobsElement, + ]; + $expectedResponse = new ListJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setJobs($jobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/ListJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listJobs($request); + // 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 runJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/runJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/runJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + $response = $gapicClient->runJob($request); + $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.run.v2.Jobs/RunJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runJobTest'); + $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 runJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/runJobTest'); + $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 + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + $response = $gapicClient->runJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runJobTest'); + 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 updateJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + $response = $gapicClient->updateJob($request); + $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.run.v2.Jobs/UpdateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateJobTest'); + $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 updateJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateJobTest'); + $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 + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + $response = $gapicClient->updateJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateJobTest'); + 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 createJobAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJobAsync($request)->wait(); + $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.run.v2.Jobs/CreateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $actualValue = $actualApiRequestObject->getJobId(); + $this->assertProtobufEquals($jobId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + $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()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php new file mode 100644 index 00000000000..30d2f22dcac --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php @@ -0,0 +1,466 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RevisionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RevisionsClient($options); + } + + /** @test */ + public function deleteRevisionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRevisionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevision($request); + $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.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + $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 deleteRevisionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteRevisionTest'); + $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 + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevision($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + 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 getRevisionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag = 'etag3123477'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new GetRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->getRevision($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/GetRevision', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRevisionExceptionTest() + { + $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->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new GetRevisionRequest()) + ->setName($formattedName); + try { + $gapicClient->getRevision($request); + // 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 listRevisionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $revisionsElement = new Revision(); + $revisions = [ + $revisionsElement, + ]; + $expectedResponse = new ListRevisionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRevisions($revisions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListRevisionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRevisions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRevisions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/ListRevisions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRevisionsExceptionTest() + { + $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListRevisionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRevisions($request); + // 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 deleteRevisionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRevisionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevisionAsync($request)->wait(); + $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.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + $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()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php new file mode 100644 index 00000000000..c642d0821e4 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php @@ -0,0 +1,1044 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServicesClient($options); + } + + /** @test */ + public function createServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createService($request); + $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.run.v2.Services/CreateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualApiRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + $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 createServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createServiceTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + 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 deleteServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteService($request); + $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.run.v2.Services/DeleteService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); + $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 deleteServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/deleteServiceTest'); + $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 + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); + 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // 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 getServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceExceptionTest() + { + $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getService($request); + // 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 listServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServices($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServices($request); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 updateServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $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.run.v2.Services/UpdateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateServiceTest'); + $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 updateServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/updateServiceTest'); + $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 + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateServiceTest'); + 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 createServiceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + '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/createServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createServiceAsync($request)->wait(); + $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.run.v2.Services/CreateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualApiRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + $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()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php new file mode 100644 index 00000000000..2809f1bd76e --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php @@ -0,0 +1,285 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TasksClient($options); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $execution = 'execution-1090974952'; + $maxRetries = 1129288043; + $serviceAccount = 'serviceAccount-1948028253'; + $reconciling = false; + $observedGeneration = 900833007; + $index = 100346066; + $retried = 1098377527; + $encryptionKey = 'encryptionKey-1122344029'; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setExecution($execution); + $expectedResponse->setMaxRetries($maxRetries); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setIndex($index); + $expectedResponse->setRetried($retried); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $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->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getTask($request); + // 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 listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTasks($request); + // 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 getTaskAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $execution = 'execution-1090974952'; + $maxRetries = 1129288043; + $serviceAccount = 'serviceAccount-1948028253'; + $reconciling = false; + $observedGeneration = 900833007; + $index = 100346066; + $retried = 1098377527; + $encryptionKey = 'encryptionKey-1122344029'; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setExecution($execution); + $expectedResponse->setMaxRetries($maxRetries); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setIndex($index); + $expectedResponse->setRetried($retried); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTaskAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php new file mode 100644 index 00000000000..c572edac81d --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php @@ -0,0 +1,74 @@ +internalAddGeneratedFile( + ' +� +.google/cloud/scheduler/v1/cloudscheduler.protogoogle.cloud.scheduler.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/scheduler/v1/job.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"s +ListJobsRequest9 +parent ( B)�A�A#!cloudscheduler.googleapis.com/Job + page_size ( + +page_token ( "Y +ListJobsResponse, +jobs ( 2.google.cloud.scheduler.v1.Job +next_page_token ( "H + GetJobRequest7 +name ( B)�A�A# +!cloudscheduler.googleapis.com/Job" +CreateJobRequest9 +parent ( B)�A�A#!cloudscheduler.googleapis.com/Job0 +job ( 2.google.cloud.scheduler.v1.JobB�A"u +UpdateJobRequest0 +job ( 2.google.cloud.scheduler.v1.JobB�A/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteJobRequest7 +name ( B)�A�A# +!cloudscheduler.googleapis.com/Job"J +PauseJobRequest7 +name ( B)�A�A# +!cloudscheduler.googleapis.com/Job"K +ResumeJobRequest7 +name ( B)�A�A# +!cloudscheduler.googleapis.com/Job"H + RunJobRequest7 +name ( B)�A�A# +!cloudscheduler.googleapis.com/Job2� + +CloudScheduler� +ListJobs*.google.cloud.scheduler.v1.ListJobsRequest+.google.cloud.scheduler.v1.ListJobsResponse"9�Aparent���*(/v1/{parent=projects/*/locations/*}/jobs� +GetJob(.google.cloud.scheduler.v1.GetJobRequest.google.cloud.scheduler.v1.Job"7�Aname���*(/v1/{name=projects/*/locations/*/jobs/*}� + CreateJob+.google.cloud.scheduler.v1.CreateJobRequest.google.cloud.scheduler.v1.Job"B�A +parent,job���/"(/v1/{parent=projects/*/locations/*}/jobs:job� + UpdateJob+.google.cloud.scheduler.v1.UpdateJobRequest.google.cloud.scheduler.v1.Job"K�Ajob,update_mask���32,/v1/{job.name=projects/*/locations/*/jobs/*}:job� + DeleteJob+.google.cloud.scheduler.v1.DeleteJobRequest.google.protobuf.Empty"7�Aname���**(/v1/{name=projects/*/locations/*/jobs/*}� +PauseJob*.google.cloud.scheduler.v1.PauseJobRequest.google.cloud.scheduler.v1.Job"@�Aname���3"./v1/{name=projects/*/locations/*/jobs/*}:pause:*� + ResumeJob+.google.cloud.scheduler.v1.ResumeJobRequest.google.cloud.scheduler.v1.Job"A�Aname���4"//v1/{name=projects/*/locations/*/jobs/*}:resume:*� +RunJob(.google.cloud.scheduler.v1.RunJobRequest.google.cloud.scheduler.v1.Job">�Aname���1",/v1/{name=projects/*/locations/*/jobs/*}:run:*Q�Acloudscheduler.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBz +com.google.cloud.scheduler.v1BSchedulerProtoPZ;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb� SCHEDULERbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php new file mode 100644 index 0000000000000000000000000000000000000000..242b2f5581c946b1e5dafa24b19a3e45ecbea3d1 GIT binary patch literal 2214 zcmbVN;cnYD5U!ipOU}&@t4*f{*v6(=;{uzEq$>tE$u=i;QV&}q#7;XD0t8v2ZFRCl zNK~=5@DuJW_GiGJVn<3;z1dBI`G-xD_uU=8`;K?;0~<4VL{4c)V~10Z4Biqxri8^2 zkK8CAgLF8gF>#{_^8*?igtX7e*?FII+TH#`geFlMyR=D0Q8Wr@!wsU;Yb5TNdMVmB z-t0DBM*~Cp0|=c7O_<|Sa%vv^Lb>BP+_6q2)H)VWtEZsWi`{(yH*k`K{1gq~JrMk` zbP)J1Nw~xDXWLI~KlHip1pYhB{*VlvAfbqxw;iUT%l#-M0&pI>wEl!-K85Wzi}1FG zL?vSi0`T%yH{>)9oxp0-#EpH%qu4~#W^+V&L7UjAKgq)icm9ynvmBevxg-w>k5f7u zosgLFG!FM=-onAOSXm3GYBArspgHx;4;T7?Uxb<`*y=km-lKVA7X>Zt6!n5^{tsy1 zM-gym!fuYeV6N4}lBdaHjI7=_-}`y3TAo*w<^*M1FUS?LlT_NKqSw zsEs$fn~y(^=aSP*@|$1ecCrCbPYo|8EN7G;+`X{@OS{#SvM8w=Bq2*{0qGfE2!h{CE~HlX~9h{g!!?wMgrDVJdZkFfECy8OAil}hk`cs4s87j<&239sP+1- ze#gE%>zSS7?n$@PUcaSP;gil;>*#0vQ_=t`X6v$t>)WW`m3Ft6oh)fJSi3aa0)Eo! z3ghMGtG`<>;i1e~(HG}=ILuEBoJ|eU2z!{+YwGf(@jhQo8$smCXA1Y!aw-NA{>Sg> z(F#_Bz0Y_jU!$GOqIgL@M{vlFiy&~cUtcgUuNQ}#Hl<1;M%SU7Q9NAJuoR`7T3KD6G(Px%k?Pure zi9nV|(adB=?s2#m6=8$@nf0I|74meaczM6hhThDK6#e463+AJ=%tqN1rU3r{uer-a literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php new file mode 100644 index 0000000000000000000000000000000000000000..7ba328ba14fb88c941ffa798a087bde3faf58b85 GIT binary patch literal 2072 zcmb7F+iu%N5RERjqLJDVY}&dB3~W@lQF@_Zw?GToZYx=gB{Z>!nCU|yfLM`hX&ahL zkV^qhpkL}2^r@fF&&VhAsk0<4sd210dJ(alGka#v;mpC$;WUKL$uSF9L?!dc_=3nO zBVi<@aD`9C$=Ml;h%3%R?z6}sq&FldLz|erf&BoXu}C79waG+?iO*WDFA}d6yHn;R z7~h)hwj_-vOd4rQfPkK}IHWEk$5!_#lhmVdu218b*l8Ac z1q6R#GWNMkVo4?b?eN&)0hgTm{3X_KNY1DqGlX7^Jxc;tauE;(7zQqDJ|bC86}uA( ztoe{!^08DKumz(*AXyYpf7D~K8}U$z$imQe8!KBhPn|R$<=3io{ERd+j_vjpl7~b_ z30u9Lkci173ieapD#3j5Gmop3$}m$*uR$q^_*Q`wnpM3GwJE-G&Y7GFZ>xxh zAMSl&T${{LiO?k&tRF#T%BaVpc&kK8&D!4HJ8&5Rqo0AyKt>mO9m-?jU2K){=DL0W zH9-?Ob)|nI5g8R3y7!cfZbMR&g-dV$Gh`~Abo&oj$@xm^>U>A9p zK7frG^%Iu%r`j(5Sm=HNcNI|)@t5d%5ja^Z8h;hxqfQu_!Gs5FrR#4rT6O=%jXnmQ zhM~jKoK7SX$%9GCrMCC=n)((zo@EgIF4QCDBi|Wwlm|-4qN+bx>R3*7+`mcAWo>U4 zRB2a#-?ldXDL~yy#&I&v-TFO%6d`vVHK#H;y5!%^Hr&UVgJC&U8uHk{q1dujuyU0e zV`+hP{Z{}gWyHscWHCBTdG&`iHLemcItyfK*n7Kh=Zz!vMXmEn!v^h&6nCH!vuMWM zyeJ(HX80+gl`@y<8rkak*x91google.cloud.scheduler.v1.AppEngineHttpTarget + */ +class AppEngineHttpTarget extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP method to use for the request. PATCH and OPTIONS are not + * permitted. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; + */ + protected $http_method = 0; + /** + * App Engine Routing setting for the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; + */ + protected $app_engine_routing = null; + /** + * The relative URI. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path, query string arguments, and `#` fragments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + */ + protected $relative_uri = ''; + /** + * HTTP request headers. + * This map contains the header field names and values. Headers can be set + * when the job is created. + * Cloud Scheduler sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Scheduler will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * If the job has an + * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the job is + * created. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Scheduler. This value is + * output only. It cannot be changed. + * The headers below are output only. They cannot be set or overridden: + * * `X-Google-*`: For Google internal use only. + * * `X-AppEngine-*`: For Google internal use only. + * In addition, some App Engine headers, which contain + * job-specific information, are also be sent to the job handler. + * + * Generated from protobuf field map headers = 4; + */ + private $headers; + /** + * Body. + * HTTP request body. A request body is allowed only if the HTTP method is + * POST or PUT. It will result in invalid argument error to set a body on a + * job with an incompatible + * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + */ + protected $body = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_method + * The HTTP method to use for the request. PATCH and OPTIONS are not + * permitted. + * @type \Google\Cloud\Scheduler\V1\AppEngineRouting $app_engine_routing + * App Engine Routing setting for the job. + * @type string $relative_uri + * The relative URI. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path, query string arguments, and `#` fragments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. Headers can be set + * when the job is created. + * Cloud Scheduler sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Scheduler will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * If the job has an + * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the job is + * created. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Scheduler. This value is + * output only. It cannot be changed. + * The headers below are output only. They cannot be set or overridden: + * * `X-Google-*`: For Google internal use only. + * * `X-AppEngine-*`: For Google internal use only. + * In addition, some App Engine headers, which contain + * job-specific information, are also be sent to the job handler. + * @type string $body + * Body. + * HTTP request body. A request body is allowed only if the HTTP method is + * POST or PUT. It will result in invalid argument error to set a body on a + * job with an incompatible + * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP method to use for the request. PATCH and OPTIONS are not + * permitted. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. PATCH and OPTIONS are not + * permitted. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * App Engine Routing setting for the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; + * @return \Google\Cloud\Scheduler\V1\AppEngineRouting|null + */ + public function getAppEngineRouting() + { + return $this->app_engine_routing; + } + + public function hasAppEngineRouting() + { + return isset($this->app_engine_routing); + } + + public function clearAppEngineRouting() + { + unset($this->app_engine_routing); + } + + /** + * App Engine Routing setting for the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; + * @param \Google\Cloud\Scheduler\V1\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRouting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineRouting::class); + $this->app_engine_routing = $var; + + return $this; + } + + /** + * The relative URI. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path, query string arguments, and `#` fragments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @return string + */ + public function getRelativeUri() + { + return $this->relative_uri; + } + + /** + * The relative URI. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path, query string arguments, and `#` fragments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @param string $var + * @return $this + */ + public function setRelativeUri($var) + { + GPBUtil::checkString($var, True); + $this->relative_uri = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. Headers can be set + * when the job is created. + * Cloud Scheduler sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Scheduler will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * If the job has an + * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the job is + * created. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Scheduler. This value is + * output only. It cannot be changed. + * The headers below are output only. They cannot be set or overridden: + * * `X-Google-*`: For Google internal use only. + * * `X-AppEngine-*`: For Google internal use only. + * In addition, some App Engine headers, which contain + * job-specific information, are also be sent to the job handler. + * + * Generated from protobuf field map headers = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. Headers can be set + * when the job is created. + * Cloud Scheduler sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Scheduler will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * If the job has an + * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the job is + * created. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Scheduler. This value is + * output only. It cannot be changed. + * The headers below are output only. They cannot be set or overridden: + * * `X-Google-*`: For Google internal use only. + * * `X-AppEngine-*`: For Google internal use only. + * In addition, some App Engine headers, which contain + * job-specific information, are also be sent to the job handler. + * + * Generated from protobuf field map headers = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * Body. + * HTTP request body. A request body is allowed only if the HTTP method is + * POST or PUT. It will result in invalid argument error to set a body on a + * job with an incompatible + * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * Body. + * HTTP request body. A request body is allowed only if the HTTP method is + * POST or PUT. It will result in invalid argument error to set a body on a + * job with an incompatible + * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php new file mode 100644 index 00000000000..cb63e683678 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php @@ -0,0 +1,414 @@ +google.cloud.scheduler.v1.AppEngineRouting + */ +class AppEngineRouting extends \Google\Protobuf\Internal\Message +{ + /** + * App service. + * By default, the job is sent to the service which is the default + * service when the job is attempted. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * App version. + * By default, the job is sent to the version which is the default + * version when the job is attempted. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * App instance. + * By default, the job is sent to an instance which is available when + * the job is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + */ + protected $instance = ''; + /** + * Output only. The host that the job is sent to. + * For more information about how App Engine requests are routed, see + * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * job's project ID. + * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, + * then the job will be sent to the service which is the default service when + * the job is attempted. + * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, + * then the job will be sent to the version which is the default version when + * the job is attempted. + * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is + * empty, then the job will be sent to an instance which is available when the + * job is attempted. + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], + * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, + * then the job will be sent to the default version of the default service + * when the job is attempted. + * + * Generated from protobuf field string host = 4; + */ + protected $host = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * App service. + * By default, the job is sent to the service which is the default + * service when the job is attempted. + * @type string $version + * App version. + * By default, the job is sent to the version which is the default + * version when the job is attempted. + * @type string $instance + * App instance. + * By default, the job is sent to an instance which is available when + * the job is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * @type string $host + * Output only. The host that the job is sent to. + * For more information about how App Engine requests are routed, see + * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * job's project ID. + * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, + * then the job will be sent to the service which is the default service when + * the job is attempted. + * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, + * then the job will be sent to the version which is the default version when + * the job is attempted. + * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is + * empty, then the job will be sent to an instance which is available when the + * job is attempted. + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], + * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, + * then the job will be sent to the default version of the default service + * when the job is attempted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * App service. + * By default, the job is sent to the service which is the default + * service when the job is attempted. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * App service. + * By default, the job is sent to the service which is the default + * service when the job is attempted. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * App version. + * By default, the job is sent to the version which is the default + * version when the job is attempted. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * App version. + * By default, the job is sent to the version which is the default + * version when the job is attempted. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * App instance. + * By default, the job is sent to an instance which is available when + * the job is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * App instance. + * By default, the job is sent to an instance which is available when + * the job is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Output only. The host that the job is sent to. + * For more information about how App Engine requests are routed, see + * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * job's project ID. + * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, + * then the job will be sent to the service which is the default service when + * the job is attempted. + * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, + * then the job will be sent to the version which is the default version when + * the job is attempted. + * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is + * empty, then the job will be sent to an instance which is available when the + * job is attempted. + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], + * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, + * then the job will be sent to the default version of the default service + * when the job is attempted. + * + * Generated from protobuf field string host = 4; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Output only. The host that the job is sent to. + * For more information about how App Engine requests are routed, see + * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * job's project ID. + * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` + * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.scheduler.v1.AppEngineRouting.service] + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, + * then the job will be sent to the service which is the default service when + * the job is attempted. + * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, + * then the job will be sent to the version which is the default version when + * the job is attempted. + * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is + * empty, then the job will be sent to an instance which is available when the + * job is attempted. + * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], + * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or + * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, + * then the job will be sent to the default version of the default service + * when the job is attempted. + * + * Generated from protobuf field string host = 4; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php new file mode 100644 index 00000000000..9fc7f261948 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php @@ -0,0 +1,158 @@ +google.cloud.scheduler.v1.CreateJobRequest + */ +class CreateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The job to add. The user can optionally specify a name for the + * job in [name][google.cloud.scheduler.v1.Job.name]. + * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + + /** + * @param string $parent Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. Please see + * {@see CloudSchedulerClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Scheduler\V1\Job $job Required. The job to add. The user can optionally specify a name for the + * job in [name][google.cloud.scheduler.v1.Job.name]. + * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * + * @return \Google\Cloud\Scheduler\V1\CreateJobRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Scheduler\V1\Job $job): self + { + return (new self()) + ->setParent($parent) + ->setJob($job); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * @type \Google\Cloud\Scheduler\V1\Job $job + * Required. The job to add. The user can optionally specify a name for the + * job in [name][google.cloud.scheduler.v1.Job.name]. + * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * 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 location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * 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 job to add. The user can optionally specify a name for the + * job in [name][google.cloud.scheduler.v1.Job.name]. + * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Scheduler\V1\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The job to add. The user can optionally specify a name for the + * job in [name][google.cloud.scheduler.v1.Job.name]. + * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Scheduler\V1\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\Job::class); + $this->job = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php new file mode 100644 index 00000000000..1556a3f9938 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.scheduler.v1.DeleteJobRequest + */ +class DeleteJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see + * {@see CloudSchedulerClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\DeleteJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php new file mode 100644 index 00000000000..8663933090d --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.scheduler.v1.GetJobRequest + */ +class GetJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see + * {@see CloudSchedulerClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\GetJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php new file mode 100644 index 00000000000..3954ec47a8c --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php @@ -0,0 +1,96 @@ +google.cloud.scheduler.v1.HttpMethod + */ +class HttpMethod +{ + /** + * HTTP method unspecified. Defaults to POST. + * + * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; + */ + const HTTP_METHOD_UNSPECIFIED = 0; + /** + * HTTP POST + * + * Generated from protobuf enum POST = 1; + */ + const POST = 1; + /** + * HTTP GET + * + * Generated from protobuf enum GET = 2; + */ + const GET = 2; + /** + * HTTP HEAD + * + * Generated from protobuf enum HEAD = 3; + */ + const HEAD = 3; + /** + * HTTP PUT + * + * Generated from protobuf enum PUT = 4; + */ + const PUT = 4; + /** + * HTTP DELETE + * + * Generated from protobuf enum DELETE = 5; + */ + const DELETE = 5; + /** + * HTTP PATCH + * + * Generated from protobuf enum PATCH = 6; + */ + const PATCH = 6; + /** + * HTTP OPTIONS + * + * Generated from protobuf enum OPTIONS = 7; + */ + const OPTIONS = 7; + + private static $valueToName = [ + self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', + self::POST => 'POST', + self::GET => 'GET', + self::HEAD => 'HEAD', + self::PUT => 'PUT', + self::DELETE => 'DELETE', + self::PATCH => 'PATCH', + self::OPTIONS => 'OPTIONS', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php new file mode 100644 index 00000000000..34cea521913 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php @@ -0,0 +1,383 @@ +google.cloud.scheduler.v1.HttpTarget + */ +class HttpTarget extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full URI path that the request will be sent to. This string + * must begin with either "http://" or "https://". Some examples of + * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: + * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + /** + * Which HTTP method to use for the request. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * The user can specify HTTP request headers to send with the job's + * HTTP request. This map contains the header field names and + * values. Repeated headers are not supported, but a header value can + * contain commas. These headers represent a subset of the headers + * that will accompany the job's HTTP request. Some HTTP request + * headers will be ignored or replaced. A partial list of headers that + * will be ignored or replaced is below: + * - Host: This will be computed by Cloud Scheduler and derived from + * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. + * * `Content-Length`: This will be computed by Cloud Scheduler. + * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + * * `X-Google-*`: Google internal use only. + * * `X-AppEngine-*`: Google internal use only. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * The total size of headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * HTTP request body. A request body is allowed only if the HTTP + * method is POST, PUT, or PATCH. It is an error to set body on a job with an + * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + */ + protected $body = ''; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The full URI path that the request will be sent to. This string + * must begin with either "http://" or "https://". Some examples of + * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: + * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * @type int $http_method + * Which HTTP method to use for the request. + * @type array|\Google\Protobuf\Internal\MapField $headers + * The user can specify HTTP request headers to send with the job's + * HTTP request. This map contains the header field names and + * values. Repeated headers are not supported, but a header value can + * contain commas. These headers represent a subset of the headers + * that will accompany the job's HTTP request. Some HTTP request + * headers will be ignored or replaced. A partial list of headers that + * will be ignored or replaced is below: + * - Host: This will be computed by Cloud Scheduler and derived from + * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. + * * `Content-Length`: This will be computed by Cloud Scheduler. + * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + * * `X-Google-*`: Google internal use only. + * * `X-AppEngine-*`: Google internal use only. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * The total size of headers must be less than 80KB. + * @type string $body + * HTTP request body. A request body is allowed only if the HTTP + * method is POST, PUT, or PATCH. It is an error to set body on a job with an + * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * @type \Google\Cloud\Scheduler\V1\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Scheduler\V1\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full URI path that the request will be sent to. This string + * must begin with either "http://" or "https://". Some examples of + * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: + * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The full URI path that the request will be sent to. This string + * must begin with either "http://" or "https://". Some examples of + * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: + * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Which HTTP method to use for the request. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * Which HTTP method to use for the request. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * The user can specify HTTP request headers to send with the job's + * HTTP request. This map contains the header field names and + * values. Repeated headers are not supported, but a header value can + * contain commas. These headers represent a subset of the headers + * that will accompany the job's HTTP request. Some HTTP request + * headers will be ignored or replaced. A partial list of headers that + * will be ignored or replaced is below: + * - Host: This will be computed by Cloud Scheduler and derived from + * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. + * * `Content-Length`: This will be computed by Cloud Scheduler. + * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + * * `X-Google-*`: Google internal use only. + * * `X-AppEngine-*`: Google internal use only. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * The total size of headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * The user can specify HTTP request headers to send with the job's + * HTTP request. This map contains the header field names and + * values. Repeated headers are not supported, but a header value can + * contain commas. These headers represent a subset of the headers + * that will accompany the job's HTTP request. Some HTTP request + * headers will be ignored or replaced. A partial list of headers that + * will be ignored or replaced is below: + * - Host: This will be computed by Cloud Scheduler and derived from + * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. + * * `Content-Length`: This will be computed by Cloud Scheduler. + * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + * * `X-Google-*`: Google internal use only. + * * `X-AppEngine-*`: Google internal use only. + * * `X-CloudScheduler`: This header will be set to true. + * * `X-CloudScheduler-JobName`: This header will contain the job name. + * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + * the unix-cron format, this header will contain the job schedule as an + * offset of UTC parsed according to RFC3339. + * The total size of headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. A request body is allowed only if the HTTP + * method is POST, PUT, or PATCH. It is an error to set body on a job with an + * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. A request body is allowed only if the HTTP + * method is POST, PUT, or PATCH. It is an error to set body on a job with an + * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.scheduler.v1.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Scheduler\V1\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.scheduler.v1.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Scheduler\V1\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.scheduler.v1.OidcToken oidc_token = 6; + * @return \Google\Cloud\Scheduler\V1\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.scheduler.v1.OidcToken oidc_token = 6; + * @param \Google\Cloud\Scheduler\V1\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php new file mode 100644 index 00000000000..65d3652c794 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php @@ -0,0 +1,832 @@ +google.cloud.scheduler.v1.Job + */ +class Job extends \Google\Protobuf\Internal\Message +{ + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after + * which it becomes output only. + * The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the job's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * A human-readable description for the job. This string must not contain + * more than 500 characters. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Required, except when used with + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * Describes the schedule on which the job will be executed. + * The schedule can be either of the following types: + * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + * * English-like + * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + * As a general rule, execution `n + 1` of a job will not begin + * until execution `n` has finished. Cloud Scheduler will never + * allow two simultaneously outstanding executions. For example, + * this implies that if the `n+1`th execution is scheduled to run at + * 16:00 but the `n`th execution takes until 16:15, the `n+1`th + * execution will not start until `16:15`. + * A scheduled start time will be delayed if the previous + * execution has not ended when its scheduled time occurs. + * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and + * a job attempt fails, the job will be tried a total of + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, + * with exponential backoff, until the next scheduled start time. + * + * Generated from protobuf field string schedule = 20; + */ + protected $schedule = ''; + /** + * Specifies the time zone to be used in interpreting + * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field + * must be a time zone name from the [tz + * database](http://en.wikipedia.org/wiki/Tz_database). + * Note that some time zones include a provision for + * daylight savings time. The rules for daylight saving time are + * determined by the chosen tz. For UTC use the string "utc". If a + * time zone is not specified, the default will be in UTC (also known + * as GMT). + * + * Generated from protobuf field string time_zone = 21; + */ + protected $time_zone = ''; + /** + * Output only. The creation time of the job. + * + * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; + */ + protected $user_update_time = null; + /** + * Output only. State of the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; + */ + protected $state = 0; + /** + * Output only. The response from the target for the last attempted execution. + * + * Generated from protobuf field .google.rpc.Status status = 11; + */ + protected $status = null; + /** + * Output only. The next time the job is scheduled. Note that this may be a + * retry of a previously failed attempt or the next execution time + * according to the schedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; + */ + protected $schedule_time = null; + /** + * Output only. The time the last job attempt started. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; + */ + protected $last_attempt_time = null; + /** + * Settings that determine the retry behavior. + * + * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; + */ + protected $retry_config = null; + /** + * The deadline for job attempts. If the request handler does not respond by + * this deadline then the request is cancelled and the attempt is marked as a + * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + * execution logs. Cloud Scheduler will retry the job according + * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. + * The default and the allowed values depend on the type of target: + * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the + * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + * minutes]. + * * For [App Engine HTTP + * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + * that the request has the default deadline. The default deadline depends on + * the scaling type of the service: 10 minutes for standard apps with + * automatic scaling, 24 hours for standard apps with manual and basic + * scaling, and 60 minutes for flex apps. If the request deadline is set, it + * must be in the interval [15 seconds, 24 hours 15 seconds]. + * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + * field is ignored. + * + * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; + */ + protected $attempt_deadline = null; + protected $target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after + * which it becomes output only. + * The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the job's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * @type string $description + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * A human-readable description for the job. This string must not contain + * more than 500 characters. + * @type \Google\Cloud\Scheduler\V1\PubsubTarget $pubsub_target + * Pub/Sub target. + * @type \Google\Cloud\Scheduler\V1\AppEngineHttpTarget $app_engine_http_target + * App Engine HTTP target. + * @type \Google\Cloud\Scheduler\V1\HttpTarget $http_target + * HTTP target. + * @type string $schedule + * Required, except when used with + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * Describes the schedule on which the job will be executed. + * The schedule can be either of the following types: + * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + * * English-like + * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + * As a general rule, execution `n + 1` of a job will not begin + * until execution `n` has finished. Cloud Scheduler will never + * allow two simultaneously outstanding executions. For example, + * this implies that if the `n+1`th execution is scheduled to run at + * 16:00 but the `n`th execution takes until 16:15, the `n+1`th + * execution will not start until `16:15`. + * A scheduled start time will be delayed if the previous + * execution has not ended when its scheduled time occurs. + * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and + * a job attempt fails, the job will be tried a total of + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, + * with exponential backoff, until the next scheduled start time. + * @type string $time_zone + * Specifies the time zone to be used in interpreting + * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field + * must be a time zone name from the [tz + * database](http://en.wikipedia.org/wiki/Tz_database). + * Note that some time zones include a provision for + * daylight savings time. The rules for daylight saving time are + * determined by the chosen tz. For UTC use the string "utc". If a + * time zone is not specified, the default will be in UTC (also known + * as GMT). + * @type \Google\Protobuf\Timestamp $user_update_time + * Output only. The creation time of the job. + * @type int $state + * Output only. State of the job. + * @type \Google\Rpc\Status $status + * Output only. The response from the target for the last attempted execution. + * @type \Google\Protobuf\Timestamp $schedule_time + * Output only. The next time the job is scheduled. Note that this may be a + * retry of a previously failed attempt or the next execution time + * according to the schedule. + * @type \Google\Protobuf\Timestamp $last_attempt_time + * Output only. The time the last job attempt started. + * @type \Google\Cloud\Scheduler\V1\RetryConfig $retry_config + * Settings that determine the retry behavior. + * @type \Google\Protobuf\Duration $attempt_deadline + * The deadline for job attempts. If the request handler does not respond by + * this deadline then the request is cancelled and the attempt is marked as a + * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + * execution logs. Cloud Scheduler will retry the job according + * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. + * The default and the allowed values depend on the type of target: + * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the + * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + * minutes]. + * * For [App Engine HTTP + * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + * that the request has the default deadline. The default deadline depends on + * the scaling type of the service: 10 minutes for standard apps with + * automatic scaling, 24 hours for standard apps with manual and basic + * scaling, and 60 minutes for flex apps. If the request deadline is set, it + * must be in the interval [15 seconds, 24 hours 15 seconds]. + * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + * field is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after + * which it becomes output only. + * The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the job's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after + * which it becomes output only. + * The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the job's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * A human-readable description for the job. This string must not contain + * more than 500 characters. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optionally caller-specified in + * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * A human-readable description for the job. This string must not contain + * more than 500 characters. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Pub/Sub target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.PubsubTarget pubsub_target = 4; + * @return \Google\Cloud\Scheduler\V1\PubsubTarget|null + */ + public function getPubsubTarget() + { + return $this->readOneof(4); + } + + public function hasPubsubTarget() + { + return $this->hasOneof(4); + } + + /** + * Pub/Sub target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.PubsubTarget pubsub_target = 4; + * @param \Google\Cloud\Scheduler\V1\PubsubTarget $var + * @return $this + */ + public function setPubsubTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\PubsubTarget::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * App Engine HTTP target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineHttpTarget app_engine_http_target = 5; + * @return \Google\Cloud\Scheduler\V1\AppEngineHttpTarget|null + */ + public function getAppEngineHttpTarget() + { + return $this->readOneof(5); + } + + public function hasAppEngineHttpTarget() + { + return $this->hasOneof(5); + } + + /** + * App Engine HTTP target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineHttpTarget app_engine_http_target = 5; + * @param \Google\Cloud\Scheduler\V1\AppEngineHttpTarget $var + * @return $this + */ + public function setAppEngineHttpTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineHttpTarget::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * HTTP target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpTarget http_target = 6; + * @return \Google\Cloud\Scheduler\V1\HttpTarget|null + */ + public function getHttpTarget() + { + return $this->readOneof(6); + } + + public function hasHttpTarget() + { + return $this->hasOneof(6); + } + + /** + * HTTP target. + * + * Generated from protobuf field .google.cloud.scheduler.v1.HttpTarget http_target = 6; + * @param \Google\Cloud\Scheduler\V1\HttpTarget $var + * @return $this + */ + public function setHttpTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\HttpTarget::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required, except when used with + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * Describes the schedule on which the job will be executed. + * The schedule can be either of the following types: + * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + * * English-like + * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + * As a general rule, execution `n + 1` of a job will not begin + * until execution `n` has finished. Cloud Scheduler will never + * allow two simultaneously outstanding executions. For example, + * this implies that if the `n+1`th execution is scheduled to run at + * 16:00 but the `n`th execution takes until 16:15, the `n+1`th + * execution will not start until `16:15`. + * A scheduled start time will be delayed if the previous + * execution has not ended when its scheduled time occurs. + * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and + * a job attempt fails, the job will be tried a total of + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, + * with exponential backoff, until the next scheduled start time. + * + * Generated from protobuf field string schedule = 20; + * @return string + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Required, except when used with + * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. + * Describes the schedule on which the job will be executed. + * The schedule can be either of the following types: + * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + * * English-like + * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + * As a general rule, execution `n + 1` of a job will not begin + * until execution `n` has finished. Cloud Scheduler will never + * allow two simultaneously outstanding executions. For example, + * this implies that if the `n+1`th execution is scheduled to run at + * 16:00 but the `n`th execution takes until 16:15, the `n+1`th + * execution will not start until `16:15`. + * A scheduled start time will be delayed if the previous + * execution has not ended when its scheduled time occurs. + * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and + * a job attempt fails, the job will be tried a total of + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, + * with exponential backoff, until the next scheduled start time. + * + * Generated from protobuf field string schedule = 20; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + + /** + * Specifies the time zone to be used in interpreting + * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field + * must be a time zone name from the [tz + * database](http://en.wikipedia.org/wiki/Tz_database). + * Note that some time zones include a provision for + * daylight savings time. The rules for daylight saving time are + * determined by the chosen tz. For UTC use the string "utc". If a + * time zone is not specified, the default will be in UTC (also known + * as GMT). + * + * Generated from protobuf field string time_zone = 21; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Specifies the time zone to be used in interpreting + * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field + * must be a time zone name from the [tz + * database](http://en.wikipedia.org/wiki/Tz_database). + * Note that some time zones include a provision for + * daylight savings time. The rules for daylight saving time are + * determined by the chosen tz. For UTC use the string "utc". If a + * time zone is not specified, the default will be in UTC (also known + * as GMT). + * + * Generated from protobuf field string time_zone = 21; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Output only. The creation time of the job. + * + * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUserUpdateTime() + { + return $this->user_update_time; + } + + public function hasUserUpdateTime() + { + return isset($this->user_update_time); + } + + public function clearUserUpdateTime() + { + unset($this->user_update_time); + } + + /** + * Output only. The creation time of the job. + * + * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUserUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->user_update_time = $var; + + return $this; + } + + /** + * Output only. State of the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the job. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\Job\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The response from the target for the last attempted execution. + * + * Generated from protobuf field .google.rpc.Status status = 11; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. The response from the target for the last attempted execution. + * + * Generated from protobuf field .google.rpc.Status status = 11; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. The next time the job is scheduled. Note that this may be a + * retry of a previously failed attempt or the next execution time + * according to the schedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Output only. The next time the job is scheduled. Note that this may be a + * retry of a previously failed attempt or the next execution time + * according to the schedule. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time the last job attempt started. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastAttemptTime() + { + return $this->last_attempt_time; + } + + public function hasLastAttemptTime() + { + return isset($this->last_attempt_time); + } + + public function clearLastAttemptTime() + { + unset($this->last_attempt_time); + } + + /** + * Output only. The time the last job attempt started. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastAttemptTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_attempt_time = $var; + + return $this; + } + + /** + * Settings that determine the retry behavior. + * + * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; + * @return \Google\Cloud\Scheduler\V1\RetryConfig|null + */ + public function getRetryConfig() + { + return $this->retry_config; + } + + public function hasRetryConfig() + { + return isset($this->retry_config); + } + + public function clearRetryConfig() + { + unset($this->retry_config); + } + + /** + * Settings that determine the retry behavior. + * + * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; + * @param \Google\Cloud\Scheduler\V1\RetryConfig $var + * @return $this + */ + public function setRetryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\RetryConfig::class); + $this->retry_config = $var; + + return $this; + } + + /** + * The deadline for job attempts. If the request handler does not respond by + * this deadline then the request is cancelled and the attempt is marked as a + * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + * execution logs. Cloud Scheduler will retry the job according + * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. + * The default and the allowed values depend on the type of target: + * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the + * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + * minutes]. + * * For [App Engine HTTP + * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + * that the request has the default deadline. The default deadline depends on + * the scaling type of the service: 10 minutes for standard apps with + * automatic scaling, 24 hours for standard apps with manual and basic + * scaling, and 60 minutes for flex apps. If the request deadline is set, it + * must be in the interval [15 seconds, 24 hours 15 seconds]. + * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + * field is ignored. + * + * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; + * @return \Google\Protobuf\Duration|null + */ + public function getAttemptDeadline() + { + return $this->attempt_deadline; + } + + public function hasAttemptDeadline() + { + return isset($this->attempt_deadline); + } + + public function clearAttemptDeadline() + { + unset($this->attempt_deadline); + } + + /** + * The deadline for job attempts. If the request handler does not respond by + * this deadline then the request is cancelled and the attempt is marked as a + * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + * execution logs. Cloud Scheduler will retry the job according + * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. + * The default and the allowed values depend on the type of target: + * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the + * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + * minutes]. + * * For [App Engine HTTP + * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + * that the request has the default deadline. The default deadline depends on + * the scaling type of the service: 10 minutes for standard apps with + * automatic scaling, 24 hours for standard apps with manual and basic + * scaling, and 60 minutes for flex apps. If the request deadline is set, it + * must be in the interval [15 seconds, 24 hours 15 seconds]. + * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + * field is ignored. + * + * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setAttemptDeadline($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->attempt_deadline = $var; + + return $this; + } + + /** + * @return string + */ + public function getTarget() + { + return $this->whichOneof("target"); + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php new file mode 100644 index 00000000000..85a4de34afe --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php @@ -0,0 +1,85 @@ +google.cloud.scheduler.v1.Job.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The job is executing normally. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * The job is paused by the user. It will not execute. A user can + * intentionally pause the job using + * [PauseJobRequest][google.cloud.scheduler.v1.PauseJobRequest]. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + /** + * The job is disabled by the system due to error. The user + * cannot directly set a job to be disabled. + * + * Generated from protobuf enum DISABLED = 3; + */ + const DISABLED = 3; + /** + * The job state resulting from a failed + * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob] + * operation. To recover a job from this state, retry + * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob] + * until a successful response is received. + * + * Generated from protobuf enum UPDATE_FAILED = 4; + */ + const UPDATE_FAILED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::PAUSED => 'PAUSED', + self::DISABLED => 'DISABLED', + self::UPDATE_FAILED => 'UPDATE_FAILED', + ]; + + 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(State::class, \Google\Cloud\Scheduler\V1\Job_State::class); + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php new file mode 100644 index 00000000000..48a50cb4738 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php @@ -0,0 +1,207 @@ +google.cloud.scheduler.v1.ListJobsRequest + */ +class ListJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. + * The maximum page size is 500. If unspecified, the page size will + * be the maximum. Fewer jobs than requested might be returned, + * even if more jobs exist; use next_page_token to determine if more + * jobs exist. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server will return. To + * request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] + * returned from the previous call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an + * error to switch the value of + * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. Please see + * {@see CloudSchedulerClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\ListJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * @type int $page_size + * Requested page size. + * The maximum page size is 500. If unspecified, the page size will + * be the maximum. Fewer jobs than requested might be returned, + * even if more jobs exist; use next_page_token to determine if more + * jobs exist. + * @type string $page_token + * A token identifying a page of results the server will return. To + * request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] + * returned from the previous call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an + * error to switch the value of + * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + * iterating through pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * 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 location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * + * 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; + } + + /** + * Requested page size. + * The maximum page size is 500. If unspecified, the page size will + * be the maximum. Fewer jobs than requested might be returned, + * even if more jobs exist; use next_page_token to determine if more + * jobs exist. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * The maximum page size is 500. If unspecified, the page size will + * be the maximum. Fewer jobs than requested might be returned, + * even if more jobs exist; use next_page_token to determine if more + * jobs exist. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server will return. To + * request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] + * returned from the previous call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an + * error to switch the value of + * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server will return. To + * request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] + * returned from the previous call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an + * error to switch the value of + * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 6; + * @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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php new file mode 100644 index 00000000000..c79a062affb --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php @@ -0,0 +1,126 @@ +google.cloud.scheduler.v1.ListJobsResponse + */ +class ListJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of jobs. + * + * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; + */ + private $jobs; + /** + * A token to retrieve next page of results. Pass this value in the + * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in + * the subsequent call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve + * the next page of results. If this is empty it indicates that there are no + * more results through which to paginate. + * The page token is valid for only 2 hours. + * + * 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\Scheduler\V1\Job>|\Google\Protobuf\Internal\RepeatedField $jobs + * The list of jobs. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in the + * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in + * the subsequent call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve + * the next page of results. If this is empty it indicates that there are no + * more results through which to paginate. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * The list of jobs. + * + * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * The list of jobs. + * + * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; + * @param array<\Google\Cloud\Scheduler\V1\Job>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Scheduler\V1\Job::class); + $this->jobs = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in the + * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in + * the subsequent call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve + * the next page of results. If this is empty it indicates that there are no + * more results through which to paginate. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. Pass this value in the + * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in + * the subsequent call to + * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve + * the next page of results. If this is empty it indicates that there are no + * more results through which to paginate. + * The page token is valid for only 2 hours. + * + * 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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php new file mode 100644 index 00000000000..cc63531bac2 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php @@ -0,0 +1,124 @@ +google.cloud.scheduler.v1.OAuthToken + */ +class OAuthToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + */ + protected $scope = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * @type string $scope + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php new file mode 100644 index 00000000000..b1359b688f9 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php @@ -0,0 +1,122 @@ +google.cloud.scheduler.v1.OidcToken + */ +class OidcToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + */ + protected $audience = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * @type string $audience + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the job. The caller + * must have iam.serviceAccounts.actAs permission for the service account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @return string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @param string $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkString($var, True); + $this->audience = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php new file mode 100644 index 00000000000..f91e74580f7 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.scheduler.v1.PauseJobRequest + */ +class PauseJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see + * {@see CloudSchedulerClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\PauseJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php new file mode 100644 index 00000000000..e8413612185 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php @@ -0,0 +1,172 @@ +google.cloud.scheduler.v1.PubsubTarget + */ +class PubsubTarget extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Cloud Pub/Sub topic to which messages will + * be published when a job is delivered. The topic name must be in the + * same format as required by Pub/Sub's + * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + * for example `projects/PROJECT_ID/topics/TOPIC_ID`. + * The topic must be in the same project as the Cloud Scheduler job. + * + * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { + */ + protected $topic_name = ''; + /** + * The message payload for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field bytes data = 3; + */ + protected $data = ''; + /** + * Attributes for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field map attributes = 4; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic_name + * Required. The name of the Cloud Pub/Sub topic to which messages will + * be published when a job is delivered. The topic name must be in the + * same format as required by Pub/Sub's + * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + * for example `projects/PROJECT_ID/topics/TOPIC_ID`. + * The topic must be in the same project as the Cloud Scheduler job. + * @type string $data + * The message payload for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Attributes for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Cloud Pub/Sub topic to which messages will + * be published when a job is delivered. The topic name must be in the + * same format as required by Pub/Sub's + * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + * for example `projects/PROJECT_ID/topics/TOPIC_ID`. + * The topic must be in the same project as the Cloud Scheduler job. + * + * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTopicName() + { + return $this->topic_name; + } + + /** + * Required. The name of the Cloud Pub/Sub topic to which messages will + * be published when a job is delivered. The topic name must be in the + * same format as required by Pub/Sub's + * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + * for example `projects/PROJECT_ID/topics/TOPIC_ID`. + * The topic must be in the same project as the Cloud Scheduler job. + * + * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTopicName($var) + { + GPBUtil::checkString($var, True); + $this->topic_name = $var; + + return $this; + } + + /** + * The message payload for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field bytes data = 3; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * The message payload for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field bytes data = 3; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Attributes for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field map attributes = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Attributes for PubsubMessage. + * Pubsub message must contain either non-empty data, or at least one + * attribute. + * + * Generated from protobuf field map attributes = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php new file mode 100644 index 00000000000..d97de2ae4dc --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.scheduler.v1.ResumeJobRequest + */ +class ResumeJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see + * {@see CloudSchedulerClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\ResumeJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php new file mode 100644 index 00000000000..d47986872f8 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php @@ -0,0 +1,397 @@ +google.cloud.scheduler.v1.RetryConfig + */ +class RetryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of attempts that the system will make to run a job using the + * exponential backoff procedure described by + * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. + * The default value of retry_count is zero. + * If retry_count is zero, a job attempt will *not* be retried if + * it fails. Instead the Cloud Scheduler system will wait for the + * next scheduled execution time. + * If retry_count is set to a non-zero number then Cloud Scheduler + * will retry failed attempts, using exponential backoff, + * retry_count times, or until the next scheduled execution time, + * whichever comes first. + * Values greater than 5 and negative values are not allowed. + * + * Generated from protobuf field int32 retry_count = 1; + */ + protected $retry_count = 0; + /** + * The time limit for retrying a failed job, measured from time when an + * execution was first attempted. If specified with + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job + * will be retried until both limits are reached. + * The default value for max_retry_duration is zero, which means retry + * duration is unlimited. + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + */ + protected $max_retry_duration = null; + /** + * The minimum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; + */ + protected $min_backoff_duration = null; + /** + * The maximum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; + */ + protected $max_backoff_duration = null; + /** + * The time between retries will double `max_doublings` times. + * A job's retry interval starts at + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], + * then doubles `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] + * times. + * For example, if + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] + * is 10s, + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * is 300s, and `max_doublings` is 3, then the a job will first be retried in + * 10s. The retry interval will double three times, and then increase linearly + * by 2^3 * 10s. Finally, the job will retry at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * until the job has been attempted + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * The default value of this field is 5. + * + * Generated from protobuf field int32 max_doublings = 5; + */ + protected $max_doublings = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $retry_count + * The number of attempts that the system will make to run a job using the + * exponential backoff procedure described by + * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. + * The default value of retry_count is zero. + * If retry_count is zero, a job attempt will *not* be retried if + * it fails. Instead the Cloud Scheduler system will wait for the + * next scheduled execution time. + * If retry_count is set to a non-zero number then Cloud Scheduler + * will retry failed attempts, using exponential backoff, + * retry_count times, or until the next scheduled execution time, + * whichever comes first. + * Values greater than 5 and negative values are not allowed. + * @type \Google\Protobuf\Duration $max_retry_duration + * The time limit for retrying a failed job, measured from time when an + * execution was first attempted. If specified with + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job + * will be retried until both limits are reached. + * The default value for max_retry_duration is zero, which means retry + * duration is unlimited. + * @type \Google\Protobuf\Duration $min_backoff_duration + * The minimum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 5 seconds. + * @type \Google\Protobuf\Duration $max_backoff_duration + * The maximum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 1 hour. + * @type int $max_doublings + * The time between retries will double `max_doublings` times. + * A job's retry interval starts at + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], + * then doubles `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] + * times. + * For example, if + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] + * is 10s, + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * is 300s, and `max_doublings` is 3, then the a job will first be retried in + * 10s. The retry interval will double three times, and then increase linearly + * by 2^3 * 10s. Finally, the job will retry at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * until the job has been attempted + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * The default value of this field is 5. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The number of attempts that the system will make to run a job using the + * exponential backoff procedure described by + * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. + * The default value of retry_count is zero. + * If retry_count is zero, a job attempt will *not* be retried if + * it fails. Instead the Cloud Scheduler system will wait for the + * next scheduled execution time. + * If retry_count is set to a non-zero number then Cloud Scheduler + * will retry failed attempts, using exponential backoff, + * retry_count times, or until the next scheduled execution time, + * whichever comes first. + * Values greater than 5 and negative values are not allowed. + * + * Generated from protobuf field int32 retry_count = 1; + * @return int + */ + public function getRetryCount() + { + return $this->retry_count; + } + + /** + * The number of attempts that the system will make to run a job using the + * exponential backoff procedure described by + * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. + * The default value of retry_count is zero. + * If retry_count is zero, a job attempt will *not* be retried if + * it fails. Instead the Cloud Scheduler system will wait for the + * next scheduled execution time. + * If retry_count is set to a non-zero number then Cloud Scheduler + * will retry failed attempts, using exponential backoff, + * retry_count times, or until the next scheduled execution time, + * whichever comes first. + * Values greater than 5 and negative values are not allowed. + * + * Generated from protobuf field int32 retry_count = 1; + * @param int $var + * @return $this + */ + public function setRetryCount($var) + { + GPBUtil::checkInt32($var); + $this->retry_count = $var; + + return $this; + } + + /** + * The time limit for retrying a failed job, measured from time when an + * execution was first attempted. If specified with + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job + * will be retried until both limits are reached. + * The default value for max_retry_duration is zero, which means retry + * duration is unlimited. + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRetryDuration() + { + return $this->max_retry_duration; + } + + public function hasMaxRetryDuration() + { + return isset($this->max_retry_duration); + } + + public function clearMaxRetryDuration() + { + unset($this->max_retry_duration); + } + + /** + * The time limit for retrying a failed job, measured from time when an + * execution was first attempted. If specified with + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job + * will be retried until both limits are reached. + * The default value for max_retry_duration is zero, which means retry + * duration is unlimited. + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRetryDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_retry_duration = $var; + + return $this; + } + + /** + * The minimum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBackoffDuration() + { + return $this->min_backoff_duration; + } + + public function hasMinBackoffDuration() + { + return isset($this->min_backoff_duration); + } + + public function clearMinBackoffDuration() + { + unset($this->min_backoff_duration); + } + + /** + * The minimum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBackoffDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_backoff_duration = $var; + + return $this; + } + + /** + * The maximum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxBackoffDuration() + { + return $this->max_backoff_duration; + } + + public function hasMaxBackoffDuration() + { + return isset($this->max_backoff_duration); + } + + public function clearMaxBackoffDuration() + { + unset($this->max_backoff_duration); + } + + /** + * The maximum amount of time to wait before retrying a job after + * it fails. + * The default value of this field is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxBackoffDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_backoff_duration = $var; + + return $this; + } + + /** + * The time between retries will double `max_doublings` times. + * A job's retry interval starts at + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], + * then doubles `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] + * times. + * For example, if + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] + * is 10s, + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * is 300s, and `max_doublings` is 3, then the a job will first be retried in + * 10s. The retry interval will double three times, and then increase linearly + * by 2^3 * 10s. Finally, the job will retry at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * until the job has been attempted + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * The default value of this field is 5. + * + * Generated from protobuf field int32 max_doublings = 5; + * @return int + */ + public function getMaxDoublings() + { + return $this->max_doublings; + } + + /** + * The time between retries will double `max_doublings` times. + * A job's retry interval starts at + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], + * then doubles `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] + * times. + * For example, if + * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] + * is 10s, + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * is 300s, and `max_doublings` is 3, then the a job will first be retried in + * 10s. The retry interval will double three times, and then increase linearly + * by 2^3 * 10s. Finally, the job will retry at intervals of + * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] + * until the job has been attempted + * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * The default value of this field is 5. + * + * Generated from protobuf field int32 max_doublings = 5; + * @param int $var + * @return $this + */ + public function setMaxDoublings($var) + { + GPBUtil::checkInt32($var); + $this->max_doublings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php new file mode 100644 index 00000000000..7bba62951ed --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.scheduler.v1.RunJobRequest + */ +class RunJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see + * {@see CloudSchedulerClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Scheduler\V1\RunJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php new file mode 100644 index 00000000000..d0030ac59c0 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php @@ -0,0 +1,153 @@ +google.cloud.scheduler.v1.UpdateJobRequest + */ +class UpdateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new job properties. + * [name][google.cloud.scheduler.v1.Job.name] must be specified. + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * A mask used to specify which fields of the job are being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Scheduler\V1\Job $job Required. The new job properties. + * [name][google.cloud.scheduler.v1.Job.name] must be specified. + * + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * @param \Google\Protobuf\FieldMask $updateMask A mask used to specify which fields of the job are being updated. + * + * @return \Google\Cloud\Scheduler\V1\UpdateJobRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Scheduler\V1\Job $job, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setJob($job) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Scheduler\V1\Job $job + * Required. The new job properties. + * [name][google.cloud.scheduler.v1.Job.name] must be specified. + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * @type \Google\Protobuf\FieldMask $update_mask + * A mask used to specify which fields of the job are being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new job properties. + * [name][google.cloud.scheduler.v1.Job.name] must be specified. + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Scheduler\V1\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The new job properties. + * [name][google.cloud.scheduler.v1.Job.name] must be specified. + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * + * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Scheduler\V1\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\Job::class); + $this->job = $var; + + return $this; + } + + /** + * A mask used to specify which fields of the job are being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * A mask used to specify which fields of the job are being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php new file mode 100644 index 00000000000..cd823779753 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setJob($job); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->createJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudSchedulerClient::locationName('[PROJECT]', '[LOCATION]'); + + create_job_sample($formattedParent); +} +// [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php new file mode 100644 index 00000000000..61cad929479 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $cloudSchedulerClient->deleteJob($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + delete_job_sample($formattedName); +} +// [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php new file mode 100644 index 00000000000..7280e6b715b --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->getJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_job_sample($formattedName); +} +// [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php new file mode 100644 index 00000000000..6ad5dccb6a8 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudscheduler_v1_generated_CloudScheduler_GetLocation_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php new file mode 100644 index 00000000000..302f847f3ae --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudSchedulerClient->listJobs($request); + + /** @var Job $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudSchedulerClient::locationName('[PROJECT]', '[LOCATION]'); + + list_jobs_sample($formattedParent); +} +// [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php new file mode 100644 index 00000000000..4a8887666ed --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudscheduler_v1_generated_CloudScheduler_ListLocations_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php new file mode 100644 index 00000000000..0b0b9dfeefd --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->pauseJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + pause_job_sample($formattedName); +} +// [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php new file mode 100644 index 00000000000..3590328c285 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->resumeJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + resume_job_sample($formattedName); +} +// [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php new file mode 100644 index 00000000000..bd8e0fe5912 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->runJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + run_job_sample($formattedName); +} +// [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php new file mode 100644 index 00000000000..dafd14d2d59 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php @@ -0,0 +1,71 @@ +setJob($job) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $cloudSchedulerClient->updateJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php b/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php new file mode 100644 index 00000000000..f7c4dfa8126 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php @@ -0,0 +1,561 @@ + createJobAsync(CreateJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) + * @method PromiseInterface pauseJobAsync(PauseJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeJobAsync(ResumeJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface runJobAsync(RunJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateJobAsync(UpdateJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class CloudSchedulerClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.scheduler.v1.CloudScheduler'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudscheduler.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudscheduler.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_scheduler_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_scheduler_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_scheduler_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_scheduler_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a topic + * resource. + * + * @param string $project + * @param string $topic + * + * @return string The formatted topic resource. + */ + public static function topicName(string $project, string $topic): string + { + return self::getPathTemplate('topic')->render([ + 'project' => $project, + 'topic' => $topic, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - job: projects/{project}/locations/{location}/jobs/{job} + * - location: projects/{project}/locations/{location} + * - topic: projects/{project}/topics/{topic} + * + * 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. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudscheduler.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 + * $apiEndpoint 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a job. + * + * The async variant is {@see CloudSchedulerClient::createJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/create_job.php + * + * @param CreateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function createJob(CreateJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); + } + + /** + * Deletes a job. + * + * The async variant is {@see CloudSchedulerClient::deleteJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/delete_job.php + * + * @param DeleteJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Thrown if the API call fails. + */ + public function deleteJob(DeleteJobRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); + } + + /** + * Gets a job. + * + * The async variant is {@see CloudSchedulerClient::getJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/get_job.php + * + * @param GetJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function getJob(GetJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('GetJob', $request, $callOptions)->wait(); + } + + /** + * Lists jobs. + * + * The async variant is {@see CloudSchedulerClient::listJobsAsync()} . + * + * @example samples/V1/CloudSchedulerClient/list_jobs.php + * + * @param ListJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListJobs', $request, $callOptions); + } + + /** + * Pauses a job. + * + * If a job is paused then the system will stop executing the job + * until it is re-enabled via + * [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state + * of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if + * paused it will be set to + * [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must + * be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to + * be paused. + * + * The async variant is {@see CloudSchedulerClient::pauseJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/pause_job.php + * + * @param PauseJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function pauseJob(PauseJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('PauseJob', $request, $callOptions)->wait(); + } + + /** + * Resume a job. + * + * This method reenables a job after it has been + * [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state + * of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; + * after calling this method it will be set to + * [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job + * must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] + * to be resumed. + * + * The async variant is {@see CloudSchedulerClient::resumeJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/resume_job.php + * + * @param ResumeJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeJob(ResumeJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('ResumeJob', $request, $callOptions)->wait(); + } + + /** + * Forces a job to run now. + * + * When this method is called, Cloud Scheduler will dispatch the job, even + * if the job is already running. + * + * The async variant is {@see CloudSchedulerClient::runJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/run_job.php + * + * @param RunJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function runJob(RunJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('RunJob', $request, $callOptions)->wait(); + } + + /** + * Updates a job. + * + * If successful, the updated [Job][google.cloud.scheduler.v1.Job] is + * returned. If the job does not exist, `NOT_FOUND` is returned. + * + * If UpdateJob does not successfully return, it is possible for the + * job to be in an + * [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] + * state. A job in this state may not be executed. If this happens, retry the + * UpdateJob request until a successful response is received. + * + * The async variant is {@see CloudSchedulerClient::updateJobAsync()} . + * + * @example samples/V1/CloudSchedulerClient/update_job.php + * + * @param UpdateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateJob(UpdateJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('UpdateJob', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see CloudSchedulerClient::getLocationAsync()} . + * + * @example samples/V1/CloudSchedulerClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see CloudSchedulerClient::listLocationsAsync()} . + * + * @example samples/V1/CloudSchedulerClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..bcd45c81af7 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.scheduler.v1", + "libraryPackage": "Google\\Cloud\\Scheduler\\V1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "CloudSchedulerGapicClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs" + ] + }, + "PauseJob": { + "methods": [ + "pauseJob" + ] + }, + "ResumeJob": { + "methods": [ + "resumeJob" + ] + }, + "RunJob": { + "methods": [ + "runJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json new file mode 100644 index 00000000000..466c38cf596 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json @@ -0,0 +1,95 @@ +{ + "interfaces": { + "google.cloud.scheduler.v1.CloudScheduler": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteJob": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetJob": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListJobs": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseJob": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeJob": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunJob": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateJob": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php new file mode 100644 index 00000000000..0306dcf2405 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.scheduler.v1.CloudScheduler' => [ + 'CreateJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\ListJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PauseJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResumeJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RunJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Scheduler\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'job.name', + 'fieldAccessors' => [ + 'getJob', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + 'location' => 'projects/{project}/locations/{location}', + 'topic' => 'projects/{project}/topics/{topic}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php new file mode 100644 index 00000000000..5f7e537c2c4 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php @@ -0,0 +1,150 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.scheduler.v1.CloudScheduler' => [ + 'CreateJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'body' => 'job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RunJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateJob' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{job.name=projects/*/locations/*/jobs/*}', + 'body' => 'job', + 'placeholders' => [ + 'job.name' => [ + 'getters' => [ + 'getJob', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php b/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php new file mode 100644 index 00000000000..97eb440cac7 --- /dev/null +++ b/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php @@ -0,0 +1,804 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudSchedulerClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudSchedulerClient($options); + } + + /** @test */ + public function createJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + $response = $gapicClient->createJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/CreateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createJobExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + try { + $gapicClient->createJob($request); + // 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 deleteJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + $gapicClient->deleteJob($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/DeleteJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteJob($request); + // 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 getJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + $response = $gapicClient->getJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/GetJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + try { + $gapicClient->getJob($request); + // 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 listJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $jobsElement = new Job(); + $jobs = [ + $jobsElement, + ]; + $expectedResponse = new ListJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setJobs($jobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/ListJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listJobs($request); + // 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 pauseJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new PauseJobRequest()) + ->setName($formattedName); + $response = $gapicClient->pauseJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/PauseJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new PauseJobRequest()) + ->setName($formattedName); + try { + $gapicClient->pauseJob($request); + // 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 resumeJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ResumeJobRequest()) + ->setName($formattedName); + $response = $gapicClient->resumeJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/ResumeJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ResumeJobRequest()) + ->setName($formattedName); + try { + $gapicClient->resumeJob($request); + // 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 runJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + $response = $gapicClient->runJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/RunJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runJobExceptionTest() + { + $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + try { + $gapicClient->runJob($request); + // 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 updateJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $job = new Job(); + $updateMask = new FieldMask(); + $request = (new UpdateJobRequest()) + ->setJob($job) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/UpdateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateJobExceptionTest() + { + $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 + $job = new Job(); + $updateMask = new FieldMask(); + $request = (new UpdateJobRequest()) + ->setJob($job) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateJob($request); + // 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createJobAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $schedule = 'schedule-697920873'; + $timeZone = 'timeZone36848094'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setTimeZone($timeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + $response = $gapicClient->createJobAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/CreateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} From 561badcd6cd9c31895711e6292f68e693a941b13 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 10 Dec 2024 21:07:55 +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 --- .../src/V1/Client/ParallelstoreClient.php | 10 +- .../src/V1beta/Client/ParallelstoreClient.php | 10 +- .../src/V1/Client/SimulatorClient.php | 10 +- .../src/V1/Client/IamCheckerClient.php | 4 + .../V3/Client/PolicyTroubleshooterClient.php | 4 + .../V1beta1/Client/PrivateCatalogClient.php | 4 + .../Client/PrivilegedAccessManagerClient.php | 10 +- .../src/V2/Client/ExportServiceClient.php | 10 +- .../src/V2/Client/ProfilerServiceClient.php | 10 +- PubSub/src/V1/Client/PublisherClient.php | 10 +- PubSub/src/V1/Client/SchemaServiceClient.php | 10 +- PubSub/src/V1/Client/SubscriberClient.php | 10 +- Quotas/src/V1/Client/CloudQuotasClient.php | 10 +- .../Client/RapidMigrationAssessmentClient.php | 10 +- .../RecaptchaEnterpriseServiceClient.php | 10 +- .../V1beta1/Client/CatalogServiceClient.php | 10 +- .../Client/PredictionApiKeyRegistryClient.php | 10 +- .../Client/PredictionServiceClient.php | 10 +- .../V1beta1/Client/UserEventServiceClient.php | 10 +- .../src/V1/Client/RecommenderClient.php | 10 +- Redis/src/V1/Client/CloudRedisClient.php | 10 +- .../src/V1/Client/CloudRedisClusterClient.php | 10 +- .../src/V3/Client/FoldersClient.php | 10 +- .../src/V3/Client/OrganizationsClient.php | 10 +- .../src/V3/Client/ProjectsClient.php | 10 +- .../src/V3/Client/TagBindingsClient.php | 10 +- .../src/V3/Client/TagHoldsClient.php | 10 +- .../src/V3/Client/TagKeysClient.php | 10 +- .../src/V3/Client/TagValuesClient.php | 10 +- .../Client/ResourceSettingsServiceClient.php | 10 +- .../src/V2/Client/AnalyticsServiceClient.php | 4 + Retail/src/V2/Client/CatalogServiceClient.php | 10 +- .../src/V2/Client/CompletionServiceClient.php | 10 +- Retail/src/V2/Client/ControlServiceClient.php | 10 +- .../GenerativeQuestionServiceClient.php | 10 +- Retail/src/V2/Client/ModelServiceClient.php | 10 +- .../src/V2/Client/PredictionServiceClient.php | 10 +- Retail/src/V2/Client/ProductServiceClient.php | 10 +- Retail/src/V2/Client/SearchServiceClient.php | 10 +- .../V2/Client/ServingConfigServiceClient.php | 10 +- .../src/V2/Client/UserEventServiceClient.php | 10 +- Run/src/V2/Client/BuildsClient.php | 10 +- Run/src/V2/Client/ExecutionsClient.php | 10 +- Run/src/V2/Client/JobsClient.php | 10 +- Run/src/V2/Client/RevisionsClient.php | 10 +- Run/src/V2/Client/ServicesClient.php | 10 +- Run/src/V2/Client/TasksClient.php | 10 +- .../src/V1/Client/CloudSchedulerClient.php | 10 +- .../Cloud/Parallelstore/V1/Parallelstore.php | Bin 8431 -> 0 bytes .../V1/CreateInstanceRequest.php | 273 -- .../V1/DeleteInstanceRequest.php | 155 - .../Parallelstore/V1/DestinationGcsBucket.php | 75 - .../V1/DestinationParallelstore.php | 71 - .../Parallelstore/V1/DirectoryStripeLevel.php | 68 - .../Parallelstore/V1/ExportDataMetadata.php | 351 --- .../Parallelstore/V1/ExportDataRequest.php | 287 -- .../Parallelstore/V1/ExportDataResponse.php | 33 - .../Parallelstore/V1/FileStripeLevel.php | 68 - .../Parallelstore/V1/GetInstanceRequest.php | 86 - .../Parallelstore/V1/ImportDataMetadata.php | 351 --- .../Parallelstore/V1/ImportDataRequest.php | 287 -- .../Parallelstore/V1/ImportDataResponse.php | 33 - .../Cloud/Parallelstore/V1/Instance.php | 625 ---- .../Cloud/Parallelstore/V1/Instance/State.php | 85 - .../Parallelstore/V1/ListInstancesRequest.php | 237 -- .../V1/ListInstancesResponse.php | 136 - .../Parallelstore/V1/OperationMetadata.php | 307 -- .../Parallelstore/V1/SourceGcsBucket.php | 75 - .../Parallelstore/V1/SourceParallelstore.php | 71 - .../Parallelstore/V1/TransferCounters.php | 261 -- .../V1/TransferOperationMetadata.php | 261 -- .../Cloud/Parallelstore/V1/TransferType.php | 61 - .../V1/UpdateInstanceRequest.php | 225 -- .../ParallelstoreClient/create_instance.php | 104 - .../ParallelstoreClient/delete_instance.php | 80 - .../V1/ParallelstoreClient/export_data.php | 83 - .../V1/ParallelstoreClient/get_instance.php | 72 - .../V1/ParallelstoreClient/get_location.php | 57 - .../V1/ParallelstoreClient/import_data.php | 83 - .../V1/ParallelstoreClient/list_instances.php | 80 - .../V1/ParallelstoreClient/list_locations.php | 62 - .../ParallelstoreClient/update_instance.php | 89 - .../v1/src/V1/Client/ParallelstoreClient.php | 611 ---- .../v1/src/V1/gapic_metadata.json | 63 - .../parallelstore_client_config.json | 67 - .../parallelstore_descriptor_config.php | 197 -- .../parallelstore_rest_client_config.php | 188 -- .../V1/Client/ParallelstoreClientTest.php | 1100 -------- .../Parallelstore/V1Beta/Parallelstore.php | Bin 8766 -> 0 bytes .../V1beta/CreateInstanceRequest.php | 273 -- .../V1beta/DeleteInstanceRequest.php | 155 - .../Parallelstore/V1beta/DeploymentType.php | 62 - .../V1beta/DestinationGcsBucket.php | 75 - .../V1beta/DestinationParallelstore.php | 71 - .../V1beta/DirectoryStripeLevel.php | 68 - .../V1beta/ExportDataMetadata.php | 351 --- .../V1beta/ExportDataRequest.php | 287 -- .../V1beta/ExportDataResponse.php | 33 - .../Parallelstore/V1beta/FileStripeLevel.php | 68 - .../V1beta/GetInstanceRequest.php | 86 - .../V1beta/ImportDataMetadata.php | 351 --- .../V1beta/ImportDataRequest.php | 287 -- .../V1beta/ImportDataResponse.php | 33 - .../Cloud/Parallelstore/V1beta/Instance.php | 667 ----- .../Parallelstore/V1beta/Instance/State.php | 85 - .../V1beta/ListInstancesRequest.php | 237 -- .../V1beta/ListInstancesResponse.php | 136 - .../V1beta/OperationMetadata.php | 307 -- .../Parallelstore/V1beta/SourceGcsBucket.php | 75 - .../V1beta/SourceParallelstore.php | 71 - .../Parallelstore/V1beta/TransferCounters.php | 261 -- .../V1beta/TransferOperationMetadata.php | 261 -- .../Parallelstore/V1beta/TransferType.php | 61 - .../V1beta/UpdateInstanceRequest.php | 225 -- .../ParallelstoreClient/create_instance.php | 104 - .../ParallelstoreClient/delete_instance.php | 80 - .../ParallelstoreClient/export_data.php | 83 - .../ParallelstoreClient/get_instance.php | 72 - .../ParallelstoreClient/get_location.php | 57 - .../ParallelstoreClient/import_data.php | 83 - .../ParallelstoreClient/list_instances.php | 80 - .../ParallelstoreClient/list_locations.php | 62 - .../ParallelstoreClient/update_instance.php | 89 - .../src/V1beta/Client/ParallelstoreClient.php | 651 ----- .../v1beta/src/V1beta/gapic_metadata.json | 63 - .../parallelstore_client_config.json | 67 - .../parallelstore_descriptor_config.php | 197 -- .../parallelstore_rest_client_config.php | 187 -- .../V1beta/Client/ParallelstoreClientTest.php | 1100 -------- .../Cloud/Policysimulator/V1/Explanations.php | Bin 2854 -> 0 bytes .../Cloud/Policysimulator/V1/Simulator.php | Bin 5717 -> 0 bytes .../Cloud/PolicySimulator/V1/AccessState.php | 78 - .../PolicySimulator/V1/AccessStateDiff.php | 181 -- .../V1/AccessStateDiff/AccessChangeType.php | 109 - .../Cloud/PolicySimulator/V1/AccessTuple.php | 187 -- .../PolicySimulator/V1/BindingExplanation.php | 398 --- .../AnnotatedMembership.php | 108 - .../V1/BindingExplanation/Membership.php | 86 - .../V1/BindingExplanation/RolePermission.php | 73 - .../V1/CreateReplayRequest.php | 148 - .../PolicySimulator/V1/ExplainedAccess.php | 170 -- .../PolicySimulator/V1/ExplainedPolicy.php | 306 -- .../PolicySimulator/V1/GetReplayRequest.php | 114 - .../PolicySimulator/V1/HeuristicRelevance.php | 65 - .../V1/ListReplayResultsRequest.php | 204 -- .../V1/ListReplayResultsResponse.php | 110 - .../Cloud/PolicySimulator/V1/Replay.php | 213 -- .../V1/Replay/ResultsSummary.php | 268 -- .../Cloud/PolicySimulator/V1/Replay/State.php | 78 - .../Cloud/PolicySimulator/V1/ReplayConfig.php | 146 - .../V1/ReplayConfig/LogSource.php | 62 - .../Cloud/PolicySimulator/V1/ReplayDiff.php | 96 - .../V1/ReplayOperationMetadata.php | 77 - .../Cloud/PolicySimulator/V1/ReplayResult.php | 317 --- .../V1/SimulatorClient/create_replay.php | 92 - .../samples/V1/SimulatorClient/get_replay.php | 80 - .../SimulatorClient/list_replay_results.php | 83 - .../v1/src/V1/Client/SimulatorClient.php | 428 --- .../v1/src/V1/gapic_metadata.json | 33 - .../V1/resources/simulator_client_config.json | 59 - .../resources/simulator_descriptor_config.php | 85 - .../simulator_rest_client_config.php | 147 - .../Unit/V1/Client/SimulatorClientTest.php | 412 --- .../Cloud/Policytroubleshooter/V1/Checker.php | Bin 1904 -> 0 bytes .../Policytroubleshooter/V1/Explanations.php | Bin 2901 -> 0 bytes .../PolicyTroubleshooter/V1/AccessState.php | 77 - .../PolicyTroubleshooter/V1/AccessTuple.php | 187 -- .../V1/BindingExplanation.php | 398 --- .../AnnotatedMembership.php | 108 - .../V1/BindingExplanation/Membership.php | 84 - .../V1/BindingExplanation/RolePermission.php | 71 - .../V1/ExplainedPolicy.php | 290 -- .../V1/HeuristicRelevance.php | 65 - .../V1/TroubleshootIamPolicyRequest.php | 82 - .../V1/TroubleshootIamPolicyResponse.php | 168 -- .../troubleshoot_iam_policy.php | 59 - .../v1/src/V1/Client/IamCheckerClient.php | 197 -- .../v1/src/V1/gapic_metadata.json | 23 - .../resources/iam_checker_client_config.json | 50 - .../iam_checker_descriptor_config.php | 32 - .../iam_checker_rest_client_config.php | 34 - .../Unit/V1/Client/IamCheckerClientTest.php | 138 - .../Iam/V3/Troubleshooter.php | Bin 10091 -> 0 bytes .../Iam/V3/AccessTuple.php | 281 -- .../Iam/V3/AllowAccessState.php | 79 - .../Iam/V3/AllowBindingExplanation.php | 486 ---- .../AnnotatedAllowMembership.php | 108 - .../Iam/V3/AllowPolicyExplanation.php | 168 -- .../Iam/V3/ConditionContext.php | 220 -- .../Iam/V3/ConditionContext/EffectiveTag.php | 292 -- .../Iam/V3/ConditionContext/Peer.php | 107 - .../Iam/V3/ConditionContext/Request.php | 86 - .../Iam/V3/ConditionContext/Resource.php | 184 -- .../Iam/V3/ConditionExplanation.php | 153 - .../ConditionExplanation/EvaluationState.php | 194 -- .../Iam/V3/DenyAccessState.php | 79 - .../Iam/V3/DenyPolicyExplanation.php | 218 -- .../Iam/V3/DenyRuleExplanation.php | 630 ----- .../AnnotatedDenyPrincipalMatching.php | 114 - .../AnnotatedPermissionMatching.php | 113 - .../Iam/V3/ExplainedAllowPolicy.php | 294 -- .../Iam/V3/ExplainedDenyPolicy.php | 240 -- .../Iam/V3/ExplainedDenyResource.php | 238 -- .../Iam/V3/HeuristicRelevance.php | 64 - .../Iam/V3/MembershipMatchingState.php | 83 - .../Iam/V3/PermissionPatternMatchingState.php | 61 - .../Iam/V3/RolePermissionInclusionState.php | 68 - .../Iam/V3/TroubleshootIamPolicyRequest.php | 82 - .../Iam/V3/TroubleshootIamPolicyResponse.php | 220 -- .../OverallAccessState.php | 81 - .../troubleshoot_iam_policy.php | 59 - .../V3/Client/PolicyTroubleshooterClient.php | 198 -- .../v3/src/V3/gapic_metadata.json | 23 - .../policy_troubleshooter_client_config.json | 39 - ...olicy_troubleshooter_descriptor_config.php | 32 - ...licy_troubleshooter_rest_client_config.php | 34 - .../Client/PolicyTroubleshooterClientTest.php | 138 - .../Privatecatalog/V1Beta1/PrivateCatalog.php | Bin 5198 -> 0 bytes .../PrivateCatalog/V1beta1/AssetReference.php | 511 ---- .../AssetReference/AssetValidationState.php | 71 - .../Cloud/PrivateCatalog/V1beta1/Catalog.php | 228 -- .../PrivateCatalog/V1beta1/GcsSource.php | 149 - .../PrivateCatalog/V1beta1/GitSource.php | 217 -- .../Cloud/PrivateCatalog/V1beta1/Inputs.php | 77 - .../Cloud/PrivateCatalog/V1beta1/Product.php | 922 ------ .../V1beta1/SearchCatalogsRequest.php | 189 -- .../V1beta1/SearchCatalogsResponse.php | 105 - .../V1beta1/SearchProductsRequest.php | 197 -- .../V1beta1/SearchProductsResponse.php | 105 - .../V1beta1/SearchVersionsRequest.php | 197 -- .../V1beta1/SearchVersionsResponse.php | 105 - .../Cloud/PrivateCatalog/V1beta1/Version.php | 254 -- .../PrivateCatalogClient/search_catalogs.php | 80 - .../PrivateCatalogClient/search_products.php | 77 - .../PrivateCatalogClient/search_versions.php | 86 - .../V1beta1/Client/PrivateCatalogClient.php | 284 -- .../Gapic/PrivateCatalogGapicClient.php | 452 --- .../src/V1beta1/PrivateCatalogClient.php | 36 - .../v1beta1/src/V1beta1/gapic_metadata.json | 33 - .../private_catalog_client_config.json | 37 - .../private_catalog_descriptor_config.php | 88 - .../private_catalog_rest_client_config.php | 92 - .../Client/PrivateCatalogClientTest.php | 328 --- .../Unit/V1beta1/PrivateCatalogClientTest.php | 274 -- .../V1/Privilegedaccessmanager.php | Bin 16268 -> 0 bytes .../V1/AccessControlEntry.php | 75 - .../V1/ApprovalWorkflow.php | 79 - .../V1/ApproveGrantRequest.php | 109 - .../V1/CheckOnboardingStatusRequest.php | 83 - .../V1/CheckOnboardingStatusResponse.php | 109 - .../CheckOnboardingStatusResponse/Finding.php | 79 - .../Finding/IAMAccessDenied.php | 73 - .../V1/CreateEntitlementRequest.php | 289 -- .../V1/CreateGrantRequest.php | 206 -- .../V1/DeleteEntitlementRequest.php | 193 -- .../V1/DenyGrantRequest.php | 109 - .../V1/Entitlement.php | 531 ---- .../AdditionalNotificationTargets.php | 112 - .../RequesterJustificationConfig.php | 121 - .../NotMandatory.php | 37 - .../Unstructured.php | 36 - .../V1/Entitlement/State.php | 85 - .../V1/GetEntitlementRequest.php | 81 - .../V1/GetGrantRequest.php | 81 - .../PrivilegedAccessManager/V1/Grant.php | 560 ---- .../V1/Grant/AuditTrail.php | 132 - .../V1/Grant/State.php | 126 - .../V1/Grant/Timeline.php | 82 - .../V1/Grant/Timeline/Event.php | 425 --- .../V1/Grant/Timeline/Event/Activated.php | 37 - .../Grant/Timeline/Event/ActivationFailed.php | 80 - .../V1/Grant/Timeline/Event/Approved.php | 108 - .../V1/Grant/Timeline/Event/Denied.php | 108 - .../V1/Grant/Timeline/Event/Ended.php | 36 - .../V1/Grant/Timeline/Event/Expired.php | 36 - .../Timeline/Event/ExternallyModified.php | 37 - .../V1/Grant/Timeline/Event/Requested.php | 84 - .../V1/Grant/Timeline/Event/Revoked.php | 104 - .../V1/Grant/Timeline/Event/Scheduled.php | 81 - .../V1/Justification.php | 78 - .../V1/ListEntitlementsRequest.php | 221 -- .../V1/ListEntitlementsResponse.php | 135 - .../V1/ListGrantsRequest.php | 221 -- .../V1/ListGrantsResponse.php | 135 - .../V1/ManualApprovals.php | 120 - .../V1/ManualApprovals/Step.php | 154 - .../V1/OperationMetadata.php | 307 -- .../V1/PrivilegedAccess.php | 75 - .../V1/PrivilegedAccess/GcpIamAccess.php | 140 - .../GcpIamAccess/RoleBinding.php | 132 - .../V1/RevokeGrantRequest.php | 101 - .../V1/SearchEntitlementsRequest.php | 215 -- .../CallerAccessType.php | 65 - .../V1/SearchEntitlementsResponse.php | 101 - .../V1/SearchGrantsRequest.php | 211 -- .../CallerRelationshipType.php | 72 - .../V1/SearchGrantsResponse.php | 101 - .../V1/UpdateEntitlementRequest.php | 176 -- .../approve_grant.php | 78 - .../check_onboarding_status.php | 81 - .../create_entitlement.php | 110 - .../create_grant.php | 82 - .../delete_entitlement.php | 89 - .../deny_grant.php | 78 - .../get_entitlement.php | 75 - .../get_grant.php | 76 - .../get_location.php | 57 - .../list_entitlements.php | 79 - .../list_grants.php | 80 - .../list_locations.php | 62 - .../revoke_grant.php | 89 - .../search_entitlements.php | 85 - .../search_grants.php | 86 - .../update_entitlement.php | 99 - .../Client/PrivilegedAccessManagerClient.php | 982 ------- .../v1/src/V1/gapic_metadata.json | 98 - ...ivileged_access_manager_client_config.json | 106 - ...leged_access_manager_descriptor_config.php | 304 -- ...eged_access_manager_rest_client_config.php | 469 --- .../PrivilegedAccessManagerClientTest.php | 1499 ---------- .../Devtools/Cloudprofiler/V2/Profiler.php | Bin 4189 -> 0 bytes .../V2/CreateOfflineProfileRequest.php | 127 - .../Profiler/V2/CreateProfileRequest.php | 148 - .../Google/Cloud/Profiler/V2/Deployment.php | 199 -- .../Cloud/Profiler/V2/ListProfilesRequest.php | 171 -- .../Profiler/V2/ListProfilesResponse.php | 152 - .../src/Google/Cloud/Profiler/V2/Profile.php | 345 --- .../Google/Cloud/Profiler/V2/ProfileType.php | 104 - .../Profiler/V2/UpdateProfileRequest.php | 151 - .../V2/ExportServiceClient/list_profiles.php | 78 - .../create_offline_profile.php | 64 - .../ProfilerServiceClient/create_profile.php | 75 - .../ProfilerServiceClient/update_profile.php | 65 - .../v2/src/V2/Client/ExportServiceClient.php | 243 -- .../src/V2/Client/ProfilerServiceClient.php | 352 --- .../Profiler/v2/src/V2/gapic_metadata.json | 47 - .../export_service_client_config.json | 39 - .../export_service_descriptor_config.php | 51 - .../export_service_rest_client_config.php | 40 - .../profiler_service_client_config.json | 69 - .../profiler_service_descriptor_config.php | 69 - .../profiler_service_rest_client_config.php | 66 - .../V2/Client/ExportServiceClientTest.php | 176 -- .../V2/Client/ProfilerServiceClientTest.php | 264 -- .../GPBMetadata/Google/Pubsub/V1/Pubsub.php | Bin 17622 -> 0 bytes .../GPBMetadata/Google/Pubsub/V1/Schema.php | Bin 5034 -> 0 bytes .../Cloud/PubSub/V1/AcknowledgeRequest.php | 132 - .../Google/Cloud/PubSub/V1/BigQueryConfig.php | 347 --- .../Cloud/PubSub/V1/BigQueryConfig/State.php | 91 - .../Cloud/PubSub/V1/CloudStorageConfig.php | 506 ---- .../V1/CloudStorageConfig/AvroConfig.php | 129 - .../PubSub/V1/CloudStorageConfig/State.php | 88 - .../V1/CloudStorageConfig/TextConfig.php | 38 - .../Cloud/PubSub/V1/CommitSchemaRequest.php | 132 - .../Cloud/PubSub/V1/CreateSchemaRequest.php | 200 -- .../Cloud/PubSub/V1/CreateSnapshotRequest.php | 221 -- .../Cloud/PubSub/V1/DeadLetterPolicy.php | 164 -- .../Cloud/PubSub/V1/DeleteSchemaRequest.php | 86 - .../PubSub/V1/DeleteSchemaRevisionRequest.php | 143 - .../Cloud/PubSub/V1/DeleteSnapshotRequest.php | 86 - .../PubSub/V1/DeleteSubscriptionRequest.php | 86 - .../Cloud/PubSub/V1/DeleteTopicRequest.php | 86 - .../PubSub/V1/DetachSubscriptionRequest.php | 71 - .../PubSub/V1/DetachSubscriptionResponse.php | 34 - .../src/Google/Cloud/PubSub/V1/Encoding.php | 62 - .../Cloud/PubSub/V1/ExpirationPolicy.php | 98 - .../Cloud/PubSub/V1/GetSchemaRequest.php | 124 - .../Cloud/PubSub/V1/GetSnapshotRequest.php | 86 - .../PubSub/V1/GetSubscriptionRequest.php | 86 - .../Cloud/PubSub/V1/GetTopicRequest.php | 86 - .../PubSub/V1/IngestionDataSourceSettings.php | 156 - .../AwsKinesis.php | 234 -- .../AwsKinesis/State.php | 95 - .../CloudStorage.php | 320 --- .../CloudStorage/AvroFormat.php | 38 - .../CloudStorage/PubSubAvroFormat.php | 39 - .../CloudStorage/State.php | 94 - .../CloudStorage/TextFormat.php | 82 - .../Cloud/PubSub/V1/IngestionFailureEvent.php | 148 - .../ApiViolationReason.php | 43 - .../AvroFailureReason.php | 37 - .../CloudStorageFailure.php | 224 -- .../PubSub/V1/ListSchemaRevisionsRequest.php | 195 -- .../PubSub/V1/ListSchemaRevisionsResponse.php | 105 - .../Cloud/PubSub/V1/ListSchemasRequest.php | 204 -- .../Cloud/PubSub/V1/ListSchemasResponse.php | 105 - .../Cloud/PubSub/V1/ListSnapshotsRequest.php | 162 -- .../Cloud/PubSub/V1/ListSnapshotsResponse.php | 109 - .../PubSub/V1/ListSubscriptionsRequest.php | 162 -- .../PubSub/V1/ListSubscriptionsResponse.php | 109 - .../PubSub/V1/ListTopicSnapshotsRequest.php | 162 -- .../PubSub/V1/ListTopicSnapshotsResponse.php | 109 - .../V1/ListTopicSubscriptionsRequest.php | 162 -- .../V1/ListTopicSubscriptionsResponse.php | 113 - .../Cloud/PubSub/V1/ListTopicsRequest.php | 162 -- .../Cloud/PubSub/V1/ListTopicsResponse.php | 105 - .../Cloud/PubSub/V1/MessageStoragePolicy.php | 137 - .../PubSub/V1/ModifyAckDeadlineRequest.php | 198 -- .../PubSub/V1/ModifyPushConfigRequest.php | 153 - .../Cloud/PubSub/V1/PlatformLogsSettings.php | 67 - .../V1/PlatformLogsSettings/Severity.php | 85 - .../Google/Cloud/PubSub/V1/PublishRequest.php | 122 - .../Cloud/PubSub/V1/PublishResponse.php | 75 - .../Google/Cloud/PubSub/V1/PubsubMessage.php | 280 -- .../Google/Cloud/PubSub/V1/PullRequest.php | 222 -- .../Google/Cloud/PubSub/V1/PullResponse.php | 83 - .../src/Google/Cloud/PubSub/V1/PushConfig.php | 294 -- .../Cloud/PubSub/V1/PushConfig/NoWrapper.php | 78 - .../Cloud/PubSub/V1/PushConfig/OidcToken.php | 146 - .../PubSub/V1/PushConfig/PubsubWrapper.php | 38 - .../Cloud/PubSub/V1/ReceivedMessage.php | 189 -- .../Google/Cloud/PubSub/V1/RetryPolicy.php | 140 - .../Cloud/PubSub/V1/RollbackSchemaRequest.php | 128 - .../src/Google/Cloud/PubSub/V1/Schema.php | 225 -- .../Google/Cloud/PubSub/V1/Schema/Type.php | 64 - .../Google/Cloud/PubSub/V1/SchemaSettings.php | 197 -- .../src/Google/Cloud/PubSub/V1/SchemaView.php | 62 - .../Google/Cloud/PubSub/V1/SeekRequest.php | 178 -- .../Google/Cloud/PubSub/V1/SeekResponse.php | 33 - .../src/Google/Cloud/PubSub/V1/Snapshot.php | 227 -- .../Cloud/PubSub/V1/StreamingPullRequest.php | 491 ---- .../Cloud/PubSub/V1/StreamingPullResponse.php | 208 -- .../AcknowledgeConfirmation.php | 181 -- .../ModifyAckDeadlineConfirmation.php | 147 - .../SubscriptionProperties.php | 108 - .../Google/Cloud/PubSub/V1/Subscription.php | 1138 -------- .../AnalyticsHubSubscriptionInfo.php | 121 - .../Cloud/PubSub/V1/Subscription/State.php | 66 - .../src/Google/Cloud/PubSub/V1/Topic.php | 473 ---- .../Google/Cloud/PubSub/V1/Topic/State.php | 66 - .../Cloud/PubSub/V1/UpdateSnapshotRequest.php | 141 - .../PubSub/V1/UpdateSubscriptionRequest.php | 141 - .../Cloud/PubSub/V1/UpdateTopicRequest.php | 156 - .../PubSub/V1/ValidateMessageRequest.php | 217 -- .../PubSub/V1/ValidateMessageResponse.php | 34 - .../Cloud/PubSub/V1/ValidateSchemaRequest.php | 132 - .../PubSub/V1/ValidateSchemaResponse.php | 34 - .../V1/PublisherClient/create_topic.php | 75 - .../V1/PublisherClient/delete_topic.php | 74 - .../PublisherClient/detach_subscription.php | 75 - .../V1/PublisherClient/get_iam_policy.php | 72 - .../samples/V1/PublisherClient/get_topic.php | 72 - .../PublisherClient/list_topic_snapshots.php | 80 - .../list_topic_subscriptions.php | 76 - .../V1/PublisherClient/list_topics.php | 77 - .../v1/samples/V1/PublisherClient/publish.php | 76 - .../V1/PublisherClient/set_iam_policy.php | 77 - .../PublisherClient/test_iam_permissions.php | 84 - .../V1/PublisherClient/update_topic.php | 81 - .../V1/SchemaServiceClient/commit_schema.php | 78 - .../V1/SchemaServiceClient/create_schema.php | 78 - .../V1/SchemaServiceClient/delete_schema.php | 70 - .../delete_schema_revision.php | 79 - .../V1/SchemaServiceClient/get_iam_policy.php | 72 - .../V1/SchemaServiceClient/get_schema.php | 72 - .../list_schema_revisions.php | 76 - .../V1/SchemaServiceClient/list_schemas.php | 77 - .../SchemaServiceClient/rollback_schema.php | 77 - .../V1/SchemaServiceClient/set_iam_policy.php | 77 - .../test_iam_permissions.php | 84 - .../SchemaServiceClient/validate_message.php | 72 - .../SchemaServiceClient/validate_schema.php | 79 - .../V1/SubscriberClient/acknowledge.php | 82 - .../V1/SubscriberClient/create_snapshot.php | 103 - .../SubscriberClient/create_subscription.php | 90 - .../V1/SubscriberClient/delete_snapshot.php | 78 - .../SubscriberClient/delete_subscription.php | 74 - .../V1/SubscriberClient/get_iam_policy.php | 72 - .../V1/SubscriberClient/get_snapshot.php | 76 - .../V1/SubscriberClient/get_subscription.php | 72 - .../V1/SubscriberClient/list_snapshots.php | 81 - .../SubscriberClient/list_subscriptions.php | 77 - .../SubscriberClient/modify_ack_deadline.php | 92 - .../SubscriberClient/modify_push_config.php | 78 - .../v1/samples/V1/SubscriberClient/pull.php | 77 - .../v1/samples/V1/SubscriberClient/seek.php | 77 - .../V1/SubscriberClient/set_iam_policy.php | 77 - .../V1/SubscriberClient/streaming_pull.php | 92 - .../SubscriberClient/test_iam_permissions.php | 84 - .../V1/SubscriberClient/update_snapshot.php | 67 - .../SubscriberClient/update_subscription.php | 90 - .../v1/src/V1/Client/PublisherClient.php | 660 ----- .../v1/src/V1/Client/SchemaServiceClient.php | 608 ---- .../v1/src/V1/Client/SubscriberClient.php | 909 ------ .../PubSub/v1/src/V1/gapic_metadata.json | 256 -- .../V1/resources/publisher_client_config.json | 132 - .../resources/publisher_descriptor_config.php | 208 -- .../publisher_rest_client_config.php | 217 -- .../schema_service_client_config.json | 99 - .../schema_service_descriptor_config.php | 207 -- .../schema_service_rest_client_config.php | 229 -- .../resources/subscriber_client_config.json | 172 -- .../subscriber_descriptor_config.php | 280 -- .../subscriber_rest_client_config.php | 290 -- .../Unit/V1/Client/PublisherClientTest.php | 941 ------- .../V1/Client/SchemaServiceClientTest.php | 1037 ------- .../Unit/V1/Client/SubscriberClientTest.php | 1494 ---------- .../Google/Api/Cloudquotas/V1/Cloudquotas.php | 78 - .../Google/Api/Cloudquotas/V1/Resources.php | Bin 4114 -> 0 bytes .../V1/CreateQuotaPreferenceRequest.php | 232 -- .../Cloud/CloudQuotas/V1/DimensionsInfo.php | 186 -- .../CloudQuotas/V1/GetQuotaInfoRequest.php | 92 - .../V1/GetQuotaPreferenceRequest.php | 92 - .../CloudQuotas/V1/ListQuotaInfosRequest.php | 184 -- .../CloudQuotas/V1/ListQuotaInfosResponse.php | 105 - .../V1/ListQuotaPreferencesRequest.php | 290 -- .../V1/ListQuotaPreferencesResponse.php | 139 - .../Cloud/CloudQuotas/V1/QuotaConfig.php | 302 -- .../CloudQuotas/V1/QuotaConfig/Origin.php | 64 - .../Cloud/CloudQuotas/V1/QuotaDetails.php | 119 - .../V1/QuotaIncreaseEligibility.php | 109 - .../IneligibilityReason.php | 79 - .../Google/Cloud/CloudQuotas/V1/QuotaInfo.php | 648 ----- .../V1/QuotaInfo/ContainerType.php | 71 - .../Cloud/CloudQuotas/V1/QuotaPreference.php | 543 ---- .../Cloud/CloudQuotas/V1/QuotaSafetyCheck.php | 63 - .../Cloud/CloudQuotas/V1/RolloutInfo.php | 67 - .../V1/UpdateQuotaPreferenceRequest.php | 270 -- .../create_quota_preference.php | 99 - .../V1/CloudQuotasClient/get_quota_info.php | 79 - .../get_quota_preference.php | 78 - .../V1/CloudQuotasClient/list_quota_infos.php | 83 - .../list_quota_preferences.php | 85 - .../update_quota_preference.php | 91 - .../v1/src/V1/Client/CloudQuotasClient.php | 692 ----- .../Quotas/v1/src/V1/gapic_metadata.json | 48 - .../resources/cloud_quotas_client_config.json | 64 - .../cloud_quotas_descriptor_config.php | 135 - .../cloud_quotas_rest_client_config.php | 162 -- .../Unit/V1/Client/CloudQuotasClientTest.php | 620 ---- .../V1/ApiEntities.php | Bin 2874 -> 0 bytes .../V1/Rapidmigrationassessment.php | 121 - .../V1/Annotation.php | 223 -- .../V1/Annotation/Type.php | 64 - .../RapidMigrationAssessment/V1/Collector.php | 587 ---- .../V1/Collector/State.php | 113 - .../V1/CreateAnnotationRequest.php | 161 -- .../V1/CreateCollectorRequest.php | 197 -- .../V1/DeleteCollectorRequest.php | 155 - .../V1/GetAnnotationRequest.php | 81 - .../V1/GetCollectorRequest.php | 81 - .../V1/GuestOsScan.php | 67 - .../V1/ListCollectorsRequest.php | 221 -- .../V1/ListCollectorsResponse.php | 135 - .../V1/OperationMetadata.php | 307 -- .../V1/PauseCollectorRequest.php | 155 - .../V1/RegisterCollectorRequest.php | 155 - .../V1/ResumeCollectorRequest.php | 155 - .../V1/UpdateCollectorRequest.php | 230 -- .../V1/VSphereScan.php | 67 - .../create_annotation.php | 85 - .../create_collector.php | 89 - .../delete_collector.php | 88 - .../get_annotation.php | 75 - .../get_collector.php | 75 - .../get_location.php | 57 - .../list_collectors.php | 76 - .../list_locations.php | 62 - .../pause_collector.php | 87 - .../register_collector.php | 87 - .../resume_collector.php | 87 - .../update_collector.php | 74 - .../Client/RapidMigrationAssessmentClient.php | 659 ----- .../v1/src/V1/gapic_metadata.json | 78 - ...id_migration_assessment_client_config.json | 105 - ...migration_assessment_descriptor_config.php | 245 -- ...igration_assessment_rest_client_config.php | 223 -- .../RapidMigrationAssessmentClientTest.php | 1473 ---------- .../V1/Recaptchaenterprise.php | Bin 24700 -> 0 bytes .../V1/AccountDefenderAssessment.php | 67 - .../AccountDefenderLabel.php | 82 - .../V1/AccountVerificationInfo.php | 182 -- .../V1/AccountVerificationInfo/Result.php | 123 - .../V1/AddIpOverrideRequest.php | 132 - .../V1/AddIpOverrideResponse.php | 33 - .../V1/AndroidKeySettings.php | 147 - .../V1/AnnotateAssessmentRequest.php | 303 -- .../AnnotateAssessmentRequest/Annotation.php | 82 - .../V1/AnnotateAssessmentRequest/Reason.php | 165 -- .../V1/AnnotateAssessmentResponse.php | 33 - .../V1/AppleDeveloperId.php | 147 - .../RecaptchaEnterprise/V1/Assessment.php | 599 ---- .../V1/AssessmentEnvironment.php | 126 - .../V1/ChallengeMetrics.php | 185 -- .../V1/CreateAssessmentRequest.php | 132 - .../V1/CreateFirewallPolicyRequest.php | 132 - .../V1/CreateKeyRequest.php | 132 - .../V1/DeleteFirewallPolicyRequest.php | 86 - .../V1/DeleteKeyRequest.php | 86 - .../V1/EndpointVerificationInfo.php | 197 -- .../Cloud/RecaptchaEnterprise/V1/Event.php | 640 ----- .../V1/Event/FraudPrevention.php | 70 - .../V1/ExpressKeySettings.php | 33 - .../RecaptchaEnterprise/V1/FirewallAction.php | 259 -- .../V1/FirewallAction/AllowAction.php | 36 - .../V1/FirewallAction/BlockAction.php | 37 - .../IncludeRecaptchaScriptAction.php | 40 - .../V1/FirewallAction/RedirectAction.php | 37 - .../V1/FirewallAction/SetHeaderAction.php | 106 - .../V1/FirewallAction/SubstituteAction.php | 75 - .../RecaptchaEnterprise/V1/FirewallPolicy.php | 280 -- .../V1/FirewallPolicyAssessment.php | 133 - .../V1/FraudPreventionAssessment.php | 215 -- .../BehavioralTrustVerdict.php | 78 - .../CardTestingVerdict.php | 75 - .../StolenInstrumentVerdict.php | 75 - .../RecaptchaEnterprise/V1/FraudSignals.php | 125 - .../V1/FraudSignals/CardSignals.php | 70 - .../V1/FraudSignals/CardSignals/CardLabel.php | 74 - .../V1/FraudSignals/UserSignals.php | 116 - .../V1/GetFirewallPolicyRequest.php | 86 - .../RecaptchaEnterprise/V1/GetKeyRequest.php | 86 - .../V1/GetMetricsRequest.php | 86 - .../RecaptchaEnterprise/V1/IOSKeySettings.php | 165 -- .../RecaptchaEnterprise/V1/IpOverrideData.php | 125 - .../V1/IpOverrideData/OverrideType.php | 58 - .../Cloud/RecaptchaEnterprise/V1/Key.php | 417 --- .../V1/ListFirewallPoliciesRequest.php | 162 -- .../V1/ListFirewallPoliciesResponse.php | 105 - .../V1/ListIpOverridesRequest.php | 170 -- .../V1/ListIpOverridesResponse.php | 105 - .../V1/ListKeysRequest.php | 162 -- .../V1/ListKeysResponse.php | 105 - ...tRelatedAccountGroupMembershipsRequest.php | 178 -- ...RelatedAccountGroupMembershipsResponse.php | 105 - .../V1/ListRelatedAccountGroupsRequest.php | 178 -- .../V1/ListRelatedAccountGroupsResponse.php | 105 - .../Cloud/RecaptchaEnterprise/V1/Metrics.php | 195 -- .../V1/MigrateKeyRequest.php | 133 - .../V1/PhoneFraudAssessment.php | 77 - .../V1/PrivatePasswordLeakVerification.php | 201 -- .../V1/RelatedAccountGroup.php | 75 - .../V1/RelatedAccountGroupMembership.php | 164 -- .../V1/RemoveIpOverrideRequest.php | 132 - .../V1/RemoveIpOverrideResponse.php | 33 - .../V1/ReorderFirewallPoliciesRequest.php | 128 - .../V1/ReorderFirewallPoliciesResponse.php | 33 - .../V1/RetrieveLegacySecretKeyRequest.php | 86 - .../V1/RetrieveLegacySecretKeyResponse.php | 80 - .../RecaptchaEnterprise/V1/RiskAnalysis.php | 185 -- .../V1/RiskAnalysis/Challenge.php | 72 - .../V1/RiskAnalysis/ClassificationReason.php | 101 - .../V1/ScoreDistribution.php | 75 - .../RecaptchaEnterprise/V1/ScoreMetrics.php | 115 - ...hRelatedAccountGroupMembershipsRequest.php | 294 -- ...RelatedAccountGroupMembershipsResponse.php | 105 - .../V1/SmsTollFraudVerdict.php | 105 - .../SmsTollFraudReason.php | 57 - .../RecaptchaEnterprise/V1/TestingOptions.php | 113 - .../V1/TestingOptions/TestingChallenge.php | 68 - .../V1/TokenProperties.php | 309 -- .../V1/TokenProperties/InvalidReason.php | 93 - .../V1/TransactionData.php | 581 ---- .../V1/TransactionData/Address.php | 256 -- .../V1/TransactionData/GatewayInfo.php | 184 -- .../V1/TransactionData/Item.php | 180 -- .../V1/TransactionData/User.php | 256 -- .../V1/TransactionEvent.php | 199 -- .../TransactionEvent/TransactionEventType.php | 214 -- .../V1/UpdateFirewallPolicyRequest.php | 141 - .../V1/UpdateKeyRequest.php | 141 - .../Cloud/RecaptchaEnterprise/V1/UserId.php | 147 - .../Cloud/RecaptchaEnterprise/V1/UserInfo.php | 169 -- .../RecaptchaEnterprise/V1/WafSettings.php | 102 - .../V1/WafSettings/WafFeature.php | 81 - .../V1/WafSettings/WafService.php | 78 - .../RecaptchaEnterprise/V1/WebKeySettings.php | 227 -- .../ChallengeSecurityPreference.php | 72 - .../V1/WebKeySettings/IntegrationType.php | 76 - .../add_ip_override.php | 94 - .../annotate_assessment.php | 79 - .../create_assessment.php | 74 - .../create_firewall_policy.php | 76 - .../create_key.php | 77 - .../delete_firewall_policy.php | 73 - .../delete_key.php | 70 - .../get_firewall_policy.php | 75 - .../get_key.php | 72 - .../get_metrics.php | 73 - .../list_firewall_policies.php | 77 - .../list_ip_overrides.php | 77 - .../list_keys.php | 77 - ...list_related_account_group_memberships.php | 80 - .../list_related_account_groups.php | 77 - .../migrate_key.php | 77 - .../remove_ip_override.php | 95 - .../reorder_firewall_policies.php | 83 - .../retrieve_legacy_secret_key.php | 74 - ...arch_related_account_group_memberships.php | 78 - .../update_firewall_policy.php | 59 - .../update_key.php | 72 - .../RecaptchaEnterpriseServiceClient.php | 959 ------- .../RecaptchaEnterpriseServiceGapicClient.php | 1610 ----------- .../V1/RecaptchaEnterpriseServiceClient.php | 34 - .../v1/src/V1/gapic_metadata.json | 128 - ...tcha_enterprise_service_client_config.json | 142 - ...a_enterprise_service_descriptor_config.php | 350 --- ..._enterprise_service_rest_client_config.php | 284 -- .../RecaptchaEnterpriseServiceClientTest.php | 1676 ----------- .../RecaptchaEnterpriseServiceClientTest.php | 1517 ---------- .../Recommendationengine/V1Beta1/Catalog.php | Bin 2636 -> 0 bytes .../V1Beta1/CatalogService.php | 70 - .../Recommendationengine/V1Beta1/Common.php | 42 - .../Recommendationengine/V1Beta1/Import.php | Bin 3672 -> 0 bytes .../PredictionApikeyRegistryService.php | 55 - .../V1Beta1/PredictionService.php | 70 - .../V1Beta1/RecommendationengineResources.php | 33 - .../V1Beta1/UserEvent.php | Bin 3437 -> 0 bytes .../V1Beta1/UserEventService.php | 78 - .../V1beta1/CatalogInlineSource.php | 71 - .../V1beta1/CatalogItem.php | 473 ---- .../V1beta1/CatalogItem/CategoryHierarchy.php | 82 - .../V1beta1/CollectUserEventRequest.php | 219 -- .../V1beta1/CreateCatalogItemRequest.php | 132 - ...atePredictionApiKeyRegistrationRequest.php | 132 - .../V1beta1/DeleteCatalogItemRequest.php | 86 - ...etePredictionApiKeyRegistrationRequest.php | 86 - .../V1beta1/EventDetail.php | 359 --- .../V1beta1/FeatureMap.php | 139 - .../V1beta1/FeatureMap/FloatList.php | 70 - .../V1beta1/FeatureMap/StringList.php | 70 - .../V1beta1/GcsSource.php | 92 - .../V1beta1/GetCatalogItemRequest.php | 86 - .../RecommendationEngine/V1beta1/Image.php | 135 - .../V1beta1/ImportCatalogItemsRequest.php | 224 -- .../V1beta1/ImportCatalogItemsResponse.php | 113 - .../V1beta1/ImportErrorsConfig.php | 84 - .../V1beta1/ImportMetadata.php | 266 -- .../V1beta1/ImportUserEventsRequest.php | 239 -- .../V1beta1/ImportUserEventsResponse.php | 161 -- .../V1beta1/InputConfig.php | 141 - .../V1beta1/ListCatalogItemsRequest.php | 194 -- .../V1beta1/ListCatalogItemsResponse.php | 105 - ...stPredictionApiKeyRegistrationsRequest.php | 158 -- ...tPredictionApiKeyRegistrationsResponse.php | 105 - .../V1beta1/ListUserEventsRequest.php | 325 --- .../V1beta1/ListUserEventsResponse.php | 105 - .../V1beta1/PredictRequest.php | 598 ---- .../V1beta1/PredictResponse.php | 253 -- .../PredictResponse/PredictionResult.php | 124 - .../V1beta1/PredictionApiKeyRegistration.php | 67 - .../V1beta1/ProductCatalogItem.php | 340 --- .../V1beta1/ProductCatalogItem/ExactPrice.php | 108 - .../V1beta1/ProductCatalogItem/PriceRange.php | 105 - .../V1beta1/ProductCatalogItem/StockState.php | 79 - .../V1beta1/ProductDetail.php | 371 --- .../V1beta1/ProductEventDetail.php | 368 --- .../V1beta1/PurchaseTransaction.php | 251 -- .../V1beta1/PurgeUserEventsMetadata.php | 112 - .../V1beta1/PurgeUserEventsRequest.php | 258 -- .../V1beta1/PurgeUserEventsResponse.php | 107 - .../V1beta1/UpdateCatalogItemRequest.php | 188 -- .../V1beta1/UserEvent.php | 422 --- .../V1beta1/UserEvent/EventSource.php | 73 - .../V1beta1/UserEventImportSummary.php | 106 - .../V1beta1/UserEventInlineSource.php | 67 - .../RecommendationEngine/V1beta1/UserInfo.php | 271 -- .../V1beta1/WriteUserEventRequest.php | 132 - .../create_catalog_item.php | 107 - .../delete_catalog_item.php | 75 - .../CatalogServiceClient/get_catalog_item.php | 77 - .../import_catalog_items.php | 91 - .../list_catalog_items.php | 77 - .../update_catalog_item.php | 113 - ...create_prediction_api_key_registration.php | 79 - ...delete_prediction_api_key_registration.php | 76 - .../list_prediction_api_key_registrations.php | 82 - .../PredictionServiceClient/predict.php | 151 - .../collect_user_event.php | 84 - .../import_user_events.php | 98 - .../list_user_events.php | 82 - .../purge_user_events.php | 113 - .../write_user_event.php | 114 - .../src/V1beta1/CatalogServiceClient.php | 36 - .../V1beta1/Client/CatalogServiceClient.php | 473 ---- .../Client/PredictionApiKeyRegistryClient.php | 352 --- .../Client/PredictionServiceClient.php | 262 -- .../V1beta1/Client/UserEventServiceClient.php | 432 --- .../Gapic/CatalogServiceGapicClient.php | 695 ----- .../PredictionApiKeyRegistryGapicClient.php | 467 --- .../Gapic/PredictionServiceGapicClient.php | 451 --- .../Gapic/UserEventServiceGapicClient.php | 724 ----- .../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 | 119 - .../catalog_service_rest_client_config.php | 134 - ...iction_api_key_registry_client_config.json | 50 - ...ion_api_key_registry_descriptor_config.php | 76 - ...on_api_key_registry_rest_client_config.php | 99 - .../prediction_service_client_config.json | 40 - .../prediction_service_descriptor_config.php | 51 - .../prediction_service_rest_client_config.php | 77 - .../user_event_service_client_config.json | 60 - .../user_event_service_descriptor_config.php | 113 - .../user_event_service_rest_client_config.php | 123 - .../Unit/V1beta1/CatalogServiceClientTest.php | 551 ---- .../Client/CatalogServiceClientTest.php | 634 ----- .../PredictionApiKeyRegistryClientTest.php | 302 -- .../Client/PredictionServiceClientTest.php | 210 -- .../Client/UserEventServiceClientTest.php | 593 ---- .../PredictionApiKeyRegistryClientTest.php | 252 -- .../V1beta1/PredictionServiceClientTest.php | 152 - .../V1beta1/UserEventServiceClientTest.php | 525 ---- .../Google/Cloud/Recommender/V1/Insight.php | Bin 3007 -> 0 bytes .../Recommender/V1/InsightTypeConfig.php | 45 - .../Cloud/Recommender/V1/Recommendation.php | Bin 5056 -> 0 bytes .../Recommender/V1/RecommenderConfig.php | 45 - .../Recommender/V1/RecommenderService.php | 127 - .../Cloud/Recommender/V1/CostProjection.php | 181 -- .../Recommender/V1/GetInsightRequest.php | 81 - .../V1/GetInsightTypeConfigRequest.php | 111 - .../V1/GetRecommendationRequest.php | 81 - .../V1/GetRecommenderConfigRequest.php | 111 - .../Google/Cloud/Recommender/V1/Impact.php | 208 -- .../Cloud/Recommender/V1/Impact/Category.php | 92 - .../Google/Cloud/Recommender/V1/Insight.php | 502 ---- .../Cloud/Recommender/V1/Insight/Category.php | 92 - .../V1/Insight/RecommendationReference.php | 74 - .../Cloud/Recommender/V1/Insight/Severity.php | 78 - .../Cloud/Recommender/V1/InsightStateInfo.php | 101 - .../Recommender/V1/InsightStateInfo/State.php | 77 - .../Recommender/V1/InsightTypeConfig.php | 347 --- .../V1/InsightTypeGenerationConfig.php | 83 - .../Recommender/V1/ListInsightsRequest.php | 319 --- .../Recommender/V1/ListInsightsResponse.php | 105 - .../V1/ListRecommendationsRequest.php | 378 --- .../V1/ListRecommendationsResponse.php | 105 - .../V1/MarkInsightAcceptedRequest.php | 158 -- .../V1/MarkRecommendationClaimedRequest.php | 168 -- .../V1/MarkRecommendationDismissedRequest.php | 101 - .../V1/MarkRecommendationFailedRequest.php | 168 -- .../V1/MarkRecommendationSucceededRequest.php | 168 -- .../Google/Cloud/Recommender/V1/Operation.php | 564 ---- .../Cloud/Recommender/V1/OperationGroup.php | 71 - .../Cloud/Recommender/V1/Recommendation.php | 546 ---- .../V1/Recommendation/InsightReference.php | 74 - .../V1/Recommendation/Priority.php | 78 - .../Recommender/V1/RecommendationContent.php | 119 - .../V1/RecommendationStateInfo.php | 101 - .../V1/RecommendationStateInfo/State.php | 95 - .../Recommender/V1/RecommenderConfig.php | 347 --- .../V1/RecommenderGenerationConfig.php | 83 - .../Recommender/V1/ReliabilityProjection.php | 111 - .../V1/ReliabilityProjection/RiskType.php | 72 - .../Recommender/V1/SecurityProjection.php | 77 - .../V1/SustainabilityProjection.php | 116 - .../V1/UpdateInsightTypeConfigRequest.php | 174 -- .../V1/UpdateRecommenderConfigRequest.php | 174 -- .../Cloud/Recommender/V1/ValueMatcher.php | 81 - .../V1/RecommenderClient/get_insight.php | 77 - .../get_insight_type_config.php | 86 - .../RecommenderClient/get_recommendation.php | 77 - .../get_recommender_config.php | 86 - .../V1/RecommenderClient/list_insights.php | 93 - .../list_recommendations.php | 93 - .../mark_insight_accepted.php | 84 - .../mark_recommendation_claimed.php | 88 - .../mark_recommendation_dismissed.php | 84 - .../mark_recommendation_failed.php | 89 - .../mark_recommendation_succeeded.php | 89 - .../update_insight_type_config.php | 60 - .../update_recommender_config.php | 60 - .../v1/src/V1/Client/RecommenderClient.php | 1199 -------- .../Recommender/v1/src/V1/gapic_metadata.json | 83 - .../resources/recommender_client_config.json | 110 - .../recommender_descriptor_config.php | 232 -- .../recommender_rest_client_config.php | 366 --- .../Unit/V1/Client/RecommenderClientTest.php | 1062 ------- .../Google/Cloud/Redis/V1/CloudRedis.php | Bin 10724 -> 0 bytes .../Cloud/Redis/V1/CreateInstanceRequest.php | 205 -- .../Cloud/Redis/V1/DeleteInstanceRequest.php | 92 - .../Cloud/Redis/V1/ExportInstanceRequest.php | 136 - .../Redis/V1/FailoverInstanceRequest.php | 133 - .../DataProtectionMode.php | 68 - .../Google/Cloud/Redis/V1/GcsDestination.php | 71 - .../src/Google/Cloud/Redis/V1/GcsSource.php | 67 - .../Redis/V1/GetInstanceAuthStringRequest.php | 92 - .../Cloud/Redis/V1/GetInstanceRequest.php | 91 - .../Cloud/Redis/V1/ImportInstanceRequest.php | 136 - .../src/Google/Cloud/Redis/V1/InputConfig.php | 75 - .../src/Google/Cloud/Redis/V1/Instance.php | 1567 ----------- .../Cloud/Redis/V1/Instance/ConnectMode.php | 66 - .../Redis/V1/Instance/ReadReplicasMode.php | 67 - .../Google/Cloud/Redis/V1/Instance/State.php | 108 - .../Redis/V1/Instance/SuspensionReason.php | 57 - .../Google/Cloud/Redis/V1/Instance/Tier.php | 64 - .../V1/Instance/TransitEncryptionMode.php | 64 - .../Cloud/Redis/V1/InstanceAuthString.php | 67 - .../Cloud/Redis/V1/ListInstancesRequest.php | 187 -- .../Cloud/Redis/V1/ListInstancesResponse.php | 175 -- .../Cloud/Redis/V1/LocationMetadata.php | 82 - .../Cloud/Redis/V1/MaintenancePolicy.php | 201 -- .../Cloud/Redis/V1/MaintenanceSchedule.php | 217 -- .../src/Google/Cloud/Redis/V1/NodeInfo.php | 101 - .../Cloud/Redis/V1/OperationMetadata.php | 291 -- .../Google/Cloud/Redis/V1/OutputConfig.php | 75 - .../Cloud/Redis/V1/PersistenceConfig.php | 221 -- .../V1/PersistenceConfig/PersistenceMode.php | 65 - .../V1/PersistenceConfig/SnapshotPeriod.php | 78 - .../Redis/V1/RescheduleMaintenanceRequest.php | 190 -- .../RescheduleType.php | 72 - .../Google/Cloud/Redis/V1/TlsCertificate.php | 239 -- .../Cloud/Redis/V1/UpdateInstanceRequest.php | 178 -- .../Cloud/Redis/V1/UpgradeInstanceRequest.php | 128 - .../Redis/V1/WeeklyMaintenanceWindow.php | 160 -- .../Google/Cloud/Redis/V1/ZoneMetadata.php | 34 - .../V1/CloudRedisClient/create_instance.php | 139 - .../V1/CloudRedisClient/delete_instance.php | 83 - .../V1/CloudRedisClient/export_instance.php | 92 - .../V1/CloudRedisClient/failover_instance.php | 86 - .../V1/CloudRedisClient/get_instance.php | 73 - .../get_instance_auth_string.php | 75 - .../V1/CloudRedisClient/get_location.php | 57 - .../V1/CloudRedisClient/import_instance.php | 94 - .../V1/CloudRedisClient/list_instances.php | 86 - .../V1/CloudRedisClient/list_locations.php | 62 - .../reschedule_maintenance.php | 91 - .../V1/CloudRedisClient/update_instance.php | 111 - .../V1/CloudRedisClient/upgrade_instance.php | 89 - .../v1/src/V1/Client/CloudRedisClient.php | 709 ----- .../Redis/v1/src/V1/gapic_metadata.json | 83 - .../resources/cloud_redis_client_config.json | 97 - .../cloud_redis_descriptor_config.php | 263 -- .../cloud_redis_rest_client_config.php | 234 -- .../Unit/V1/Client/CloudRedisClientTest.php | 1882 ------------- .../Redis/Cluster/V1/CloudRedisCluster.php | Bin 8132 -> 0 bytes .../Redis/Cluster/V1/AuthorizationMode.php | 61 - .../Redis/Cluster/V1/CertificateAuthority.php | 112 - .../ManagedCertificateAuthority.php | 72 - .../ManagedCertificateAuthority/CertChain.php | 68 - .../Google/Cloud/Redis/Cluster/V1/Cluster.php | 821 ------ .../Cloud/Redis/Cluster/V1/Cluster/State.php | 78 - .../Redis/Cluster/V1/Cluster/StateInfo.php | 78 - .../V1/Cluster/StateInfo/UpdateInfo.php | 124 - .../Cluster/V1/ClusterPersistenceConfig.php | 155 - .../V1/ClusterPersistenceConfig/AOFConfig.php | 70 - .../AOFConfig/AppendFsync.php | 74 - .../PersistenceMode.php | 71 - .../V1/ClusterPersistenceConfig/RDBConfig.php | 122 - .../RDBConfig/SnapshotPeriod.php | 78 - .../Redis/Cluster/V1/CreateClusterRequest.php | 238 -- .../Redis/Cluster/V1/DeleteClusterRequest.php | 125 - .../Redis/Cluster/V1/DiscoveryEndpoint.php | 153 - .../GetClusterCertificateAuthorityRequest.php | 92 - .../Redis/Cluster/V1/GetClusterRequest.php | 91 - .../Redis/Cluster/V1/ListClustersRequest.php | 183 -- .../Redis/Cluster/V1/ListClustersResponse.php | 175 -- .../Cloud/Redis/Cluster/V1/NodeType.php | 73 - .../Redis/Cluster/V1/OperationMetadata.php | 307 -- .../Cloud/Redis/Cluster/V1/PscConfig.php | 73 - .../Cloud/Redis/Cluster/V1/PscConnection.php | 227 -- .../Cluster/V1/TransitEncryptionMode.php | 61 - .../Redis/Cluster/V1/UpdateClusterRequest.php | 196 -- .../Cluster/V1/ZoneDistributionConfig.php | 113 - .../ZoneDistributionMode.php | 69 - .../create_cluster.php | 132 - .../delete_cluster.php | 83 - .../CloudRedisClusterClient/get_cluster.php | 73 - .../get_cluster_certificate_authority.php | 77 - .../CloudRedisClusterClient/get_location.php | 57 - .../CloudRedisClusterClient/list_clusters.php | 86 - .../list_locations.php | 62 - .../update_cluster.php | 108 - .../src/V1/Client/CloudRedisClusterClient.php | 576 ---- .../v1/src/V1/gapic_metadata.json | 58 - .../cloud_redis_cluster_client_config.json | 72 - .../cloud_redis_cluster_descriptor_config.php | 169 -- ...cloud_redis_cluster_rest_client_config.php | 174 -- .../V1/Client/CloudRedisClusterClientTest.php | 940 ------- .../Cloud/Resourcemanager/V3/Folders.php | Bin 5416 -> 0 bytes .../Resourcemanager/V3/Organizations.php | Bin 3389 -> 0 bytes .../Cloud/Resourcemanager/V3/Projects.php | Bin 5620 -> 0 bytes .../Cloud/Resourcemanager/V3/TagBindings.php | 81 - .../Cloud/Resourcemanager/V3/TagHolds.php | 66 - .../Cloud/Resourcemanager/V3/TagKeys.php | Bin 4764 -> 0 bytes .../Cloud/Resourcemanager/V3/TagValues.php | 90 - .../V3/CreateFolderMetadata.php | 105 - .../V3/CreateFolderRequest.php | 95 - .../V3/CreateProjectMetadata.php | 155 - .../V3/CreateProjectRequest.php | 124 - .../V3/CreateTagBindingMetadata.php | 33 - .../V3/CreateTagBindingRequest.php | 128 - .../V3/CreateTagHoldMetadata.php | 35 - .../V3/CreateTagHoldRequest.php | 170 -- .../V3/CreateTagKeyMetadata.php | 33 - .../V3/CreateTagKeyRequest.php | 133 - .../V3/CreateTagValueMetadata.php | 33 - .../V3/CreateTagValueRequest.php | 133 - .../V3/DeleteFolderMetadata.php | 34 - .../V3/DeleteFolderRequest.php | 86 - .../V3/DeleteOrganizationMetadata.php | 34 - .../V3/DeleteProjectMetadata.php | 34 - .../V3/DeleteProjectRequest.php | 82 - .../V3/DeleteTagBindingMetadata.php | 33 - .../V3/DeleteTagBindingRequest.php | 91 - .../V3/DeleteTagHoldMetadata.php | 35 - .../V3/DeleteTagHoldRequest.php | 124 - .../V3/DeleteTagKeyMetadata.php | 33 - .../V3/DeleteTagKeyRequest.php | 167 -- .../V3/DeleteTagValueMetadata.php | 33 - .../V3/DeleteTagValueRequest.php | 162 -- .../Cloud/ResourceManager/V3/EffectiveTag.php | 289 -- .../Cloud/ResourceManager/V3/Folder.php | 392 --- .../Cloud/ResourceManager/V3/Folder/State.php | 64 - .../ResourceManager/V3/GetFolderRequest.php | 86 - .../V3/GetNamespacedTagKeyRequest.php | 96 - .../V3/GetNamespacedTagValueRequest.php | 113 - .../V3/GetOrganizationRequest.php | 92 - .../ResourceManager/V3/GetProjectRequest.php | 83 - .../ResourceManager/V3/GetTagKeyRequest.php | 86 - .../ResourceManager/V3/GetTagValueRequest.php | 86 - .../V3/ListEffectiveTagsRequest.php | 170 -- .../V3/ListEffectiveTagsResponse.php | 129 - .../ResourceManager/V3/ListFoldersRequest.php | 234 -- .../V3/ListFoldersResponse.php | 109 - .../V3/ListProjectsRequest.php | 225 -- .../V3/ListProjectsResponse.php | 136 - .../V3/ListTagBindingsRequest.php | 170 -- .../V3/ListTagBindingsResponse.php | 129 - .../V3/ListTagHoldsRequest.php | 236 -- .../V3/ListTagHoldsResponse.php | 129 - .../ResourceManager/V3/ListTagKeysRequest.php | 170 -- .../V3/ListTagKeysResponse.php | 105 - .../V3/ListTagValuesRequest.php | 162 -- .../V3/ListTagValuesResponse.php | 113 - .../ResourceManager/V3/MoveFolderMetadata.php | 135 - .../ResourceManager/V3/MoveFolderRequest.php | 132 - .../V3/MoveProjectMetadata.php | 34 - .../ResourceManager/V3/MoveProjectRequest.php | 119 - .../Cloud/ResourceManager/V3/Organization.php | 372 --- .../ResourceManager/V3/Organization/State.php | 64 - .../Cloud/ResourceManager/V3/Project.php | 489 ---- .../ResourceManager/V3/Project/State.php | 70 - .../Cloud/ResourceManager/V3/Purpose.php | 66 - .../V3/SearchFoldersRequest.php | 290 -- .../V3/SearchFoldersResponse.php | 109 - .../V3/SearchOrganizationsRequest.php | 234 -- .../V3/SearchOrganizationsResponse.php | 121 - .../V3/SearchProjectsRequest.php | 302 -- .../V3/SearchProjectsResponse.php | 138 - .../Cloud/ResourceManager/V3/TagBinding.php | 207 -- .../Cloud/ResourceManager/V3/TagHold.php | 256 -- .../Cloud/ResourceManager/V3/TagKey.php | 477 ---- .../Cloud/ResourceManager/V3/TagValue.php | 374 --- .../V3/UndeleteFolderMetadata.php | 34 - .../V3/UndeleteFolderRequest.php | 86 - .../V3/UndeleteOrganizationMetadata.php | 34 - .../V3/UndeleteProjectMetadata.php | 34 - .../V3/UndeleteProjectRequest.php | 89 - .../V3/UpdateFolderMetadata.php | 34 - .../V3/UpdateFolderRequest.php | 152 - .../V3/UpdateProjectMetadata.php | 34 - .../V3/UpdateProjectRequest.php | 141 - .../V3/UpdateTagKeyMetadata.php | 33 - .../V3/UpdateTagKeyRequest.php | 199 -- .../V3/UpdateTagValueMetadata.php | 33 - .../V3/UpdateTagValueRequest.php | 189 -- .../V3/FoldersClient/create_folder.php | 112 - .../V3/FoldersClient/delete_folder.php | 94 - .../samples/V3/FoldersClient/get_folder.php | 76 - .../V3/FoldersClient/get_iam_policy.php | 75 - .../samples/V3/FoldersClient/list_folders.php | 89 - .../samples/V3/FoldersClient/move_folder.php | 105 - .../V3/FoldersClient/search_folders.php | 67 - .../V3/FoldersClient/set_iam_policy.php | 77 - .../V3/FoldersClient/test_iam_permissions.php | 82 - .../V3/FoldersClient/undelete_folder.php | 94 - .../V3/FoldersClient/update_folder.php | 105 - .../V3/OrganizationsClient/get_iam_policy.php | 76 - .../OrganizationsClient/get_organization.php | 73 - .../search_organizations.php | 68 - .../V3/OrganizationsClient/set_iam_policy.php | 78 - .../test_iam_permissions.php | 82 - .../V3/ProjectsClient/create_project.php | 75 - .../V3/ProjectsClient/delete_project.php | 115 - .../V3/ProjectsClient/get_iam_policy.php | 73 - .../samples/V3/ProjectsClient/get_project.php | 75 - .../V3/ProjectsClient/list_projects.php | 85 - .../V3/ProjectsClient/move_project.php | 101 - .../V3/ProjectsClient/search_projects.php | 71 - .../V3/ProjectsClient/set_iam_policy.php | 113 - .../ProjectsClient/test_iam_permissions.php | 79 - .../V3/ProjectsClient/undelete_project.php | 93 - .../V3/ProjectsClient/update_project.php | 76 - .../TagBindingsClient/create_tag_binding.php | 71 - .../TagBindingsClient/delete_tag_binding.php | 82 - .../TagBindingsClient/list_effective_tags.php | 78 - .../TagBindingsClient/list_tag_bindings.php | 81 - .../V3/TagHoldsClient/create_tag_hold.php | 92 - .../V3/TagHoldsClient/delete_tag_hold.php | 81 - .../V3/TagHoldsClient/list_tag_holds.php | 77 - .../V3/TagKeysClient/create_tag_key.php | 92 - .../V3/TagKeysClient/delete_tag_key.php | 86 - .../V3/TagKeysClient/get_iam_policy.php | 76 - .../TagKeysClient/get_namespaced_tag_key.php | 76 - .../samples/V3/TagKeysClient/get_tag_key.php | 73 - .../V3/TagKeysClient/list_tag_keys.php | 77 - .../V3/TagKeysClient/set_iam_policy.php | 77 - .../V3/TagKeysClient/test_iam_permissions.php | 82 - .../V3/TagKeysClient/update_tag_key.php | 89 - .../V3/TagValuesClient/create_tag_value.php | 92 - .../V3/TagValuesClient/delete_tag_value.php | 85 - .../V3/TagValuesClient/get_iam_policy.php | 76 - .../get_namespaced_tag_value.php | 81 - .../V3/TagValuesClient/get_tag_value.php | 73 - .../V3/TagValuesClient/list_tag_values.php | 75 - .../V3/TagValuesClient/set_iam_policy.php | 77 - .../TagValuesClient/test_iam_permissions.php | 82 - .../V3/TagValuesClient/update_tag_value.php | 89 - .../v3/src/V3/Client/FoldersClient.php | 684 ----- .../v3/src/V3/Client/OrganizationsClient.php | 375 --- .../v3/src/V3/Client/ProjectsClient.php | 702 ----- .../v3/src/V3/Client/TagBindingsClient.php | 385 --- .../v3/src/V3/Client/TagHoldsClient.php | 374 --- .../v3/src/V3/Client/TagKeysClient.php | 541 ---- .../v3/src/V3/Client/TagValuesClient.php | 541 ---- .../v3/src/V3/gapic_metadata.json | 332 --- .../V3/resources/folders_client_config.json | 99 - .../resources/folders_descriptor_config.php | 191 -- .../resources/folders_rest_client_config.php | 156 - .../organizations_client_config.json | 69 - .../organizations_descriptor_config.php | 91 - .../organizations_rest_client_config.php | 93 - .../V3/resources/projects_client_config.json | 99 - .../resources/projects_descriptor_config.php | 191 -- .../resources/projects_rest_client_config.php | 153 - .../resources/tag_bindings_client_config.json | 64 - .../tag_bindings_descriptor_config.php | 85 - .../tag_bindings_rest_client_config.php | 72 - .../V3/resources/tag_holds_client_config.json | 37 - .../resources/tag_holds_descriptor_config.php | 90 - .../tag_holds_rest_client_config.php | 76 - .../V3/resources/tag_keys_client_config.json | 89 - .../resources/tag_keys_descriptor_config.php | 145 - .../resources/tag_keys_rest_client_config.php | 132 - .../resources/tag_values_client_config.json | 89 - .../tag_values_descriptor_config.php | 145 - .../tag_values_rest_client_config.php | 132 - .../Unit/V3/Client/FoldersClientTest.php | 1232 -------- .../V3/Client/OrganizationsClientTest.php | 440 --- .../Unit/V3/Client/ProjectsClientTest.php | 1229 -------- .../Unit/V3/Client/TagBindingsClientTest.php | 539 ---- .../Unit/V3/Client/TagHoldsClientTest.php | 480 ---- .../Unit/V3/Client/TagKeysClientTest.php | 988 ------- .../Unit/V3/Client/TagValuesClientTest.php | 988 ------- .../Resourcesettings/V1/ResourceSettings.php | Bin 3819 -> 0 bytes .../ResourceSettings/V1/GetSettingRequest.php | 125 - .../V1/ListSettingsRequest.php | 208 -- .../V1/ListSettingsResponse.php | 101 - .../Cloud/ResourceSettings/V1/Setting.php | 329 --- .../ResourceSettings/V1/SettingMetadata.php | 229 -- .../V1/SettingMetadata/DataType.php | 80 - .../Cloud/ResourceSettings/V1/SettingView.php | 76 - .../V1/UpdateSettingRequest.php | 81 - .../Cloud/ResourceSettings/V1/Value.php | 174 -- .../ResourceSettings/V1/Value/EnumValue.php | 72 - .../ResourceSettings/V1/Value/StringSet.php | 72 - .../get_setting.php | 76 - .../list_settings.php | 81 - .../update_setting.php | 74 - .../Client/ResourceSettingsServiceClient.php | 387 --- .../v1/src/V1/gapic_metadata.json | 33 - ...source_settings_service_client_config.json | 50 - ...rce_settings_service_descriptor_config.php | 79 - ...ce_settings_service_rest_client_config.php | 96 - .../ResourceSettingsServiceClientTest.php | 300 -- .../Cloud/Retail/V2/AnalyticsService.php | 36 - .../Google/Cloud/Retail/V2/Catalog.php | Bin 4735 -> 0 bytes .../Google/Cloud/Retail/V2/CatalogService.php | 99 - .../Google/Cloud/Retail/V2/Common.php | Bin 4745 -> 0 bytes .../Cloud/Retail/V2/CompletionService.php | 71 - .../Google/Cloud/Retail/V2/Control.php | Bin 1465 -> 0 bytes .../Google/Cloud/Retail/V2/ControlService.php | 66 - .../Google/Cloud/Retail/V2/ExportConfig.php | Bin 2256 -> 0 bytes .../Cloud/Retail/V2/GenerativeQuestion.php | 40 - .../Retail/V2/GenerativeQuestionService.php | 59 - .../Google/Cloud/Retail/V2/ImportConfig.php | Bin 4253 -> 0 bytes .../Google/Cloud/Retail/V2/Model.php | Bin 2944 -> 0 bytes .../Google/Cloud/Retail/V2/ModelService.php | 84 - .../Cloud/Retail/V2/PredictionService.php | 64 - .../Google/Cloud/Retail/V2/Product.php | Bin 3387 -> 0 bytes .../Google/Cloud/Retail/V2/ProductService.php | 129 - .../Google/Cloud/Retail/V2/Promotion.php | 29 - .../Google/Cloud/Retail/V2/PurgeConfig.php | 52 - .../Google/Cloud/Retail/V2/SearchService.php | Bin 8443 -> 0 bytes .../Google/Cloud/Retail/V2/ServingConfig.php | Bin 2231 -> 0 bytes .../Cloud/Retail/V2/ServingConfigService.php | 76 - .../Google/Cloud/Retail/V2/UserEvent.php | 77 - .../Cloud/Retail/V2/UserEventService.php | Bin 3520 -> 0 bytes .../Retail/V2/AddCatalogAttributeRequest.php | 121 - .../Cloud/Retail/V2/AddControlRequest.php | 124 - .../V2/AddFulfillmentPlacesMetadata.php | 36 - .../Retail/V2/AddFulfillmentPlacesRequest.php | 391 --- .../V2/AddFulfillmentPlacesResponse.php | 36 - .../Retail/V2/AddLocalInventoriesMetadata.php | 36 - .../Retail/V2/AddLocalInventoriesRequest.php | 337 --- .../Retail/V2/AddLocalInventoriesResponse.php | 38 - .../Cloud/Retail/V2/AttributeConfigLevel.php | 64 - .../Cloud/Retail/V2/AttributesConfig.php | 171 -- .../src/Google/Cloud/Retail/V2/Audience.php | 178 -- ...UpdateGenerativeQuestionConfigsRequest.php | 121 - ...pdateGenerativeQuestionConfigsResponse.php | 67 - .../Cloud/Retail/V2/BigQueryOutputResult.php | 101 - .../Google/Cloud/Retail/V2/BigQuerySource.php | 351 --- .../src/Google/Cloud/Retail/V2/Catalog.php | 153 - .../Cloud/Retail/V2/CatalogAttribute.php | 578 ---- .../V2/CatalogAttribute/AttributeType.php | 66 - .../DynamicFacetableOption.php | 64 - .../ExactSearchableOption.php | 64 - .../V2/CatalogAttribute/FacetConfig.php | 315 --- .../FacetConfig/IgnoredFacetValues.php | 202 -- .../FacetConfig/MergedFacet.php | 94 - .../FacetConfig/MergedFacetValue.php | 123 - .../FacetConfig/RerankConfig.php | 123 - .../V2/CatalogAttribute/IndexableOption.php | 64 - .../V2/CatalogAttribute/RetrievableOption.php | 64 - .../V2/CatalogAttribute/SearchableOption.php | 64 - .../Retail/V2/CollectUserEventRequest.php | 288 -- .../src/Google/Cloud/Retail/V2/ColorInfo.php | 177 -- .../Cloud/Retail/V2/CompleteQueryRequest.php | 511 ---- .../Cloud/Retail/V2/CompleteQueryResponse.php | 262 -- .../CompleteQueryResponse/AttributeResult.php | 64 - .../CompletionResult.php | 128 - .../RecentSearchResult.php | 71 - .../Cloud/Retail/V2/CompletionConfig.php | 546 ---- .../Retail/V2/CompletionDataInputConfig.php | 84 - .../Cloud/Retail/V2/CompletionDetail.php | 152 - .../src/Google/Cloud/Retail/V2/Condition.php | 168 -- .../Cloud/Retail/V2/Condition/QueryTerm.php | 124 - .../Cloud/Retail/V2/Condition/TimeRange.php | 125 - .../src/Google/Cloud/Retail/V2/Control.php | 325 --- .../Cloud/Retail/V2/CreateControlRequest.php | 184 -- .../Cloud/Retail/V2/CreateModelMetadata.php | 75 - .../Cloud/Retail/V2/CreateModelRequest.php | 175 -- .../Cloud/Retail/V2/CreateProductRequest.php | 228 -- .../Retail/V2/CreateServingConfigRequest.php | 184 -- .../Cloud/Retail/V2/CustomAttribute.php | 340 --- .../Cloud/Retail/V2/DeleteControlRequest.php | 86 - .../Cloud/Retail/V2/DeleteModelRequest.php | 91 - .../Cloud/Retail/V2/DeleteProductRequest.php | 167 -- .../Retail/V2/DeleteServingConfigRequest.php | 86 - .../Google/Cloud/Retail/V2/ExperimentInfo.php | 120 - .../ServingConfigExperiment.php | 128 - .../V2/ExportAnalyticsMetricsRequest.php | 197 -- .../V2/ExportAnalyticsMetricsResponse.php | 157 -- .../Cloud/Retail/V2/ExportErrorsConfig.php | 84 - .../Google/Cloud/Retail/V2/ExportMetadata.php | 126 - .../Cloud/Retail/V2/FulfillmentInfo.php | 190 -- .../Cloud/Retail/V2/GcsOutputResult.php | 67 - .../src/Google/Cloud/Retail/V2/GcsSource.php | 197 -- .../Retail/V2/GenerativeQuestionConfig.php | 283 -- .../V2/GenerativeQuestionsFeatureConfig.php | 151 - .../Retail/V2/GetAttributesConfigRequest.php | 88 - .../Retail/V2/GetCompletionConfigRequest.php | 88 - .../Cloud/Retail/V2/GetControlRequest.php | 86 - .../Retail/V2/GetDefaultBranchRequest.php | 85 - .../Retail/V2/GetDefaultBranchResponse.php | 154 - ...enerativeQuestionsFeatureConfigRequest.php | 86 - .../Cloud/Retail/V2/GetModelRequest.php | 91 - .../Cloud/Retail/V2/GetProductRequest.php | 120 - .../Retail/V2/GetServingConfigRequest.php | 86 - .../src/Google/Cloud/Retail/V2/Image.php | 174 -- .../Retail/V2/ImportCompletionDataRequest.php | 165 -- .../V2/ImportCompletionDataResponse.php | 70 - .../Cloud/Retail/V2/ImportErrorsConfig.php | 84 - .../Google/Cloud/Retail/V2/ImportMetadata.php | 283 -- .../Cloud/Retail/V2/ImportProductsRequest.php | 386 --- .../ReconciliationMode.php | 66 - .../Retail/V2/ImportProductsResponse.php | 114 - .../Retail/V2/ImportUserEventsRequest.php | 159 -- .../Retail/V2/ImportUserEventsResponse.php | 161 -- .../src/Google/Cloud/Retail/V2/Interval.php | 183 -- .../Cloud/Retail/V2/ListCatalogsRequest.php | 216 -- .../Cloud/Retail/V2/ListCatalogsResponse.php | 115 - .../Cloud/Retail/V2/ListControlsRequest.php | 212 -- .../Cloud/Retail/V2/ListControlsResponse.php | 101 - .../ListGenerativeQuestionConfigsRequest.php | 86 - .../ListGenerativeQuestionConfigsResponse.php | 67 - .../Cloud/Retail/V2/ListModelsRequest.php | 167 -- .../Cloud/Retail/V2/ListModelsResponse.php | 101 - .../Cloud/Retail/V2/ListProductsRequest.php | 452 --- .../Cloud/Retail/V2/ListProductsResponse.php | 115 - .../Retail/V2/ListServingConfigsRequest.php | 166 -- .../Retail/V2/ListServingConfigsResponse.php | 101 - .../Google/Cloud/Retail/V2/LocalInventory.php | 316 --- .../src/Google/Cloud/Retail/V2/Model.php | 811 ------ .../Retail/V2/Model/ContextProductsType.php | 68 - .../Cloud/Retail/V2/Model/DataState.php | 66 - ...FrequentlyBoughtTogetherFeaturesConfig.php | 82 - .../Retail/V2/Model/ModelFeaturesConfig.php | 78 - .../Retail/V2/Model/PeriodicTuningState.php | 82 - .../Retail/V2/Model/ServingConfigList.php | 75 - .../Cloud/Retail/V2/Model/ServingState.php | 72 - .../Cloud/Retail/V2/Model/TrainingState.php | 64 - .../Google/Cloud/Retail/V2/OutputConfig.php | 108 - .../V2/OutputConfig/BigQueryDestination.php | 146 - .../Retail/V2/OutputConfig/GcsDestination.php | 94 - .../Google/Cloud/Retail/V2/OutputResult.php | 102 - .../Cloud/Retail/V2/PauseModelRequest.php | 91 - .../Google/Cloud/Retail/V2/PredictRequest.php | 708 ----- .../Cloud/Retail/V2/PredictResponse.php | 185 -- .../V2/PredictResponse/PredictionResult.php | 124 - .../src/Google/Cloud/Retail/V2/PriceInfo.php | 505 ---- .../Cloud/Retail/V2/PriceInfo/PriceRange.php | 159 -- .../src/Google/Cloud/Retail/V2/Product.php | 2502 ----------------- .../Cloud/Retail/V2/Product/Availability.php | 81 - .../Google/Cloud/Retail/V2/Product/Type.php | 89 - .../Retail/V2/ProductAttributeInterval.php | 111 - .../Cloud/Retail/V2/ProductAttributeValue.php | 103 - .../Google/Cloud/Retail/V2/ProductDetail.php | 206 -- .../Cloud/Retail/V2/ProductInlineSource.php | 75 - .../Cloud/Retail/V2/ProductInputConfig.php | 141 - .../Cloud/Retail/V2/ProductLevelConfig.php | 246 -- .../src/Google/Cloud/Retail/V2/Promotion.php | 91 - .../Cloud/Retail/V2/PurchaseTransaction.php | 235 -- .../Google/Cloud/Retail/V2/PurgeMetadata.php | 34 - .../Cloud/Retail/V2/PurgeProductsMetadata.php | 194 -- .../Cloud/Retail/V2/PurgeProductsRequest.php | 263 -- .../Cloud/Retail/V2/PurgeProductsResponse.php | 111 - .../Retail/V2/PurgeUserEventsRequest.php | 223 -- .../Retail/V2/PurgeUserEventsResponse.php | 69 - .../src/Google/Cloud/Retail/V2/Rating.php | 175 -- .../V2/RecommendationsFilteringOption.php | 63 - .../Retail/V2/RejoinUserEventsMetadata.php | 33 - .../Retail/V2/RejoinUserEventsRequest.php | 117 - .../UserEventRejoinScope.php | 71 - .../Retail/V2/RejoinUserEventsResponse.php | 67 - .../V2/RemoveCatalogAttributeRequest.php | 111 - .../Cloud/Retail/V2/RemoveControlRequest.php | 124 - .../V2/RemoveFulfillmentPlacesMetadata.php | 36 - .../V2/RemoveFulfillmentPlacesRequest.php | 375 --- .../V2/RemoveFulfillmentPlacesResponse.php | 36 - .../V2/RemoveLocalInventoriesMetadata.php | 36 - .../V2/RemoveLocalInventoriesRequest.php | 253 -- .../V2/RemoveLocalInventoriesResponse.php | 38 - .../V2/ReplaceCatalogAttributeRequest.php | 181 -- .../Cloud/Retail/V2/ResumeModelRequest.php | 90 - .../proto/src/Google/Cloud/Retail/V2/Rule.php | 427 --- .../Cloud/Retail/V2/Rule/BoostAction.php | 200 -- .../Retail/V2/Rule/DoNotAssociateAction.php | 152 - .../Cloud/Retail/V2/Rule/FilterAction.php | 127 - .../Retail/V2/Rule/ForceReturnFacetAction.php | 95 - .../FacetPositionAdjustment.php | 117 - .../Cloud/Retail/V2/Rule/IgnoreAction.php | 71 - .../Retail/V2/Rule/OnewaySynonymsAction.php | 162 -- .../Cloud/Retail/V2/Rule/RedirectAction.php | 75 - .../Retail/V2/Rule/RemoveFacetAction.php | 95 - .../Retail/V2/Rule/ReplacementAction.php | 148 - .../Retail/V2/Rule/TwowaySynonymsAction.php | 81 - .../Google/Cloud/Retail/V2/SearchRequest.php | 1625 ----------- .../Retail/V2/SearchRequest/BoostSpec.php | 146 - .../BoostSpec/ConditionBoostSpec.php | 192 -- .../ConversationalSearchSpec.php | 181 -- .../ConversationalSearchSpec/UserAnswer.php | 122 - .../UserAnswer/SelectedAnswer.php | 124 - .../V2/SearchRequest/DynamicFacetSpec.php | 82 - .../SearchRequest/DynamicFacetSpec/Mode.php | 64 - .../Retail/V2/SearchRequest/FacetSpec.php | 362 --- .../V2/SearchRequest/FacetSpec/FacetKey.php | 770 ----- .../V2/SearchRequest/PersonalizationSpec.php | 74 - .../PersonalizationSpec/Mode.php | 66 - .../V2/SearchRequest/QueryExpansionSpec.php | 117 - .../QueryExpansionSpec/Condition.php | 68 - .../Retail/V2/SearchRequest/SearchMode.php | 88 - .../V2/SearchRequest/SpellCorrectionSpec.php | 78 - .../SpellCorrectionSpec/Mode.php | 70 - .../V2/SearchRequest/TileNavigationSpec.php | 120 - .../Google/Cloud/Retail/V2/SearchResponse.php | 590 ---- .../ConversationalSearchResult.php | 324 --- .../AdditionalFilter.php | 84 - .../SuggestedAnswer.php | 84 - .../Cloud/Retail/V2/SearchResponse/Facet.php | 142 - .../V2/SearchResponse/Facet/FacetValue.php | 245 -- .../V2/SearchResponse/QueryExpansionInfo.php | 117 - .../Retail/V2/SearchResponse/SearchResult.php | 486 ---- .../SearchResponse/TileNavigationResult.php | 75 - .../Cloud/Retail/V2/SearchSolutionUseCase.php | 64 - .../Google/Cloud/Retail/V2/ServingConfig.php | 1258 --------- .../Retail/V2/ServingConfig/DiversityType.php | 64 - .../Retail/V2/SetDefaultBranchRequest.php | 231 -- .../Cloud/Retail/V2/SetInventoryMetadata.php | 36 - .../Cloud/Retail/V2/SetInventoryRequest.php | 507 ---- .../Cloud/Retail/V2/SetInventoryResponse.php | 36 - .../Google/Cloud/Retail/V2/SolutionType.php | 61 - .../proto/src/Google/Cloud/Retail/V2/Tile.php | 144 - .../Cloud/Retail/V2/TuneModelMetadata.php | 75 - .../Cloud/Retail/V2/TuneModelRequest.php | 92 - .../Cloud/Retail/V2/TuneModelResponse.php | 33 - .../V2/UpdateAttributesConfigRequest.php | 165 -- .../Cloud/Retail/V2/UpdateCatalogRequest.php | 181 -- .../V2/UpdateCompletionConfigRequest.php | 207 -- .../Cloud/Retail/V2/UpdateControlRequest.php | 158 -- .../UpdateGenerativeQuestionConfigRequest.php | 158 -- ...enerativeQuestionsFeatureConfigRequest.php | 146 - .../Cloud/Retail/V2/UpdateModelRequest.php | 141 - .../Cloud/Retail/V2/UpdateProductRequest.php | 264 -- .../Retail/V2/UpdateServingConfigRequest.php | 158 -- .../src/Google/Cloud/Retail/V2/UserEvent.php | 1360 --------- .../Retail/V2/UserEventImportSummary.php | 106 - .../Cloud/Retail/V2/UserEventInlineSource.php | 67 - .../Cloud/Retail/V2/UserEventInputConfig.php | 141 - .../src/Google/Cloud/Retail/V2/UserInfo.php | 309 -- .../Cloud/Retail/V2/WriteUserEventRequest.php | 161 -- .../export_analytics_metrics.php | 89 - .../add_catalog_attribute.php | 99 - .../get_attributes_config.php | 72 - .../get_completion_config.php | 72 - .../get_default_branch.php | 59 - .../V2/CatalogServiceClient/list_catalogs.php | 82 - .../remove_catalog_attribute.php | 85 - .../replace_catalog_attribute.php | 101 - .../set_default_branch.php | 87 - .../update_attributes_config.php | 80 - .../CatalogServiceClient/update_catalog.php | 81 - .../update_completion_config.php | 73 - .../complete_query.php | 82 - .../import_completion_data.php | 114 - .../ControlServiceClient/create_control.php | 109 - .../ControlServiceClient/delete_control.php | 78 - .../V2/ControlServiceClient/get_control.php | 77 - .../V2/ControlServiceClient/list_controls.php | 78 - .../ControlServiceClient/update_control.php | 90 - ...tch_update_generative_question_configs.php | 86 - ...et_generative_questions_feature_config.php | 77 - .../list_generative_question_configs.php | 76 - .../update_generative_question_config.php | 81 - ...te_generative_questions_feature_config.php | 75 - .../V2/ModelServiceClient/create_model.php | 123 - .../V2/ModelServiceClient/delete_model.php | 71 - .../V2/ModelServiceClient/get_model.php | 73 - .../V2/ModelServiceClient/list_models.php | 78 - .../V2/ModelServiceClient/pause_model.php | 73 - .../V2/ModelServiceClient/resume_model.php | 72 - .../V2/ModelServiceClient/tune_model.php | 85 - .../V2/ModelServiceClient/update_model.php | 105 - .../V2/PredictionServiceClient/predict.php | 123 - .../add_fulfillment_places.php | 167 -- .../add_local_inventories.php | 125 - .../ProductServiceClient/create_product.php | 109 - .../ProductServiceClient/delete_product.php | 95 - .../V2/ProductServiceClient/get_product.php | 86 - .../ProductServiceClient/import_products.php | 101 - .../V2/ProductServiceClient/list_products.php | 88 - .../ProductServiceClient/purge_products.php | 147 - .../remove_fulfillment_places.php | 162 -- .../remove_local_inventories.php | 125 - .../V2/ProductServiceClient/set_inventory.php | 140 - .../ProductServiceClient/update_product.php | 79 - .../samples/V2/SearchServiceClient/search.php | 95 - .../add_control.php | 87 - .../create_serving_config.php | 107 - .../delete_serving_config.php | 77 - .../get_serving_config.php | 79 - .../list_serving_configs.php | 77 - .../remove_control.php | 84 - .../update_serving_config.php | 84 - .../collect_user_event.php | 79 - .../import_user_events.php | 140 - .../purge_user_events.php | 113 - .../rejoin_user_events.php | 90 - .../write_user_event.php | 110 - .../src/V2/Client/AnalyticsServiceClient.php | 253 -- .../v2/src/V2/Client/CatalogServiceClient.php | 668 ----- .../src/V2/Client/CompletionServiceClient.php | 340 --- .../v2/src/V2/Client/ControlServiceClient.php | 388 --- .../GenerativeQuestionServiceClient.php | 368 --- .../v2/src/V2/Client/ModelServiceClient.php | 528 ---- .../src/V2/Client/PredictionServiceClient.php | 247 -- .../v2/src/V2/Client/ProductServiceClient.php | 813 ------ .../v2/src/V2/Client/SearchServiceClient.php | 251 -- .../V2/Client/ServingConfigServiceClient.php | 454 --- .../src/V2/Client/UserEventServiceClient.php | 455 --- .../Retail/v2/src/V2/gapic_metadata.json | 398 --- .../analytics_service_client_config.json | 40 - .../analytics_service_descriptor_config.php | 47 - .../analytics_service_rest_client_config.php | 89 - .../catalog_service_client_config.json | 90 - .../catalog_service_descriptor_config.php | 178 -- .../catalog_service_rest_client_config.php | 208 -- .../completion_service_client_config.json | 45 - .../completion_service_descriptor_config.php | 62 - .../completion_service_rest_client_config.php | 100 - .../control_service_client_config.json | 47 - .../control_service_descriptor_config.php | 101 - .../control_service_rest_client_config.php | 138 - ...rative_question_service_client_config.json | 47 - ...ive_question_service_descriptor_config.php | 93 - ...ve_question_service_rest_client_config.php | 137 - .../model_service_client_config.json | 75 - .../model_service_descriptor_config.php | 151 - .../model_service_rest_client_config.php | 171 -- .../prediction_service_client_config.json | 40 - .../prediction_service_descriptor_config.php | 43 - .../prediction_service_rest_client_config.php | 96 - .../product_service_client_config.json | 108 - .../product_service_descriptor_config.php | 235 -- .../product_service_rest_client_config.php | 223 -- .../search_service_client_config.json | 40 - .../search_service_descriptor_config.php | 51 - .../search_service_rest_client_config.php | 96 - .../serving_config_service_client_config.json | 57 - ...rving_config_service_descriptor_config.php | 125 - ...ving_config_service_rest_client_config.php | 162 -- .../user_event_service_client_config.json | 86 - .../user_event_service_descriptor_config.php | 113 - .../user_event_service_rest_client_config.php | 136 - .../V2/Client/AnalyticsServiceClientTest.php | 262 -- .../V2/Client/CatalogServiceClientTest.php | 885 ------ .../V2/Client/CompletionServiceClientTest.php | 312 -- .../V2/Client/ControlServiceClientTest.php | 470 ---- .../GenerativeQuestionServiceClientTest.php | 442 --- .../Unit/V2/Client/ModelServiceClientTest.php | 863 ------ .../V2/Client/PredictionServiceClientTest.php | 182 -- .../V2/Client/ProductServiceClientTest.php | 1447 ---------- .../V2/Client/SearchServiceClientTest.php | 198 -- .../Client/ServingConfigServiceClientTest.php | 668 ----- .../V2/Client/UserEventServiceClientTest.php | 672 ----- .../GPBMetadata/Google/Cloud/Run/V2/Build.php | Bin 2450 -> 0 bytes .../Google/Cloud/Run/V2/Condition.php | Bin 2428 -> 0 bytes .../Google/Cloud/Run/V2/Execution.php | 109 - .../Google/Cloud/Run/V2/ExecutionTemplate.php | 42 - .../GPBMetadata/Google/Cloud/Run/V2/Job.php | Bin 6807 -> 0 bytes .../Google/Cloud/Run/V2/K8SMin.php | Bin 3770 -> 0 bytes .../Google/Cloud/Run/V2/Revision.php | 112 - .../Google/Cloud/Run/V2/RevisionTemplate.php | 62 - .../Google/Cloud/Run/V2/Service.php | 135 - .../Google/Cloud/Run/V2/Status.php | 29 - .../GPBMetadata/Google/Cloud/Run/V2/Task.php | 103 - .../Google/Cloud/Run/V2/TaskTemplate.php | Bin 1579 -> 0 bytes .../Google/Cloud/Run/V2/TrafficTarget.php | Bin 1280 -> 0 bytes .../Google/Cloud/Run/V2/VendorSettings.php | Bin 2510 -> 0 bytes .../Cloud/Run/V2/BinaryAuthorization.php | 160 -- .../Cloud/Run/V2/CancelExecutionRequest.php | 172 -- .../Google/Cloud/Run/V2/CloudSqlInstance.php | 86 - .../src/Google/Cloud/Run/V2/Condition.php | 337 --- .../Cloud/Run/V2/Condition/CommonReason.php | 148 - .../Run/V2/Condition/ExecutionReason.php | 86 - .../Cloud/Run/V2/Condition/RevisionReason.php | 141 - .../Cloud/Run/V2/Condition/Severity.php | 71 - .../Google/Cloud/Run/V2/Condition/State.php | 78 - .../src/Google/Cloud/Run/V2/Container.php | 531 ---- .../src/Google/Cloud/Run/V2/ContainerPort.php | 109 - .../Google/Cloud/Run/V2/CreateJobRequest.php | 216 -- .../Cloud/Run/V2/CreateServiceRequest.php | 221 -- .../Cloud/Run/V2/DeleteExecutionRequest.php | 172 -- .../Google/Cloud/Run/V2/DeleteJobRequest.php | 167 -- .../Cloud/Run/V2/DeleteRevisionRequest.php | 169 -- .../Cloud/Run/V2/DeleteServiceRequest.php | 167 -- .../Cloud/Run/V2/EmptyDirVolumeSource.php | 143 - .../Run/V2/EmptyDirVolumeSource/Medium.php | 58 - .../Run/V2/EncryptionKeyRevocationAction.php | 61 - .../proto/src/Google/Cloud/Run/V2/EnvVar.php | 152 - .../src/Google/Cloud/Run/V2/EnvVarSource.php | 77 - .../src/Google/Cloud/Run/V2/Execution.php | 1183 -------- .../Cloud/Run/V2/ExecutionEnvironment.php | 61 - .../Cloud/Run/V2/ExecutionReference.php | 238 -- .../ExecutionReference/CompletionStatus.php | 85 - .../Google/Cloud/Run/V2/ExecutionTemplate.php | 322 --- .../Google/Cloud/Run/V2/GCSVolumeSource.php | 140 - .../src/Google/Cloud/Run/V2/GRPCAction.php | 121 - .../Cloud/Run/V2/GetExecutionRequest.php | 96 - .../src/Google/Cloud/Run/V2/GetJobRequest.php | 91 - .../Cloud/Run/V2/GetRevisionRequest.php | 91 - .../Google/Cloud/Run/V2/GetServiceRequest.php | 91 - .../Google/Cloud/Run/V2/GetTaskRequest.php | 91 - .../src/Google/Cloud/Run/V2/HTTPGetAction.php | 147 - .../src/Google/Cloud/Run/V2/HTTPHeader.php | 101 - .../Google/Cloud/Run/V2/IngressTraffic.php | 75 - .../v2/proto/src/Google/Cloud/Run/V2/Job.php | 1249 -------- .../Cloud/Run/V2/ListExecutionsRequest.php | 202 -- .../Cloud/Run/V2/ListExecutionsResponse.php | 105 - .../Google/Cloud/Run/V2/ListJobsRequest.php | 197 -- .../Google/Cloud/Run/V2/ListJobsResponse.php | 105 - .../Cloud/Run/V2/ListRevisionsRequest.php | 202 -- .../Cloud/Run/V2/ListRevisionsResponse.php | 105 - .../Cloud/Run/V2/ListServicesRequest.php | 202 -- .../Cloud/Run/V2/ListServicesResponse.php | 105 - .../Google/Cloud/Run/V2/ListTasksRequest.php | 202 -- .../Google/Cloud/Run/V2/ListTasksResponse.php | 105 - .../Google/Cloud/Run/V2/NFSVolumeSource.php | 135 - .../src/Google/Cloud/Run/V2/NodeSelector.php | 67 - .../proto/src/Google/Cloud/Run/V2/Probe.php | 319 --- .../Cloud/Run/V2/ResourceRequirements.php | 175 -- .../src/Google/Cloud/Run/V2/Revision.php | 1373 --------- .../Google/Cloud/Run/V2/RevisionScaling.php | 117 - .../Cloud/Run/V2/RevisionScalingStatus.php | 67 - .../Google/Cloud/Run/V2/RevisionTemplate.php | 822 ------ .../src/Google/Cloud/Run/V2/RunJobRequest.php | 215 -- .../Cloud/Run/V2/RunJobRequest/Overrides.php | 160 -- .../Overrides/ContainerOverride.php | 180 -- .../Google/Cloud/Run/V2/SecretKeySelector.php | 121 - .../Cloud/Run/V2/SecretVolumeSource.php | 217 -- .../proto/src/Google/Cloud/Run/V2/Service.php | 1609 ----------- .../src/Google/Cloud/Run/V2/ServiceMesh.php | 76 - .../Google/Cloud/Run/V2/ServiceScaling.php | 162 -- .../Run/V2/ServiceScaling/ScalingMode.php | 65 - .../src/Google/Cloud/Run/V2/StorageSource.php | 155 - .../Cloud/Run/V2/SubmitBuildRequest.php | 356 --- .../V2/SubmitBuildRequest/BuildpacksBuild.php | 273 -- .../Run/V2/SubmitBuildRequest/DockerBuild.php | 36 - .../Cloud/Run/V2/SubmitBuildResponse.php | 149 - .../Google/Cloud/Run/V2/TCPSocketAction.php | 75 - .../v2/proto/src/Google/Cloud/Run/V2/Task.php | 1339 --------- .../Google/Cloud/Run/V2/TaskAttemptResult.php | 127 - .../src/Google/Cloud/Run/V2/TaskTemplate.php | 381 --- .../src/Google/Cloud/Run/V2/TrafficTarget.php | 182 -- .../Run/V2/TrafficTargetAllocationType.php | 61 - .../Cloud/Run/V2/TrafficTargetStatus.php | 203 -- .../Google/Cloud/Run/V2/UpdateJobRequest.php | 170 -- .../Cloud/Run/V2/UpdateServiceRequest.php | 229 -- .../src/Google/Cloud/Run/V2/VersionToPath.php | 188 -- .../proto/src/Google/Cloud/Run/V2/Volume.php | 247 -- .../src/Google/Cloud/Run/V2/VolumeMount.php | 117 - .../src/Google/Cloud/Run/V2/VpcAccess.php | 160 -- .../Run/V2/VpcAccess/NetworkInterface.php | 170 -- .../Cloud/Run/V2/VpcAccess/VpcEgress.php | 64 - .../samples/V2/BuildsClient/submit_build.php | 94 - .../V2/ExecutionsClient/cancel_execution.php | 86 - .../V2/ExecutionsClient/delete_execution.php | 86 - .../V2/ExecutionsClient/get_execution.php | 74 - .../V2/ExecutionsClient/list_executions.php | 80 - .../v2/samples/V2/JobsClient/create_job.php | 97 - .../v2/samples/V2/JobsClient/delete_job.php | 85 - .../samples/V2/JobsClient/get_iam_policy.php | 72 - .../Run/v2/samples/V2/JobsClient/get_job.php | 73 - .../v2/samples/V2/JobsClient/list_jobs.php | 78 - .../Run/v2/samples/V2/JobsClient/run_job.php | 85 - .../samples/V2/JobsClient/set_iam_policy.php | 74 - .../V2/JobsClient/test_iam_permissions.php | 80 - .../v2/samples/V2/JobsClient/update_job.php | 77 - .../V2/RevisionsClient/delete_revision.php | 90 - .../V2/RevisionsClient/get_revision.php | 78 - .../V2/RevisionsClient/list_revisions.php | 80 - .../V2/ServicesClient/create_service.php | 95 - .../V2/ServicesClient/delete_service.php | 87 - .../V2/ServicesClient/get_iam_policy.php | 72 - .../samples/V2/ServicesClient/get_service.php | 73 - .../V2/ServicesClient/list_services.php | 79 - .../V2/ServicesClient/set_iam_policy.php | 74 - .../ServicesClient/test_iam_permissions.php | 80 - .../V2/ServicesClient/update_service.php | 74 - .../v2/samples/V2/TasksClient/get_task.php | 73 - .../v2/samples/V2/TasksClient/list_tasks.php | 79 - .../Run/v2/src/V2/Client/BuildsClient.php | 243 -- .../Run/v2/src/V2/Client/ExecutionsClient.php | 405 --- .../Run/v2/src/V2/Client/JobsClient.php | 697 ----- .../Run/v2/src/V2/Client/RevisionsClient.php | 377 --- .../Run/v2/src/V2/Client/ServicesClient.php | 690 ----- .../Run/v2/src/V2/Client/TasksClient.php | 298 -- .../Run/v2/src/V2/gapic_metadata.json | 198 -- .../V2/resources/builds_client_config.json | 27 - .../V2/resources/builds_descriptor_config.php | 43 - .../resources/builds_rest_client_config.php | 88 - .../resources/executions_client_config.json | 42 - .../executions_descriptor_config.php | 102 - .../executions_rest_client_config.php | 121 - .../src/V2/resources/jobs_client_config.json | 67 - .../V2/resources/jobs_descriptor_config.php | 191 -- .../V2/resources/jobs_rest_client_config.php | 184 -- .../V2/resources/revisions_client_config.json | 37 - .../resources/revisions_descriptor_config.php | 86 - .../revisions_rest_client_config.php | 109 - .../V2/resources/services_client_config.json | 94 - .../resources/services_descriptor_config.php | 172 -- .../resources/services_rest_client_config.php | 172 -- .../src/V2/resources/tasks_client_config.json | 32 - .../V2/resources/tasks_descriptor_config.php | 64 - .../V2/resources/tasks_rest_client_config.php | 98 - .../tests/Unit/V2/Client/BuildsClientTest.php | 192 -- .../Unit/V2/Client/ExecutionsClientTest.php | 638 ----- .../tests/Unit/V2/Client/JobsClientTest.php | 1170 -------- .../Unit/V2/Client/RevisionsClientTest.php | 466 --- .../Unit/V2/Client/ServicesClientTest.php | 1044 ------- .../tests/Unit/V2/Client/TasksClientTest.php | 285 -- .../Cloud/Scheduler/V1/Cloudscheduler.php | 74 - .../Google/Cloud/Scheduler/V1/Job.php | Bin 2214 -> 0 bytes .../Google/Cloud/Scheduler/V1/Target.php | Bin 2072 -> 0 bytes .../Scheduler/V1/AppEngineHttpTarget.php | 370 --- .../Cloud/Scheduler/V1/AppEngineRouting.php | 414 --- .../Cloud/Scheduler/V1/CreateJobRequest.php | 158 -- .../Cloud/Scheduler/V1/DeleteJobRequest.php | 87 - .../Cloud/Scheduler/V1/GetJobRequest.php | 87 - .../Google/Cloud/Scheduler/V1/HttpMethod.php | 96 - .../Google/Cloud/Scheduler/V1/HttpTarget.php | 383 --- .../src/Google/Cloud/Scheduler/V1/Job.php | 832 ------ .../Google/Cloud/Scheduler/V1/Job/State.php | 85 - .../Cloud/Scheduler/V1/ListJobsRequest.php | 207 -- .../Cloud/Scheduler/V1/ListJobsResponse.php | 126 - .../Google/Cloud/Scheduler/V1/OAuthToken.php | 124 - .../Google/Cloud/Scheduler/V1/OidcToken.php | 122 - .../Cloud/Scheduler/V1/PauseJobRequest.php | 87 - .../Cloud/Scheduler/V1/PubsubTarget.php | 172 -- .../Cloud/Scheduler/V1/ResumeJobRequest.php | 87 - .../Google/Cloud/Scheduler/V1/RetryConfig.php | 397 --- .../Cloud/Scheduler/V1/RunJobRequest.php | 87 - .../Cloud/Scheduler/V1/UpdateJobRequest.php | 153 - .../V1/CloudSchedulerClient/create_job.php | 74 - .../V1/CloudSchedulerClient/delete_job.php | 70 - .../V1/CloudSchedulerClient/get_job.php | 72 - .../V1/CloudSchedulerClient/get_location.php | 57 - .../V1/CloudSchedulerClient/list_jobs.php | 77 - .../CloudSchedulerClient/list_locations.php | 62 - .../V1/CloudSchedulerClient/pause_job.php | 81 - .../V1/CloudSchedulerClient/resume_job.php | 80 - .../V1/CloudSchedulerClient/run_job.php | 75 - .../V1/CloudSchedulerClient/update_job.php | 71 - .../v1/src/V1/Client/CloudSchedulerClient.php | 561 ---- .../Scheduler/v1/src/V1/gapic_metadata.json | 68 - .../cloud_scheduler_client_config.json | 95 - .../cloud_scheduler_descriptor_config.php | 172 -- .../cloud_scheduler_rest_client_config.php | 150 - .../V1/Client/CloudSchedulerClientTest.php | 804 ------ 1715 files changed, 324 insertions(+), 285435 deletions(-) delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php delete mode 100644 owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php delete mode 100644 owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php delete mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json delete mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php delete mode 100644 owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php delete mode 100644 owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json delete mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php delete mode 100644 owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json delete mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php delete mode 100644 owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php delete mode 100644 owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AccessTuple.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php delete mode 100644 owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_client_config.json delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_descriptor_config.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php delete mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php delete mode 100644 owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateOfflineProfileRequest.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php delete mode 100644 owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php delete mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php delete mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php delete mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php delete mode 100644 owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php delete mode 100644 owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php delete mode 100644 owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php delete mode 100644 owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php delete mode 100644 owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php delete mode 100644 owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php delete mode 100644 owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php delete mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php delete mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php delete mode 100644 owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/CreateQuotaPreferenceRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php delete mode 100644 owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php delete mode 100644 owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php delete mode 100644 owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php delete mode 100644 owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json delete mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php delete mode 100644 owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php delete mode 100644 owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php delete mode 100644 owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_client_config.json delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_descriptor_config.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php delete mode 100644 owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php 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/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/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/PredictionApiKeyRegistration.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/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/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/samples/V1beta1/CatalogServiceClient/create_catalog_item.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/CatalogServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.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/Client/CatalogServiceClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.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 delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php delete mode 100644 owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php delete mode 100644 owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php delete mode 100644 owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php delete mode 100644 owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php delete mode 100644 owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json delete mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php delete mode 100644 owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php delete mode 100644 owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php delete mode 100644 owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Organizations.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json delete mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/CatalogService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/CompletionService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ControlService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Model.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ModelService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PredictionService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php delete mode 100644 owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php delete mode 100644 owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php delete mode 100644 owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php delete mode 100644 owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Execution.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/ExecutionTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Revision.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TrafficTarget.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/BinaryAuthorization.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php delete mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php delete mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php delete mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php delete mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineHttpTarget.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php delete mode 100644 owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php delete mode 100644 owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json delete mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php delete mode 100644 owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php delete mode 100644 owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php diff --git a/Parallelstore/src/V1/Client/ParallelstoreClient.php b/Parallelstore/src/V1/Client/ParallelstoreClient.php index 26374b478f7..bf2f58f85ad 100644 --- a/Parallelstore/src/V1/Client/ParallelstoreClient.php +++ b/Parallelstore/src/V1/Client/ParallelstoreClient.php @@ -48,6 +48,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service describing handlers for resources @@ -287,14 +288,14 @@ public static function serviceAccountName(string $project, string $serviceAccoun * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -349,6 +350,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Parallelstore/src/V1beta/Client/ParallelstoreClient.php b/Parallelstore/src/V1beta/Client/ParallelstoreClient.php index a703d343bb4..cae2c024d0f 100644 --- a/Parallelstore/src/V1beta/Client/ParallelstoreClient.php +++ b/Parallelstore/src/V1beta/Client/ParallelstoreClient.php @@ -50,6 +50,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service describing handlers for resources @@ -305,8 +306,8 @@ public static function serviceAccountName(string $project, string $serviceAccoun * 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 + * @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. * @@ -314,7 +315,7 @@ public static function serviceAccountName(string $project, string $serviceAccoun * * @experimental */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -369,6 +370,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PolicySimulator/src/V1/Client/SimulatorClient.php b/PolicySimulator/src/V1/Client/SimulatorClient.php index b06626f31f4..0a3857e0955 100644 --- a/PolicySimulator/src/V1/Client/SimulatorClient.php +++ b/PolicySimulator/src/V1/Client/SimulatorClient.php @@ -41,6 +41,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Policy Simulator API service. @@ -260,14 +261,14 @@ public static function replayName(string $project, string $location, string $rep * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -322,6 +323,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PolicyTroubleshooter/src/V1/Client/IamCheckerClient.php b/PolicyTroubleshooter/src/V1/Client/IamCheckerClient.php index efde54a95c3..e7279db8ac1 100644 --- a/PolicyTroubleshooter/src/V1/Client/IamCheckerClient.php +++ b/PolicyTroubleshooter/src/V1/Client/IamCheckerClient.php @@ -34,6 +34,7 @@ use Google\Cloud\PolicyTroubleshooter\V1\TroubleshootIamPolicyRequest; use Google\Cloud\PolicyTroubleshooter\V1\TroubleshootIamPolicyResponse; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: IAM Policy Troubleshooter service. @@ -140,6 +141,9 @@ private static function getClientDefaults() * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PolicyTroubleshooterIam/src/V3/Client/PolicyTroubleshooterClient.php b/PolicyTroubleshooterIam/src/V3/Client/PolicyTroubleshooterClient.php index d7c816cfbca..99da1f7b233 100644 --- a/PolicyTroubleshooterIam/src/V3/Client/PolicyTroubleshooterClient.php +++ b/PolicyTroubleshooterIam/src/V3/Client/PolicyTroubleshooterClient.php @@ -34,6 +34,7 @@ use Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyRequest; use Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: IAM Policy Troubleshooter service. @@ -140,6 +141,9 @@ private static function getClientDefaults() * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PrivateCatalog/src/V1beta1/Client/PrivateCatalogClient.php b/PrivateCatalog/src/V1beta1/Client/PrivateCatalogClient.php index c9ad2cb7428..9695ee55c42 100644 --- a/PrivateCatalog/src/V1beta1/Client/PrivateCatalogClient.php +++ b/PrivateCatalog/src/V1beta1/Client/PrivateCatalogClient.php @@ -38,6 +38,7 @@ use Google\Cloud\PrivateCatalog\V1beta1\SearchProductsRequest; use Google\Cloud\PrivateCatalog\V1beta1\SearchVersionsRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` @@ -168,6 +169,9 @@ private static function getClientDefaults() * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PrivilegedAccessManager/src/V1/Client/PrivilegedAccessManagerClient.php b/PrivilegedAccessManager/src/V1/Client/PrivilegedAccessManagerClient.php index d8b494026c2..ab94f4afc70 100644 --- a/PrivilegedAccessManager/src/V1/Client/PrivilegedAccessManagerClient.php +++ b/PrivilegedAccessManager/src/V1/Client/PrivilegedAccessManagerClient.php @@ -57,6 +57,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: This API allows customers to manage temporary, request based privileged @@ -455,14 +456,14 @@ public static function projectLocationEntitlementGrantName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -517,6 +518,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Profiler/src/V2/Client/ExportServiceClient.php b/Profiler/src/V2/Client/ExportServiceClient.php index 93c55f70d2d..2c4c7dfc1ec 100644 --- a/Profiler/src/V2/Client/ExportServiceClient.php +++ b/Profiler/src/V2/Client/ExportServiceClient.php @@ -35,6 +35,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Profiler\V2\ListProfilesRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service allows existing Cloud Profiler customers to export their profile data @@ -127,14 +128,14 @@ public static function projectName(string $project): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -189,6 +190,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Profiler/src/V2/Client/ProfilerServiceClient.php b/Profiler/src/V2/Client/ProfilerServiceClient.php index 7746d3cdb12..0c34774d14f 100644 --- a/Profiler/src/V2/Client/ProfilerServiceClient.php +++ b/Profiler/src/V2/Client/ProfilerServiceClient.php @@ -37,6 +37,7 @@ use Google\Cloud\Profiler\V2\Profile; use Google\Cloud\Profiler\V2\UpdateProfileRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Manage the collection of continuous profiling data provided by profiling @@ -152,14 +153,14 @@ public static function projectName(string $project): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -214,6 +215,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PubSub/src/V1/Client/PublisherClient.php b/PubSub/src/V1/Client/PublisherClient.php index 6780e7ddc0a..cb154fd306c 100644 --- a/PubSub/src/V1/Client/PublisherClient.php +++ b/PubSub/src/V1/Client/PublisherClient.php @@ -50,6 +50,7 @@ use Google\Cloud\PubSub\V1\Topic; use Google\Cloud\PubSub\V1\UpdateTopicRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: The service that an application uses to manipulate topics, and to send @@ -236,14 +237,14 @@ public static function topicName(string $project, string $topic): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -298,6 +299,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PubSub/src/V1/Client/SchemaServiceClient.php b/PubSub/src/V1/Client/SchemaServiceClient.php index db2bfc181b2..a234595fc98 100644 --- a/PubSub/src/V1/Client/SchemaServiceClient.php +++ b/PubSub/src/V1/Client/SchemaServiceClient.php @@ -52,6 +52,7 @@ use Google\Cloud\PubSub\V1\ValidateSchemaRequest; use Google\Cloud\PubSub\V1\ValidateSchemaResponse; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for doing schema-related operations. @@ -172,14 +173,14 @@ public static function schemaName(string $project, string $schema): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -234,6 +235,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/PubSub/src/V1/Client/SubscriberClient.php b/PubSub/src/V1/Client/SubscriberClient.php index bcccf61d29d..58397867d91 100644 --- a/PubSub/src/V1/Client/SubscriberClient.php +++ b/PubSub/src/V1/Client/SubscriberClient.php @@ -58,6 +58,7 @@ use Google\Cloud\PubSub\V1\UpdateSnapshotRequest; use Google\Cloud\PubSub\V1\UpdateSubscriptionRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: The service that an application uses to manipulate subscriptions and to @@ -251,14 +252,14 @@ public static function topicName(string $project, string $topic): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -313,6 +314,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Quotas/src/V1/Client/CloudQuotasClient.php b/Quotas/src/V1/Client/CloudQuotasClient.php index e74c69b5528..d4d51dedd5d 100644 --- a/Quotas/src/V1/Client/CloudQuotasClient.php +++ b/Quotas/src/V1/Client/CloudQuotasClient.php @@ -42,6 +42,7 @@ use Google\Cloud\CloudQuotas\V1\QuotaPreference; use Google\Cloud\CloudQuotas\V1\UpdateQuotaPreferenceRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: The Cloud Quotas API is an infrastructure service for Google Cloud that lets @@ -468,14 +469,14 @@ public static function serviceName(string $project, string $location, string $se * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -530,6 +531,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php b/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php index d94b570735b..b374bce38a0 100644 --- a/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php +++ b/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php @@ -52,6 +52,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service describing handlers for resources. @@ -245,14 +246,14 @@ public static function locationName(string $project, string $location): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -307,6 +308,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RecaptchaEnterprise/src/V1/Client/RecaptchaEnterpriseServiceClient.php b/RecaptchaEnterprise/src/V1/Client/RecaptchaEnterpriseServiceClient.php index 0fbe0552079..069f2cdaad0 100644 --- a/RecaptchaEnterprise/src/V1/Client/RecaptchaEnterpriseServiceClient.php +++ b/RecaptchaEnterprise/src/V1/Client/RecaptchaEnterpriseServiceClient.php @@ -65,6 +65,7 @@ use Google\Cloud\RecaptchaEnterprise\V1\UpdateFirewallPolicyRequest; use Google\Cloud\RecaptchaEnterprise\V1\UpdateKeyRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service to determine the likelihood an event is legitimate. @@ -265,14 +266,14 @@ public static function relatedAccountGroupName(string $project, string $relateda * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -327,6 +328,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RecommendationEngine/src/V1beta1/Client/CatalogServiceClient.php b/RecommendationEngine/src/V1beta1/Client/CatalogServiceClient.php index d8336568540..04109e0c4fb 100644 --- a/RecommendationEngine/src/V1beta1/Client/CatalogServiceClient.php +++ b/RecommendationEngine/src/V1beta1/Client/CatalogServiceClient.php @@ -46,6 +46,7 @@ use Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for ingesting catalog information of the customer's website. @@ -207,8 +208,8 @@ public static function catalogItemPathName(string $project, string $location, st * 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 + * @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. * @@ -216,7 +217,7 @@ public static function catalogItemPathName(string $project, string $location, st * * @experimental */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -271,6 +272,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RecommendationEngine/src/V1beta1/Client/PredictionApiKeyRegistryClient.php b/RecommendationEngine/src/V1beta1/Client/PredictionApiKeyRegistryClient.php index 876ec23c577..6a7bc60177e 100644 --- a/RecommendationEngine/src/V1beta1/Client/PredictionApiKeyRegistryClient.php +++ b/RecommendationEngine/src/V1beta1/Client/PredictionApiKeyRegistryClient.php @@ -40,6 +40,7 @@ use Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest; use Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for registering API keys for use with the `predict` method. If you @@ -171,8 +172,8 @@ public static function predictionApiKeyRegistrationName(string $project, string * 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 + * @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. * @@ -180,7 +181,7 @@ public static function predictionApiKeyRegistrationName(string $project, string * * @experimental */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -235,6 +236,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RecommendationEngine/src/V1beta1/Client/PredictionServiceClient.php b/RecommendationEngine/src/V1beta1/Client/PredictionServiceClient.php index 2ebe94e2150..91ac8c7e63d 100644 --- a/RecommendationEngine/src/V1beta1/Client/PredictionServiceClient.php +++ b/RecommendationEngine/src/V1beta1/Client/PredictionServiceClient.php @@ -37,6 +37,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\RecommendationEngine\V1beta1\PredictRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for making recommendation prediction. @@ -138,8 +139,8 @@ public static function placementName(string $project, string $location, string $ * 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 + * @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. * @@ -147,7 +148,7 @@ public static function placementName(string $project, string $location, string $ * * @experimental */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -202,6 +203,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RecommendationEngine/src/V1beta1/Client/UserEventServiceClient.php b/RecommendationEngine/src/V1beta1/Client/UserEventServiceClient.php index 9a48f572ffc..8db5105e009 100644 --- a/RecommendationEngine/src/V1beta1/Client/UserEventServiceClient.php +++ b/RecommendationEngine/src/V1beta1/Client/UserEventServiceClient.php @@ -47,6 +47,7 @@ use Google\Cloud\RecommendationEngine\V1beta1\WriteUserEventRequest; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for ingesting end user actions on the customer website. @@ -185,8 +186,8 @@ public static function eventStoreName(string $project, string $location, string * 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 + * @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. * @@ -194,7 +195,7 @@ public static function eventStoreName(string $project, string $location, string * * @experimental */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -249,6 +250,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Recommender/src/V1/Client/RecommenderClient.php b/Recommender/src/V1/Client/RecommenderClient.php index 14d42c299a4..ac1841fe9fd 100644 --- a/Recommender/src/V1/Client/RecommenderClient.php +++ b/Recommender/src/V1/Client/RecommenderClient.php @@ -51,6 +51,7 @@ use Google\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest; use Google\Cloud\Recommender\V1\UpdateRecommenderConfigRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Provides insights and recommendations for cloud customers for various @@ -789,14 +790,14 @@ public static function recommenderConfigName(string $project, string $location, * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -851,6 +852,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Redis/src/V1/Client/CloudRedisClient.php b/Redis/src/V1/Client/CloudRedisClient.php index 79096ee15bb..1806f73f2f6 100644 --- a/Redis/src/V1/Client/CloudRedisClient.php +++ b/Redis/src/V1/Client/CloudRedisClient.php @@ -53,6 +53,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Configures and manages Cloud Memorystore for Redis instances @@ -240,14 +241,14 @@ public static function locationName(string $project, string $location): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -302,6 +303,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php index 78735502954..6a8bc240a62 100644 --- a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php +++ b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php @@ -49,6 +49,7 @@ use Google\LongRunning\Operation; use Google\Protobuf\Any; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Configures and manages Cloud Memorystore for Redis clusters @@ -257,14 +258,14 @@ public static function locationName(string $project, string $location): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -319,6 +320,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/FoldersClient.php b/ResourceManager/src/V3/Client/FoldersClient.php index 883d7358227..765345755a0 100644 --- a/ResourceManager/src/V3/Client/FoldersClient.php +++ b/ResourceManager/src/V3/Client/FoldersClient.php @@ -51,6 +51,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Manages Cloud Platform folder resources. @@ -205,14 +206,14 @@ public static function folderName(string $folder): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -267,6 +268,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/OrganizationsClient.php b/ResourceManager/src/V3/Client/OrganizationsClient.php index 99117c81acf..e4a84c35b63 100644 --- a/ResourceManager/src/V3/Client/OrganizationsClient.php +++ b/ResourceManager/src/V3/Client/OrganizationsClient.php @@ -42,6 +42,7 @@ use Google\Cloud\ResourceManager\V3\Organization; use Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Allows users to manage their organization resources. @@ -136,14 +137,14 @@ public static function organizationName(string $organization): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -198,6 +199,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/ProjectsClient.php b/ResourceManager/src/V3/Client/ProjectsClient.php index 83a8159cbb0..b25ac4bbd23 100644 --- a/ResourceManager/src/V3/Client/ProjectsClient.php +++ b/ResourceManager/src/V3/Client/ProjectsClient.php @@ -51,6 +51,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Manages Google Cloud Projects. @@ -203,14 +204,14 @@ public static function projectName(string $project): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -265,6 +266,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/TagBindingsClient.php b/ResourceManager/src/V3/Client/TagBindingsClient.php index 57fd974a33c..5df09008e71 100644 --- a/ResourceManager/src/V3/Client/TagBindingsClient.php +++ b/ResourceManager/src/V3/Client/TagBindingsClient.php @@ -42,6 +42,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Allow users to create and manage TagBindings between TagValues and @@ -188,14 +189,14 @@ public static function tagBindingName(string $tagBinding): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -250,6 +251,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/TagHoldsClient.php b/ResourceManager/src/V3/Client/TagHoldsClient.php index 709a1fb2f96..6b1ba98679d 100644 --- a/ResourceManager/src/V3/Client/TagHoldsClient.php +++ b/ResourceManager/src/V3/Client/TagHoldsClient.php @@ -41,6 +41,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Allow users to create and manage TagHolds for TagValues. TagHolds represent @@ -207,14 +208,14 @@ public static function tagValueName(string $tagValue): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -269,6 +270,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/TagKeysClient.php b/ResourceManager/src/V3/Client/TagKeysClient.php index 39c31b7bae7..70e9662109b 100644 --- a/ResourceManager/src/V3/Client/TagKeysClient.php +++ b/ResourceManager/src/V3/Client/TagKeysClient.php @@ -49,6 +49,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Allow users to create and manage tag keys. @@ -199,14 +200,14 @@ public static function tagKeyName(string $tagKey): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -261,6 +262,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceManager/src/V3/Client/TagValuesClient.php b/ResourceManager/src/V3/Client/TagValuesClient.php index 9be63d52e82..fbe441afc05 100644 --- a/ResourceManager/src/V3/Client/TagValuesClient.php +++ b/ResourceManager/src/V3/Client/TagValuesClient.php @@ -49,6 +49,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Allow users to create and manage tag values. @@ -199,14 +200,14 @@ public static function tagValueName(string $tagValue): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -261,6 +262,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php b/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php index 7abe165785b..fd42a9b0e0c 100644 --- a/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php +++ b/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php @@ -38,6 +38,7 @@ use Google\Cloud\ResourceSettings\V1\Setting; use Google\Cloud\ResourceSettings\V1\UpdateSettingRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: An interface to interact with resource settings and setting values throughout @@ -200,14 +201,14 @@ public static function settingName(string $projectNumber, string $settingName): * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -262,6 +263,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/AnalyticsServiceClient.php b/Retail/src/V2/Client/AnalyticsServiceClient.php index 5ff4deb39b9..dcd7979478f 100644 --- a/Retail/src/V2/Client/AnalyticsServiceClient.php +++ b/Retail/src/V2/Client/AnalyticsServiceClient.php @@ -38,6 +38,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for managing & accessing retail search business metric. @@ -195,6 +196,9 @@ private function createOperationsClient(array $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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/CatalogServiceClient.php b/Retail/src/V2/Client/CatalogServiceClient.php index 9c01921682b..d525dc75ee0 100644 --- a/Retail/src/V2/Client/CatalogServiceClient.php +++ b/Retail/src/V2/Client/CatalogServiceClient.php @@ -49,6 +49,7 @@ use Google\Cloud\Retail\V2\UpdateCatalogRequest; use Google\Cloud\Retail\V2\UpdateCompletionConfigRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for managing catalog configuration. @@ -230,14 +231,14 @@ public static function locationName(string $project, string $location): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -292,6 +293,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/CompletionServiceClient.php b/Retail/src/V2/Client/CompletionServiceClient.php index a82da0990a5..00f8017cd90 100644 --- a/Retail/src/V2/Client/CompletionServiceClient.php +++ b/Retail/src/V2/Client/CompletionServiceClient.php @@ -39,6 +39,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Autocomplete service for retail. @@ -186,14 +187,14 @@ public static function catalogName(string $project, string $location, string $ca * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -248,6 +249,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/ControlServiceClient.php b/Retail/src/V2/Client/ControlServiceClient.php index 80831c87074..905c4842f41 100644 --- a/Retail/src/V2/Client/ControlServiceClient.php +++ b/Retail/src/V2/Client/ControlServiceClient.php @@ -40,6 +40,7 @@ use Google\Cloud\Retail\V2\ListControlsRequest; use Google\Cloud\Retail\V2\UpdateControlRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for modifying Control. @@ -157,14 +158,14 @@ public static function controlName(string $project, string $location, string $ca * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -219,6 +220,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/GenerativeQuestionServiceClient.php b/Retail/src/V2/Client/GenerativeQuestionServiceClient.php index ee224493cf3..1c96c900e88 100644 --- a/Retail/src/V2/Client/GenerativeQuestionServiceClient.php +++ b/Retail/src/V2/Client/GenerativeQuestionServiceClient.php @@ -42,6 +42,7 @@ use Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest; use Google\Cloud\Retail\V2\UpdateGenerativeQuestionsFeatureConfigRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for managing LLM generated questions in search serving. @@ -138,14 +139,14 @@ public static function catalogName(string $project, string $location, string $ca * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -200,6 +201,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/ModelServiceClient.php b/Retail/src/V2/Client/ModelServiceClient.php index 587253bddbf..5d7add5e18c 100644 --- a/Retail/src/V2/Client/ModelServiceClient.php +++ b/Retail/src/V2/Client/ModelServiceClient.php @@ -46,6 +46,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for performing CRUD operations on models. @@ -229,14 +230,14 @@ public static function modelName(string $project, string $location, string $cata * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -291,6 +292,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/PredictionServiceClient.php b/Retail/src/V2/Client/PredictionServiceClient.php index 101211dc0be..504bb301f78 100644 --- a/Retail/src/V2/Client/PredictionServiceClient.php +++ b/Retail/src/V2/Client/PredictionServiceClient.php @@ -35,6 +35,7 @@ use Google\Cloud\Retail\V2\PredictRequest; use Google\Cloud\Retail\V2\PredictResponse; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for making recommendation prediction. @@ -135,14 +136,14 @@ public static function productName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -197,6 +198,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/ProductServiceClient.php b/Retail/src/V2/Client/ProductServiceClient.php index 038b91bc862..b8208e16c6c 100644 --- a/Retail/src/V2/Client/ProductServiceClient.php +++ b/Retail/src/V2/Client/ProductServiceClient.php @@ -50,6 +50,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for ingesting [Product][google.cloud.retail.v2.Product] information @@ -236,14 +237,14 @@ public static function productName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -298,6 +299,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/SearchServiceClient.php b/Retail/src/V2/Client/SearchServiceClient.php index 62b12dab7de..1889a87df67 100644 --- a/Retail/src/V2/Client/SearchServiceClient.php +++ b/Retail/src/V2/Client/SearchServiceClient.php @@ -35,6 +35,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Retail\V2\SearchRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for search. @@ -131,14 +132,14 @@ public static function branchName(string $project, string $location, string $cat * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -193,6 +194,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/ServingConfigServiceClient.php b/Retail/src/V2/Client/ServingConfigServiceClient.php index 6bc6d0d4aa5..4e1b05fad1a 100644 --- a/Retail/src/V2/Client/ServingConfigServiceClient.php +++ b/Retail/src/V2/Client/ServingConfigServiceClient.php @@ -42,6 +42,7 @@ use Google\Cloud\Retail\V2\ServingConfig; use Google\Cloud\Retail\V2\UpdateServingConfigRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for modifying ServingConfig. @@ -165,14 +166,14 @@ public static function servingConfigName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -227,6 +228,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Retail/src/V2/Client/UserEventServiceClient.php b/Retail/src/V2/Client/UserEventServiceClient.php index a5207e1776f..721ab71fcb0 100644 --- a/Retail/src/V2/Client/UserEventServiceClient.php +++ b/Retail/src/V2/Client/UserEventServiceClient.php @@ -44,6 +44,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Service for ingesting end user actions on the customer website. @@ -220,14 +221,14 @@ public static function productName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -282,6 +283,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/BuildsClient.php b/Run/src/V2/Client/BuildsClient.php index ad60de57537..e9508d320bc 100644 --- a/Run/src/V2/Client/BuildsClient.php +++ b/Run/src/V2/Client/BuildsClient.php @@ -35,6 +35,7 @@ use Google\Cloud\Run\V2\SubmitBuildRequest; use Google\Cloud\Run\V2\SubmitBuildResponse; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Build Control Plane API @@ -126,14 +127,14 @@ public static function workerPoolName(string $project, string $location, string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -188,6 +189,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/ExecutionsClient.php b/Run/src/V2/Client/ExecutionsClient.php index d0bfe2adb67..509be8afac4 100644 --- a/Run/src/V2/Client/ExecutionsClient.php +++ b/Run/src/V2/Client/ExecutionsClient.php @@ -42,6 +42,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Execution Control Plane API. @@ -210,14 +211,14 @@ public static function jobName(string $project, string $location, string $job): * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -272,6 +273,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/JobsClient.php b/Run/src/V2/Client/JobsClient.php index d510bd133cd..7e154ae0422 100644 --- a/Run/src/V2/Client/JobsClient.php +++ b/Run/src/V2/Client/JobsClient.php @@ -50,6 +50,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Job Control Plane API. @@ -369,14 +370,14 @@ public static function secretVersionName(string $project, string $secret, string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -431,6 +432,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/RevisionsClient.php b/Run/src/V2/Client/RevisionsClient.php index 0569ac1c6ba..cafc4d8218e 100644 --- a/Run/src/V2/Client/RevisionsClient.php +++ b/Run/src/V2/Client/RevisionsClient.php @@ -41,6 +41,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Revision Control Plane API. @@ -208,14 +209,14 @@ public static function serviceName(string $project, string $location, string $se * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -270,6 +271,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/ServicesClient.php b/Run/src/V2/Client/ServicesClient.php index b12bd1422d2..f7dcab0ce9a 100644 --- a/Run/src/V2/Client/ServicesClient.php +++ b/Run/src/V2/Client/ServicesClient.php @@ -48,6 +48,7 @@ use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Service Control Plane API @@ -386,14 +387,14 @@ public static function serviceName(string $project, string $location, string $se * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -448,6 +449,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Run/src/V2/Client/TasksClient.php b/Run/src/V2/Client/TasksClient.php index 15361bdcfab..3d98fc2070a 100644 --- a/Run/src/V2/Client/TasksClient.php +++ b/Run/src/V2/Client/TasksClient.php @@ -37,6 +37,7 @@ use Google\Cloud\Run\V2\ListTasksRequest; use Google\Cloud\Run\V2\Task; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Cloud Run Task Control Plane API. @@ -160,14 +161,14 @@ public static function taskName( * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -222,6 +223,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/Scheduler/src/V1/Client/CloudSchedulerClient.php b/Scheduler/src/V1/Client/CloudSchedulerClient.php index cf7183a6012..873ed50bf32 100644 --- a/Scheduler/src/V1/Client/CloudSchedulerClient.php +++ b/Scheduler/src/V1/Client/CloudSchedulerClient.php @@ -46,6 +46,7 @@ use Google\Cloud\Scheduler\V1\RunJobRequest; use Google\Cloud\Scheduler\V1\UpdateJobRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: The Cloud Scheduler API allows external entities to reliably @@ -183,14 +184,14 @@ public static function topicName(string $project, string $topic): string * 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 + * @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. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -245,6 +246,9 @@ public static function parseName(string $formattedName, string $template = null) * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1/Parallelstore.php deleted file mode 100644 index 0da87d8cc8afb9f56b4d726ce21300ad34db8e43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8431 zcmeHM&2QVt6<><6R~diL+KJ+Jh;FiDYMf<-8*;<+KK_G;_HV_ zcUl&qOZSZ+9@R!848ILX+l4S-X!zVfpMQjw&z-M$j+10qif3Xeo;g~cy&Q1V9RpB+ zh7r&6*=v!7JsK-oEeMui!_`w83L7rA_g;G|%O5I)@D3s3M3>0c#LvS@*C05$Lwx0#fD_(*1#5>e(dzKureE`gsK6)SZC7>%sV3PwWa zOc*^ORm%aa4XB0&qk4dbO}z$~o*GtU_{<05Gu`8%E$0^7E z^t+5~i&Am3KS7roh70o9?s1&yBxBmoq3eRUlk@Bn8i_a=k0AMg9P=c=V`%6|H(P{9 zelBrGO6zEd#W0>hQ@a(lQqUf4@0JQ{#f@TNeex|lijr&Pf?6qVZ%#@Wp<#8cQhZ#P zOwg6}!d8K;$aG~xEp7qL1^CRxN2SfOx=x9PawlJ@pQ3NXF^Z>G=zNh+_#WiR55X*6 z_IdDhk~Qr*FA>@2;_)PF1ZfT%#pB81Me*pZB*kO;4-%T*GCaR1D9YqVEdX%5iiSZb zz{UU~mLTH4R;xGgfU;gf7ahF`F##u4 zAjme-vH-s7`+Ci!FbK(<{yxH+Bs83`+uazj3abt1;q;$Cu{DO1LMXxaP5lArE}X6z zjW)U`@O>191M|l@EJj_L0J9;NM-Amnp*?WZZ$O(z48J?IfpQQ4JFQ?W#JZJ(uo2-O zib_fy^M;brY8FU(h-TJ_Nqo{N=o`7S!!qrPn*K=wO@-Z^7$`c6B(2TetkO{=mr;^f z4PIBdRr=Od$TeSgq4#empiEl=sARRa17&;_jnl&4@-%4bJV@tu63TcUT?*U|#i&lZ z3e#jz1Z7uRNK%){w5b3b3rpnN!sK##9!>1BiEOj(yq6g&>a2amw)*p znMg`Fk0xkGV$_KSJ&)ajlEI-G`Wk3z=FxRSKkRI1b~%O03Gzua%*~k}V_m2)MVeZ_ z@JXlj%V;{Ve%w?%{8##ziaQ|YcyPiaXgVT3h`5#FME@=_;(#zt|Hq9#jc_#bd5KMb zk%+zy!K;FBIMM)I@H3JC+3)o6NCg^M4^D6TLgIk<7KKFay>mcfSistl7`7hWAd#XS zD+y)Yk&-^h=4Su zZncAk!MSUP;P`P*?4mR2>tPq?En)qv+JqSU*R4(B6B{VW>ITfwLAA>c2pDU$+yEKl zgg4QcA0Ub5A3KCKBI7IH8jx89NEoBu<>)gBO^S#S--h9E%&xJyOxpu_8VvMgIyBUd zec}Z#DRjwn#1MPE1H*AhgJ~>NCVaPeO<_pJm(aM_U$-3two@#U@iZFc+k>|>Ddfch z8Wqw}W$+xtcUj%u-6)i`%F|Nk_zGib@nLDFT;aoO;R$$f1>f$mkIOcXuJu@t2zUk)D&@*AM$uTTqriWZ&{%9n#r=*gV!MMz zbM|(h;O!s^YR3JSYB0Y4?C)RxI+4Xo^lsxhbW1SNuZG76i;?4l#mKP%{;h;YBEv0S z?juEHuMm9Tu{(Y5rOFN?W1`a2$sU46jyD!h@Rt%AkB`i_pUvXig}`${$H*ydChSPk zCoj~w=mBcDA}aDr^(wdTEh9Kg2_IlCX3Bk(KA#_Q;be~g32Me?>Aq^lw-2c1kNc}R z9qJdE;hBE+gxZZX{Q@a~e!KwW&F}KNXs55KyhB_1bSmyEa3$b1euCP1qu;CK>tAxT? zVt+3#<&#jxLUDM5Ma1#Ot)xi^-hd=GfP+T~C*oC1>n)IeL z`UD^QX2*;-~Ql6c!hb3-;hTx)ahZG SQSWk@&UW%k?-O)_(0>5sx$5iy diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php deleted file mode 100644 index 602bfbf612b..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/CreateInstanceRequest.php +++ /dev/null @@ -1,273 +0,0 @@ -google.cloud.parallelstore.v1.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. Please see - * {@see ParallelstoreClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to create. - * @param string $instanceId Required. The name of the Parallelstore instance. - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * @return \Google\Cloud\Parallelstore\V1\CreateInstanceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Parallelstore\V1\Instance $instance, string $instanceId): self - { - return (new self()) - ->setParent($parent) - ->setInstance($instance) - ->setInstanceId($instanceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * @type string $instance_id - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @type \Google\Cloud\Parallelstore\V1\Instance $instance - * Required. The instance to create. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * 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 instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * 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 name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Parallelstore\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Parallelstore\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); - $this->instance = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php deleted file mode 100644 index af5164d5b83..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DeleteInstanceRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.parallelstore.v1.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource - * Please see {@see ParallelstoreClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1\DeleteInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource - * - * 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. Name of the resource - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php deleted file mode 100644 index 0acc29d5985..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationGcsBucket.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.parallelstore.v1.DestinationGcsBucket - */ -class DestinationGcsBucket extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php deleted file mode 100644 index 79e74ab6adf..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DestinationParallelstore.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.parallelstore.v1.DestinationParallelstore - */ -class DestinationParallelstore extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php deleted file mode 100644 index d55b9050370..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/DirectoryStripeLevel.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.parallelstore.v1.DirectoryStripeLevel - */ -class DirectoryStripeLevel -{ - /** - * If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; - */ - const DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; - /** - * Minimum directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MIN = 1; - */ - const DIRECTORY_STRIPE_LEVEL_MIN = 1; - /** - * Medium directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_BALANCED = 2; - */ - const DIRECTORY_STRIPE_LEVEL_BALANCED = 2; - /** - * Maximum directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MAX = 3; - */ - const DIRECTORY_STRIPE_LEVEL_MAX = 3; - - private static $valueToName = [ - self::DIRECTORY_STRIPE_LEVEL_UNSPECIFIED => 'DIRECTORY_STRIPE_LEVEL_UNSPECIFIED', - self::DIRECTORY_STRIPE_LEVEL_MIN => 'DIRECTORY_STRIPE_LEVEL_MIN', - self::DIRECTORY_STRIPE_LEVEL_BALANCED => 'DIRECTORY_STRIPE_LEVEL_BALANCED', - self::DIRECTORY_STRIPE_LEVEL_MAX => 'DIRECTORY_STRIPE_LEVEL_MAX', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php deleted file mode 100644 index 946a522a2a0..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataMetadata.php +++ /dev/null @@ -1,351 +0,0 @@ -google.cloud.parallelstore.v1.ExportDataMetadata - */ -class ExportDataMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - */ - protected $operation_metadata = null; - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata - * Data transfer operation metadata. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null - */ - public function getOperationMetadata() - { - return $this->operation_metadata; - } - - public function hasOperationMetadata() - { - return isset($this->operation_metadata); - } - - public function clearOperationMetadata() - { - unset($this->operation_metadata); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var - * @return $this - */ - public function setOperationMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); - $this->operation_metadata = $var; - - return $this; - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php deleted file mode 100644 index 25a1ed7d4d1..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.parallelstore.v1.ExportDataRequest - */ -class ExportDataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - */ - protected $request_id = ''; - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $service_account = ''; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore - * Parallelstore source. - * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket - * Cloud Storage destination. - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type string $service_account - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; - * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null - */ - public function getSourceParallelstore() - { - return $this->readOneof(2); - } - - public function hasSourceParallelstore() - { - return $this->hasOneof(2); - } - - /** - * Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; - * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var - * @return $this - */ - public function setSourceParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; - * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null - */ - public function getDestinationGcsBucket() - { - return $this->readOneof(3); - } - - public function hasDestinationGcsBucket() - { - return $this->hasOneof(3); - } - - /** - * Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; - * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var - * @return $this - */ - public function setDestinationGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php deleted file mode 100644 index 7a2a7ca3f97..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ExportDataResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.parallelstore.v1.ExportDataResponse - */ -class ExportDataResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php deleted file mode 100644 index 7f349e1ef99..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/FileStripeLevel.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.parallelstore.v1.FileStripeLevel - */ -class FileStripeLevel -{ - /** - * If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_UNSPECIFIED = 0; - */ - const FILE_STRIPE_LEVEL_UNSPECIFIED = 0; - /** - * Minimum file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_MIN = 1; - */ - const FILE_STRIPE_LEVEL_MIN = 1; - /** - * Medium file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_BALANCED = 2; - */ - const FILE_STRIPE_LEVEL_BALANCED = 2; - /** - * Maximum file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_MAX = 3; - */ - const FILE_STRIPE_LEVEL_MAX = 3; - - private static $valueToName = [ - self::FILE_STRIPE_LEVEL_UNSPECIFIED => 'FILE_STRIPE_LEVEL_UNSPECIFIED', - self::FILE_STRIPE_LEVEL_MIN => 'FILE_STRIPE_LEVEL_MIN', - self::FILE_STRIPE_LEVEL_BALANCED => 'FILE_STRIPE_LEVEL_BALANCED', - self::FILE_STRIPE_LEVEL_MAX => 'FILE_STRIPE_LEVEL_MAX', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php deleted file mode 100644 index 1faa91f6339..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/GetInstanceRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.parallelstore.v1.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. Please see - * {@see ParallelstoreClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1\GetInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_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. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_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/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php deleted file mode 100644 index e64fbf40267..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataMetadata.php +++ /dev/null @@ -1,351 +0,0 @@ -google.cloud.parallelstore.v1.ImportDataMetadata - */ -class ImportDataMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - */ - protected $operation_metadata = null; - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata - * Data transfer operation metadata. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null - */ - public function getOperationMetadata() - { - return $this->operation_metadata; - } - - public function hasOperationMetadata() - { - return isset($this->operation_metadata); - } - - public function clearOperationMetadata() - { - unset($this->operation_metadata); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; - * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var - * @return $this - */ - public function setOperationMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); - $this->operation_metadata = $var; - - return $this; - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php deleted file mode 100644 index e9822439ab5..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.parallelstore.v1.ImportDataRequest - */ -class ImportDataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - */ - protected $request_id = ''; - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $service_account = ''; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore - * Parallelstore destination. - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type string $service_account - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; - * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null - */ - public function getSourceGcsBucket() - { - return $this->readOneof(2); - } - - public function hasSourceGcsBucket() - { - return $this->hasOneof(2); - } - - /** - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; - * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var - * @return $this - */ - public function setSourceGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; - * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null - */ - public function getDestinationParallelstore() - { - return $this->readOneof(3); - } - - public function hasDestinationParallelstore() - { - return $this->hasOneof(3); - } - - /** - * Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; - * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var - * @return $this - */ - public function setDestinationParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php deleted file mode 100644 index 49d0ebaf5ae..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ImportDataResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.parallelstore.v1.ImportDataResponse - */ -class ImportDataResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php deleted file mode 100644 index af2dc82ba62..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance.php +++ /dev/null @@ -1,625 +0,0 @@ -google.cloud.parallelstore.v1.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - */ - protected $capacity_gib = 0; - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $daos_version = ''; - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $access_points; - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $reserved_ip_range = ''; - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $effective_reserved_ip_range = ''; - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $file_stripe_level = 0; - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $directory_stripe_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * @type string $description - * Optional. The description of the instance. 2048 characters or less. - * @type int $state - * Output only. The instance state. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the instance was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the instance was updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * @type int|string $capacity_gib - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * @type string $daos_version - * Output only. The version of DAOS software running in the instance. - * @type array|\Google\Protobuf\Internal\RepeatedField $access_points - * Output only. A list of IPv4 addresses used for client side configuration. - * @type string $network - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * @type string $reserved_ip_range - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * @type string $effective_reserved_ip_range - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * @type int $file_stripe_level - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * @type int $directory_stripe_level - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.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; - } - - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getCapacityGib() - { - return $this->capacity_gib; - } - - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setCapacityGib($var) - { - GPBUtil::checkInt64($var); - $this->capacity_gib = $var; - - return $this; - } - - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDaosVersion() - { - return $this->daos_version; - } - - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDaosVersion($var) - { - GPBUtil::checkString($var, True); - $this->daos_version = $var; - - return $this; - } - - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAccessPoints() - { - return $this->access_points; - } - - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAccessPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->access_points = $arr; - - return $this; - } - - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getReservedIpRange() - { - return $this->reserved_ip_range; - } - - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setReservedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->reserved_ip_range = $var; - - return $this; - } - - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEffectiveReservedIpRange() - { - return $this->effective_reserved_ip_range; - } - - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEffectiveReservedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->effective_reserved_ip_range = $var; - - return $this; - } - - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getFileStripeLevel() - { - return $this->file_stripe_level; - } - - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setFileStripeLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\FileStripeLevel::class); - $this->file_stripe_level = $var; - - return $this; - } - - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDirectoryStripeLevel() - { - return $this->directory_stripe_level; - } - - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDirectoryStripeLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\DirectoryStripeLevel::class); - $this->directory_stripe_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php deleted file mode 100644 index 8eabb8656dc..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/Instance/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.parallelstore.v1.Instance.State - */ -class State -{ - /** - * Not set. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The instance is available for use. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * The instance is not usable. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The instance is being upgraded. - * - * Generated from protobuf enum UPGRADING = 5; - */ - const UPGRADING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::UPGRADING => 'UPGRADING', - ]; - - 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(State::class, \Google\Cloud\Parallelstore\V1\Instance_State::class); - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php deleted file mode 100644 index 0a02c88d308..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesRequest.php +++ /dev/null @@ -1,237 +0,0 @@ -google.cloud.parallelstore.v1.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. Please see - * {@see ParallelstoreClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1\ListInstancesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filtering results. - * @type string $order_by - * Optional. Hint for how to order the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * 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 project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * 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. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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 results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering 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; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php deleted file mode 100644 index c8b9fd39f5d..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/ListInstancesResponse.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.parallelstore.v1.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; - */ - private $instances; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * The list of Parallelstore instances. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; - * @param array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Parallelstore\V1\Instance::class); - $this->instances = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php deleted file mode 100644 index 98a34bef679..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.parallelstore.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php deleted file mode 100644 index 6b042397ff3..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceGcsBucket.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.parallelstore.v1.SourceGcsBucket - */ -class SourceGcsBucket extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php deleted file mode 100644 index 63a37aaeebf..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/SourceParallelstore.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.parallelstore.v1.SourceParallelstore - */ -class SourceParallelstore extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php deleted file mode 100644 index 9b4b96f6fd4..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferCounters.php +++ /dev/null @@ -1,261 +0,0 @@ -google.cloud.parallelstore.v1.TransferCounters - */ -class TransferCounters extends \Google\Protobuf\Internal\Message -{ - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - */ - protected $objects_found = 0; - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - */ - protected $bytes_found = 0; - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - */ - protected $objects_skipped = 0; - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - */ - protected $bytes_skipped = 0; - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - */ - protected $objects_copied = 0; - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - */ - protected $bytes_copied = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $objects_found - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * @type int|string $bytes_found - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * @type int|string $objects_skipped - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * @type int|string $bytes_skipped - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * @type int|string $objects_copied - * Objects that are copied to the data destination. - * @type int|string $bytes_copied - * Bytes that are copied to the data destination. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - * @return int|string - */ - public function getObjectsFound() - { - return $this->objects_found; - } - - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - * @param int|string $var - * @return $this - */ - public function setObjectsFound($var) - { - GPBUtil::checkInt64($var); - $this->objects_found = $var; - - return $this; - } - - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - * @return int|string - */ - public function getBytesFound() - { - return $this->bytes_found; - } - - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - * @param int|string $var - * @return $this - */ - public function setBytesFound($var) - { - GPBUtil::checkInt64($var); - $this->bytes_found = $var; - - return $this; - } - - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - * @return int|string - */ - public function getObjectsSkipped() - { - return $this->objects_skipped; - } - - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - * @param int|string $var - * @return $this - */ - public function setObjectsSkipped($var) - { - GPBUtil::checkInt64($var); - $this->objects_skipped = $var; - - return $this; - } - - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - * @return int|string - */ - public function getBytesSkipped() - { - return $this->bytes_skipped; - } - - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - * @param int|string $var - * @return $this - */ - public function setBytesSkipped($var) - { - GPBUtil::checkInt64($var); - $this->bytes_skipped = $var; - - return $this; - } - - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - * @return int|string - */ - public function getObjectsCopied() - { - return $this->objects_copied; - } - - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - * @param int|string $var - * @return $this - */ - public function setObjectsCopied($var) - { - GPBUtil::checkInt64($var); - $this->objects_copied = $var; - - return $this; - } - - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - * @return int|string - */ - public function getBytesCopied() - { - return $this->bytes_copied; - } - - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - * @param int|string $var - * @return $this - */ - public function setBytesCopied($var) - { - GPBUtil::checkInt64($var); - $this->bytes_copied = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php deleted file mode 100644 index 0cdbf05167a..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferOperationMetadata.php +++ /dev/null @@ -1,261 +0,0 @@ -google.cloud.parallelstore.v1.TransferOperationMetadata - */ -class TransferOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $counters = null; - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $transfer_type = 0; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore - * Output only. Parallelstore source. - * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket - * Output only. Cloud Storage source. - * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket - * Output only. Cloud Storage destination. - * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore - * Output only. Parallelstore destination. - * @type \Google\Cloud\Parallelstore\V1\TransferCounters $counters - * Output only. The progress of the transfer operation. - * @type int $transfer_type - * Output only. The type of transfer occurring. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null - */ - public function getSourceParallelstore() - { - return $this->readOneof(7); - } - - public function hasSourceParallelstore() - { - return $this->hasOneof(7); - } - - /** - * Output only. Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var - * @return $this - */ - public function setSourceParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Output only. Cloud Storage source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null - */ - public function getSourceGcsBucket() - { - return $this->readOneof(8); - } - - public function hasSourceGcsBucket() - { - return $this->hasOneof(8); - } - - /** - * Output only. Cloud Storage source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var - * @return $this - */ - public function setSourceGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Output only. Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null - */ - public function getDestinationGcsBucket() - { - return $this->readOneof(9); - } - - public function hasDestinationGcsBucket() - { - return $this->hasOneof(9); - } - - /** - * Output only. Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var - * @return $this - */ - public function setDestinationGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Output only. Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null - */ - public function getDestinationParallelstore() - { - return $this->readOneof(10); - } - - public function hasDestinationParallelstore() - { - return $this->hasOneof(10); - } - - /** - * Output only. Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var - * @return $this - */ - public function setDestinationParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1\TransferCounters|null - */ - public function getCounters() - { - return $this->counters; - } - - public function hasCounters() - { - return isset($this->counters); - } - - public function clearCounters() - { - unset($this->counters); - } - - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1\TransferCounters $var - * @return $this - */ - public function setCounters($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferCounters::class); - $this->counters = $var; - - return $this; - } - - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTransferType() - { - return $this->transfer_type; - } - - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTransferType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\TransferType::class); - $this->transfer_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php deleted file mode 100644 index cecde2a1b64..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/TransferType.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.parallelstore.v1.TransferType - */ -class TransferType -{ - /** - * Zero is an illegal value. - * - * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; - */ - const TRANSFER_TYPE_UNSPECIFIED = 0; - /** - * Imports to Parallelstore. - * - * Generated from protobuf enum IMPORT = 1; - */ - const IMPORT = 1; - /** - * Exports from Parallelstore. - * - * Generated from protobuf enum EXPORT = 2; - */ - const EXPORT = 2; - - private static $valueToName = [ - self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', - self::IMPORT => 'IMPORT', - self::EXPORT => 'EXPORT', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php deleted file mode 100644 index e2e23b6223a..00000000000 --- a/owl-bot-staging/Parallelstore/v1/proto/src/Google/Cloud/Parallelstore/V1/UpdateInstanceRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.parallelstore.v1.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to update. - * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * @return \Google\Cloud\Parallelstore\V1\UpdateInstanceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Parallelstore\V1\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setInstance($instance) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * @type \Google\Cloud\Parallelstore\V1\Instance $instance - * Required. The instance to update. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Parallelstore\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Parallelstore\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); - $this->instance = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php deleted file mode 100644 index 56f45bf3e94..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/create_instance.php +++ /dev/null @@ -1,104 +0,0 @@ -setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->createInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); - $instanceId = '[INSTANCE_ID]'; - $instanceCapacityGib = 0; - - create_instance_sample($formattedParent, $instanceId, $instanceCapacityGib); -} -// [END parallelstore_v1_generated_Parallelstore_CreateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php deleted file mode 100644 index 8202d349d9b..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/delete_instance.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->deleteInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - delete_instance_sample($formattedName); -} -// [END parallelstore_v1_generated_Parallelstore_DeleteInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php deleted file mode 100644 index 9a64b7551fe..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/export_data.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->exportData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportDataResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - export_data_sample($formattedName); -} -// [END parallelstore_v1_generated_Parallelstore_ExportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php deleted file mode 100644 index aba7bdaedf3..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_instance.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Instance $response */ - $response = $parallelstoreClient->getInstance($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_sample($formattedName); -} -// [END parallelstore_v1_generated_Parallelstore_GetInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php deleted file mode 100644 index 0950b50a4c6..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END parallelstore_v1_generated_Parallelstore_GetLocation_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php deleted file mode 100644 index a4e745a904e..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/import_data.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->importData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportDataResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - import_data_sample($formattedName); -} -// [END parallelstore_v1_generated_Parallelstore_ImportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php deleted file mode 100644 index 8388dfa1a88..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_instances.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $parallelstoreClient->listInstances($request); - - /** @var Instance $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); - - list_instances_sample($formattedParent); -} -// [END parallelstore_v1_generated_Parallelstore_ListInstances_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php deleted file mode 100644 index 05b2ed1ff36..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END parallelstore_v1_generated_Parallelstore_ListLocations_sync] diff --git a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php b/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php deleted file mode 100644 index a4aff2499ae..00000000000 --- a/owl-bot-staging/Parallelstore/v1/samples/V1/ParallelstoreClient/update_instance.php +++ /dev/null @@ -1,89 +0,0 @@ -setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->updateInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $instanceCapacityGib = 0; - - update_instance_sample($instanceCapacityGib); -} -// [END parallelstore_v1_generated_Parallelstore_UpdateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php b/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php deleted file mode 100644 index fd45a4b287c..00000000000 --- a/owl-bot-staging/Parallelstore/v1/src/V1/Client/ParallelstoreClient.php +++ /dev/null @@ -1,611 +0,0 @@ - createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) - * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) - * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class ParallelstoreClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.parallelstore.v1.Parallelstore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'parallelstore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'parallelstore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/parallelstore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/parallelstore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/parallelstore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/parallelstore_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a address - * resource. - * - * @param string $project - * @param string $region - * @param string $address - * - * @return string The formatted address resource. - */ - public static function addressName(string $project, string $region, string $address): string - { - return self::getPathTemplate('address')->render([ - 'project' => $project, - 'region' => $region, - 'address' => $address, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName(string $project, string $location, string $instance): string - { - return self::getPathTemplate('instance')->render([ - 'project' => $project, - 'location' => $location, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName(string $project, string $network): string - { - return self::getPathTemplate('network')->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_account resource. - * - * @param string $project - * @param string $serviceAccount - * - * @return string The formatted service_account resource. - */ - public static function serviceAccountName(string $project, string $serviceAccount): string - { - return self::getPathTemplate('serviceAccount')->render([ - 'project' => $project, - 'service_account' => $serviceAccount, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - address: projects/{project}/regions/{region}/addresses/{address} - * - instance: projects/{project}/locations/{location}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - serviceAccount: projects/{project}/serviceAccounts/{service_account} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'parallelstore.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Parallelstore instance in a given project and location. - * - * The async variant is {@see ParallelstoreClient::createInstanceAsync()} . - * - * @example samples/V1/ParallelstoreClient/create_instance.php - * - * @param CreateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); - } - - /** - * Deletes a single instance. - * - * The async variant is {@see ParallelstoreClient::deleteInstanceAsync()} . - * - * @example samples/V1/ParallelstoreClient/delete_instance.php - * - * @param DeleteInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); - } - - /** - * Copies data from Parallelstore to Cloud Storage. - * - * The async variant is {@see ParallelstoreClient::exportDataAsync()} . - * - * @example samples/V1/ParallelstoreClient/export_data.php - * - * @param ExportDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportData', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single instance. - * - * The async variant is {@see ParallelstoreClient::getInstanceAsync()} . - * - * @example samples/V1/ParallelstoreClient/get_instance.php - * - * @param GetInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Instance - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance - { - return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); - } - - /** - * Copies data from Cloud Storage to Parallelstore. - * - * The async variant is {@see ParallelstoreClient::importDataAsync()} . - * - * @example samples/V1/ParallelstoreClient/import_data.php - * - * @param ImportDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportData', $request, $callOptions)->wait(); - } - - /** - * Lists all instances in a given project and location. - * - * The async variant is {@see ParallelstoreClient::listInstancesAsync()} . - * - * @example samples/V1/ParallelstoreClient/list_instances.php - * - * @param ListInstancesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInstances', $request, $callOptions); - } - - /** - * Updates the parameters of a single instance. - * - * The async variant is {@see ParallelstoreClient::updateInstanceAsync()} . - * - * @example samples/V1/ParallelstoreClient/update_instance.php - * - * @param UpdateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ParallelstoreClient::getLocationAsync()} . - * - * @example samples/V1/ParallelstoreClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ParallelstoreClient::listLocationsAsync()} . - * - * @example samples/V1/ParallelstoreClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 2eaf40bfd51..00000000000 --- a/owl-bot-staging/Parallelstore/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.parallelstore.v1", - "libraryPackage": "Google\\Cloud\\Parallelstore\\V1", - "services": { - "Parallelstore": { - "clients": { - "grpc": { - "libraryClient": "ParallelstoreGapicClient", - "rpcs": { - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json deleted file mode 100644 index bc0e63dce49..00000000000 --- a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_client_config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "interfaces": { - "google.cloud.parallelstore.v1.Parallelstore": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ExportData": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ImportData": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php deleted file mode 100644 index 8f886377a79..00000000000 --- a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_descriptor_config.php +++ /dev/null @@ -1,197 +0,0 @@ - [ - 'google.cloud.parallelstore.v1.Parallelstore' => [ - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ExportData' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataResponse', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ImportData' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataResponse', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'instance.name', - 'fieldAccessors' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Parallelstore\V1\Instance', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Parallelstore\V1\ListInstancesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'address' => 'projects/{project}/regions/{region}/addresses/{address}', - 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', - 'location' => 'projects/{project}/locations/{location}', - 'network' => 'projects/{project}/global/networks/{network}', - 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php b/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php deleted file mode 100644 index f7d9fb7afb5..00000000000 --- a/owl-bot-staging/Parallelstore/v1/src/V1/resources/parallelstore_rest_client_config.php +++ /dev/null @@ -1,188 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.parallelstore.v1.Parallelstore' => [ - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportData' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:exportData', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportData' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:importData', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php b/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php deleted file mode 100644 index 0b34f04570c..00000000000 --- a/owl-bot-staging/Parallelstore/v1/tests/Unit/V1/Client/ParallelstoreClientTest.php +++ /dev/null @@ -1,1100 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ParallelstoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ParallelstoreClient($options); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $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.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 deleteInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $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.parallelstore.v1.Parallelstore/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 exportDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ExportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->exportData($request); - $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.parallelstore.v1.Parallelstore/ExportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - $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 exportDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportDataTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ExportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->exportData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->getInstance($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - try { - $gapicClient->getInstance($request); - // 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 importDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ImportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->importData($request); - $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.parallelstore.v1.Parallelstore/ImportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - $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 importDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importDataTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ImportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->importData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInstances($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInstances($request); - // 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 updateInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $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.parallelstore.v1.Parallelstore/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $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 - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createInstanceAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstanceAsync($request)->wait(); - $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.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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()); - } -} diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/GPBMetadata/Google/Cloud/Parallelstore/V1Beta/Parallelstore.php deleted file mode 100644 index 33dd88ecf03ccdeaeac6a1a3ca83c87592d615d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8766 zcmeGi&2Jl7eaF+J?#uVvq;=EncItF#8d_UTciENGEQ~*rnoSeqxK#@lW^BJWLnbrB z%sAa_6^UKM1##objoTjKe*me{3JHWj?d*b)rn>U_uoMh5)L86yV-h02_ z`+a{s-~Xn)ZKFA5m6*iQJknO0`--pt7REVv%9rL9HnLL+PXoUjG`1bl=Y38 zQYw~f*8$YEx=xGal#XR}43cdbR=1tCHAgcHVz{2=knG;wCh@fBVusy-kg4qw*VbA@ zS*_$B!m+mIY4ufxtX`nV>Xk6E`s2HKIJJaO%g|g`iEN_hNP&NLw`u4t#q~4~{=1>O z4c*i|T{HAgfWu{FOEX*o7!IG^>Y6Q2w@ifsY?v)Fe@o#w>De2$1rk|S1bG!IBoI)& zYE?1ho_Z*b0xTFhF}>5ltmwpO=gGFVr(4czfR@cI z>vUjM;#*&A-qtL$<8)0^H#_wWo7(*8WD}?y1YX*;z5VzE2cS$&4>fn^HDGHxxQnOl z+Jj-4h2Hs4_w7+_w*&KA0r#B`42GJ|P4v$t^xkXvExyjdGR)mG5qHmUcb~oFW7cdP zq5?H1?(?(PLK|DuW*SZ3X#4|L4js_JH2lrWp-sovzrQu-Zy7x$XRScVeaKn-0q4yU zsz!fPM6qC#)3*!C@=pljgA<<62tSbicM>JbCg=#F2cAObXn;#eiZp*AFTYZgIE6;q zev|;yOC`jPgiC0Mh69q4VQqZzZicgSjEpnlqRb`*q!-BeT{O~i2>jWgq@~UQvXRAE zflSby2`njq>e>){eW;;$P-|$|(3%kEQ^Sf3*Ss&TIod9IG_NtplIc17lm-dEg+^N% zZ*=r#DhWi$`QcaU&?_~8FQd`6X1R?$;>o#l)Y~M{G zpvK?Jq4Os3o>|ULYJ@@DV)&%5R0X|F(^}UfKGk5UZU&aJ>l^?V(G-{%arQ{Nq1z2d zGdmRW!8)&fIW4NHwHkkUe6gCIHL$ z;$jT>(?GDvK-VZF7k#~sF1B?Ch_syjDCS9qIgVzF0>L5l8)%|UY{S~$g)q?Y_HB}y zVrb(Sc`<;j0U)Dy_6`~enGYU8@($VOZidIu(4J;=3HPmB;sYtIp&{lWcm_>v*3??5 z@o0UsQYw^J%BAAu8+a5Y3)PZZE3dCkN*JMGwNNWRE=?xrPO-FBVmmV3Sy9Vt0CNtm zx$vm6T2+e_Xef8^rTPhaCmIR40|#a$ycOREFZ?0M+RZ-qzYem7)#Ax0`&@h;WOYA~ zz(MhOuy8?qx{FEinf|qerq^`WD+`D!`B4{A1ztwOKop4G4?=gqm%dW#H*ri_FQN;! z)&XmS;)zLgh+E7hgxI=g?GTfNEaq?$eiIFYc|t+NLXW>VgOZlhCQhTdpQ5paFQ)T)rN|xCQ(85}Gi{$6g~uBMY@a-bmMk_}JRkng)%v5Gm5% zL3ot}vJ;|PibQWAxR^>#e*wG|SRfWe3A|@j38WCA_lDl?rH};9qrf7VN=_#nUWdWpp+97KK!CEu~au_Czd8opV(bAQzQoQ zNI$J-Qfi-YddWNe;{=)t3QEz(^ygw)1`HBRUoO6jlEiHD^vwlxV)_QB^E3zAjh-jU zwEBQ#+3e|1##hidtueZ81L{Z@{JQ6jGM+;hea%C@YtaJ6Fj!22>@LkGsn%p#zd%3> zvhaB!aydPRCN^0!xY}~_-PR8A@FbGEj_yYuYF+7hG!0FXr<)A%@h9Kp=prp1Wy;pP z?H*1keFvpNI8QwOsf?z|ySC+cMd&q!Q*NLs-b^$)Ew|BR^fT8QiIr9RIDha4{sFoS zg`VIP0#T?X_MLMnMnpS`vj-ABn<-x#;O8SyhW+j5zyEVGk(3~qOwig#Z;=L6S5_BN z2oK#*K|%R6hpy||Zhz^t$stq@kWZpvF4g=Pt9ykw(o_khkNcJI7)|?1h>DAQ!8c-v zi|Zj`1E7niP~C)d5z;UX8S(1YkRk%J{U2AtG{Rv=;HfwL*F<c z$NKv*G*g4}*@aosiBU3U$O}hFuEkSC$sn!uqGV8(42qI80J6+-T$H4-aB!5QoeT$0 zgUrKrACh@*`TsJfnd!eL^WU9Amyb5T?;R0zs5(a$Uo+^iWC@X{HYlx7b9k+^BCvk{ z$aqG(;@6L79KVFgak&ezE6$R;#5LbWNtRcjqxUo7y;B5|0!>K(%CO;&(3s~(7~Wt~ z^BG^vo&uq0FXf}t)-NSADJ)6c4^8Em)nxr#V+&|%v!E!`PNTW+5!YX&VNIrei8$-- z=(bJTjB}YH;itti4N)?_h{nbFmSyX3oW>~`Poq(O++U^K$_phlDyXB(;HzNwRds!H zrBrRyo>uzXUT9~_4=Wqh8gF__PuO>2;b#(>=o=H@>*(qVbiR$vTD1&_)=G~{Ykghx zWi)g6$iwnFV1FCU9^T5UYwCIdnrS-R83d|6nUoiP1)c4n$pZcwN*Bx3QlYj{eR>>O zaQ6}CIBj$2+7bI90*^t$s9Zqh4@>K{LDC;V=Qj&gwN`il0vboC zQmSs2H*0WuGO_r@C>o1YG5EI<8jJMGIL=Ha0^!%XvmeB8iatO;Pvu{#{y5>YKmPp} ziF^32c-?sp6&p+$mV?p8LTIG15E^CR-$-aA)NSMUVo(!0FPJ#ZI3WG4mnxgY9-^9# zXOEycG<{h(!2giYc(k3zal{w}5wu?wEQdzbnV>LAe=5CDuZG9S!Ir2DUaD8Pyl?CN zz$f^CuAOnYoIbs7a>4ij{|oqycKfmTje^AF_a`yU_9ysKUE08|8(13}L=ZZ)*B}ptrc3Xps0`05>xsVdG_ z7)v(KJA>)Xs~U2mH|#NV-D zfU{*eyZO(~p?BbE<7CC>aU|_j=o@!M`tC>ERK$}MJd$**=!xq3tSj$t)5BkMmP!4%&Af?@yDBN2*sn)e4FbV!FjIA@>pkAtknABhMo`JW8; z$)gqg?f~@uyvCot0M5Pv&Ovh+pgil|&EO^YHvgeP=ywTpK&ZC{{3d~& diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php deleted file mode 100644 index fe29cbe5c78..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/CreateInstanceRequest.php +++ /dev/null @@ -1,273 +0,0 @@ -google.cloud.parallelstore.v1beta.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. Please see - * {@see ParallelstoreClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Parallelstore\V1beta\Instance $instance Required. The instance to create. - * @param string $instanceId Required. The name of the Parallelstore instance. - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * @return \Google\Cloud\Parallelstore\V1beta\CreateInstanceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Parallelstore\V1beta\Instance $instance, string $instanceId): self - { - return (new self()) - ->setParent($parent) - ->setInstance($instance) - ->setInstanceId($instanceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * @type string $instance_id - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @type \Google\Cloud\Parallelstore\V1beta\Instance $instance - * Required. The instance to create. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * 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 instance's project and location, in the format - * `projects/{project}/locations/{location}`. - * Locations map to Google Cloud zones; for example, `us-west1-b`. - * - * 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 name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. The name of the Parallelstore instance. - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Parallelstore\V1beta\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The instance to create. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Parallelstore\V1beta\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\Instance::class); - $this->instance = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php deleted file mode 100644 index a4a8255bf2d..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeleteInstanceRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.parallelstore.v1beta.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource - * Please see {@see ParallelstoreClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1beta\DeleteInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource - * - * 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. Name of the resource - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php deleted file mode 100644 index 26ed91f54fc..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DeploymentType.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.parallelstore.v1beta.DeploymentType - */ -class DeploymentType -{ - /** - * Default Deployment Type - * It is equivalent to SCRATCH - * - * Generated from protobuf enum DEPLOYMENT_TYPE_UNSPECIFIED = 0; - */ - const DEPLOYMENT_TYPE_UNSPECIFIED = 0; - /** - * Scratch - * - * Generated from protobuf enum SCRATCH = 1; - */ - const SCRATCH = 1; - /** - * Persistent - * - * Generated from protobuf enum PERSISTENT = 2; - */ - const PERSISTENT = 2; - - private static $valueToName = [ - self::DEPLOYMENT_TYPE_UNSPECIFIED => 'DEPLOYMENT_TYPE_UNSPECIFIED', - self::SCRATCH => 'SCRATCH', - self::PERSISTENT => 'PERSISTENT', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php deleted file mode 100644 index 8e7de4c6a1e..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationGcsBucket.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.parallelstore.v1beta.DestinationGcsBucket - */ -class DestinationGcsBucket extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php deleted file mode 100644 index 8c0d829fa41..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DestinationParallelstore.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.parallelstore.v1beta.DestinationParallelstore - */ -class DestinationParallelstore extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php deleted file mode 100644 index 335a8d65009..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/DirectoryStripeLevel.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.parallelstore.v1beta.DirectoryStripeLevel - */ -class DirectoryStripeLevel -{ - /** - * If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; - */ - const DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; - /** - * Minimum directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MIN = 1; - */ - const DIRECTORY_STRIPE_LEVEL_MIN = 1; - /** - * Medium directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_BALANCED = 2; - */ - const DIRECTORY_STRIPE_LEVEL_BALANCED = 2; - /** - * Maximum directory striping - * - * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MAX = 3; - */ - const DIRECTORY_STRIPE_LEVEL_MAX = 3; - - private static $valueToName = [ - self::DIRECTORY_STRIPE_LEVEL_UNSPECIFIED => 'DIRECTORY_STRIPE_LEVEL_UNSPECIFIED', - self::DIRECTORY_STRIPE_LEVEL_MIN => 'DIRECTORY_STRIPE_LEVEL_MIN', - self::DIRECTORY_STRIPE_LEVEL_BALANCED => 'DIRECTORY_STRIPE_LEVEL_BALANCED', - self::DIRECTORY_STRIPE_LEVEL_MAX => 'DIRECTORY_STRIPE_LEVEL_MAX', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php deleted file mode 100644 index 22a6f8b50cf..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataMetadata.php +++ /dev/null @@ -1,351 +0,0 @@ -google.cloud.parallelstore.v1beta.ExportDataMetadata - */ -class ExportDataMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - */ - protected $operation_metadata = null; - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata - * Data transfer operation metadata. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - * @return \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata|null - */ - public function getOperationMetadata() - { - return $this->operation_metadata; - } - - public function hasOperationMetadata() - { - return isset($this->operation_metadata); - } - - public function clearOperationMetadata() - { - unset($this->operation_metadata); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - * @param \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $var - * @return $this - */ - public function setOperationMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata::class); - $this->operation_metadata = $var; - - return $this; - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php deleted file mode 100644 index b5b2af48db2..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.parallelstore.v1beta.ExportDataRequest - */ -class ExportDataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - */ - protected $request_id = ''; - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $service_account = ''; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore - * Parallelstore source. - * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket - * Cloud Storage destination. - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type string $service_account - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; - * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null - */ - public function getSourceParallelstore() - { - return $this->readOneof(2); - } - - public function hasSourceParallelstore() - { - return $this->hasOneof(2); - } - - /** - * Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; - * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var - * @return $this - */ - public function setSourceParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; - * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null - */ - public function getDestinationGcsBucket() - { - return $this->readOneof(3); - } - - public function hasDestinationGcsBucket() - { - return $this->hasOneof(3); - } - - /** - * Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; - * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var - * @return $this - */ - public function setDestinationGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. User-specified Service Account (SA) credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php deleted file mode 100644 index 53ef6c9be2d..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ExportDataResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.parallelstore.v1beta.ExportDataResponse - */ -class ExportDataResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php deleted file mode 100644 index 9b2e9505754..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/FileStripeLevel.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.parallelstore.v1beta.FileStripeLevel - */ -class FileStripeLevel -{ - /** - * If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_UNSPECIFIED = 0; - */ - const FILE_STRIPE_LEVEL_UNSPECIFIED = 0; - /** - * Minimum file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_MIN = 1; - */ - const FILE_STRIPE_LEVEL_MIN = 1; - /** - * Medium file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_BALANCED = 2; - */ - const FILE_STRIPE_LEVEL_BALANCED = 2; - /** - * Maximum file striping - * - * Generated from protobuf enum FILE_STRIPE_LEVEL_MAX = 3; - */ - const FILE_STRIPE_LEVEL_MAX = 3; - - private static $valueToName = [ - self::FILE_STRIPE_LEVEL_UNSPECIFIED => 'FILE_STRIPE_LEVEL_UNSPECIFIED', - self::FILE_STRIPE_LEVEL_MIN => 'FILE_STRIPE_LEVEL_MIN', - self::FILE_STRIPE_LEVEL_BALANCED => 'FILE_STRIPE_LEVEL_BALANCED', - self::FILE_STRIPE_LEVEL_MAX => 'FILE_STRIPE_LEVEL_MAX', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php deleted file mode 100644 index fd795fcc0f6..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/GetInstanceRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.parallelstore.v1beta.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. Please see - * {@see ParallelstoreClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1beta\GetInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_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. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_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/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php deleted file mode 100644 index 3c3cfac406b..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataMetadata.php +++ /dev/null @@ -1,351 +0,0 @@ -google.cloud.parallelstore.v1beta.ImportDataMetadata - */ -class ImportDataMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - */ - protected $operation_metadata = null; - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata - * Data transfer operation metadata. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - * @return \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata|null - */ - public function getOperationMetadata() - { - return $this->operation_metadata; - } - - public function hasOperationMetadata() - { - return isset($this->operation_metadata); - } - - public function clearOperationMetadata() - { - unset($this->operation_metadata); - } - - /** - * Data transfer operation metadata. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; - * @param \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $var - * @return $this - */ - public function setOperationMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata::class); - $this->operation_metadata = $var; - - return $this; - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php deleted file mode 100644 index 7c2e0471a0d..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.parallelstore.v1beta.ImportDataRequest - */ -class ImportDataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - */ - protected $request_id = ''; - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $service_account = ''; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore - * Parallelstore destination. - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type string $service_account - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; - * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null - */ - public function getSourceGcsBucket() - { - return $this->readOneof(2); - } - - public function hasSourceGcsBucket() - { - return $this->hasOneof(2); - } - - /** - * The Cloud Storage source bucket and, optionally, path inside the bucket. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; - * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var - * @return $this - */ - public function setSourceGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; - * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null - */ - public function getDestinationParallelstore() - { - return $this->readOneof(3); - } - - public function hasDestinationParallelstore() - { - return $this->hasOneof(3); - } - - /** - * Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; - * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var - * @return $this - */ - public function setDestinationParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. User-specified service account credentials to be used when - * performing the transfer. - * Use one of the following formats: - * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * If unspecified, the Parallelstore service agent is used: - * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php deleted file mode 100644 index 9eb5207960b..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ImportDataResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.parallelstore.v1beta.ImportDataResponse - */ -class ImportDataResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php deleted file mode 100644 index f7bf0900d60..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance.php +++ /dev/null @@ -1,667 +0,0 @@ -google.cloud.parallelstore.v1beta.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - */ - protected $capacity_gib = 0; - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $daos_version = ''; - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $access_points; - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $reserved_ip_range = ''; - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $effective_reserved_ip_range = ''; - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $file_stripe_level = 0; - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $directory_stripe_level = 0; - /** - * Optional. The deployment type of the instance. Allowed values are: - * * `SCRATCH`: the instance is a scratch instance. - * * `PERSISTENT`: the instance is a persistent instance. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $deployment_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * @type string $description - * Optional. The description of the instance. 2048 characters or less. - * @type int $state - * Output only. The instance state. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the instance was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the instance was updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * @type int|string $capacity_gib - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * @type string $daos_version - * Output only. The version of DAOS software running in the instance. - * @type array|\Google\Protobuf\Internal\RepeatedField $access_points - * Output only. A list of IPv4 addresses used for client side configuration. - * @type string $network - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * @type string $reserved_ip_range - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * @type string $effective_reserved_ip_range - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * @type int $file_stripe_level - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * @type int $directory_stripe_level - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * @type int $deployment_type - * Optional. The deployment type of the instance. Allowed values are: - * * `SCRATCH`: the instance is a scratch instance. - * * `PERSISTENT`: the instance is a persistent instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. The resource name of the instance, in the format - * `projects/{project}/locations/{location}/instances/{instance_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. The description of the instance. 2048 characters or less. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The instance state. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Cloud Labels are a flexible and lightweight mechanism for - * organizing cloud resources into groups that reflect a customer's - * organizational needs and deployment strategies. See - * https://cloud.google.com/resource-manager/docs/labels-overview for details. - * - * Generated from protobuf field map labels = 6 [(.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; - } - - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getCapacityGib() - { - return $this->capacity_gib; - } - - /** - * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). - * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., - * 12000, 16000, 20000, ... - * - * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setCapacityGib($var) - { - GPBUtil::checkInt64($var); - $this->capacity_gib = $var; - - return $this; - } - - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDaosVersion() - { - return $this->daos_version; - } - - /** - * Output only. The version of DAOS software running in the instance. - * - * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDaosVersion($var) - { - GPBUtil::checkString($var, True); - $this->daos_version = $var; - - return $this; - } - - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAccessPoints() - { - return $this->access_points; - } - - /** - * Output only. A list of IPv4 addresses used for client side configuration. - * - * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAccessPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->access_points = $arr; - - return $this; - } - - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Optional. Immutable. The name of the Compute Engine - * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. - * - * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getReservedIpRange() - { - return $this->reserved_ip_range; - } - - /** - * Optional. Immutable. The ID of the IP address range being used by the - * instance's VPC network. See [Configure a VPC - * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). - * If no ID is provided, all ranges are considered. - * - * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setReservedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->reserved_ip_range = $var; - - return $this; - } - - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEffectiveReservedIpRange() - { - return $this->effective_reserved_ip_range; - } - - /** - * Output only. Immutable. The ID of the IP address range being used by the - * instance's VPC network. This field is populated by the service and contains - * the value currently used by the service. - * - * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEffectiveReservedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->effective_reserved_ip_range = $var; - - return $this; - } - - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getFileStripeLevel() - { - return $this->file_stripe_level; - } - - /** - * Optional. Stripe level for files. Allowed values are: - * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size - * files. - * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large files. - * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setFileStripeLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\FileStripeLevel::class); - $this->file_stripe_level = $var; - - return $this; - } - - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDirectoryStripeLevel() - { - return $this->directory_stripe_level; - } - - /** - * Optional. Stripe level for directories. Allowed values are: - * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a - * small number of files. - * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads - * involving a mix of small and large directories. - * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large - * number of files. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDirectoryStripeLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\DirectoryStripeLevel::class); - $this->directory_stripe_level = $var; - - return $this; - } - - /** - * Optional. The deployment type of the instance. Allowed values are: - * * `SCRATCH`: the instance is a scratch instance. - * * `PERSISTENT`: the instance is a persistent instance. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDeploymentType() - { - return $this->deployment_type; - } - - /** - * Optional. The deployment type of the instance. Allowed values are: - * * `SCRATCH`: the instance is a scratch instance. - * * `PERSISTENT`: the instance is a persistent instance. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DeploymentType deployment_type = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDeploymentType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\DeploymentType::class); - $this->deployment_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php deleted file mode 100644 index 354012ed350..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/Instance/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.parallelstore.v1beta.Instance.State - */ -class State -{ - /** - * Not set. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The instance is available for use. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * The instance is not usable. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The instance is being upgraded. - * - * Generated from protobuf enum UPGRADING = 5; - */ - const UPGRADING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::UPGRADING => 'UPGRADING', - ]; - - 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(State::class, \Google\Cloud\Parallelstore\V1beta\Instance_State::class); - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php deleted file mode 100644 index 7a8b21e383d..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesRequest.php +++ /dev/null @@ -1,237 +0,0 @@ -google.cloud.parallelstore.v1beta.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. Please see - * {@see ParallelstoreClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Parallelstore\V1beta\ListInstancesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filtering results. - * @type string $order_by - * Optional. Hint for how to order the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * 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 project and location for which to retrieve instance - * information, in the format `projects/{project_id}/locations/{location}`. - * To retrieve instance information for all locations, use "-" as the value of - * `{location}`. - * - * 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. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server will pick an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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 results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering 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; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php deleted file mode 100644 index 771809f6496..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/ListInstancesResponse.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.parallelstore.v1beta.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; - */ - private $instances; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Parallelstore\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * The list of Parallelstore instances. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The list of Parallelstore instances. - * - * Generated from protobuf field repeated .google.cloud.parallelstore.v1beta.Instance instances = 1; - * @param array<\Google\Cloud\Parallelstore\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Parallelstore\V1beta\Instance::class); - $this->instances = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php deleted file mode 100644 index 4c18d216563..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.parallelstore.v1beta.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php deleted file mode 100644 index d75c59be5ee..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceGcsBucket.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.parallelstore.v1beta.SourceGcsBucket - */ -class SourceGcsBucket extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI to a Cloud Storage bucket in the format: - * `gs:///`. The path inside the bucket is - * optional. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php deleted file mode 100644 index 9d009c92d2a..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/SourceParallelstore.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.parallelstore.v1beta.SourceParallelstore - */ -class SourceParallelstore extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with `/`. Defaults to `/` if unset. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php deleted file mode 100644 index 1f3c823561c..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferCounters.php +++ /dev/null @@ -1,261 +0,0 @@ -google.cloud.parallelstore.v1beta.TransferCounters - */ -class TransferCounters extends \Google\Protobuf\Internal\Message -{ - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - */ - protected $objects_found = 0; - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - */ - protected $bytes_found = 0; - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - */ - protected $objects_skipped = 0; - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - */ - protected $bytes_skipped = 0; - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - */ - protected $objects_copied = 0; - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - */ - protected $bytes_copied = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $objects_found - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * @type int|string $bytes_found - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * @type int|string $objects_skipped - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * @type int|string $bytes_skipped - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * @type int|string $objects_copied - * Objects that are copied to the data destination. - * @type int|string $bytes_copied - * Bytes that are copied to the data destination. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - * @return int|string - */ - public function getObjectsFound() - { - return $this->objects_found; - } - - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 objects_found = 1; - * @param int|string $var - * @return $this - */ - public function setObjectsFound($var) - { - GPBUtil::checkInt64($var); - $this->objects_found = $var; - - return $this; - } - - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - * @return int|string - */ - public function getBytesFound() - { - return $this->bytes_found; - } - - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - * - * Generated from protobuf field int64 bytes_found = 2; - * @param int|string $var - * @return $this - */ - public function setBytesFound($var) - { - GPBUtil::checkInt64($var); - $this->bytes_found = $var; - - return $this; - } - - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - * @return int|string - */ - public function getObjectsSkipped() - { - return $this->objects_skipped; - } - - /** - * Objects in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 objects_skipped = 3; - * @param int|string $var - * @return $this - */ - public function setObjectsSkipped($var) - { - GPBUtil::checkInt64($var); - $this->objects_skipped = $var; - - return $this; - } - - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - * @return int|string - */ - public function getBytesSkipped() - { - return $this->bytes_skipped; - } - - /** - * Bytes in the data source that are not transferred because they already - * exist in the data destination. - * - * Generated from protobuf field int64 bytes_skipped = 4; - * @param int|string $var - * @return $this - */ - public function setBytesSkipped($var) - { - GPBUtil::checkInt64($var); - $this->bytes_skipped = $var; - - return $this; - } - - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - * @return int|string - */ - public function getObjectsCopied() - { - return $this->objects_copied; - } - - /** - * Objects that are copied to the data destination. - * - * Generated from protobuf field int64 objects_copied = 5; - * @param int|string $var - * @return $this - */ - public function setObjectsCopied($var) - { - GPBUtil::checkInt64($var); - $this->objects_copied = $var; - - return $this; - } - - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - * @return int|string - */ - public function getBytesCopied() - { - return $this->bytes_copied; - } - - /** - * Bytes that are copied to the data destination. - * - * Generated from protobuf field int64 bytes_copied = 6; - * @param int|string $var - * @return $this - */ - public function setBytesCopied($var) - { - GPBUtil::checkInt64($var); - $this->bytes_copied = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php deleted file mode 100644 index 6a51f19d65e..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferOperationMetadata.php +++ /dev/null @@ -1,261 +0,0 @@ -google.cloud.parallelstore.v1beta.TransferOperationMetadata - */ -class TransferOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $counters = null; - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $transfer_type = 0; - protected $source; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore - * Output only. Parallelstore source. - * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket - * Output only. Cloud Storage source. - * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket - * Output only. Cloud Storage destination. - * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore - * Output only. Parallelstore destination. - * @type \Google\Cloud\Parallelstore\V1beta\TransferCounters $counters - * Output only. The progress of the transfer operation. - * @type int $transfer_type - * Output only. The type of transfer occurring. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null - */ - public function getSourceParallelstore() - { - return $this->readOneof(7); - } - - public function hasSourceParallelstore() - { - return $this->hasOneof(7); - } - - /** - * Output only. Parallelstore source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var - * @return $this - */ - public function setSourceParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Output only. Cloud Storage source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null - */ - public function getSourceGcsBucket() - { - return $this->readOneof(8); - } - - public function hasSourceGcsBucket() - { - return $this->hasOneof(8); - } - - /** - * Output only. Cloud Storage source. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var - * @return $this - */ - public function setSourceGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Output only. Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null - */ - public function getDestinationGcsBucket() - { - return $this->readOneof(9); - } - - public function hasDestinationGcsBucket() - { - return $this->hasOneof(9); - } - - /** - * Output only. Cloud Storage destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var - * @return $this - */ - public function setDestinationGcsBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Output only. Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null - */ - public function getDestinationParallelstore() - { - return $this->readOneof(10); - } - - public function hasDestinationParallelstore() - { - return $this->hasOneof(10); - } - - /** - * Output only. Parallelstore destination. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var - * @return $this - */ - public function setDestinationParallelstore($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Parallelstore\V1beta\TransferCounters|null - */ - public function getCounters() - { - return $this->counters; - } - - public function hasCounters() - { - return isset($this->counters); - } - - public function clearCounters() - { - unset($this->counters); - } - - /** - * Output only. The progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Parallelstore\V1beta\TransferCounters $var - * @return $this - */ - public function setCounters($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferCounters::class); - $this->counters = $var; - - return $this; - } - - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTransferType() - { - return $this->transfer_type; - } - - /** - * Output only. The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTransferType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1beta\TransferType::class); - $this->transfer_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php deleted file mode 100644 index 32f4f425911..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/TransferType.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.parallelstore.v1beta.TransferType - */ -class TransferType -{ - /** - * Zero is an illegal value. - * - * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; - */ - const TRANSFER_TYPE_UNSPECIFIED = 0; - /** - * Imports to Parallelstore. - * - * Generated from protobuf enum IMPORT = 1; - */ - const IMPORT = 1; - /** - * Exports from Parallelstore. - * - * Generated from protobuf enum EXPORT = 2; - */ - const EXPORT = 2; - - private static $valueToName = [ - self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', - self::IMPORT => 'IMPORT', - self::EXPORT => 'EXPORT', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php b/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php deleted file mode 100644 index 4ef5ca11a7b..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/proto/src/Google/Cloud/Parallelstore/V1beta/UpdateInstanceRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.parallelstore.v1beta.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param \Google\Cloud\Parallelstore\V1beta\Instance $instance Required. The instance to update. - * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * @return \Google\Cloud\Parallelstore\V1beta\UpdateInstanceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Parallelstore\V1beta\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setInstance($instance) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * @type \Google\Cloud\Parallelstore\V1beta\Instance $instance - * Required. The instance to update. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); - parent::__construct($data); - } - - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Mask of fields to update. Field mask is used to specify the - * fields to be overwritten in the Instance resource by the update. At least - * one path must be supplied in this field. The fields specified in the - * update_mask are relative to the resource, not the full request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Parallelstore\V1beta\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The instance to update. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Parallelstore\V1beta\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\Instance::class); - $this->instance = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php deleted file mode 100644 index a167a3c6851..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/create_instance.php +++ /dev/null @@ -1,104 +0,0 @@ -setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->createInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); - $instanceId = '[INSTANCE_ID]'; - $instanceCapacityGib = 0; - - create_instance_sample($formattedParent, $instanceId, $instanceCapacityGib); -} -// [END parallelstore_v1beta_generated_Parallelstore_CreateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php deleted file mode 100644 index bc9e448eef1..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/delete_instance.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->deleteInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - delete_instance_sample($formattedName); -} -// [END parallelstore_v1beta_generated_Parallelstore_DeleteInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php deleted file mode 100644 index 7ff721f7a80..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/export_data.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->exportData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportDataResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - export_data_sample($formattedName); -} -// [END parallelstore_v1beta_generated_Parallelstore_ExportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php deleted file mode 100644 index 4ac319b07fc..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_instance.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Instance $response */ - $response = $parallelstoreClient->getInstance($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_sample($formattedName); -} -// [END parallelstore_v1beta_generated_Parallelstore_GetInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php deleted file mode 100644 index a20382fc3d3..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END parallelstore_v1beta_generated_Parallelstore_GetLocation_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php deleted file mode 100644 index 2bed07a1b4b..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/import_data.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->importData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportDataResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - import_data_sample($formattedName); -} -// [END parallelstore_v1beta_generated_Parallelstore_ImportData_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php deleted file mode 100644 index 3c500ce1f28..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_instances.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $parallelstoreClient->listInstances($request); - - /** @var Instance $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); - - list_instances_sample($formattedParent); -} -// [END parallelstore_v1beta_generated_Parallelstore_ListInstances_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php deleted file mode 100644 index 914034ce8fe..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END parallelstore_v1beta_generated_Parallelstore_ListLocations_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php b/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php deleted file mode 100644 index 6d1a4798aee..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/samples/V1beta/ParallelstoreClient/update_instance.php +++ /dev/null @@ -1,89 +0,0 @@ -setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $parallelstoreClient->updateInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $instanceCapacityGib = 0; - - update_instance_sample($instanceCapacityGib); -} -// [END parallelstore_v1beta_generated_Parallelstore_UpdateInstance_sync] diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php deleted file mode 100644 index 01ad01a3daf..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/Client/ParallelstoreClient.php +++ /dev/null @@ -1,651 +0,0 @@ - createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) - * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) - * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class ParallelstoreClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.parallelstore.v1beta.Parallelstore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'parallelstore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'parallelstore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/parallelstore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/parallelstore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/parallelstore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/parallelstore_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a address - * resource. - * - * @param string $project - * @param string $region - * @param string $address - * - * @return string The formatted address resource. - * - * @experimental - */ - public static function addressName(string $project, string $region, string $address): string - { - return self::getPathTemplate('address')->render([ - 'project' => $project, - 'region' => $region, - 'address' => $address, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $instance - * - * @return string The formatted instance resource. - * - * @experimental - */ - public static function instanceName(string $project, string $location, string $instance): string - { - return self::getPathTemplate('instance')->render([ - 'project' => $project, - 'location' => $location, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName(string $project, string $network): string - { - return self::getPathTemplate('network')->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_account resource. - * - * @param string $project - * @param string $serviceAccount - * - * @return string The formatted service_account resource. - * - * @experimental - */ - public static function serviceAccountName(string $project, string $serviceAccount): string - { - return self::getPathTemplate('serviceAccount')->render([ - 'project' => $project, - 'service_account' => $serviceAccount, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - address: projects/{project}/regions/{region}/addresses/{address} - * - instance: projects/{project}/locations/{location}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - serviceAccount: projects/{project}/serviceAccounts/{service_account} - * - * 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(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'parallelstore.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Parallelstore instance in a given project and location. - * - * The async variant is {@see ParallelstoreClient::createInstanceAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/create_instance.php - * - * @param CreateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); - } - - /** - * Deletes a single instance. - * - * The async variant is {@see ParallelstoreClient::deleteInstanceAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/delete_instance.php - * - * @param DeleteInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); - } - - /** - * Copies data from Parallelstore to Cloud Storage. - * - * The async variant is {@see ParallelstoreClient::exportDataAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/export_data.php - * - * @param ExportDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportData', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single instance. - * - * The async variant is {@see ParallelstoreClient::getInstanceAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/get_instance.php - * - * @param GetInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Instance - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance - { - return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); - } - - /** - * Copies data from Cloud Storage to Parallelstore. - * - * The async variant is {@see ParallelstoreClient::importDataAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/import_data.php - * - * @param ImportDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportData', $request, $callOptions)->wait(); - } - - /** - * Lists all instances in a given project and location. - * - * The async variant is {@see ParallelstoreClient::listInstancesAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/list_instances.php - * - * @param ListInstancesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInstances', $request, $callOptions); - } - - /** - * Updates the parameters of a single instance. - * - * The async variant is {@see ParallelstoreClient::updateInstanceAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/update_instance.php - * - * @param UpdateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ParallelstoreClient::getLocationAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ParallelstoreClient::listLocationsAsync()} . - * - * @example samples/V1beta/ParallelstoreClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json deleted file mode 100644 index 7b389692ba7..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.parallelstore.v1beta", - "libraryPackage": "Google\\Cloud\\Parallelstore\\V1beta", - "services": { - "Parallelstore": { - "clients": { - "grpc": { - "libraryClient": "ParallelstoreGapicClient", - "rpcs": { - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json deleted file mode 100644 index bc53acd55a4..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_client_config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "interfaces": { - "google.cloud.parallelstore.v1beta.Parallelstore": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ExportData": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ImportData": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php deleted file mode 100644 index 6ff219c559f..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_descriptor_config.php +++ /dev/null @@ -1,197 +0,0 @@ - [ - 'google.cloud.parallelstore.v1beta.Parallelstore' => [ - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ExportData' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\ExportDataResponse', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\ExportDataMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ImportData' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\ImportDataResponse', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\ImportDataMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Parallelstore\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'instance.name', - 'fieldAccessors' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Parallelstore\V1beta\Instance', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Parallelstore\V1beta\ListInstancesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'address' => 'projects/{project}/regions/{region}/addresses/{address}', - 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', - 'location' => 'projects/{project}/locations/{location}', - 'network' => 'projects/{project}/global/networks/{network}', - 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php b/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php deleted file mode 100644 index f1562b87eff..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/src/V1beta/resources/parallelstore_rest_client_config.php +++ /dev/null @@ -1,187 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.parallelstore.v1beta.Parallelstore' => [ - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportData' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}:exportData', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportData' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/instances/*}:importData', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{instance.name=projects/*/locations/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php b/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php deleted file mode 100644 index 3bb333809c1..00000000000 --- a/owl-bot-staging/Parallelstore/v1beta/tests/Unit/V1beta/Client/ParallelstoreClientTest.php +++ /dev/null @@ -1,1100 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ParallelstoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ParallelstoreClient($options); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $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.parallelstore.v1beta.Parallelstore/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 deleteInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $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.parallelstore.v1beta.Parallelstore/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 exportDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ExportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->exportData($request); - $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.parallelstore.v1beta.Parallelstore/ExportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - $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 exportDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportDataTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ExportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->exportData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->getInstance($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.parallelstore.v1beta.Parallelstore/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - try { - $gapicClient->getInstance($request); - // 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 importDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ImportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->importData($request); - $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.parallelstore.v1beta.Parallelstore/ImportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - $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 importDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importDataTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new ImportDataRequest()) - ->setName($formattedName); - $response = $gapicClient->importData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInstances($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.parallelstore.v1beta.Parallelstore/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInstances($request); - // 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 updateInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $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.parallelstore.v1beta.Parallelstore/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $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 - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createInstanceAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $capacityGib = 498394811; - $daosVersion = 'daosVersion-1809382982'; - $network = 'network1843485230'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setCapacityGib($capacityGib); - $expectedResponse->setDaosVersion($daosVersion); - $expectedResponse->setNetwork($network); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceCapacityGib = 1813257007; - $instance->setCapacityGib($instanceCapacityGib); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstanceAsync($request)->wait(); - $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.parallelstore.v1beta.Parallelstore/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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()); - } -} diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php b/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Explanations.php deleted file mode 100644 index 29c6b7e51d02e9b475534b6bb9d4e8200f222e19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2854 zcmbtWU2o$=6vaulyS+i(?kuz+yP`u{)a+_;)$9v$w~O-OrWTD8lC%i0WI4{H9pTuP zKPpPqKf({-0f`5G1TXvqo_OXRiATns*h$k=yIcB{dhR{<+%sop?yE1{GZ!{-li0*F z0y4yd3mlvg?0Qb%n2v=9;b=rWY&v6?TEr7EZnUx5?qj*3^gm&#z7u*Tk?^VGoLXeZ zw489b<2n{KFMK)Ur_Qe<;z&6IjcMX%^W~bI7fiW}!LuNi~h)Z+s7lr@(BaD z89NGXGvbD$gtl#x@-xgaqu4FiVOs3tgj*+)he@L;c0fGau(Ss8O^>>)*$xYpq*D^4 zqDEiJ&n9IfI6A^*&QX$Xkle?C7n0fP7<(iLJ$ohi{nC#?<$j$qLzYq4aA89>z|l zHW_laqgSwG#6{y0E0q`G8(I@N#~$-NLB-p-pig0mw;fZ+S3XRTnI=pkaYEoL_+UWo zA+=9+rbT*g3pt!E=PNIhq}!AhYdksbi=TOP0Lvb+$hpDJR^cA&f8{N34oT=ypPl7y zl3M!n0iXr&)&CY*MBin&@aee=m?oM$FmQ9CQE4pk8_Zd#U@+ct~ z9X^qn#w-3Nz~icIJCUJ>Q!c0rFl}&hI$kH~?_fu92J@OTqa%AaXBIDEb&Be9)$)-2 zo?P&og6;afbHfU`!}68pU3f1LMaq0GlztLmWzJ+9@TA*5lJ$<Xo z^s@jk)rQ?rYc07|le@h`r87rr9UjlDrPT!V1lDI3=BSk5UB+%j*CdqN9)9&^e z(cJUPv~PZv(n{;h{~~IFygOO0Tcf^{#v*pH$WQJQaW?wcTwod;vXx+@aDuT+P(} z5nz)|Zg28g?a|Cd?Z>lCNBFkIk5lsUIOCmD=f+@XxHNr9({axo?D0ot=F7i=@JnW+ z8IN{iJsRyMZ%r>562+63p(#h^%DIPIj ZZl|Ng3qDrOOkuZ9U~wd$ldj+j;6FxGm-YYv diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php b/owl-bot-staging/PolicySimulator/v1/proto/src/GPBMetadata/Google/Cloud/Policysimulator/V1/Simulator.php deleted file mode 100644 index 133eb375f8cfb21698d888591c09b7c30cb0b795..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5717 zcmbVQO>7&-70yzkY7TAvjGI^?&}6f6Ygx9r5$n3?+G@L`Xoav$5+vm&0s&&R98%jX zcenc^M-c?Hz4X{a&pj7N5%kbwQJ}}d$D}6%1=^y$_)?&!qNl$3*%eKZ7HM6?oq6xg z%=f=8@i@z%Lh@fM||0I2cBgUKQGJMHMv@A z$>r@z>pf5n+{ibHCih*pZxhwD-KeX2u5Fpefi;M1BXoWBXj4r-^2|0ujxivCXP89Z zsTUuU(C8YW(cWQZ+9hhHU4Pk3`^n~ggiPBA0=XI6Mkh#yKQB6fCFLMALil&x3Obf! zg_dDkpTViNuP)0z2_xUR&-P6X zoF>28V_?%gtF1eZOHpv0K-137bY^0bV#&6M6V9gd&?0uXNDhr7%k^hdZ4g17sW&-^ z6z%e-o^3d@p1EQSfKh^E)9-!Pb^3nfIF{3I*E||Fvq7COsAWL_gvP*|e(i>5wwvJG zXa?7|jy=-ehTtB*3?ulR?^}Y-dbgXf_aQ|5dcrr#z8mN-Ye=0j)bYDqAK zk2Z7Hghj)%Ac0U8@+6THnkt>>QL1$g1lNSX+e4bZAe5LYT(nIx#2TTK6FQbLpgD_g zRm`o4Is452s+;&<2*n#_IS$f<8pci*0`XCO&s1q5hypS3mM|ZJyHrSpgpVu#PNRhe z0e&Cj6*Nzi=Bgx1>zU%*-}E`GqcpWbR#PyxSh$ntRwhE7=ce+MM1-3tq6O1+dRBjR z4s2wnwozhA)J6)o&=Q~@*hrHRrEW&9>uX}0uMxwBVo*2|^J!%BI3 z`3;;!U#pj^+m-6hvP3@`d(|raNZ~6e)7&eS%H?ekoWlq$Jk%?@@OxhSyYxc;tAxHe z8bsXf5GFw$O0_Bo^8wKC$HWW+^+fzSRc+Vg8B0Bhf1av7BN&MBAE)?Uk7D7&2>&sy zUeWdYhGTseFERW%r48j@^XM`^0CzsVkLIZ(g-dS5E}4{01jn~Q<-<4d8cH)?uX0D> zSQ`S6ML`sR(BUO;B#7*l= zsYP}0O|%G2PS^Fqn2!Ut)b!h=SVNn|Mq{F{YarO1+ zGSS}tFmHf_!=F>qXp-&XCA7e|tsJ7OC7(b{$87sa1Yr%?A$EU~XjAwB)uLILaUxr2 z-?-4D+$u|uN(EixpGn6Mcf2@{5TtNF?9fuda$2^Ki;c&1B%d@3N)0XVknrU#Lxc=f zhC7gwXP~U|Qwgo^T0vry`M5zi8e1c1%xIiuY|rSEP5_NK!!C^>qp_jT{e(CyKr+e+ zdV9H|r6fHH|?oI`Kz)^hr3hyP_OQkJFSoFqn?4rp;{C3&{SZwxL18tt^KGPkEQ6CFw-bM zsXby1#tOP3#&+~dmG&9XJAGXYJ=Q-imOHU9ZMUwzG$T|Nls`&nX%y(QVhAY?nkvf4 z#lp13khf3Za2AUe3BXr0>}T*54-Wuufi(dEIEh*q(*+cMb_v?9_*DV_B84(Zn#G$J zIyI3Mc{4Y4flz)eJ=aezVFmnW$d1Ex65qWLjbZT^kZ;6VLl>xgQVx}WNYC{5lB>?7 zYWZBh!dtW390CT}ZzP37#-}ELmUOwAsO0;16%L(H8w=ifEluGN3awXwcup5TOQDr> zWe$HYMrLASJf{|7{~o?OtT-0Pae5E1 zHmvswD932$8qf51SY|kTXcTC~_nko?m zkkg{8y4b zPrbXt9z*jb`WPxob+T^$$>y_IqAlJ_#amV)(}wr07b%6C(KKd9(|Arygf#8R=D`AM hG{1c#dF{E)-y(;eE@=k0%rVcFOp-q@o}yEP{tu1_mhu1q diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php deleted file mode 100644 index 077a3033f17..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessState.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.policysimulator.v1.AccessState - */ -class AccessState -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum ACCESS_STATE_UNSPECIFIED = 0; - */ - const ACCESS_STATE_UNSPECIFIED = 0; - /** - * The principal has the permission. - * - * Generated from protobuf enum GRANTED = 1; - */ - const GRANTED = 1; - /** - * The principal does not have the permission. - * - * Generated from protobuf enum NOT_GRANTED = 2; - */ - const NOT_GRANTED = 2; - /** - * The principal has the permission only if a condition expression evaluates - * to `true`. - * - * Generated from protobuf enum UNKNOWN_CONDITIONAL = 3; - */ - const UNKNOWN_CONDITIONAL = 3; - /** - * The user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to all of the policies that Policy Simulator needs to evaluate. - * - * Generated from protobuf enum UNKNOWN_INFO_DENIED = 4; - */ - const UNKNOWN_INFO_DENIED = 4; - - private static $valueToName = [ - self::ACCESS_STATE_UNSPECIFIED => 'ACCESS_STATE_UNSPECIFIED', - self::GRANTED => 'GRANTED', - self::NOT_GRANTED => 'NOT_GRANTED', - self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', - self::UNKNOWN_INFO_DENIED => 'UNKNOWN_INFO_DENIED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php deleted file mode 100644 index 452fc1fa8d8..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.policysimulator.v1.AccessStateDiff - */ -class AccessStateDiff extends \Google\Protobuf\Internal\Message -{ - /** - * The results of evaluating the access tuple under the current (baseline) - * policies. - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't - * be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; - */ - protected $baseline = null; - /** - * The results of evaluating the access tuple under the proposed (simulated) - * policies. - * If the AccessState couldn't be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; - */ - protected $simulated = null; - /** - * How the principal's access, specified in the AccessState field, changed - * between the current (baseline) policies and proposed (simulated) policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; - */ - protected $access_change = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicySimulator\V1\ExplainedAccess $baseline - * The results of evaluating the access tuple under the current (baseline) - * policies. - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't - * be fully evaluated, this field explains why. - * @type \Google\Cloud\PolicySimulator\V1\ExplainedAccess $simulated - * The results of evaluating the access tuple under the proposed (simulated) - * policies. - * If the AccessState couldn't be fully evaluated, this field explains why. - * @type int $access_change - * How the principal's access, specified in the AccessState field, changed - * between the current (baseline) policies and proposed (simulated) policies. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * The results of evaluating the access tuple under the current (baseline) - * policies. - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't - * be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; - * @return \Google\Cloud\PolicySimulator\V1\ExplainedAccess|null - */ - public function getBaseline() - { - return $this->baseline; - } - - public function hasBaseline() - { - return isset($this->baseline); - } - - public function clearBaseline() - { - unset($this->baseline); - } - - /** - * The results of evaluating the access tuple under the current (baseline) - * policies. - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't - * be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess baseline = 1; - * @param \Google\Cloud\PolicySimulator\V1\ExplainedAccess $var - * @return $this - */ - public function setBaseline($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ExplainedAccess::class); - $this->baseline = $var; - - return $this; - } - - /** - * The results of evaluating the access tuple under the proposed (simulated) - * policies. - * If the AccessState couldn't be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; - * @return \Google\Cloud\PolicySimulator\V1\ExplainedAccess|null - */ - public function getSimulated() - { - return $this->simulated; - } - - public function hasSimulated() - { - return isset($this->simulated); - } - - public function clearSimulated() - { - unset($this->simulated); - } - - /** - * The results of evaluating the access tuple under the proposed (simulated) - * policies. - * If the AccessState couldn't be fully evaluated, this field explains why. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ExplainedAccess simulated = 2; - * @param \Google\Cloud\PolicySimulator\V1\ExplainedAccess $var - * @return $this - */ - public function setSimulated($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ExplainedAccess::class); - $this->simulated = $var; - - return $this; - } - - /** - * How the principal's access, specified in the AccessState field, changed - * between the current (baseline) policies and proposed (simulated) policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; - * @return int - */ - public function getAccessChange() - { - return $this->access_change; - } - - /** - * How the principal's access, specified in the AccessState field, changed - * between the current (baseline) policies and proposed (simulated) policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType access_change = 3; - * @param int $var - * @return $this - */ - public function setAccessChange($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessStateDiff\AccessChangeType::class); - $this->access_change = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php deleted file mode 100644 index ba5a4819fb9..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessStateDiff/AccessChangeType.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType - */ -class AccessChangeType -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum ACCESS_CHANGE_TYPE_UNSPECIFIED = 0; - */ - const ACCESS_CHANGE_TYPE_UNSPECIFIED = 0; - /** - * The principal's access did not change. - * This includes the case where both baseline and simulated are UNKNOWN, - * but the unknown information is equivalent. - * - * Generated from protobuf enum NO_CHANGE = 1; - */ - const NO_CHANGE = 1; - /** - * The principal's access under both the current policies and the proposed - * policies is `UNKNOWN`, but the unknown information differs between them. - * - * Generated from protobuf enum UNKNOWN_CHANGE = 2; - */ - const UNKNOWN_CHANGE = 2; - /** - * The principal had access under the current policies (`GRANTED`), but will - * no longer have access after the proposed changes (`NOT_GRANTED`). - * - * Generated from protobuf enum ACCESS_REVOKED = 3; - */ - const ACCESS_REVOKED = 3; - /** - * The principal did not have access under the current policies - * (`NOT_GRANTED`), but will have access after the proposed changes - * (`GRANTED`). - * - * Generated from protobuf enum ACCESS_GAINED = 4; - */ - const ACCESS_GAINED = 4; - /** - * This result can occur for the following reasons: - * * The principal had access under the current policies (`GRANTED`), but - * their access after the proposed changes is `UNKNOWN`. - * * The principal's access under the current policies is `UNKNOWN`, but - * they - * will not have access after the proposed changes (`NOT_GRANTED`). - * - * Generated from protobuf enum ACCESS_MAYBE_REVOKED = 5; - */ - const ACCESS_MAYBE_REVOKED = 5; - /** - * This result can occur for the following reasons: - * * The principal did not have access under the current policies - * (`NOT_GRANTED`), but their access after the proposed changes is - * `UNKNOWN`. - * * The principal's access under the current policies is `UNKNOWN`, but - * they will have access after the proposed changes (`GRANTED`). - * - * Generated from protobuf enum ACCESS_MAYBE_GAINED = 6; - */ - const ACCESS_MAYBE_GAINED = 6; - - private static $valueToName = [ - self::ACCESS_CHANGE_TYPE_UNSPECIFIED => 'ACCESS_CHANGE_TYPE_UNSPECIFIED', - self::NO_CHANGE => 'NO_CHANGE', - self::UNKNOWN_CHANGE => 'UNKNOWN_CHANGE', - self::ACCESS_REVOKED => 'ACCESS_REVOKED', - self::ACCESS_GAINED => 'ACCESS_GAINED', - self::ACCESS_MAYBE_REVOKED => 'ACCESS_MAYBE_REVOKED', - self::ACCESS_MAYBE_GAINED => 'ACCESS_MAYBE_GAINED', - ]; - - 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(AccessChangeType::class, \Google\Cloud\PolicySimulator\V1\AccessStateDiff_AccessChangeType::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php deleted file mode 100644 index 5aef864d04e..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/AccessTuple.php +++ /dev/null @@ -1,187 +0,0 @@ -google.cloud.policysimulator.v1.AccessTuple - */ -class AccessTuple extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $principal = ''; - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $full_resource_name = ''; - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $permission = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $principal - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * @type string $full_resource_name - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type string $permission - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPermission() - { - return $this->permission; - } - - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPermission($var) - { - GPBUtil::checkString($var, True); - $this->permission = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php deleted file mode 100644 index f890be34bae..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation.php +++ /dev/null @@ -1,398 +0,0 @@ -google.cloud.policysimulator.v1.BindingExplanation - */ -class BindingExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $access = 0; - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - */ - protected $role = ''; - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; - */ - protected $role_permission = 0; - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; - */ - protected $role_permission_relevance = 0; - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * The principal in the replayed access tuple is `user:bob@example.com`. This - * user is a principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - */ - private $memberships; - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; - */ - protected $relevance = 0; - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/docs/conditions-overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - */ - protected $condition = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * @type string $role - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * @type int $role_permission - * Indicates whether the role granted by this binding contains the specified - * permission. - * @type int $role_permission_relevance - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * @type array|\Google\Protobuf\Internal\MapField $memberships - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * The principal in the replayed access tuple is `user:bob@example.com`. This - * user is a principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * @type int $relevance - * The relevance of this binding to the overall determination for the entire - * policy. - * @type \Google\Type\Expr $condition - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/docs/conditions-overview. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAccess() - { - return $this->access; - } - - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAccess($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); - $this->access = $var; - - return $this; - } - - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @return string - */ - public function getRole() - { - return $this->role; - } - - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @param string $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkString($var, True); - $this->role = $var; - - return $this; - } - - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; - * @return int - */ - public function getRolePermission() - { - return $this->role_permission; - } - - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.RolePermission role_permission = 3; - * @param int $var - * @return $this - */ - public function setRolePermission($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\BindingExplanation\RolePermission::class); - $this->role_permission = $var; - - return $this; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; - * @return int - */ - public function getRolePermissionRelevance() - { - return $this->role_permission_relevance; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance role_permission_relevance = 4; - * @param int $var - * @return $this - */ - public function setRolePermissionRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); - $this->role_permission_relevance = $var; - - return $this; - } - - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * The principal in the replayed access tuple is `user:bob@example.com`. This - * user is a principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMemberships() - { - return $this->memberships; - } - - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * The principal in the replayed access tuple is `user:bob@example.com`. This - * user is a principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMemberships($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\BindingExplanation\AnnotatedMembership::class); - $this->memberships = $arr; - - return $this; - } - - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 6; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/docs/conditions-overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - * @return \Google\Type\Expr|null - */ - public function getCondition() - { - return $this->condition; - } - - public function hasCondition() - { - return isset($this->condition); - } - - public function clearCondition() - { - unset($this->condition); - } - - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/docs/conditions-overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - * @param \Google\Type\Expr $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkMessage($var, \Google\Type\Expr::class); - $this->condition = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php deleted file mode 100644 index 391223fe840..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/AnnotatedMembership.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership - */ -class AnnotatedMembership extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; - */ - protected $membership = 0; - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $membership - * Indicates whether the binding includes the principal. - * @type int $relevance - * The relevance of the principal's status to the overall determination for - * the binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; - * @return int - */ - public function getMembership() - { - return $this->membership; - } - - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.BindingExplanation.Membership membership = 1; - * @param int $var - * @return $this - */ - public function setMembership($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\BindingExplanation\Membership::class); - $this->membership = $var; - - return $this; - } - - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 2; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnnotatedMembership::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_AnnotatedMembership::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php deleted file mode 100644 index c52085900dc..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/Membership.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.policysimulator.v1.BindingExplanation.Membership - */ -class Membership -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum MEMBERSHIP_UNSPECIFIED = 0; - */ - const MEMBERSHIP_UNSPECIFIED = 0; - /** - * The binding includes the principal. The principal can be included - * directly or indirectly. For example: - * * A principal is included directly if that principal is listed in the - * binding. - * * A principal is included indirectly if that principal is in a Google - * group or Google Workspace domain that is listed in the binding. - * - * Generated from protobuf enum MEMBERSHIP_INCLUDED = 1; - */ - const MEMBERSHIP_INCLUDED = 1; - /** - * The binding does not include the principal. - * - * Generated from protobuf enum MEMBERSHIP_NOT_INCLUDED = 2; - */ - const MEMBERSHIP_NOT_INCLUDED = 2; - /** - * The user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] is not - * allowed to access the binding. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; - */ - const MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; - /** - * The principal is an unsupported type. Only Google Accounts and service - * accounts are supported. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - */ - const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - - private static $valueToName = [ - self::MEMBERSHIP_UNSPECIFIED => 'MEMBERSHIP_UNSPECIFIED', - self::MEMBERSHIP_INCLUDED => 'MEMBERSHIP_INCLUDED', - self::MEMBERSHIP_NOT_INCLUDED => 'MEMBERSHIP_NOT_INCLUDED', - self::MEMBERSHIP_UNKNOWN_INFO_DENIED => 'MEMBERSHIP_UNKNOWN_INFO_DENIED', - self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', - ]; - - 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(Membership::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_Membership::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php deleted file mode 100644 index da2637968e1..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/BindingExplanation/RolePermission.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.policysimulator.v1.BindingExplanation.RolePermission - */ -class RolePermission -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum ROLE_PERMISSION_UNSPECIFIED = 0; - */ - const ROLE_PERMISSION_UNSPECIFIED = 0; - /** - * The permission is included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; - */ - const ROLE_PERMISSION_INCLUDED = 1; - /** - * The permission is not included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; - */ - const ROLE_PERMISSION_NOT_INCLUDED = 2; - /** - * The user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] is not - * allowed to access the binding. - * - * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; - */ - const ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; - - private static $valueToName = [ - self::ROLE_PERMISSION_UNSPECIFIED => 'ROLE_PERMISSION_UNSPECIFIED', - self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', - self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', - self::ROLE_PERMISSION_UNKNOWN_INFO_DENIED => 'ROLE_PERMISSION_UNKNOWN_INFO_DENIED', - ]; - - 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(RolePermission::class, \Google\Cloud\PolicySimulator\V1\BindingExplanation_RolePermission::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php deleted file mode 100644 index a79ba5da359..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/CreateReplayRequest.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.policysimulator.v1.CreateReplayRequest - */ -class CreateReplayRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource where this - * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This - * resource must be a project, folder, or organization with a location. - * Example: `projects/my-example-project/locations/global` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. - * Set `Replay.ReplayConfig` to configure the replay. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $replay = null; - - /** - * @param string $parent Required. The parent resource where this - * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This - * resource must be a project, folder, or organization with a location. - * - * Example: `projects/my-example-project/locations/global` - * @param \Google\Cloud\PolicySimulator\V1\Replay $replay Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. - * Set `Replay.ReplayConfig` to configure the replay. - * - * @return \Google\Cloud\PolicySimulator\V1\CreateReplayRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\PolicySimulator\V1\Replay $replay): self - { - return (new self()) - ->setParent($parent) - ->setReplay($replay); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource where this - * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This - * resource must be a project, folder, or organization with a location. - * Example: `projects/my-example-project/locations/global` - * @type \Google\Cloud\PolicySimulator\V1\Replay $replay - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. - * Set `Replay.ReplayConfig` to configure the replay. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource where this - * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This - * resource must be a project, folder, or organization with a location. - * Example: `projects/my-example-project/locations/global` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource where this - * [Replay][google.cloud.policysimulator.v1.Replay] will be created. This - * resource must be a project, folder, or organization with a location. - * Example: `projects/my-example-project/locations/global` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. - * Set `Replay.ReplayConfig` to configure the replay. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PolicySimulator\V1\Replay|null - */ - public function getReplay() - { - return $this->replay; - } - - public function hasReplay() - { - return isset($this->replay); - } - - public function clearReplay() - { - unset($this->replay); - } - - /** - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. - * Set `Replay.ReplayConfig` to configure the replay. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay replay = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PolicySimulator\V1\Replay $var - * @return $this - */ - public function setReplay($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\Replay::class); - $this->replay = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php deleted file mode 100644 index b6d9b5875a4..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedAccess.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.policysimulator.v1.ExplainedAccess - */ -class ExplainedAccess extends \Google\Protobuf\Internal\Message -{ - /** - * Whether the principal in the access tuple has permission to access the - * resource in the access tuple under the given policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; - */ - protected $access_state = 0; - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains the policies that led to that result. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; - */ - private $policies; - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains a list of errors explaining why the result - * is `UNKNOWN`. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access_state - * Whether the principal in the access tuple has permission to access the - * resource in the access tuple under the given policies. - * @type array<\Google\Cloud\PolicySimulator\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $policies - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains the policies that led to that result. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains a list of errors explaining why the result - * is `UNKNOWN`. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Whether the principal in the access tuple has permission to access the - * resource in the access tuple under the given policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; - * @return int - */ - public function getAccessState() - { - return $this->access_state; - } - - /** - * Whether the principal in the access tuple has permission to access the - * resource in the access tuple under the given policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access_state = 1; - * @param int $var - * @return $this - */ - public function setAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); - $this->access_state = $var; - - return $this; - } - - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains the policies that led to that result. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPolicies() - { - return $this->policies; - } - - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains the policies that led to that result. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ExplainedPolicy policies = 2; - * @param array<\Google\Cloud\PolicySimulator\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\ExplainedPolicy::class); - $this->policies = $arr; - - return $this; - } - - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains a list of errors explaining why the result - * is `UNKNOWN`. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * If the [AccessState][google.cloud.policysimulator.v1.AccessState] is - * `UNKNOWN`, this field contains a list of errors explaining why the result - * is `UNKNOWN`. - * If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is - * omitted. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php deleted file mode 100644 index 1d8b50692bb..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ExplainedPolicy.php +++ /dev/null @@ -1,306 +0,0 @@ -google.cloud.policysimulator.v1.ExplainedPolicy - */ -class ExplainedPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; - */ - protected $access = 0; - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - */ - protected $full_resource_name = ''; - /** - * The IAM policy attached to the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - */ - protected $policy = null; - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; - */ - private $binding_explanations; - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * @type string $full_resource_name - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type \Google\Cloud\Iam\V1\Policy $policy - * The IAM policy attached to the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is empty. - * @type array<\Google\Cloud\PolicySimulator\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * @type int $relevance - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; - * @return int - */ - public function getAccess() - { - return $this->access; - } - - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessState access = 1; - * @param int $var - * @return $this - */ - public function setAccess($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\AccessState::class); - $this->access = $var; - - return $this; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * The IAM policy attached to the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - * @return \Google\Cloud\Iam\V1\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * The IAM policy attached to the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - * @param \Google\Cloud\Iam\V1\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); - $this->policy = $var; - - return $this; - } - - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBindingExplanations() - { - return $this->binding_explanations; - } - - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4; - * @param array<\Google\Cloud\PolicySimulator\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBindingExplanations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\BindingExplanation::class); - $this->binding_explanations = $arr; - - return $this; - } - - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the user who created the - * [Replay][google.cloud.policysimulator.v1.Replay] does not have - * access to the policy, this field is omitted. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php deleted file mode 100644 index 937f3292e65..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/GetReplayRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.policysimulator.v1.GetReplayRequest - */ -class GetReplayRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] - * to retrieve, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the `Replay`. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] - * to retrieve, in the following format: - * - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the `Replay`. - * - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * Please see {@see SimulatorClient::replayName()} for help formatting this field. - * - * @return \Google\Cloud\PolicySimulator\V1\GetReplayRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] - * to retrieve, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the `Replay`. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] - * to retrieve, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the `Replay`. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * 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 name of the [Replay][google.cloud.policysimulator.v1.Replay] - * to retrieve, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the `Replay`. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * 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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php deleted file mode 100644 index fe3763179c9..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/HeuristicRelevance.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.policysimulator.v1.HeuristicRelevance - */ -class HeuristicRelevance -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - */ - const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - /** - * The data point has a limited effect on the result. Changing the data point - * is unlikely to affect the overall determination. - * - * Generated from protobuf enum NORMAL = 1; - */ - const NORMAL = 1; - /** - * The data point has a strong effect on the result. Changing the data point - * is likely to affect the overall determination. - * - * Generated from protobuf enum HIGH = 2; - */ - const HIGH = 2; - - private static $valueToName = [ - self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', - self::NORMAL => 'NORMAL', - self::HIGH => 'HIGH', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php deleted file mode 100644 index 9a5d990a78f..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsRequest.php +++ /dev/null @@ -1,204 +0,0 @@ -google.cloud.policysimulator.v1.ListReplayResultsRequest - */ -class ListReplayResultsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose - * results are listed, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` - * Example: - * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to - * return. Defaults to 5000. - * The maximum value is 5000; values above 5000 are rounded down to 5000. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous - * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] - * call. Provide this token to retrieve the next page of results. - * When paginating, all other parameters provided to - * [Simulator.ListReplayResults[] must match the call that provided the page - * token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose - * results are listed, in the following format: - * - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` - * - * Example: - * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * Please see {@see SimulatorClient::replayName()} for help formatting this field. - * - * @return \Google\Cloud\PolicySimulator\V1\ListReplayResultsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose - * results are listed, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` - * Example: - * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * @type int $page_size - * The maximum number of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to - * return. Defaults to 5000. - * The maximum value is 5000; values above 5000 are rounded down to 5000. - * @type string $page_token - * A page token, received from a previous - * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] - * call. Provide this token to retrieve the next page of results. - * When paginating, all other parameters provided to - * [Simulator.ListReplayResults[] must match the call that provided the page - * token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose - * results are listed, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` - * Example: - * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * 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 [Replay][google.cloud.policysimulator.v1.Replay] whose - * results are listed, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` - * Example: - * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * 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; - } - - /** - * The maximum number of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to - * return. Defaults to 5000. - * The maximum value is 5000; values above 5000 are rounded down to 5000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to - * return. Defaults to 5000. - * The maximum value is 5000; values above 5000 are rounded down to 5000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token, received from a previous - * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] - * call. Provide this token to retrieve the next page of results. - * When paginating, all other parameters provided to - * [Simulator.ListReplayResults[] must match the call that provided the page - * token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous - * [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] - * call. Provide this token to retrieve the next page of results. - * When paginating, all other parameters provided to - * [Simulator.ListReplayResults[] must match the call that provided the page - * token. - * - * Generated from protobuf field string page_token = 3; - * @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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php deleted file mode 100644 index 8dc33e2d81a..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ListReplayResultsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.policysimulator.v1.ListReplayResultsResponse - */ -class ListReplayResultsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; - */ - private $replay_results; - /** - * A token that you can use to retrieve the next page of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If - * this field is omitted, there are no subsequent pages. - * - * 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\PolicySimulator\V1\ReplayResult>|\Google\Protobuf\Internal\RepeatedField $replay_results - * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. - * @type string $next_page_token - * A token that you can use to retrieve the next page of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If - * this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReplayResults() - { - return $this->replay_results; - } - - /** - * The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field repeated .google.cloud.policysimulator.v1.ReplayResult replay_results = 1; - * @param array<\Google\Cloud\PolicySimulator\V1\ReplayResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReplayResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicySimulator\V1\ReplayResult::class); - $this->replay_results = $arr; - - return $this; - } - - /** - * A token that you can use to retrieve the next page of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If - * this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that you can use to retrieve the next page of - * [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If - * this field is omitted, there are no subsequent pages. - * - * 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/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php deleted file mode 100644 index 5c085465e5a..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay.php +++ /dev/null @@ -1,213 +0,0 @@ -google.cloud.policysimulator.v1.Replay - */ -class Replay extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the `Replay`, which has the following - * format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the Replay. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The current state of the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The configuration used for the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $config = null; - /** - * Output only. Summary statistics about the replayed log entries. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $results_summary = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the `Replay`, which has the following - * format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the Replay. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * @type int $state - * Output only. The current state of the `Replay`. - * @type \Google\Cloud\PolicySimulator\V1\ReplayConfig $config - * Required. The configuration used for the `Replay`. - * @type \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $results_summary - * Output only. Summary statistics about the replayed log entries. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the `Replay`, which has the following - * format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the Replay. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the `Replay`, which has the following - * format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the Replay. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The current state of the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\Replay\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The configuration used for the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PolicySimulator\V1\ReplayConfig|null - */ - public function getConfig() - { - return $this->config; - } - - public function hasConfig() - { - return isset($this->config); - } - - public function clearConfig() - { - unset($this->config); - } - - /** - * Required. The configuration used for the `Replay`. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PolicySimulator\V1\ReplayConfig $var - * @return $this - */ - public function setConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ReplayConfig::class); - $this->config = $var; - - return $this; - } - - /** - * Output only. Summary statistics about the replayed log entries. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary|null - */ - public function getResultsSummary() - { - return $this->results_summary; - } - - public function hasResultsSummary() - { - return isset($this->results_summary); - } - - public function clearResultsSummary() - { - unset($this->results_summary); - } - - /** - * Output only. Summary statistics about the replayed log entries. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $var - * @return $this - */ - public function setResultsSummary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary::class); - $this->results_summary = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php deleted file mode 100644 index be8edbe1c4f..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/ResultsSummary.php +++ /dev/null @@ -1,268 +0,0 @@ -google.cloud.policysimulator.v1.Replay.ResultsSummary - */ -class ResultsSummary extends \Google\Protobuf\Internal\Message -{ - /** - * The total number of log entries replayed. - * - * Generated from protobuf field int32 log_count = 1; - */ - protected $log_count = 0; - /** - * The number of replayed log entries with no difference between - * baseline and simulated policies. - * - * Generated from protobuf field int32 unchanged_count = 2; - */ - protected $unchanged_count = 0; - /** - * The number of replayed log entries with a difference between baseline and - * simulated policies. - * - * Generated from protobuf field int32 difference_count = 3; - */ - protected $difference_count = 0; - /** - * The number of log entries that could not be replayed. - * - * Generated from protobuf field int32 error_count = 4; - */ - protected $error_count = 0; - /** - * The date of the oldest log entry replayed. - * - * Generated from protobuf field .google.type.Date oldest_date = 5; - */ - protected $oldest_date = null; - /** - * The date of the newest log entry replayed. - * - * Generated from protobuf field .google.type.Date newest_date = 6; - */ - protected $newest_date = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $log_count - * The total number of log entries replayed. - * @type int $unchanged_count - * The number of replayed log entries with no difference between - * baseline and simulated policies. - * @type int $difference_count - * The number of replayed log entries with a difference between baseline and - * simulated policies. - * @type int $error_count - * The number of log entries that could not be replayed. - * @type \Google\Type\Date $oldest_date - * The date of the oldest log entry replayed. - * @type \Google\Type\Date $newest_date - * The date of the newest log entry replayed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * The total number of log entries replayed. - * - * Generated from protobuf field int32 log_count = 1; - * @return int - */ - public function getLogCount() - { - return $this->log_count; - } - - /** - * The total number of log entries replayed. - * - * Generated from protobuf field int32 log_count = 1; - * @param int $var - * @return $this - */ - public function setLogCount($var) - { - GPBUtil::checkInt32($var); - $this->log_count = $var; - - return $this; - } - - /** - * The number of replayed log entries with no difference between - * baseline and simulated policies. - * - * Generated from protobuf field int32 unchanged_count = 2; - * @return int - */ - public function getUnchangedCount() - { - return $this->unchanged_count; - } - - /** - * The number of replayed log entries with no difference between - * baseline and simulated policies. - * - * Generated from protobuf field int32 unchanged_count = 2; - * @param int $var - * @return $this - */ - public function setUnchangedCount($var) - { - GPBUtil::checkInt32($var); - $this->unchanged_count = $var; - - return $this; - } - - /** - * The number of replayed log entries with a difference between baseline and - * simulated policies. - * - * Generated from protobuf field int32 difference_count = 3; - * @return int - */ - public function getDifferenceCount() - { - return $this->difference_count; - } - - /** - * The number of replayed log entries with a difference between baseline and - * simulated policies. - * - * Generated from protobuf field int32 difference_count = 3; - * @param int $var - * @return $this - */ - public function setDifferenceCount($var) - { - GPBUtil::checkInt32($var); - $this->difference_count = $var; - - return $this; - } - - /** - * The number of log entries that could not be replayed. - * - * Generated from protobuf field int32 error_count = 4; - * @return int - */ - public function getErrorCount() - { - return $this->error_count; - } - - /** - * The number of log entries that could not be replayed. - * - * Generated from protobuf field int32 error_count = 4; - * @param int $var - * @return $this - */ - public function setErrorCount($var) - { - GPBUtil::checkInt32($var); - $this->error_count = $var; - - return $this; - } - - /** - * The date of the oldest log entry replayed. - * - * Generated from protobuf field .google.type.Date oldest_date = 5; - * @return \Google\Type\Date|null - */ - public function getOldestDate() - { - return $this->oldest_date; - } - - public function hasOldestDate() - { - return isset($this->oldest_date); - } - - public function clearOldestDate() - { - unset($this->oldest_date); - } - - /** - * The date of the oldest log entry replayed. - * - * Generated from protobuf field .google.type.Date oldest_date = 5; - * @param \Google\Type\Date $var - * @return $this - */ - public function setOldestDate($var) - { - GPBUtil::checkMessage($var, \Google\Type\Date::class); - $this->oldest_date = $var; - - return $this; - } - - /** - * The date of the newest log entry replayed. - * - * Generated from protobuf field .google.type.Date newest_date = 6; - * @return \Google\Type\Date|null - */ - public function getNewestDate() - { - return $this->newest_date; - } - - public function hasNewestDate() - { - return isset($this->newest_date); - } - - public function clearNewestDate() - { - unset($this->newest_date); - } - - /** - * The date of the newest log entry replayed. - * - * Generated from protobuf field .google.type.Date newest_date = 6; - * @param \Google\Type\Date $var - * @return $this - */ - public function setNewestDate($var) - { - GPBUtil::checkMessage($var, \Google\Type\Date::class); - $this->newest_date = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResultsSummary::class, \Google\Cloud\PolicySimulator\V1\Replay_ResultsSummary::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php deleted file mode 100644 index 0f54e3e57a2..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/Replay/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.policysimulator.v1.Replay.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The `Replay` has not started yet. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The `Replay` is currently running. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * The `Replay` has successfully completed. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * The `Replay` has finished with an error. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - ]; - - 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(State::class, \Google\Cloud\PolicySimulator\V1\Replay_State::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php deleted file mode 100644 index 585dca643c3..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.policysimulator.v1.ReplayConfig - */ -class ReplayConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A mapping of the resources that you want to simulate policies for and the - * policies that you want to simulate. - * Keys are the full resource names for the resources. For example, - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * Values are [Policy][google.iam.v1.Policy] objects representing the policies - * that you want to simulate. - * Replays automatically take into account any IAM policies inherited through - * the resource hierarchy, and any policies set on descendant resources. You - * do not need to include these policies in the policy overlay. - * - * Generated from protobuf field map policy_overlay = 1; - */ - private $policy_overlay; - /** - * The logs to use as input for the - * [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; - */ - protected $log_source = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $policy_overlay - * A mapping of the resources that you want to simulate policies for and the - * policies that you want to simulate. - * Keys are the full resource names for the resources. For example, - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * Values are [Policy][google.iam.v1.Policy] objects representing the policies - * that you want to simulate. - * Replays automatically take into account any IAM policies inherited through - * the resource hierarchy, and any policies set on descendant resources. You - * do not need to include these policies in the policy overlay. - * @type int $log_source - * The logs to use as input for the - * [Replay][google.cloud.policysimulator.v1.Replay]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * A mapping of the resources that you want to simulate policies for and the - * policies that you want to simulate. - * Keys are the full resource names for the resources. For example, - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * Values are [Policy][google.iam.v1.Policy] objects representing the policies - * that you want to simulate. - * Replays automatically take into account any IAM policies inherited through - * the resource hierarchy, and any policies set on descendant resources. You - * do not need to include these policies in the policy overlay. - * - * Generated from protobuf field map policy_overlay = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPolicyOverlay() - { - return $this->policy_overlay; - } - - /** - * A mapping of the resources that you want to simulate policies for and the - * policies that you want to simulate. - * Keys are the full resource names for the resources. For example, - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * Values are [Policy][google.iam.v1.Policy] objects representing the policies - * that you want to simulate. - * Replays automatically take into account any IAM policies inherited through - * the resource hierarchy, and any policies set on descendant resources. You - * do not need to include these policies in the policy overlay. - * - * Generated from protobuf field map policy_overlay = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPolicyOverlay($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\Policy::class); - $this->policy_overlay = $arr; - - return $this; - } - - /** - * The logs to use as input for the - * [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; - * @return int - */ - public function getLogSource() - { - return $this->log_source; - } - - /** - * The logs to use as input for the - * [Replay][google.cloud.policysimulator.v1.Replay]. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayConfig.LogSource log_source = 2; - * @param int $var - * @return $this - */ - public function setLogSource($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\ReplayConfig\LogSource::class); - $this->log_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php deleted file mode 100644 index c7ae9891172..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayConfig/LogSource.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.policysimulator.v1.ReplayConfig.LogSource - */ -class LogSource -{ - /** - * An unspecified log source. - * If the log source is unspecified, the - * [Replay][google.cloud.policysimulator.v1.Replay] defaults to using - * `RECENT_ACCESSES`. - * - * Generated from protobuf enum LOG_SOURCE_UNSPECIFIED = 0; - */ - const LOG_SOURCE_UNSPECIFIED = 0; - /** - * All access logs from the last 90 days. These logs may not include logs - * from the most recent 7 days. - * - * Generated from protobuf enum RECENT_ACCESSES = 1; - */ - const RECENT_ACCESSES = 1; - - private static $valueToName = [ - self::LOG_SOURCE_UNSPECIFIED => 'LOG_SOURCE_UNSPECIFIED', - self::RECENT_ACCESSES => 'RECENT_ACCESSES', - ]; - - 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(LogSource::class, \Google\Cloud\PolicySimulator\V1\ReplayConfig_LogSource::class); - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php deleted file mode 100644 index c8a1f84c59d..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayDiff.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.policysimulator.v1.ReplayDiff - */ -class ReplayDiff extends \Google\Protobuf\Internal\Message -{ - /** - * A summary and comparison of the principal's access under the current - * (baseline) policies and the proposed (simulated) policies for a single - * access tuple. - * The evaluation of the principal's access is reported in the - * [AccessState][google.cloud.policysimulator.v1.AccessState] field. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; - */ - protected $access_diff = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicySimulator\V1\AccessStateDiff $access_diff - * A summary and comparison of the principal's access under the current - * (baseline) policies and the proposed (simulated) policies for a single - * access tuple. - * The evaluation of the principal's access is reported in the - * [AccessState][google.cloud.policysimulator.v1.AccessState] field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * A summary and comparison of the principal's access under the current - * (baseline) policies and the proposed (simulated) policies for a single - * access tuple. - * The evaluation of the principal's access is reported in the - * [AccessState][google.cloud.policysimulator.v1.AccessState] field. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; - * @return \Google\Cloud\PolicySimulator\V1\AccessStateDiff|null - */ - public function getAccessDiff() - { - return $this->access_diff; - } - - public function hasAccessDiff() - { - return isset($this->access_diff); - } - - public function clearAccessDiff() - { - unset($this->access_diff); - } - - /** - * A summary and comparison of the principal's access under the current - * (baseline) policies and the proposed (simulated) policies for a single - * access tuple. - * The evaluation of the principal's access is reported in the - * [AccessState][google.cloud.policysimulator.v1.AccessState] field. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessStateDiff access_diff = 2; - * @param \Google\Cloud\PolicySimulator\V1\AccessStateDiff $var - * @return $this - */ - public function setAccessDiff($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\AccessStateDiff::class); - $this->access_diff = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php deleted file mode 100644 index f1f319951f5..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayOperationMetadata.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.policysimulator.v1.ReplayOperationMetadata - */ -class ReplayOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Time when the request was received. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php b/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php deleted file mode 100644 index ce63810c6cf..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/proto/src/Google/Cloud/PolicySimulator/V1/ReplayResult.php +++ /dev/null @@ -1,317 +0,0 @@ -google.cloud.policysimulator.v1.ReplayResult - */ -class ReplayResult extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `ReplayResult`, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple - * was included in. - * - * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The access tuple that was replayed. This field includes information about - * the principal, resource, and permission that were involved in the access - * attempt. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; - */ - protected $access_tuple = null; - /** - * The latest date this access tuple was seen in the logs. - * - * Generated from protobuf field .google.type.Date last_seen_date = 4; - */ - protected $last_seen_date = null; - protected $result; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicySimulator\V1\ReplayDiff $diff - * The difference between the principal's access under the current - * (baseline) policies and the principal's access under the proposed - * (simulated) policies. - * This field is only included for access tuples that were successfully - * replayed and had different results under the current policies and the - * proposed policies. - * @type \Google\Rpc\Status $error - * The error that caused the access tuple replay to fail. - * This field is only included for access tuples that were not replayed - * successfully. - * @type string $name - * The resource name of the `ReplayResult`, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` - * @type string $parent - * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple - * was included in. - * @type \Google\Cloud\PolicySimulator\V1\AccessTuple $access_tuple - * The access tuple that was replayed. This field includes information about - * the principal, resource, and permission that were involved in the access - * attempt. - * @type \Google\Type\Date $last_seen_date - * The latest date this access tuple was seen in the logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce(); - parent::__construct($data); - } - - /** - * The difference between the principal's access under the current - * (baseline) policies and the principal's access under the proposed - * (simulated) policies. - * This field is only included for access tuples that were successfully - * replayed and had different results under the current policies and the - * proposed policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayDiff diff = 5; - * @return \Google\Cloud\PolicySimulator\V1\ReplayDiff|null - */ - public function getDiff() - { - return $this->readOneof(5); - } - - public function hasDiff() - { - return $this->hasOneof(5); - } - - /** - * The difference between the principal's access under the current - * (baseline) policies and the principal's access under the proposed - * (simulated) policies. - * This field is only included for access tuples that were successfully - * replayed and had different results under the current policies and the - * proposed policies. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.ReplayDiff diff = 5; - * @param \Google\Cloud\PolicySimulator\V1\ReplayDiff $var - * @return $this - */ - public function setDiff($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ReplayDiff::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The error that caused the access tuple replay to fail. - * This field is only included for access tuples that were not replayed - * successfully. - * - * Generated from protobuf field .google.rpc.Status error = 6; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->readOneof(6); - } - - public function hasError() - { - return $this->hasOneof(6); - } - - /** - * The error that caused the access tuple replay to fail. - * This field is only included for access tuples that were not replayed - * successfully. - * - * Generated from protobuf field .google.rpc.Status error = 6; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The resource name of the `ReplayResult`, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the `ReplayResult`, in the following format: - * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, - * where `{resource-id}` is the ID of the project, folder, or organization - * that owns the [Replay][google.cloud.policysimulator.v1.Replay]. - * Example: - * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple - * was included in. - * - * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple - * was included in. - * - * Generated from protobuf field string parent = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The access tuple that was replayed. This field includes information about - * the principal, resource, and permission that were involved in the access - * attempt. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; - * @return \Google\Cloud\PolicySimulator\V1\AccessTuple|null - */ - public function getAccessTuple() - { - return $this->access_tuple; - } - - public function hasAccessTuple() - { - return isset($this->access_tuple); - } - - public function clearAccessTuple() - { - unset($this->access_tuple); - } - - /** - * The access tuple that was replayed. This field includes information about - * the principal, resource, and permission that were involved in the access - * attempt. - * - * Generated from protobuf field .google.cloud.policysimulator.v1.AccessTuple access_tuple = 3; - * @param \Google\Cloud\PolicySimulator\V1\AccessTuple $var - * @return $this - */ - public function setAccessTuple($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\AccessTuple::class); - $this->access_tuple = $var; - - return $this; - } - - /** - * The latest date this access tuple was seen in the logs. - * - * Generated from protobuf field .google.type.Date last_seen_date = 4; - * @return \Google\Type\Date|null - */ - public function getLastSeenDate() - { - return $this->last_seen_date; - } - - public function hasLastSeenDate() - { - return isset($this->last_seen_date); - } - - public function clearLastSeenDate() - { - unset($this->last_seen_date); - } - - /** - * The latest date this access tuple was seen in the logs. - * - * Generated from protobuf field .google.type.Date last_seen_date = 4; - * @param \Google\Type\Date $var - * @return $this - */ - public function setLastSeenDate($var) - { - GPBUtil::checkMessage($var, \Google\Type\Date::class); - $this->last_seen_date = $var; - - return $this; - } - - /** - * @return string - */ - public function getResult() - { - return $this->whichOneof("result"); - } - -} - diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php deleted file mode 100644 index 6dba7758282..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/create_replay.php +++ /dev/null @@ -1,92 +0,0 @@ -setConfig($replayConfig); - $request = (new CreateReplayRequest()) - ->setParent($parent) - ->setReplay($replay); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $simulatorClient->createReplay($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Replay $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - create_replay_sample($parent); -} -// [END policysimulator_v1_generated_Simulator_CreateReplay_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php deleted file mode 100644 index 0080ee90254..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/get_replay.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Replay $response */ - $response = $simulatorClient->getReplay($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SimulatorClient::replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - - get_replay_sample($formattedName); -} -// [END policysimulator_v1_generated_Simulator_GetReplay_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php b/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php deleted file mode 100644 index 5f4def94350..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/samples/V1/SimulatorClient/list_replay_results.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $simulatorClient->listReplayResults($request); - - /** @var ReplayResult $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SimulatorClient::replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - - list_replay_results_sample($formattedParent); -} -// [END policysimulator_v1_generated_Simulator_ListReplayResults_sync] diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php b/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php deleted file mode 100644 index 29c2f0b78e5..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/src/V1/Client/SimulatorClient.php +++ /dev/null @@ -1,428 +0,0 @@ - createReplayAsync(CreateReplayRequest $request, array $optionalArgs = []) - * @method PromiseInterface getReplayAsync(GetReplayRequest $request, array $optionalArgs = []) - * @method PromiseInterface listReplayResultsAsync(ListReplayResultsRequest $request, array $optionalArgs = []) - */ -final class SimulatorClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.policysimulator.v1.Simulator'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'policysimulator.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'policysimulator.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/simulator_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/simulator_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/simulator_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/simulator_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_replay resource. - * - * @param string $folder - * @param string $location - * @param string $replay - * - * @return string The formatted folder_location_replay resource. - */ - public static function folderLocationReplayName(string $folder, string $location, string $replay): string - { - return self::getPathTemplate('folderLocationReplay')->render([ - 'folder' => $folder, - 'location' => $location, - 'replay' => $replay, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_replay resource. - * - * @param string $organization - * @param string $location - * @param string $replay - * - * @return string The formatted organization_location_replay resource. - */ - public static function organizationLocationReplayName(string $organization, string $location, string $replay): string - { - return self::getPathTemplate('organizationLocationReplay')->render([ - 'organization' => $organization, - 'location' => $location, - 'replay' => $replay, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_replay resource. - * - * @param string $project - * @param string $location - * @param string $replay - * - * @return string The formatted project_location_replay resource. - */ - public static function projectLocationReplayName(string $project, string $location, string $replay): string - { - return self::getPathTemplate('projectLocationReplay')->render([ - 'project' => $project, - 'location' => $location, - 'replay' => $replay, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a replay - * resource. - * - * @param string $project - * @param string $location - * @param string $replay - * - * @return string The formatted replay resource. - */ - public static function replayName(string $project, string $location, string $replay): string - { - return self::getPathTemplate('replay')->render([ - 'project' => $project, - 'location' => $location, - 'replay' => $replay, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderLocationReplay: folders/{folder}/locations/{location}/replays/{replay} - * - organizationLocationReplay: organizations/{organization}/locations/{location}/replays/{replay} - * - projectLocationReplay: projects/{project}/locations/{location}/replays/{replay} - * - replay: projects/{project}/locations/{location}/replays/{replay} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'policysimulator.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using - * the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig]. - * - * The async variant is {@see SimulatorClient::createReplayAsync()} . - * - * @example samples/V1/SimulatorClient/create_replay.php - * - * @param CreateReplayRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createReplay(CreateReplayRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateReplay', $request, $callOptions)->wait(); - } - - /** - * Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each - * `Replay` is available for at least 7 days. - * - * The async variant is {@see SimulatorClient::getReplayAsync()} . - * - * @example samples/V1/SimulatorClient/get_replay.php - * - * @param GetReplayRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Replay - * - * @throws ApiException Thrown if the API call fails. - */ - public function getReplay(GetReplayRequest $request, array $callOptions = []): Replay - { - return $this->startApiCall('GetReplay', $request, $callOptions)->wait(); - } - - /** - * Lists the results of running a - * [Replay][google.cloud.policysimulator.v1.Replay]. - * - * The async variant is {@see SimulatorClient::listReplayResultsAsync()} . - * - * @example samples/V1/SimulatorClient/list_replay_results.php - * - * @param ListReplayResultsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listReplayResults(ListReplayResultsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListReplayResults', $request, $callOptions); - } -} diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 7916061cffd..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.policysimulator.v1", - "libraryPackage": "Google\\Cloud\\PolicySimulator\\V1", - "services": { - "Simulator": { - "clients": { - "grpc": { - "libraryClient": "SimulatorGapicClient", - "rpcs": { - "CreateReplay": { - "methods": [ - "createReplay" - ] - }, - "GetReplay": { - "methods": [ - "getReplay" - ] - }, - "ListReplayResults": { - "methods": [ - "listReplayResults" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json deleted file mode 100644 index 344f797062a..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_client_config.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "interfaces": { - "google.cloud.policysimulator.v1.Simulator": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateReplay": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetReplay": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListReplayResults": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php deleted file mode 100644 index 81964f7d8a9..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_descriptor_config.php +++ /dev/null @@ -1,85 +0,0 @@ - [ - 'google.cloud.policysimulator.v1.Simulator' => [ - 'CreateReplay' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\PolicySimulator\V1\Replay', - 'metadataReturnType' => '\Google\Cloud\PolicySimulator\V1\ReplayOperationMetadata', - 'initialPollDelayMillis' => '1000', - 'pollDelayMultiplier' => '2.0', - 'maxPollDelayMillis' => '10000', - 'totalPollTimeoutMillis' => '18000000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetReplay' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PolicySimulator\V1\Replay', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListReplayResults' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getReplayResults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PolicySimulator\V1\ListReplayResultsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'folderLocationReplay' => 'folders/{folder}/locations/{location}/replays/{replay}', - 'organizationLocationReplay' => 'organizations/{organization}/locations/{location}/replays/{replay}', - 'projectLocationReplay' => 'projects/{project}/locations/{location}/replays/{replay}', - 'replay' => 'projects/{project}/locations/{location}/replays/{replay}', - ], - ], - ], -]; diff --git a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php b/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php deleted file mode 100644 index 351a9fd85c3..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/src/V1/resources/simulator_rest_client_config.php +++ /dev/null @@ -1,147 +0,0 @@ - [ - 'google.cloud.policysimulator.v1.Simulator' => [ - 'CreateReplay' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/replays', - 'body' => 'replay', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/replays', - 'body' => 'replay', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/replays', - 'body' => 'replay', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetReplay' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListReplayResults' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/replays/*}/results', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/replays/*}/results', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/replays/*}/results', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=operations/**}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*/operations/**}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*/operations/**}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*/operations/**}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=operations}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/replays/*/operations}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/replays/*/operations}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/replays/*/operations}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php b/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php deleted file mode 100644 index 0efe061cf5a..00000000000 --- a/owl-bot-staging/PolicySimulator/v1/tests/Unit/V1/Client/SimulatorClientTest.php +++ /dev/null @@ -1,412 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SimulatorClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SimulatorClient($options); - } - - /** @test */ - public function createReplayTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createReplayTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Replay(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createReplayTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $replay = new Replay(); - $replayConfig = new ReplayConfig(); - $replay->setConfig($replayConfig); - $request = (new CreateReplayRequest()) - ->setParent($parent) - ->setReplay($replay); - $response = $gapicClient->createReplay($request); - $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.policysimulator.v1.Simulator/CreateReplay', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getReplay(); - $this->assertProtobufEquals($replay, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createReplayTest'); - $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 createReplayExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createReplayTest'); - $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 - $parent = 'parent-995424086'; - $replay = new Replay(); - $replayConfig = new ReplayConfig(); - $replay->setConfig($replayConfig); - $request = (new CreateReplayRequest()) - ->setParent($parent) - ->setReplay($replay); - $response = $gapicClient->createReplay($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createReplayTest'); - 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 getReplayTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Replay(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - $request = (new GetReplayRequest()) - ->setName($formattedName); - $response = $gapicClient->getReplay($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policysimulator.v1.Simulator/GetReplay', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReplayExceptionTest() - { - $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->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - $request = (new GetReplayRequest()) - ->setName($formattedName); - try { - $gapicClient->getReplay($request); - // 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 listReplayResultsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $replayResultsElement = new ReplayResult(); - $replayResults = [ - $replayResultsElement, - ]; - $expectedResponse = new ListReplayResultsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setReplayResults($replayResults); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - $request = (new ListReplayResultsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listReplayResults($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getReplayResults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policysimulator.v1.Simulator/ListReplayResults', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReplayResultsExceptionTest() - { - $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->replayName('[PROJECT]', '[LOCATION]', '[REPLAY]'); - $request = (new ListReplayResultsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listReplayResults($request); - // 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 createReplayAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createReplayTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Replay(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createReplayTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $replay = new Replay(); - $replayConfig = new ReplayConfig(); - $replay->setConfig($replayConfig); - $request = (new CreateReplayRequest()) - ->setParent($parent) - ->setReplay($replay); - $response = $gapicClient->createReplayAsync($request)->wait(); - $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.policysimulator.v1.Simulator/CreateReplay', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getReplay(); - $this->assertProtobufEquals($replay, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createReplayTest'); - $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()); - } -} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Checker.php deleted file mode 100644 index 7f0b079eb6100f908df246f5dc29f558b7f4c746..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1904 zcmbtVL2DC16gDXo8AV}HtfAtV2AYc9B^57Qt0ZX+In>4)D#${aOeV?TW@nt4ZLQLa ze?jm+=#LP*_NXWCp8N$Kot@dF(XNuxaa{A&a{nXCcK$ zO0c*S5;6zU>{f`&l~>IqWN%0LSCD(e8? z5J?H^77@GwP(NJ9qZmqslzx?{+@}#$6ovG)u5APMP$-G^J!{*GBdjQkVB)Y7VNza! z7BjIeai+Q0fTP@62|b#cpc(1PA`}LjL}Ed?Vxpx@eZNoCnAGG?c_j^-z|kHo+Z=uW zOp+T=iI_}Ahfoj|i)h{Cod6tmv%Fgvqj zJ)|U3(+At-IC!cf#eYfAv}5%FP06ozyJM~&X_c18>?B+*gHPwd+U)XlO4i3Ul6JEs z?H*JLizzbV)I+BPS&0{}O`KxG!XF2MV=s|HEbT$D4;I@K_oj)4_6qEhmobsbX@H9e zVM8xD>JF6R()YZ>!^1SQ(V>T8HLxRkRX0WTm>AaH=RsLJPE|zha!*&9ITp{vWPf_K)lfB($oKITgevl3jh5?rf;$(HDivR647nFZHArjzQ0##o$Jh-Wp#IXJXG%30X;F#lM767#w<6McCa3U HV*q{ulJS|) diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/V1/Explanations.php deleted file mode 100644 index 8a2887fdcf49263acb3e40891bfa8fb0e2d7aa5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2901 zcmbtW-EQMV6vj!mOHWX@%t9NoD>|DNHM;^=2^Xwf3d)b0THDxBl6EDqFpe{6M>w`M zb}GuM5)yC018~7Bz!UHQTyu$d3dVMvzow|Py-Gc2zVn@LzB6+^|I$16U>i4xLzo$m zKJH!O;GAHOxq)lBHtvlE1H!Q74n1lUCSqLIu&Q;jTvxi!_*UN?F^fp}%yrLfvS-=u zsK4jAHnlDT=8k$c@y}g1AZ+iVv`4=8Y|}9V>N>s{59W^bWB^X6W?Og3tZOXp^|h) zf{DE0m*Vqr+7ONoa53g6N!Lgo;DC+DY<7$p2}aD>k9dawSCe1*68S0~)ekAL`&Dvo zUQm}w(zL26$g-`9Iph+LrN8~Q?xja`ejYbuisbv`3py67((g~SIpqE-PO1rO+l9Z^ z;j=p$3+==k#mJH3GDnIRrF?!2Pt9Ry&^Ro%W`1M57Vw%v>$3QJ!GLVVvWV|@N1jd4 z2CRCFIu`XzJ11bFxLQsBRY{>OK!cHO8;ry~VuVi5rKSO!03KmO>igVox%6bA@Oug# zMV_V(>Br_r6<9H&q*02sa!I^RePT?s!`pzM{LO^WN3ast9`VSQ-%sGVFkB~b%;FT@ z>rtmqoil?AGU?@92B(YJ^2=n?e`+pPV}z)}_%cARV3iS@T$sGyau2u?YqteEA|pn9 z-sJ6Mf8nQ9KudBQ-dn-=T;G8VbM5g-qHp0*_@A+Gl56G0UBwXF9IrJo2KpL4SjfOF zm1vc@pH}D_$PUS{N0@(3J)cV-o}+SS>dh&Z>;&v`{$N+`Np=TTEtk75yqsWCHc+R|Gf8WEr`5y&XpJMy5 zidjg1M=s;bh5O;bg=vps17^#|cP?RxNK)#hQ21GZwFM7u!IQRjEE_Gk-BdaqMN^Fv zwbPPo%Aq3H*WW@Nj3pJfz6qP1u6yjaAt8S3A8+hOLEd` zY3(j2ntAaic_!l9mn&4M)#Ogc=yWSxd4Xyc9yZz)HQXtnN01FUB_C3V7n1O(X)2$* z_yJUo*VD5Lvnpj?Xn?NYjA$FSj^vZJ(&;KSqb(oHrxmrfNCjX;)!I#tFQB&}bEGtm z)>G9#g|Boy?vmu;aff?n?($jB^yuU@ogV|e-hTYhEPnnqwbO`(KCu=Ked8CWJ2yj$ zr=>rVFnv56jz^UFK%LJn|D^QY7*UcUNJ)xcvH4I*IxY29qG9yY-O2p%aXfp?jA}QI NX;EZ6OkKehz`xaKuTKB~ diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php deleted file mode 100644 index 38a94c21d6a..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessState.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.policytroubleshooter.v1.AccessState - */ -class AccessState -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum ACCESS_STATE_UNSPECIFIED = 0; - */ - const ACCESS_STATE_UNSPECIFIED = 0; - /** - * The principal has the permission. - * - * Generated from protobuf enum GRANTED = 1; - */ - const GRANTED = 1; - /** - * The principal does not have the permission. - * - * Generated from protobuf enum NOT_GRANTED = 2; - */ - const NOT_GRANTED = 2; - /** - * The principal has the permission only if a condition expression evaluates - * to `true`. - * - * Generated from protobuf enum UNKNOWN_CONDITIONAL = 3; - */ - const UNKNOWN_CONDITIONAL = 3; - /** - * The sender of the request does not have access to all of the policies that - * Policy Troubleshooter needs to evaluate. - * - * Generated from protobuf enum UNKNOWN_INFO_DENIED = 4; - */ - const UNKNOWN_INFO_DENIED = 4; - - private static $valueToName = [ - self::ACCESS_STATE_UNSPECIFIED => 'ACCESS_STATE_UNSPECIFIED', - self::GRANTED => 'GRANTED', - self::NOT_GRANTED => 'NOT_GRANTED', - self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', - self::UNKNOWN_INFO_DENIED => 'UNKNOWN_INFO_DENIED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php deleted file mode 100644 index 6a94ba29e53..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/AccessTuple.php +++ /dev/null @@ -1,187 +0,0 @@ -google.cloud.policytroubleshooter.v1.AccessTuple - */ -class AccessTuple extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $principal = ''; - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $full_resource_name = ''; - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $permission = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $principal - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * @type string $full_resource_name - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type string $permission - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * Required. The principal whose access you want to check, in the form of - * the email address that represents that principal. For example, - * `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPermission() - { - return $this->permission; - } - - /** - * Required. The IAM permission to check for the specified principal and - * resource. - * For a complete list of IAM permissions, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPermission($var) - { - GPBUtil::checkString($var, True); - $this->permission = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php deleted file mode 100644 index 0ed308060ee..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation.php +++ /dev/null @@ -1,398 +0,0 @@ -google.cloud.policytroubleshooter.v1.BindingExplanation - */ -class BindingExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $access = 0; - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - */ - protected $role = ''; - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; - */ - protected $role_permission = 0; - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; - */ - protected $role_permission_relevance = 0; - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - */ - private $memberships; - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; - */ - protected $relevance = 0; - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - */ - protected $condition = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * @type string $role - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * @type int $role_permission - * Indicates whether the role granted by this binding contains the specified - * permission. - * @type int $role_permission_relevance - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * @type array|\Google\Protobuf\Internal\MapField $memberships - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * @type int $relevance - * The relevance of this binding to the overall determination for the entire - * policy. - * @type \Google\Type\Expr $condition - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAccess() - { - return $this->access; - } - - /** - * Required. Indicates whether _this binding_ provides the specified - * permission to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another binding that overrides - * this binding. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAccess($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); - $this->access = $var; - - return $this; - } - - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @return string - */ - public function getRole() - { - return $this->role; - } - - /** - * The role that this binding grants. For example, - * `roles/compute.serviceAgent`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @param string $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkString($var, True); - $this->role = $var; - - return $this; - } - - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; - * @return int - */ - public function getRolePermission() - { - return $this->role_permission; - } - - /** - * Indicates whether the role granted by this binding contains the specified - * permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission role_permission = 3; - * @param int $var - * @return $this - */ - public function setRolePermission($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\RolePermission::class); - $this->role_permission = $var; - - return $this; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; - * @return int - */ - public function getRolePermissionRelevance() - { - return $this->role_permission_relevance; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance role_permission_relevance = 4; - * @param int $var - * @return $this - */ - public function setRolePermissionRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); - $this->role_permission_relevance = $var; - - return $this; - } - - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMemberships() - { - return $this->memberships; - } - - /** - * Indicates whether each principal in the binding includes the principal - * specified in the request, either directly or indirectly. Each key - * identifies a principal in the binding, and each value indicates whether the - * principal in the binding includes the principal in the request. - * For example, suppose that a binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * principal of the group `group:product-eng@example.com`. - * For the first principal in the binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `MEMBERSHIP_NOT_INCLUDED`. - * For the second principal in the binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `MEMBERSHIP_INCLUDED`. - * - * Generated from protobuf field map memberships = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMemberships($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\AnnotatedMembership::class); - $this->memberships = $arr; - - return $this; - } - - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this binding to the overall determination for the entire - * policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 6; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - * @return \Google\Type\Expr|null - */ - public function getCondition() - { - return $this->condition; - } - - public function hasCondition() - { - return isset($this->condition); - } - - public function clearCondition() - { - unset($this->condition); - } - - /** - * A condition expression that prevents this binding from granting access - * unless the expression evaluates to `true`. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 7; - * @param \Google\Type\Expr $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkMessage($var, \Google\Type\Expr::class); - $this->condition = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php deleted file mode 100644 index fa404ca0589..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/AnnotatedMembership.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership - */ -class AnnotatedMembership extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; - */ - protected $membership = 0; - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $membership - * Indicates whether the binding includes the principal. - * @type int $relevance - * The relevance of the principal's status to the overall determination for - * the binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; - * @return int - */ - public function getMembership() - { - return $this->membership; - } - - /** - * Indicates whether the binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.BindingExplanation.Membership membership = 1; - * @param int $var - * @return $this - */ - public function setMembership($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation\Membership::class); - $this->membership = $var; - - return $this; - } - - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the principal's status to the overall determination for - * the binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 2; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnnotatedMembership::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_AnnotatedMembership::class); - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php deleted file mode 100644 index ce26c1c2722..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/Membership.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.policytroubleshooter.v1.BindingExplanation.Membership - */ -class Membership -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum MEMBERSHIP_UNSPECIFIED = 0; - */ - const MEMBERSHIP_UNSPECIFIED = 0; - /** - * The binding includes the principal. The principal can be included - * directly or indirectly. For example: - * * A principal is included directly if that principal is listed in the - * binding. - * * A principal is included indirectly if that principal is in a Google - * group or Google Workspace domain that is listed in the binding. - * - * Generated from protobuf enum MEMBERSHIP_INCLUDED = 1; - */ - const MEMBERSHIP_INCLUDED = 1; - /** - * The binding does not include the principal. - * - * Generated from protobuf enum MEMBERSHIP_NOT_INCLUDED = 2; - */ - const MEMBERSHIP_NOT_INCLUDED = 2; - /** - * The sender of the request is not allowed to access the binding. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; - */ - const MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; - /** - * The principal is an unsupported type. Only Google Accounts and service - * accounts are supported. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - */ - const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - - private static $valueToName = [ - self::MEMBERSHIP_UNSPECIFIED => 'MEMBERSHIP_UNSPECIFIED', - self::MEMBERSHIP_INCLUDED => 'MEMBERSHIP_INCLUDED', - self::MEMBERSHIP_NOT_INCLUDED => 'MEMBERSHIP_NOT_INCLUDED', - self::MEMBERSHIP_UNKNOWN_INFO_DENIED => 'MEMBERSHIP_UNKNOWN_INFO_DENIED', - self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', - ]; - - 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(Membership::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_Membership::class); - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php deleted file mode 100644 index 12606d1e011..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/BindingExplanation/RolePermission.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission - */ -class RolePermission -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum ROLE_PERMISSION_UNSPECIFIED = 0; - */ - const ROLE_PERMISSION_UNSPECIFIED = 0; - /** - * The permission is included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; - */ - const ROLE_PERMISSION_INCLUDED = 1; - /** - * The permission is not included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; - */ - const ROLE_PERMISSION_NOT_INCLUDED = 2; - /** - * The sender of the request is not allowed to access the binding. - * - * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; - */ - const ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; - - private static $valueToName = [ - self::ROLE_PERMISSION_UNSPECIFIED => 'ROLE_PERMISSION_UNSPECIFIED', - self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', - self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', - self::ROLE_PERMISSION_UNKNOWN_INFO_DENIED => 'ROLE_PERMISSION_UNKNOWN_INFO_DENIED', - ]; - - 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(RolePermission::class, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation_RolePermission::class); - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php deleted file mode 100644 index 825e85a27a2..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/ExplainedPolicy.php +++ /dev/null @@ -1,290 +0,0 @@ -google.cloud.policytroubleshooter.v1.ExplainedPolicy - */ -class ExplainedPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - */ - protected $access = 0; - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - */ - protected $full_resource_name = ''; - /** - * The IAM policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - */ - protected $policy = null; - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; - */ - private $binding_explanations; - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * @type string $full_resource_name - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type \Google\Cloud\Iam\V1\Policy $policy - * The IAM policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * @type array<\Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * @type int $relevance - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Explanations::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - * @return int - */ - public function getAccess() - { - return $this->access; - } - - /** - * Indicates whether _this policy_ provides the specified permission to the - * specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `access` field in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - * @param int $var - * @return $this - */ - public function setAccess($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); - $this->access = $var; - - return $this; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * The IAM policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - * @return \Google\Cloud\Iam\V1\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * The IAM policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 3; - * @param \Google\Cloud\Iam\V1\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); - $this->policy = $var; - - return $this; - } - - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBindingExplanations() - { - return $this->binding_explanations; - } - - /** - * Details about how each binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.BindingExplanation binding_explanations = 4; - * @param array<\Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBindingExplanations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\BindingExplanation::class); - $this->binding_explanations = $arr; - - return $this; - } - - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this policy to the overall determination in the - * [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.HeuristicRelevance relevance = 5; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php deleted file mode 100644 index f41f00cfa6b..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/HeuristicRelevance.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.policytroubleshooter.v1.HeuristicRelevance - */ -class HeuristicRelevance -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - */ - const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - /** - * The data point has a limited effect on the result. Changing the data point - * is unlikely to affect the overall determination. - * - * Generated from protobuf enum NORMAL = 1; - */ - const NORMAL = 1; - /** - * The data point has a strong effect on the result. Changing the data point - * is likely to affect the overall determination. - * - * Generated from protobuf enum HIGH = 2; - */ - const HIGH = 2; - - private static $valueToName = [ - self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', - self::NORMAL => 'NORMAL', - self::HIGH => 'HIGH', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php deleted file mode 100644 index c850ac29fac..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest - */ -class TroubleshootIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; - */ - protected $access_tuple = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple $access_tuple - * The information to use for checking whether a principal has a permission - * for a resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Checker::initOnce(); - parent::__construct($data); - } - - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; - * @return \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple|null - */ - public function getAccessTuple() - { - return $this->access_tuple; - } - - public function hasAccessTuple() - { - return isset($this->access_tuple); - } - - public function clearAccessTuple() - { - unset($this->access_tuple); - } - - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessTuple access_tuple = 1; - * @param \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple $var - * @return $this - */ - public function setAccessTuple($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessTuple::class); - $this->access_tuple = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php b/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php deleted file mode 100644 index a183021d594..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/proto/src/Google/Cloud/PolicyTroubleshooter/V1/TroubleshootIamPolicyResponse.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse - */ -class TroubleshootIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all of the applicable IAM policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - */ - protected $access = 0; - /** - * List of IAM policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies can include the policy for the resource itself. It can - * also include policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; - */ - private $explained_policies; - /** - * The general errors contained in the troubleshooting response. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $access - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all of the applicable IAM policies. - * @type array<\Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies - * List of IAM policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies can include the policy for the resource itself. It can - * also include policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors - * The general errors contained in the troubleshooting response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\V1\Checker::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all of the applicable IAM policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - * @return int - */ - public function getAccess() - { - return $this->access; - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all of the applicable IAM policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.v1.AccessState access = 1; - * @param int $var - * @return $this - */ - public function setAccess($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\V1\AccessState::class); - $this->access = $var; - - return $this; - } - - /** - * List of IAM policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies can include the policy for the resource itself. It can - * also include policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExplainedPolicies() - { - return $this->explained_policies; - } - - /** - * List of IAM policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies can include the policy for the resource itself. It can - * also include policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.v1.ExplainedPolicy explained_policies = 2; - * @param array<\Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExplainedPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\V1\ExplainedPolicy::class); - $this->explained_policies = $arr; - - return $this; - } - - /** - * The general errors contained in the troubleshooting response. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * The general errors contained in the troubleshooting response. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php b/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php deleted file mode 100644 index 250637b13d0..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/samples/V1/IamCheckerClient/troubleshoot_iam_policy.php +++ /dev/null @@ -1,59 +0,0 @@ -troubleshootIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php deleted file mode 100644 index 3facc74ba68..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/Client/IamCheckerClient.php +++ /dev/null @@ -1,197 +0,0 @@ - troubleshootIamPolicyAsync(TroubleshootIamPolicyRequest $request, array $optionalArgs = []) - */ -final class IamCheckerClient -{ - use GapicClientTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.policytroubleshooter.v1.IamChecker'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'policytroubleshooter.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'policytroubleshooter.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/iam_checker_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/iam_checker_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/iam_checker_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/iam_checker_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'policytroubleshooter.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Checks whether a principal has a specific permission for a specific - * resource, and explains why the principal does or does not have that - * permission. - * - * The async variant is {@see IamCheckerClient::troubleshootIamPolicyAsync()} . - * - * @example samples/V1/IamCheckerClient/troubleshoot_iam_policy.php - * - * @param TroubleshootIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TroubleshootIamPolicyResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function troubleshootIamPolicy(TroubleshootIamPolicyRequest $request, array $callOptions = []): TroubleshootIamPolicyResponse - { - return $this->startApiCall('TroubleshootIamPolicy', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json deleted file mode 100644 index edff7df0b55..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.policytroubleshooter.v1", - "libraryPackage": "Google\\Cloud\\PolicyTroubleshooter\\V1", - "services": { - "IamChecker": { - "clients": { - "grpc": { - "libraryClient": "IamCheckerGapicClient", - "rpcs": { - "TroubleshootIamPolicy": { - "methods": [ - "troubleshootIamPolicy" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json deleted file mode 100644 index ab57e45de76..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_client_config.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "interfaces": { - "google.cloud.policytroubleshooter.v1.IamChecker": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "UNKNOWN" - ], - "no_retry_1_codes": [] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "TroubleshootIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php deleted file mode 100644 index b1fe76c28bb..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_descriptor_config.php +++ /dev/null @@ -1,32 +0,0 @@ - [ - 'google.cloud.policytroubleshooter.v1.IamChecker' => [ - 'TroubleshootIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PolicyTroubleshooter\V1\TroubleshootIamPolicyResponse', - ], - ], - ], -]; diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php b/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php deleted file mode 100644 index 35b80f85afd..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/src/V1/resources/iam_checker_rest_client_config.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.policytroubleshooter.v1.IamChecker' => [ - 'TroubleshootIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/iam:troubleshoot', - 'body' => '*', - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php b/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php deleted file mode 100644 index 3b5a17a698b..00000000000 --- a/owl-bot-staging/PolicyTroubleshooter/v1/tests/Unit/V1/Client/IamCheckerClientTest.php +++ /dev/null @@ -1,138 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return IamCheckerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new IamCheckerClient($options); - } - - /** @test */ - public function troubleshootIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TroubleshootIamPolicyResponse(); - $transport->addResponse($expectedResponse); - $request = new TroubleshootIamPolicyRequest(); - $response = $gapicClient->troubleshootIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policytroubleshooter.v1.IamChecker/TroubleshootIamPolicy', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function troubleshootIamPolicyExceptionTest() - { - $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); - $request = new TroubleshootIamPolicyRequest(); - try { - $gapicClient->troubleshootIamPolicy($request); - // 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 troubleshootIamPolicyAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TroubleshootIamPolicyResponse(); - $transport->addResponse($expectedResponse); - $request = new TroubleshootIamPolicyRequest(); - $response = $gapicClient->troubleshootIamPolicyAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policytroubleshooter.v1.IamChecker/TroubleshootIamPolicy', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/GPBMetadata/Google/Cloud/Policytroubleshooter/Iam/V3/Troubleshooter.php deleted file mode 100644 index 4bae7bc3f6cf162413e3ec5fd29cb0d35bb47860..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10091 zcmdTK&u<%9nQ@XP`I2puNt(Fcb~|;uY#LfyO|$~sZFe2VNvut5%XU&)jE2ehB^lM3 znVlIY4X6U`i3?m-uw1xsgBu5g7H*4#U^yTG7sQ1F2gF~%k?*}XzwC??8#mI@OPzV& z`+om=?|bjOYaWzAIUtg08IGYEO=-8aw?`~VH4aU!NvxD4t(K%> zsV3!D3$;uDah?Ulq!}QT|y8Ua4 zQ3BAFLt>kXN~HDj$`)~yhTSK>G+>>blU z4Ly=PHp^6LsIYoLM|pLnSzjf#YH6lpSY-swWcG>UtD1gUxa*Ro=(Ig)f%BNjoMQ5k z>PYZ_@b zR>*;Jq#0K4TbV^4xYq7-+fv`#e4ABKziJ;6`WtH+dak1!n!WQ{G1Yn%?a=DO3bhlH z)blUQE}CS%c>l5HdS15C@EvUp19!o94eBUw!B5xV(LfO^F7WLs7VxR4fKOq-r;e5r z^DZI9)G$3zKjJ~3xEWg5qs}7ly58afBwPTNIUcxKC2DP{eeJrtkL4B&$h6Ij+dE@r59Yb5LOy7rZ;0>1q@t?Cwq>Vf zHc4ENgoTNvw^JP5`6^6h+3p(Mocz@=+~`8hHZib?_yT5)Bh2T`rtFfXQgE`Dm!9=b z_DnLV5~sm=qwY*j2^t$fP;nRHD1vb;bLWy#;Y~$n*(*N85Wm;EC|Qb$TLpv2!y|qZ z<{Lymi6Sw~NW9xSiB&{&ibC>x0*Dcsx&u;aCtt~KZpztQE?=$6)mpZem$!@6az0mB zE96(Fz93!($YqNz#FQXT!)y3AmS68vOq_zr?c)2z(vzZGD6W;JhQxW8@xJ6rMJ&^W zQZc(ZHJtpL023ik66avtv@~7SOr^HA@LbZtA^gd(rf54{&L6*CqBZ|oatT7IS&Q? zpcp96Lh?@|Fx9ytZo`--gBx?X|D8^%;;KWe!9)YYT62AoJ9!_D(#dD4Oo$~`VbtRJ z!u9Tzfq3ParvaAPWf=37a|K3iVjXEJ z&o|@ZBn$`sL;s@LlRHg9f?*~*Kuj~a3sMNvupH)ZLy7lb)XSo8!=y!2!X&|r?OHV9 zN#dpRlwXjUXC!_pz+{+Z>h`D!`ABKDTppPe;w_ldKr9X0Zx#(>jGg39VldYwYwdu@Gh;-0 z?<0~J_Hg=s1|mzcnob%#C2GV*Lr{--?CJU3f}dgumf{GpFP323B299nU>D7lcX{cZ z-cfFlmZf3HsTB`L@?SBSjimJTi_s3XN=!_2&yAuCv%4DRH+?@`t8A2(Dlpr-v`lX+ z996hlwds)h*MK?{--JuNxVmZhs>dU1-5#WPIZOU^4CcG>bfMbDTwod4FtHFs{a&Ge z$w7&69cj&D`+VQ5AcC@Ay9&D6Y|$dd+ZP$Gbr8TB==toc(DyOS;7J;t1mo+F9PSd! zKETAsYhWLZSr=oZ-1D6qd0RdOaUUiEdUpI0^T9^bT*&}?Ig-+-$=R5H%gC?u>20P6J@TU{Cx&fT@6(Yp)3yqQ#1yNXA7CMtD`^EzJcwWG40%A^AxR zu0}S^*kMhxwmhP~ebqDm`LRxMhs#^N4l{%{|1AEz&d@7xeKc^)H7F8F!S8(93`P$q z0~$=kwjoG$GAcw<@H&k(7Gud@qw=EpczO}aJHPrpjcgux?R(U_(b{C<^`||lyn;NO z{4@qLQG_l~bwR1+!PQ=Bm)ue-ehsFr7S=ct98$doq7Nl9zeF@lMt)3r^-BDi2s2TH zE>MXtA>r3g8V|Hh^@};{5+;_O_U>yD+y^Bz=n}lVESeymqUu?vHW*oC1*HjSy6O45 z0^IN=CNETCvcq#oXc`U|D)bRtjUsGg*FxLcCxgkI_hdRH`gh=(FS)06|F(i2ohFv* z^}&eyC7n7#*+cG|TW5)sIhnU+$48me)xik6*7mXT-swXDuKOZ~bnbzWNmhdqaDK`6_I zZvQ9Sq3ha>-W47YC@T(~KzVd7sGBLLq2HlkT0&* z&;~j2BLS`j5%W1>?1uvD+-b$?h~u{N#PfD-U2NiF8v8LG)B=rtu6RrS4lk^tPM3HK z;~u;CTxiaVc>hLohh9~RNw`ET%dotTL-gQqPL-k|-m>uoH;q?p%@&)I@I2z3Z;BrH z`3I*cE>n3QFH0wh7jUKHllU5pVCurVTPnzih`vDd25ZYk0wMY6=6oUfMRkObi+{v} zEW3~hAMTQvi#9h)PtF>rya9;_nDt7wSi^CPfEtd%LB}l~OiWyaFGk>q8n_IJx8dd) zuxwm2y!cxIuF&Ke7UmY*Sj`uoo+Zn5h@S?*FLZDuh!R{sy-EdfA!6cPc=I$wv>2$C z?x3y|zrfz*%)7NTe5q2}%**9`WvfuF;!FzXRk_V=_A6@kg#t!ySoH+#T&3bMloTRH zRnQ6HiN^npa8=V@#?f$F`K^_FrMgilpUuh~h@GH}g#^rnzPFLaONaT;TD!(*fJ7|f%yPS2 zE>&m{4KE&pc>1=UhQdaEyHcpu3OTuw-^}l1i@DBmC#o(As936O;Q&(*(IukRHwx<; zQ?aGrV1DHn2I09iPS*Z_)hhhSpU;bZTpULta7R;#KE`QX@bJ-n^5%zs`R7NmYsp#q zQVK8OGfwD1Q$|=!Jozkpn_t<7SMXsLe@lRGEbJ7XA^x0A9XO6@XVU583zd}ozc!Qdk=>E zazV}AhbXSO`yWC0d2C^wz57b#=({iXW~7~33T>F$S^mret-Ei;-1k52z;*UY44;Yp zJ9dv_&SV(sOeV@-G8sgk$?PoeUSbt^`7QtP%su`JEA(g!>m5#|A|7lpNdBgoogle.cloud.policytroubleshooter.iam.v3.AccessTuple - */ -class AccessTuple extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The email address of the principal whose access you want to - * check. For example, `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $principal = ''; - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $full_resource_name = ''; - /** - * Required. The IAM permission to check for, either in the `v1` permission - * format or the `v2` permission format. - * For a complete list of IAM permissions in the `v1` format, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a list of IAM permissions in the `v2` format, see - * https://cloud.google.com/iam/help/deny/supported-permissions. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $permission = ''; - /** - * Output only. The permission that Policy Troubleshooter checked for, in - * the `v2` format. - * - * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $permission_fqdn = ''; - /** - * Optional. Additional context for the request, such as the request time or - * IP address. This context allows Policy Troubleshooter to troubleshoot - * conditional role bindings and deny rules. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $condition_context = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $principal - * Required. The email address of the principal whose access you want to - * check. For example, `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * @type string $full_resource_name - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type string $permission - * Required. The IAM permission to check for, either in the `v1` permission - * format or the `v2` permission format. - * For a complete list of IAM permissions in the `v1` format, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a list of IAM permissions in the `v2` format, see - * https://cloud.google.com/iam/help/deny/supported-permissions. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * @type string $permission_fqdn - * Output only. The permission that Policy Troubleshooter checked for, in - * the `v2` format. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $condition_context - * Optional. Additional context for the request, such as the request time or - * IP address. This context allows Policy Troubleshooter to troubleshoot - * conditional role bindings and deny rules. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. The email address of the principal whose access you want to - * check. For example, `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * Required. The email address of the principal whose access you want to - * check. For example, `alice@example.com` or - * `my-service-account@my-project.iam.gserviceaccount.com`. - * The principal must be a Google Account or a service account. Other types of - * principals are not supported. - * - * Generated from protobuf field string principal = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * Required. The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * Required. The IAM permission to check for, either in the `v1` permission - * format or the `v2` permission format. - * For a complete list of IAM permissions in the `v1` format, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a list of IAM permissions in the `v2` format, see - * https://cloud.google.com/iam/help/deny/supported-permissions. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPermission() - { - return $this->permission; - } - - /** - * Required. The IAM permission to check for, either in the `v1` permission - * format or the `v2` permission format. - * For a complete list of IAM permissions in the `v1` format, see - * https://cloud.google.com/iam/help/permissions/reference. - * For a list of IAM permissions in the `v2` format, see - * https://cloud.google.com/iam/help/deny/supported-permissions. - * For a complete list of predefined IAM roles and the permissions in each - * role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string permission = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPermission($var) - { - GPBUtil::checkString($var, True); - $this->permission = $var; - - return $this; - } - - /** - * Output only. The permission that Policy Troubleshooter checked for, in - * the `v2` format. - * - * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPermissionFqdn() - { - return $this->permission_fqdn; - } - - /** - * Output only. The permission that Policy Troubleshooter checked for, in - * the `v2` format. - * - * Generated from protobuf field string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPermissionFqdn($var) - { - GPBUtil::checkString($var, True); - $this->permission_fqdn = $var; - - return $this; - } - - /** - * Optional. Additional context for the request, such as the request time or - * IP address. This context allows Policy Troubleshooter to troubleshoot - * conditional role bindings and deny rules. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext|null - */ - public function getConditionContext() - { - return $this->condition_context; - } - - public function hasConditionContext() - { - return isset($this->condition_context); - } - - public function clearConditionContext() - { - unset($this->condition_context); - } - - /** - * Optional. Additional context for the request, such as the request time or - * IP address. This context allows Policy Troubleshooter to troubleshoot - * conditional role bindings and deny rules. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $var - * @return $this - */ - public function setConditionContext($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext::class); - $this->condition_context = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php deleted file mode 100644 index 1ecec32c116..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowAccessState.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.AllowAccessState - */ -class AllowAccessState -{ - /** - * Not specified. - * - * Generated from protobuf enum ALLOW_ACCESS_STATE_UNSPECIFIED = 0; - */ - const ALLOW_ACCESS_STATE_UNSPECIFIED = 0; - /** - * The allow policy gives the principal the permission. - * - * Generated from protobuf enum ALLOW_ACCESS_STATE_GRANTED = 1; - */ - const ALLOW_ACCESS_STATE_GRANTED = 1; - /** - * The allow policy doesn't give the principal the permission. - * - * Generated from protobuf enum ALLOW_ACCESS_STATE_NOT_GRANTED = 2; - */ - const ALLOW_ACCESS_STATE_NOT_GRANTED = 2; - /** - * The allow policy gives the principal the permission if a condition - * expression evaluate to `true`. However, the sender of the request didn't - * provide enough context for Policy Troubleshooter to evaluate the condition - * expression. - * - * Generated from protobuf enum ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; - */ - const ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; - /** - * The sender of the request doesn't have access to all of the allow policies - * that Policy Troubleshooter needs to evaluate the principal's access. - * - * Generated from protobuf enum ALLOW_ACCESS_STATE_UNKNOWN_INFO = 4; - */ - const ALLOW_ACCESS_STATE_UNKNOWN_INFO = 4; - - private static $valueToName = [ - self::ALLOW_ACCESS_STATE_UNSPECIFIED => 'ALLOW_ACCESS_STATE_UNSPECIFIED', - self::ALLOW_ACCESS_STATE_GRANTED => 'ALLOW_ACCESS_STATE_GRANTED', - self::ALLOW_ACCESS_STATE_NOT_GRANTED => 'ALLOW_ACCESS_STATE_NOT_GRANTED', - self::ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL => 'ALLOW_ACCESS_STATE_UNKNOWN_CONDITIONAL', - self::ALLOW_ACCESS_STATE_UNKNOWN_INFO => 'ALLOW_ACCESS_STATE_UNKNOWN_INFO', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php deleted file mode 100644 index f3101897bd5..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation.php +++ /dev/null @@ -1,486 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation - */ -class AllowBindingExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this role binding_ gives the specified - * permission to the specified principal on the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission on the resource. There might be another role binding that - * overrides this role binding. To determine whether the principal actually - * has the permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $allow_access_state = 0; - /** - * The role that this role binding grants. For example, - * `roles/compute.admin`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - */ - protected $role = ''; - /** - * Indicates whether the role granted by this role binding contains the - * specified permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; - */ - protected $role_permission = 0; - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; - */ - protected $role_permission_relevance = 0; - /** - * The combined result of all memberships. Indicates if the principal is - * included in any role binding, either directly or indirectly. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; - */ - protected $combined_membership = null; - /** - * Indicates whether each role binding includes the principal specified in the - * request, either directly or indirectly. Each key identifies a principal in - * the role binding, and each value indicates whether the principal in the - * role binding includes the principal in the request. - * For example, suppose that a role binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * member of the group `group:product-eng@example.com`. - * For the first principal in the role binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `NOT_INCLUDED`. - * For the second principal in the role binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `INCLUDED`. - * - * Generated from protobuf field map memberships = 6; - */ - private $memberships; - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; - */ - protected $relevance = 0; - /** - * A condition expression that specifies when the role binding grants access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 8; - */ - protected $condition = null; - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; - */ - protected $condition_explanation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $allow_access_state - * Required. Indicates whether _this role binding_ gives the specified - * permission to the specified principal on the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission on the resource. There might be another role binding that - * overrides this role binding. To determine whether the principal actually - * has the permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * @type string $role - * The role that this role binding grants. For example, - * `roles/compute.admin`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * @type int $role_permission - * Indicates whether the role granted by this role binding contains the - * specified permission. - * @type int $role_permission_relevance - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership $combined_membership - * The combined result of all memberships. Indicates if the principal is - * included in any role binding, either directly or indirectly. - * @type array|\Google\Protobuf\Internal\MapField $memberships - * Indicates whether each role binding includes the principal specified in the - * request, either directly or indirectly. Each key identifies a principal in - * the role binding, and each value indicates whether the principal in the - * role binding includes the principal in the request. - * For example, suppose that a role binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * member of the group `group:product-eng@example.com`. - * For the first principal in the role binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `NOT_INCLUDED`. - * For the second principal in the role binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `INCLUDED`. - * @type int $relevance - * The relevance of this role binding to the overall determination for the - * entire policy. - * @type \Google\Type\Expr $condition - * A condition expression that specifies when the role binding grants access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $condition_explanation - * Condition evaluation state for this role binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this role binding_ gives the specified - * permission to the specified principal on the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission on the resource. There might be another role binding that - * overrides this role binding. To determine whether the principal actually - * has the permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAllowAccessState() - { - return $this->allow_access_state; - } - - /** - * Required. Indicates whether _this role binding_ gives the specified - * permission to the specified principal on the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission on the resource. There might be another role binding that - * overrides this role binding. To determine whether the principal actually - * has the permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAllowAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); - $this->allow_access_state = $var; - - return $this; - } - - /** - * The role that this role binding grants. For example, - * `roles/compute.admin`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @return string - */ - public function getRole() - { - return $this->role; - } - - /** - * The role that this role binding grants. For example, - * `roles/compute.admin`. - * For a complete list of predefined IAM roles, as well as the permissions in - * each role, see https://cloud.google.com/iam/help/roles/reference. - * - * Generated from protobuf field string role = 2; - * @param string $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkString($var, True); - $this->role = $var; - - return $this; - } - - /** - * Indicates whether the role granted by this role binding contains the - * specified permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; - * @return int - */ - public function getRolePermission() - { - return $this->role_permission; - } - - /** - * Indicates whether the role granted by this role binding contains the - * specified permission. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState role_permission = 3; - * @param int $var - * @return $this - */ - public function setRolePermission($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\RolePermissionInclusionState::class); - $this->role_permission = $var; - - return $this; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; - * @return int - */ - public function getRolePermissionRelevance() - { - return $this->role_permission_relevance; - } - - /** - * The relevance of the permission's existence, or nonexistence, in the role - * to the overall determination for the entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance role_permission_relevance = 4; - * @param int $var - * @return $this - */ - public function setRolePermissionRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->role_permission_relevance = $var; - - return $this; - } - - /** - * The combined result of all memberships. Indicates if the principal is - * included in any role binding, either directly or indirectly. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership|null - */ - public function getCombinedMembership() - { - return $this->combined_membership; - } - - public function hasCombinedMembership() - { - return isset($this->combined_membership); - } - - public function clearCombinedMembership() - { - unset($this->combined_membership); - } - - /** - * The combined result of all memberships. Indicates if the principal is - * included in any role binding, either directly or indirectly. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership combined_membership = 5; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership $var - * @return $this - */ - public function setCombinedMembership($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership::class); - $this->combined_membership = $var; - - return $this; - } - - /** - * Indicates whether each role binding includes the principal specified in the - * request, either directly or indirectly. Each key identifies a principal in - * the role binding, and each value indicates whether the principal in the - * role binding includes the principal in the request. - * For example, suppose that a role binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * member of the group `group:product-eng@example.com`. - * For the first principal in the role binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `NOT_INCLUDED`. - * For the second principal in the role binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `INCLUDED`. - * - * Generated from protobuf field map memberships = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMemberships() - { - return $this->memberships; - } - - /** - * Indicates whether each role binding includes the principal specified in the - * request, either directly or indirectly. Each key identifies a principal in - * the role binding, and each value indicates whether the principal in the - * role binding includes the principal in the request. - * For example, suppose that a role binding includes the following principals: - * * `user:alice@example.com` - * * `group:product-eng@example.com` - * You want to troubleshoot access for `user:bob@example.com`. This user is a - * member of the group `group:product-eng@example.com`. - * For the first principal in the role binding, the key is - * `user:alice@example.com`, and the `membership` field in the value is set to - * `NOT_INCLUDED`. - * For the second principal in the role binding, the key is - * `group:product-eng@example.com`, and the `membership` field in the value is - * set to `INCLUDED`. - * - * Generated from protobuf field map memberships = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMemberships($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation\AnnotatedAllowMembership::class); - $this->memberships = $arr; - - return $this; - } - - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 7; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * A condition expression that specifies when the role binding grants access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 8; - * @return \Google\Type\Expr|null - */ - public function getCondition() - { - return $this->condition; - } - - public function hasCondition() - { - return isset($this->condition); - } - - public function clearCondition() - { - unset($this->condition); - } - - /** - * A condition expression that specifies when the role binding grants access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 8; - * @param \Google\Type\Expr $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkMessage($var, \Google\Type\Expr::class); - $this->condition = $var; - - return $this; - } - - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation|null - */ - public function getConditionExplanation() - { - return $this->condition_explanation; - } - - public function hasConditionExplanation() - { - return isset($this->condition_explanation); - } - - public function clearConditionExplanation() - { - unset($this->condition_explanation); - } - - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 9; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $var - * @return $this - */ - public function setConditionExplanation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation::class); - $this->condition_explanation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php deleted file mode 100644 index 9257e5bd13a..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowBindingExplanation/AnnotatedAllowMembership.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation.AnnotatedAllowMembership - */ -class AnnotatedAllowMembership extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the role binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - */ - protected $membership = 0; - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $membership - * Indicates whether the role binding includes the principal. - * @type int $relevance - * The relevance of the principal's status to the overall determination for - * the role binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the role binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - * @return int - */ - public function getMembership() - { - return $this->membership; - } - - /** - * Indicates whether the role binding includes the principal. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - * @param int $var - * @return $this - */ - public function setMembership($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\MembershipMatchingState::class); - $this->membership = $var; - - return $this; - } - - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnnotatedAllowMembership::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation_AnnotatedAllowMembership::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php deleted file mode 100644 index 0071db315e9..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/AllowPolicyExplanation.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation - */ -class AllowPolicyExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all applicable IAM allow policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; - */ - protected $allow_access_state = 0; - /** - * List of IAM allow policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies includes the policy for the resource itself, as well - * as allow policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; - */ - private $explained_policies; - /** - * The relevance of the allow policy type to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $allow_access_state - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all applicable IAM allow policies. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies - * List of IAM allow policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies includes the policy for the resource itself, as well - * as allow policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * @type int $relevance - * The relevance of the allow policy type to the overall access state. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all applicable IAM allow policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; - * @return int - */ - public function getAllowAccessState() - { - return $this->allow_access_state; - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all applicable IAM allow policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1; - * @param int $var - * @return $this - */ - public function setAllowAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); - $this->allow_access_state = $var; - - return $this; - } - - /** - * List of IAM allow policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies includes the policy for the resource itself, as well - * as allow policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExplainedPolicies() - { - return $this->explained_policies; - } - - /** - * List of IAM allow policies that were evaluated to check the principal's - * permissions, with annotations to indicate how each policy contributed to - * the final result. - * The list of policies includes the policy for the resource itself, as well - * as allow policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy explained_policies = 2; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExplainedPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedAllowPolicy::class); - $this->explained_policies = $arr; - - return $this; - } - - /** - * The relevance of the allow policy type to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the allow policy type to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php deleted file mode 100644 index 0f7a4da01cd..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext.php +++ /dev/null @@ -1,220 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionContext - */ -class ConditionContext extends \Google\Protobuf\Internal\Message -{ - /** - * Represents a target resource that is involved with a network activity. - * If multiple resources are involved with an activity, this must be the - * primary one. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; - */ - protected $resource = null; - /** - * The destination of a network activity, such as accepting a TCP connection. - * In a multi-hop network activity, the destination represents the receiver of - * the last hop. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; - */ - protected $destination = null; - /** - * Represents a network request, such as an HTTP request. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; - */ - protected $request = null; - /** - * Output only. The effective tags on the resource. The effective tags are - * fetched during troubleshooting. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $effective_tags; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource $resource - * Represents a target resource that is involved with a network activity. - * If multiple resources are involved with an activity, this must be the - * primary one. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer $destination - * The destination of a network activity, such as accepting a TCP connection. - * In a multi-hop network activity, the destination represents the receiver of - * the last hop. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request $request - * Represents a network request, such as an HTTP request. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags - * Output only. The effective tags on the resource. The effective tags are - * fetched during troubleshooting. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Represents a target resource that is involved with a network activity. - * If multiple resources are involved with an activity, this must be the - * primary one. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource|null - */ - public function getResource() - { - return $this->resource; - } - - public function hasResource() - { - return isset($this->resource); - } - - public function clearResource() - { - unset($this->resource); - } - - /** - * Represents a target resource that is involved with a network activity. - * If multiple resources are involved with an activity, this must be the - * primary one. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource resource = 1; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Resource::class); - $this->resource = $var; - - return $this; - } - - /** - * The destination of a network activity, such as accepting a TCP connection. - * In a multi-hop network activity, the destination represents the receiver of - * the last hop. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer|null - */ - public function getDestination() - { - return $this->destination; - } - - public function hasDestination() - { - return isset($this->destination); - } - - public function clearDestination() - { - unset($this->destination); - } - - /** - * The destination of a network activity, such as accepting a TCP connection. - * In a multi-hop network activity, the destination represents the receiver of - * the last hop. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer destination = 2; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer $var - * @return $this - */ - public function setDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Peer::class); - $this->destination = $var; - - return $this; - } - - /** - * Represents a network request, such as an HTTP request. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request|null - */ - public function getRequest() - { - return $this->request; - } - - public function hasRequest() - { - return isset($this->request); - } - - public function clearRequest() - { - unset($this->request); - } - - /** - * Represents a network request, such as an HTTP request. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request request = 3; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request $var - * @return $this - */ - public function setRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\Request::class); - $this->request = $var; - - return $this; - } - - /** - * Output only. The effective tags on the resource. The effective tags are - * fetched during troubleshooting. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEffectiveTags() - { - return $this->effective_tags; - } - - /** - * Output only. The effective tags on the resource. The effective tags are - * fetched during troubleshooting. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag effective_tags = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEffectiveTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext\EffectiveTag::class); - $this->effective_tags = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php deleted file mode 100644 index 95c87757bff..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/EffectiveTag.php +++ /dev/null @@ -1,292 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionContext.EffectiveTag - */ -class EffectiveTag extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $tag_value = ''; - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $namespaced_tag_value = ''; - /** - * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such - * as `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $tag_key = ''; - /** - * Output only. The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $namespaced_tag_key = ''; - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - */ - protected $tag_key_parent_name = ''; - /** - * Output only. Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $inherited = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $tag_value - * Output only. Resource name for TagValue in the format `tagValues/456`. - * @type string $namespaced_tag_value - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * @type string $tag_key - * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such - * as `tagKeys/123`. - * @type string $namespaced_tag_key - * Output only. The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * @type string $tag_key_parent_name - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * @type bool $inherited - * Output only. Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTagValue() - { - return $this->tag_value; - } - - /** - * Output only. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkString($var, True); - $this->tag_value = $var; - - return $this; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getNamespacedTagValue() - { - return $this->namespaced_tag_value; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setNamespacedTagValue($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_value = $var; - - return $this; - } - - /** - * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such - * as `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTagKey() - { - return $this->tag_key; - } - - /** - * Output only. The name of the TagKey, in the format `tagKeys/{id}`, such - * as `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkString($var, True); - $this->tag_key = $var; - - return $this; - } - - /** - * Output only. The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getNamespacedTagKey() - { - return $this->namespaced_tag_key; - } - - /** - * Output only. The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setNamespacedTagKey($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_key = $var; - - return $this; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @return string - */ - public function getTagKeyParentName() - { - return $this->tag_key_parent_name; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @param string $var - * @return $this - */ - public function setTagKeyParentName($var) - { - GPBUtil::checkString($var, True); - $this->tag_key_parent_name = $var; - - return $this; - } - - /** - * Output only. Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getInherited() - { - return $this->inherited; - } - - /** - * Output only. Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setInherited($var) - { - GPBUtil::checkBool($var); - $this->inherited = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EffectiveTag::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_EffectiveTag::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php deleted file mode 100644 index 82626fa22e6..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Peer.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionContext.Peer - */ -class Peer extends \Google\Protobuf\Internal\Message -{ - /** - * The IPv4 or IPv6 address of the peer. - * - * Generated from protobuf field string ip = 1; - */ - protected $ip = ''; - /** - * The network port of the peer. - * - * Generated from protobuf field int64 port = 2; - */ - protected $port = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $ip - * The IPv4 or IPv6 address of the peer. - * @type int|string $port - * The network port of the peer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * The IPv4 or IPv6 address of the peer. - * - * Generated from protobuf field string ip = 1; - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * The IPv4 or IPv6 address of the peer. - * - * Generated from protobuf field string ip = 1; - * @param string $var - * @return $this - */ - public function setIp($var) - { - GPBUtil::checkString($var, True); - $this->ip = $var; - - return $this; - } - - /** - * The network port of the peer. - * - * Generated from protobuf field int64 port = 2; - * @return int|string - */ - public function getPort() - { - return $this->port; - } - - /** - * The network port of the peer. - * - * Generated from protobuf field int64 port = 2; - * @param int|string $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt64($var); - $this->port = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Peer::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Peer::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php deleted file mode 100644 index 5d019fa1ffa..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Request.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionContext.Request - */ -class Request extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The timestamp when the destination service receives the first - * byte of the request. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $receive_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $receive_time - * Optional. The timestamp when the destination service receives the first - * byte of the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The timestamp when the destination service receives the first - * byte of the request. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReceiveTime() - { - return $this->receive_time; - } - - public function hasReceiveTime() - { - return isset($this->receive_time); - } - - public function clearReceiveTime() - { - unset($this->receive_time); - } - - /** - * Optional. The timestamp when the destination service receives the first - * byte of the request. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReceiveTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->receive_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Request::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Request::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php deleted file mode 100644 index e2632d6849f..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionContext/Resource.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionContext.Resource - */ -class Resource extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the service that this resource belongs to, such as - * `compute.googleapis.com`. The service name might not match the DNS - * hostname that actually serves the request. - * For a full list of resource service values, see - * https://cloud.google.com/iam/help/conditions/resource-services - * - * Generated from protobuf field string service = 1; - */ - protected $service = ''; - /** - * The stable identifier (name) of a resource on the `service`. A resource - * can be logically identified as `//{resource.service}/{resource.name}`. - * Unlike the resource URI, the resource name doesn't contain any protocol - * and version information. - * For a list of full resource name formats, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The type of the resource, in the format `{service}/{kind}`. - * For a full list of resource type values, see - * https://cloud.google.com/iam/help/conditions/resource-types - * - * Generated from protobuf field string type = 3; - */ - protected $type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * The name of the service that this resource belongs to, such as - * `compute.googleapis.com`. The service name might not match the DNS - * hostname that actually serves the request. - * For a full list of resource service values, see - * https://cloud.google.com/iam/help/conditions/resource-services - * @type string $name - * The stable identifier (name) of a resource on the `service`. A resource - * can be logically identified as `//{resource.service}/{resource.name}`. - * Unlike the resource URI, the resource name doesn't contain any protocol - * and version information. - * For a list of full resource name formats, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names - * @type string $type - * The type of the resource, in the format `{service}/{kind}`. - * For a full list of resource type values, see - * https://cloud.google.com/iam/help/conditions/resource-types - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * The name of the service that this resource belongs to, such as - * `compute.googleapis.com`. The service name might not match the DNS - * hostname that actually serves the request. - * For a full list of resource service values, see - * https://cloud.google.com/iam/help/conditions/resource-services - * - * Generated from protobuf field string service = 1; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * The name of the service that this resource belongs to, such as - * `compute.googleapis.com`. The service name might not match the DNS - * hostname that actually serves the request. - * For a full list of resource service values, see - * https://cloud.google.com/iam/help/conditions/resource-services - * - * Generated from protobuf field string service = 1; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * The stable identifier (name) of a resource on the `service`. A resource - * can be logically identified as `//{resource.service}/{resource.name}`. - * Unlike the resource URI, the resource name doesn't contain any protocol - * and version information. - * For a list of full resource name formats, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The stable identifier (name) of a resource on the `service`. A resource - * can be logically identified as `//{resource.service}/{resource.name}`. - * Unlike the resource URI, the resource name doesn't contain any protocol - * and version information. - * For a list of full resource name formats, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the resource, in the format `{service}/{kind}`. - * For a full list of resource type values, see - * https://cloud.google.com/iam/help/conditions/resource-types - * - * Generated from protobuf field string type = 3; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The type of the resource, in the format `{service}/{kind}`. - * For a full list of resource type values, see - * https://cloud.google.com/iam/help/conditions/resource-types - * - * Generated from protobuf field string type = 3; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Resource::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext_Resource::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php deleted file mode 100644 index 2d0da74c81e..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionExplanation - */ -class ConditionExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Value of the condition. - * - * Generated from protobuf field .google.protobuf.Value value = 1; - */ - protected $value = null; - /** - * Any errors that prevented complete evaluation of the condition expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - */ - private $errors; - /** - * The value of each statement of the condition expression. The value can be - * `true`, `false`, or `null`. The value is `null` if the statement can't be - * evaluated. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; - */ - private $evaluation_states; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Value $value - * Value of the condition. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors - * Any errors that prevented complete evaluation of the condition expression. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $evaluation_states - * The value of each statement of the condition expression. The value can be - * `true`, `false`, or `null`. The value is `null` if the statement can't be - * evaluated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Value of the condition. - * - * Generated from protobuf field .google.protobuf.Value value = 1; - * @return \Google\Protobuf\Value|null - */ - public function getValue() - { - return $this->value; - } - - public function hasValue() - { - return isset($this->value); - } - - public function clearValue() - { - unset($this->value); - } - - /** - * Value of the condition. - * - * Generated from protobuf field .google.protobuf.Value value = 1; - * @param \Google\Protobuf\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); - $this->value = $var; - - return $this; - } - - /** - * Any errors that prevented complete evaluation of the condition expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Any errors that prevented complete evaluation of the condition expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 3; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->errors = $arr; - - return $this; - } - - /** - * The value of each statement of the condition expression. The value can be - * `true`, `false`, or `null`. The value is `null` if the statement can't be - * evaluated. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEvaluationStates() - { - return $this->evaluation_states; - } - - /** - * The value of each statement of the condition expression. The value can be - * `true`, `false`, or `null`. The value is `null` if the statement can't be - * evaluated. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEvaluationStates($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState::class); - $this->evaluation_states = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php deleted file mode 100644 index c6942a296a5..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ConditionExplanation/EvaluationState.php +++ /dev/null @@ -1,194 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState - */ -class EvaluationState extends \Google\Protobuf\Internal\Message -{ - /** - * Start position of an expression in the condition, by character. - * - * Generated from protobuf field int32 start = 1; - */ - protected $start = 0; - /** - * End position of an expression in the condition, by character, - * end included, for example: the end position of the first part of - * `a==b || c==d` would be 4. - * - * Generated from protobuf field int32 end = 2; - */ - protected $end = 0; - /** - * Value of this expression. - * - * Generated from protobuf field .google.protobuf.Value value = 3; - */ - protected $value = null; - /** - * Any errors that prevented complete evaluation of the condition - * expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 4; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $start - * Start position of an expression in the condition, by character. - * @type int $end - * End position of an expression in the condition, by character, - * end included, for example: the end position of the first part of - * `a==b || c==d` would be 4. - * @type \Google\Protobuf\Value $value - * Value of this expression. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors - * Any errors that prevented complete evaluation of the condition - * expression. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Start position of an expression in the condition, by character. - * - * Generated from protobuf field int32 start = 1; - * @return int - */ - public function getStart() - { - return $this->start; - } - - /** - * Start position of an expression in the condition, by character. - * - * Generated from protobuf field int32 start = 1; - * @param int $var - * @return $this - */ - public function setStart($var) - { - GPBUtil::checkInt32($var); - $this->start = $var; - - return $this; - } - - /** - * End position of an expression in the condition, by character, - * end included, for example: the end position of the first part of - * `a==b || c==d` would be 4. - * - * Generated from protobuf field int32 end = 2; - * @return int - */ - public function getEnd() - { - return $this->end; - } - - /** - * End position of an expression in the condition, by character, - * end included, for example: the end position of the first part of - * `a==b || c==d` would be 4. - * - * Generated from protobuf field int32 end = 2; - * @param int $var - * @return $this - */ - public function setEnd($var) - { - GPBUtil::checkInt32($var); - $this->end = $var; - - return $this; - } - - /** - * Value of this expression. - * - * Generated from protobuf field .google.protobuf.Value value = 3; - * @return \Google\Protobuf\Value|null - */ - public function getValue() - { - return $this->value; - } - - public function hasValue() - { - return isset($this->value); - } - - public function clearValue() - { - unset($this->value); - } - - /** - * Value of this expression. - * - * Generated from protobuf field .google.protobuf.Value value = 3; - * @param \Google\Protobuf\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); - $this->value = $var; - - return $this; - } - - /** - * Any errors that prevented complete evaluation of the condition - * expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Any errors that prevented complete evaluation of the condition - * expression. - * - * Generated from protobuf field repeated .google.rpc.Status errors = 4; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->errors = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EvaluationState::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation_EvaluationState::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php deleted file mode 100644 index be6bbbf58e4..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyAccessState.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.DenyAccessState - */ -class DenyAccessState -{ - /** - * Not specified. - * - * Generated from protobuf enum DENY_ACCESS_STATE_UNSPECIFIED = 0; - */ - const DENY_ACCESS_STATE_UNSPECIFIED = 0; - /** - * The deny policy denies the principal the permission. - * - * Generated from protobuf enum DENY_ACCESS_STATE_DENIED = 1; - */ - const DENY_ACCESS_STATE_DENIED = 1; - /** - * The deny policy doesn't deny the principal the permission. - * - * Generated from protobuf enum DENY_ACCESS_STATE_NOT_DENIED = 2; - */ - const DENY_ACCESS_STATE_NOT_DENIED = 2; - /** - * The deny policy denies the principal the permission if a condition - * expression evaluates to `true`. However, the sender of the request didn't - * provide enough context for Policy Troubleshooter to evaluate the condition - * expression. - * - * Generated from protobuf enum DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; - */ - const DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL = 3; - /** - * The sender of the request does not have access to all of the deny policies - * that Policy Troubleshooter needs to evaluate the principal's access. - * - * Generated from protobuf enum DENY_ACCESS_STATE_UNKNOWN_INFO = 4; - */ - const DENY_ACCESS_STATE_UNKNOWN_INFO = 4; - - private static $valueToName = [ - self::DENY_ACCESS_STATE_UNSPECIFIED => 'DENY_ACCESS_STATE_UNSPECIFIED', - self::DENY_ACCESS_STATE_DENIED => 'DENY_ACCESS_STATE_DENIED', - self::DENY_ACCESS_STATE_NOT_DENIED => 'DENY_ACCESS_STATE_NOT_DENIED', - self::DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL => 'DENY_ACCESS_STATE_UNKNOWN_CONDITIONAL', - self::DENY_ACCESS_STATE_UNKNOWN_INFO => 'DENY_ACCESS_STATE_UNKNOWN_INFO', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php deleted file mode 100644 index 038fa209141..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyPolicyExplanation.php +++ /dev/null @@ -1,218 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation - */ -class DenyPolicyExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the principal is denied the specified permission for - * the specified resource, based on evaluating all applicable IAM deny - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; - */ - protected $deny_access_state = 0; - /** - * List of resources with IAM deny policies that were evaluated to check the - * principal's denied permissions, with annotations to indicate how each - * policy contributed to the final result. - * The list of resources includes the policy for the resource itself, as well - * as policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. The - * order of the resources starts from the resource and climbs up the resource - * hierarchy. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; - */ - private $explained_resources; - /** - * The relevance of the deny policy result to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - */ - protected $relevance = 0; - /** - * Indicates whether the permission to troubleshoot is supported in deny - * policies. - * - * Generated from protobuf field bool permission_deniable = 4; - */ - protected $permission_deniable = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $deny_access_state - * Indicates whether the principal is denied the specified permission for - * the specified resource, based on evaluating all applicable IAM deny - * policies. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource>|\Google\Protobuf\Internal\RepeatedField $explained_resources - * List of resources with IAM deny policies that were evaluated to check the - * principal's denied permissions, with annotations to indicate how each - * policy contributed to the final result. - * The list of resources includes the policy for the resource itself, as well - * as policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. The - * order of the resources starts from the resource and climbs up the resource - * hierarchy. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * @type int $relevance - * The relevance of the deny policy result to the overall access state. - * @type bool $permission_deniable - * Indicates whether the permission to troubleshoot is supported in deny - * policies. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the principal is denied the specified permission for - * the specified resource, based on evaluating all applicable IAM deny - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; - * @return int - */ - public function getDenyAccessState() - { - return $this->deny_access_state; - } - - /** - * Indicates whether the principal is denied the specified permission for - * the specified resource, based on evaluating all applicable IAM deny - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1; - * @param int $var - * @return $this - */ - public function setDenyAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); - $this->deny_access_state = $var; - - return $this; - } - - /** - * List of resources with IAM deny policies that were evaluated to check the - * principal's denied permissions, with annotations to indicate how each - * policy contributed to the final result. - * The list of resources includes the policy for the resource itself, as well - * as policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. The - * order of the resources starts from the resource and climbs up the resource - * hierarchy. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExplainedResources() - { - return $this->explained_resources; - } - - /** - * List of resources with IAM deny policies that were evaluated to check the - * principal's denied permissions, with annotations to indicate how each - * policy contributed to the final result. - * The list of resources includes the policy for the resource itself, as well - * as policies that are inherited from higher levels of the resource - * hierarchy, including the organization, the folder, and the project. The - * order of the resources starts from the resource and climbs up the resource - * hierarchy. - * To learn more about the resource hierarchy, see - * https://cloud.google.com/iam/help/resource-hierarchy. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource explained_resources = 2; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExplainedResources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyResource::class); - $this->explained_resources = $arr; - - return $this; - } - - /** - * The relevance of the deny policy result to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the deny policy result to the overall access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 3; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * Indicates whether the permission to troubleshoot is supported in deny - * policies. - * - * Generated from protobuf field bool permission_deniable = 4; - * @return bool - */ - public function getPermissionDeniable() - { - return $this->permission_deniable; - } - - /** - * Indicates whether the permission to troubleshoot is supported in deny - * policies. - * - * Generated from protobuf field bool permission_deniable = 4; - * @param bool $var - * @return $this - */ - public function setPermissionDeniable($var) - { - GPBUtil::checkBool($var); - $this->permission_deniable = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php deleted file mode 100644 index f196aa83e8d..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation.php +++ /dev/null @@ -1,630 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation - */ -class DenyRuleExplanation extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this rule_ denies the specified permission to - * the specified principal for the specified resource. - * This field does _not_ indicate whether the principal is actually denied on - * the permission for the resource. There might be another rule that overrides - * this rule. To determine whether the principal actually has the permission, - * use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $deny_access_state = 0; - /** - * Indicates whether the permission in the request is listed as a denied - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; - */ - protected $combined_denied_permission = null; - /** - * Lists all denied permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a denied permission in the rule, and each value - * indicates whether the denied permission matches the permission in the - * request. - * - * Generated from protobuf field map denied_permissions = 3; - */ - private $denied_permissions; - /** - * Indicates whether the permission in the request is listed as an exception - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; - */ - protected $combined_exception_permission = null; - /** - * Lists all exception permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a exception permission in the rule, and each value - * indicates whether the exception permission matches the permission in the - * request. - * - * Generated from protobuf field map exception_permissions = 5; - */ - private $exception_permissions; - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; - */ - protected $combined_denied_principal = null; - /** - * Lists all denied principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a denied principal in the rule, and each value - * indicates whether the denied principal matches the principal in the - * request. - * - * Generated from protobuf field map denied_principals = 7; - */ - private $denied_principals; - /** - * Indicates whether the principal is listed as an exception principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; - */ - protected $combined_exception_principal = null; - /** - * Lists all exception principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a exception principal in the rule, and each value - * indicates whether the exception principal matches the principal in the - * request. - * - * Generated from protobuf field map exception_principals = 9; - */ - private $exception_principals; - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; - */ - protected $relevance = 0; - /** - * A condition expression that specifies when the deny rule denies the - * principal access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 11; - */ - protected $condition = null; - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; - */ - protected $condition_explanation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $deny_access_state - * Required. Indicates whether _this rule_ denies the specified permission to - * the specified principal for the specified resource. - * This field does _not_ indicate whether the principal is actually denied on - * the permission for the resource. There might be another rule that overrides - * this rule. To determine whether the principal actually has the permission, - * use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $combined_denied_permission - * Indicates whether the permission in the request is listed as a denied - * permission in the deny rule. - * @type array|\Google\Protobuf\Internal\MapField $denied_permissions - * Lists all denied permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a denied permission in the rule, and each value - * indicates whether the denied permission matches the permission in the - * request. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $combined_exception_permission - * Indicates whether the permission in the request is listed as an exception - * permission in the deny rule. - * @type array|\Google\Protobuf\Internal\MapField $exception_permissions - * Lists all exception permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a exception permission in the rule, and each value - * indicates whether the exception permission matches the permission in the - * request. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $combined_denied_principal - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * @type array|\Google\Protobuf\Internal\MapField $denied_principals - * Lists all denied principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a denied principal in the rule, and each value - * indicates whether the denied principal matches the principal in the - * request. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $combined_exception_principal - * Indicates whether the principal is listed as an exception principal in the - * deny rule, either directly or through membership in a principal set. - * @type array|\Google\Protobuf\Internal\MapField $exception_principals - * Lists all exception principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a exception principal in the rule, and each value - * indicates whether the exception principal matches the principal in the - * request. - * @type int $relevance - * The relevance of this role binding to the overall determination for the - * entire policy. - * @type \Google\Type\Expr $condition - * A condition expression that specifies when the deny rule denies the - * principal access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $condition_explanation - * Condition evaluation state for this role binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this rule_ denies the specified permission to - * the specified principal for the specified resource. - * This field does _not_ indicate whether the principal is actually denied on - * the permission for the resource. There might be another rule that overrides - * this rule. To determine whether the principal actually has the permission, - * use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDenyAccessState() - { - return $this->deny_access_state; - } - - /** - * Required. Indicates whether _this rule_ denies the specified permission to - * the specified principal for the specified resource. - * This field does _not_ indicate whether the principal is actually denied on - * the permission for the resource. There might be another rule that overrides - * this rule. To determine whether the principal actually has the permission, - * use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDenyAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); - $this->deny_access_state = $var; - - return $this; - } - - /** - * Indicates whether the permission in the request is listed as a denied - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching|null - */ - public function getCombinedDeniedPermission() - { - return $this->combined_denied_permission; - } - - public function hasCombinedDeniedPermission() - { - return isset($this->combined_denied_permission); - } - - public function clearCombinedDeniedPermission() - { - unset($this->combined_denied_permission); - } - - /** - * Indicates whether the permission in the request is listed as a denied - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_denied_permission = 2; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $var - * @return $this - */ - public function setCombinedDeniedPermission($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); - $this->combined_denied_permission = $var; - - return $this; - } - - /** - * Lists all denied permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a denied permission in the rule, and each value - * indicates whether the denied permission matches the permission in the - * request. - * - * Generated from protobuf field map denied_permissions = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDeniedPermissions() - { - return $this->denied_permissions; - } - - /** - * Lists all denied permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a denied permission in the rule, and each value - * indicates whether the denied permission matches the permission in the - * request. - * - * Generated from protobuf field map denied_permissions = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDeniedPermissions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); - $this->denied_permissions = $arr; - - return $this; - } - - /** - * Indicates whether the permission in the request is listed as an exception - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching|null - */ - public function getCombinedExceptionPermission() - { - return $this->combined_exception_permission; - } - - public function hasCombinedExceptionPermission() - { - return isset($this->combined_exception_permission); - } - - public function clearCombinedExceptionPermission() - { - unset($this->combined_exception_permission); - } - - /** - * Indicates whether the permission in the request is listed as an exception - * permission in the deny rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching combined_exception_permission = 4; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching $var - * @return $this - */ - public function setCombinedExceptionPermission($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); - $this->combined_exception_permission = $var; - - return $this; - } - - /** - * Lists all exception permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a exception permission in the rule, and each value - * indicates whether the exception permission matches the permission in the - * request. - * - * Generated from protobuf field map exception_permissions = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getExceptionPermissions() - { - return $this->exception_permissions; - } - - /** - * Lists all exception permissions in the deny rule and indicates whether each - * permission matches the permission in the request. - * Each key identifies a exception permission in the rule, and each value - * indicates whether the exception permission matches the permission in the - * request. - * - * Generated from protobuf field map exception_permissions = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setExceptionPermissions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedPermissionMatching::class); - $this->exception_permissions = $arr; - - return $this; - } - - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching|null - */ - public function getCombinedDeniedPrincipal() - { - return $this->combined_denied_principal; - } - - public function hasCombinedDeniedPrincipal() - { - return isset($this->combined_denied_principal); - } - - public function clearCombinedDeniedPrincipal() - { - unset($this->combined_denied_principal); - } - - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_denied_principal = 6; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $var - * @return $this - */ - public function setCombinedDeniedPrincipal($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); - $this->combined_denied_principal = $var; - - return $this; - } - - /** - * Lists all denied principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a denied principal in the rule, and each value - * indicates whether the denied principal matches the principal in the - * request. - * - * Generated from protobuf field map denied_principals = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDeniedPrincipals() - { - return $this->denied_principals; - } - - /** - * Lists all denied principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a denied principal in the rule, and each value - * indicates whether the denied principal matches the principal in the - * request. - * - * Generated from protobuf field map denied_principals = 7; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDeniedPrincipals($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); - $this->denied_principals = $arr; - - return $this; - } - - /** - * Indicates whether the principal is listed as an exception principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching|null - */ - public function getCombinedExceptionPrincipal() - { - return $this->combined_exception_principal; - } - - public function hasCombinedExceptionPrincipal() - { - return isset($this->combined_exception_principal); - } - - public function clearCombinedExceptionPrincipal() - { - unset($this->combined_exception_principal); - } - - /** - * Indicates whether the principal is listed as an exception principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching combined_exception_principal = 8; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching $var - * @return $this - */ - public function setCombinedExceptionPrincipal($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); - $this->combined_exception_principal = $var; - - return $this; - } - - /** - * Lists all exception principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a exception principal in the rule, and each value - * indicates whether the exception principal matches the principal in the - * request. - * - * Generated from protobuf field map exception_principals = 9; - * @return \Google\Protobuf\Internal\MapField - */ - public function getExceptionPrincipals() - { - return $this->exception_principals; - } - - /** - * Lists all exception principals in the deny rule and indicates whether each - * principal matches the principal in the request, either directly or through - * membership in a principal set. - * Each key identifies a exception principal in the rule, and each value - * indicates whether the exception principal matches the principal in the - * request. - * - * Generated from protobuf field map exception_principals = 9; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setExceptionPrincipals($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation\AnnotatedDenyPrincipalMatching::class); - $this->exception_principals = $arr; - - return $this; - } - - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this role binding to the overall determination for the - * entire policy. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 10; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * A condition expression that specifies when the deny rule denies the - * principal access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 11; - * @return \Google\Type\Expr|null - */ - public function getCondition() - { - return $this->condition; - } - - public function hasCondition() - { - return isset($this->condition); - } - - public function clearCondition() - { - unset($this->condition); - } - - /** - * A condition expression that specifies when the deny rule denies the - * principal access. - * To learn about IAM Conditions, see - * https://cloud.google.com/iam/help/conditions/overview. - * - * Generated from protobuf field .google.type.Expr condition = 11; - * @param \Google\Type\Expr $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkMessage($var, \Google\Type\Expr::class); - $this->condition = $var; - - return $this; - } - - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation|null - */ - public function getConditionExplanation() - { - return $this->condition_explanation; - } - - public function hasConditionExplanation() - { - return isset($this->condition_explanation); - } - - public function clearConditionExplanation() - { - unset($this->condition_explanation); - } - - /** - * Condition evaluation state for this role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation condition_explanation = 12; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation $var - * @return $this - */ - public function setConditionExplanation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation::class); - $this->condition_explanation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php deleted file mode 100644 index 4e2dc255f07..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedDenyPrincipalMatching.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedDenyPrincipalMatching - */ -class AnnotatedDenyPrincipalMatching extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - */ - protected $membership = 0; - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $membership - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * @type int $relevance - * The relevance of the principal's status to the overall determination for - * the role binding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - * @return int - */ - public function getMembership() - { - return $this->membership; - } - - /** - * Indicates whether the principal is listed as a denied principal in the - * deny rule, either directly or through membership in a principal set. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState membership = 1; - * @param int $var - * @return $this - */ - public function setMembership($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\MembershipMatchingState::class); - $this->membership = $var; - - return $this; - } - - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the principal's status to the overall determination for - * the role binding. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnnotatedDenyPrincipalMatching::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation_AnnotatedDenyPrincipalMatching::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php deleted file mode 100644 index 3c4a4e7e512..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/DenyRuleExplanation/AnnotatedPermissionMatching.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation.AnnotatedPermissionMatching - */ -class AnnotatedPermissionMatching extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the permission in the request is denied by the deny - * rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; - */ - protected $permission_matching_state = 0; - /** - * The relevance of the permission status to the overall determination for - * the rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $permission_matching_state - * Indicates whether the permission in the request is denied by the deny - * rule. - * @type int $relevance - * The relevance of the permission status to the overall determination for - * the rule. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the permission in the request is denied by the deny - * rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; - * @return int - */ - public function getPermissionMatchingState() - { - return $this->permission_matching_state; - } - - /** - * Indicates whether the permission in the request is denied by the deny - * rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState permission_matching_state = 1; - * @param int $var - * @return $this - */ - public function setPermissionMatchingState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\PermissionPatternMatchingState::class); - $this->permission_matching_state = $var; - - return $this; - } - - /** - * The relevance of the permission status to the overall determination for - * the rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of the permission status to the overall determination for - * the rule. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 2; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnnotatedPermissionMatching::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation_AnnotatedPermissionMatching::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php deleted file mode 100644 index 2f8d26ce38c..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedAllowPolicy.php +++ /dev/null @@ -1,294 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ExplainedAllowPolicy - */ -class ExplainedAllowPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this policy_ provides the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $allow_access_state = 0; - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - */ - protected $full_resource_name = ''; - /** - * Details about how each role binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. The order of - * the role bindings matches the role binding order in the policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; - */ - private $binding_explanations; - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - */ - protected $relevance = 0; - /** - * The IAM allow policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 5; - */ - protected $policy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $allow_access_state - * Required. Indicates whether _this policy_ provides the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * @type string $full_resource_name - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation>|\Google\Protobuf\Internal\RepeatedField $binding_explanations - * Details about how each role binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. The order of - * the role bindings matches the role binding order in the policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * @type int $relevance - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * @type \Google\Cloud\Iam\V1\Policy $policy - * The IAM allow policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this policy_ provides the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAllowAccessState() - { - return $this->allow_access_state; - } - - /** - * Required. Indicates whether _this policy_ provides the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowAccessState allow_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAllowAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowAccessState::class); - $this->allow_access_state = $var; - - return $this; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * Details about how each role binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. The order of - * the role bindings matches the role binding order in the policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBindingExplanations() - { - return $this->binding_explanations; - } - - /** - * Details about how each role binding in the policy affects the principal's - * ability, or inability, to use the permission for the resource. The order of - * the role bindings matches the role binding order in the policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.AllowBindingExplanation binding_explanations = 3; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBindingExplanations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowBindingExplanation::class); - $this->binding_explanations = $arr; - - return $this; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - - /** - * The IAM allow policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 5; - * @return \Google\Cloud\Iam\V1\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * The IAM allow policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is empty. - * - * Generated from protobuf field .google.iam.v1.Policy policy = 5; - * @param \Google\Cloud\Iam\V1\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); - $this->policy = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php deleted file mode 100644 index a4ffb91ca30..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyPolicy.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy - */ -class ExplainedDenyPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether _this policy_ denies the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $deny_access_state = 0; - /** - * The IAM deny policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.iam.v2.Policy policy = 2; - */ - protected $policy = null; - /** - * Details about how each rule in the policy affects the principal's inability - * to use the permission for the resource. The order of the deny rule matches - * the order of the rules in the deny policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; - */ - private $rule_explanations; - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $deny_access_state - * Required. Indicates whether _this policy_ denies the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * @type \Google\Cloud\Iam\V2\Policy $policy - * The IAM deny policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation>|\Google\Protobuf\Internal\RepeatedField $rule_explanations - * Details about how each rule in the policy affects the principal's inability - * to use the permission for the resource. The order of the deny rule matches - * the order of the rules in the deny policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * @type int $relevance - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether _this policy_ denies the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDenyAccessState() - { - return $this->deny_access_state; - } - - /** - * Required. Indicates whether _this policy_ denies the specified permission - * to the specified principal for the specified resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDenyAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); - $this->deny_access_state = $var; - - return $this; - } - - /** - * The IAM deny policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.iam.v2.Policy policy = 2; - * @return \Google\Cloud\Iam\V2\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * The IAM deny policy attached to the resource. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.iam.v2.Policy policy = 2; - * @param \Google\Cloud\Iam\V2\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Iam\V2\Policy::class); - $this->policy = $var; - - return $this; - } - - /** - * Details about how each rule in the policy affects the principal's inability - * to use the permission for the resource. The order of the deny rule matches - * the order of the rules in the deny policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRuleExplanations() - { - return $this->rule_explanations; - } - - /** - * Details about how each rule in the policy affects the principal's inability - * to use the permission for the resource. The order of the deny rule matches - * the order of the rules in the deny policy. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.DenyRuleExplanation rule_explanations = 3; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRuleExplanations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyRuleExplanation::class); - $this->rule_explanations = $arr; - - return $this; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php deleted file mode 100644 index dc4b7ad16d1..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/ExplainedDenyResource.php +++ /dev/null @@ -1,238 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.ExplainedDenyResource - */ -class ExplainedDenyResource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Indicates whether any policies attached to _this resource_ deny - * the specific permission to the specified principal for the specified - * resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $deny_access_state = 0; - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - */ - protected $full_resource_name = ''; - /** - * List of IAM deny policies that were evaluated to check the principal's - * denied permissions, with annotations to indicate how each policy - * contributed to the final result. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; - */ - private $explained_policies; - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - */ - protected $relevance = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $deny_access_state - * Required. Indicates whether any policies attached to _this resource_ deny - * the specific permission to the specified principal for the specified - * resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * @type string $full_resource_name - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy>|\Google\Protobuf\Internal\RepeatedField $explained_policies - * List of IAM deny policies that were evaluated to check the principal's - * denied permissions, with annotations to indicate how each policy - * contributed to the final result. - * @type int $relevance - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Required. Indicates whether any policies attached to _this resource_ deny - * the specific permission to the specified principal for the specified - * resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDenyAccessState() - { - return $this->deny_access_state; - } - - /** - * Required. Indicates whether any policies attached to _this resource_ deny - * the specific permission to the specified principal for the specified - * resource. - * This field does _not_ indicate whether the principal actually has the - * permission for the resource. There might be another policy that overrides - * this policy. To determine whether the principal actually has the - * permission, use the `overall_access_state` field in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyAccessState deny_access_state = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDenyAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyAccessState::class); - $this->deny_access_state = $var; - - return $this; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @return string - */ - public function getFullResourceName() - { - return $this->full_resource_name; - } - - /** - * The full resource name that identifies the resource. For example, - * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * For examples of full resource names for Google Cloud services, see - * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - * - * Generated from protobuf field string full_resource_name = 2; - * @param string $var - * @return $this - */ - public function setFullResourceName($var) - { - GPBUtil::checkString($var, True); - $this->full_resource_name = $var; - - return $this; - } - - /** - * List of IAM deny policies that were evaluated to check the principal's - * denied permissions, with annotations to indicate how each policy - * contributed to the final result. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExplainedPolicies() - { - return $this->explained_policies; - } - - /** - * List of IAM deny policies that were evaluated to check the principal's - * denied permissions, with annotations to indicate how each policy - * contributed to the final result. - * - * Generated from protobuf field repeated .google.cloud.policytroubleshooter.iam.v3.ExplainedDenyPolicy explained_policies = 3; - * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExplainedPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ExplainedDenyPolicy::class); - $this->explained_policies = $arr; - - return $this; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @return int - */ - public function getRelevance() - { - return $this->relevance; - } - - /** - * The relevance of this policy to the overall access state in the - * [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse]. - * If the sender of the request does not have access to the policy, this field - * is omitted. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance relevance = 4; - * @param int $var - * @return $this - */ - public function setRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\HeuristicRelevance::class); - $this->relevance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php deleted file mode 100644 index f83209056a6..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/HeuristicRelevance.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.HeuristicRelevance - */ -class HeuristicRelevance -{ - /** - * Not specified. - * - * Generated from protobuf enum HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - */ - const HEURISTIC_RELEVANCE_UNSPECIFIED = 0; - /** - * The data point has a limited effect on the result. Changing the data point - * is unlikely to affect the overall determination. - * - * Generated from protobuf enum HEURISTIC_RELEVANCE_NORMAL = 1; - */ - const HEURISTIC_RELEVANCE_NORMAL = 1; - /** - * The data point has a strong effect on the result. Changing the data point - * is likely to affect the overall determination. - * - * Generated from protobuf enum HEURISTIC_RELEVANCE_HIGH = 2; - */ - const HEURISTIC_RELEVANCE_HIGH = 2; - - private static $valueToName = [ - self::HEURISTIC_RELEVANCE_UNSPECIFIED => 'HEURISTIC_RELEVANCE_UNSPECIFIED', - self::HEURISTIC_RELEVANCE_NORMAL => 'HEURISTIC_RELEVANCE_NORMAL', - self::HEURISTIC_RELEVANCE_HIGH => 'HEURISTIC_RELEVANCE_HIGH', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php deleted file mode 100644 index a2c6c2e2987..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/MembershipMatchingState.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.MembershipMatchingState - */ -class MembershipMatchingState -{ - /** - * Not specified. - * - * Generated from protobuf enum MEMBERSHIP_MATCHING_STATE_UNSPECIFIED = 0; - */ - const MEMBERSHIP_MATCHING_STATE_UNSPECIFIED = 0; - /** - * The principal in the request matches the principal in the policy. The - * principal can be included directly or indirectly: - * * A principal is included directly if that principal is listed in the - * role binding. - * * A principal is included indirectly if that principal is in a Google - * group, Google Workspace account, or Cloud Identity domain that is listed - * in the policy. - * - * Generated from protobuf enum MEMBERSHIP_MATCHED = 1; - */ - const MEMBERSHIP_MATCHED = 1; - /** - * The principal in the request doesn't match the principal in the policy. - * - * Generated from protobuf enum MEMBERSHIP_NOT_MATCHED = 2; - */ - const MEMBERSHIP_NOT_MATCHED = 2; - /** - * The principal in the policy is a group or domain, and the sender of the - * request doesn't have permission to view whether the principal in the - * request is a member of the group or domain. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_INFO = 3; - */ - const MEMBERSHIP_UNKNOWN_INFO = 3; - /** - * The principal is an unsupported type. - * - * Generated from protobuf enum MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - */ - const MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; - - private static $valueToName = [ - self::MEMBERSHIP_MATCHING_STATE_UNSPECIFIED => 'MEMBERSHIP_MATCHING_STATE_UNSPECIFIED', - self::MEMBERSHIP_MATCHED => 'MEMBERSHIP_MATCHED', - self::MEMBERSHIP_NOT_MATCHED => 'MEMBERSHIP_NOT_MATCHED', - self::MEMBERSHIP_UNKNOWN_INFO => 'MEMBERSHIP_UNKNOWN_INFO', - self::MEMBERSHIP_UNKNOWN_UNSUPPORTED => 'MEMBERSHIP_UNKNOWN_UNSUPPORTED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php deleted file mode 100644 index 532ba20b750..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/PermissionPatternMatchingState.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.PermissionPatternMatchingState - */ -class PermissionPatternMatchingState -{ - /** - * Not specified. - * - * Generated from protobuf enum PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED = 0; - */ - const PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED = 0; - /** - * The permission in the request matches the permission in the policy. - * - * Generated from protobuf enum PERMISSION_PATTERN_MATCHED = 1; - */ - const PERMISSION_PATTERN_MATCHED = 1; - /** - * The permission in the request matches the permission in the policy. - * - * Generated from protobuf enum PERMISSION_PATTERN_NOT_MATCHED = 2; - */ - const PERMISSION_PATTERN_NOT_MATCHED = 2; - - private static $valueToName = [ - self::PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED => 'PERMISSION_PATTERN_MATCHING_STATE_UNSPECIFIED', - self::PERMISSION_PATTERN_MATCHED => 'PERMISSION_PATTERN_MATCHED', - self::PERMISSION_PATTERN_NOT_MATCHED => 'PERMISSION_PATTERN_NOT_MATCHED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php deleted file mode 100644 index 86df4310ca3..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/RolePermissionInclusionState.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.RolePermissionInclusionState - */ -class RolePermissionInclusionState -{ - /** - * Not specified. - * - * Generated from protobuf enum ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED = 0; - */ - const ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED = 0; - /** - * The permission is included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_INCLUDED = 1; - */ - const ROLE_PERMISSION_INCLUDED = 1; - /** - * The permission is not included in the role. - * - * Generated from protobuf enum ROLE_PERMISSION_NOT_INCLUDED = 2; - */ - const ROLE_PERMISSION_NOT_INCLUDED = 2; - /** - * The sender of the request is not allowed to access the role definition. - * - * Generated from protobuf enum ROLE_PERMISSION_UNKNOWN_INFO = 3; - */ - const ROLE_PERMISSION_UNKNOWN_INFO = 3; - - private static $valueToName = [ - self::ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED => 'ROLE_PERMISSION_INCLUSION_STATE_UNSPECIFIED', - self::ROLE_PERMISSION_INCLUDED => 'ROLE_PERMISSION_INCLUDED', - self::ROLE_PERMISSION_NOT_INCLUDED => 'ROLE_PERMISSION_NOT_INCLUDED', - self::ROLE_PERMISSION_UNKNOWN_INFO => 'ROLE_PERMISSION_UNKNOWN_INFO', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php deleted file mode 100644 index 01b85d1f95e..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyRequest - */ -class TroubleshootIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; - */ - protected $access_tuple = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $access_tuple - * The information to use for checking whether a principal has a permission - * for a resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple|null - */ - public function getAccessTuple() - { - return $this->access_tuple; - } - - public function hasAccessTuple() - { - return isset($this->access_tuple); - } - - public function clearAccessTuple() - { - unset($this->access_tuple); - } - - /** - * The information to use for checking whether a principal has a permission - * for a resource. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 1; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $var - * @return $this - */ - public function setAccessTuple($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple::class); - $this->access_tuple = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php deleted file mode 100644 index 230d00f1469..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse.php +++ /dev/null @@ -1,220 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse - */ -class TroubleshootIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all types of the applicable IAM - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; - */ - protected $overall_access_state = 0; - /** - * The access tuple from the request, including any provided context used to - * evaluate the condition. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; - */ - protected $access_tuple = null; - /** - * An explanation of how the applicable IAM allow policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; - */ - protected $allow_policy_explanation = null; - /** - * An explanation of how the applicable IAM deny policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; - */ - protected $deny_policy_explanation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $overall_access_state - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all types of the applicable IAM - * policies. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $access_tuple - * The access tuple from the request, including any provided context used to - * evaluate the condition. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation $allow_policy_explanation - * An explanation of how the applicable IAM allow policies affect the final - * access state. - * @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation $deny_policy_explanation - * An explanation of how the applicable IAM deny policies affect the final - * access state. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all types of the applicable IAM - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; - * @return int - */ - public function getOverallAccessState() - { - return $this->overall_access_state; - } - - /** - * Indicates whether the principal has the specified permission for the - * specified resource, based on evaluating all types of the applicable IAM - * policies. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState overall_access_state = 1; - * @param int $var - * @return $this - */ - public function setOverallAccessState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse\OverallAccessState::class); - $this->overall_access_state = $var; - - return $this; - } - - /** - * The access tuple from the request, including any provided context used to - * evaluate the condition. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple|null - */ - public function getAccessTuple() - { - return $this->access_tuple; - } - - public function hasAccessTuple() - { - return isset($this->access_tuple); - } - - public function clearAccessTuple() - { - unset($this->access_tuple); - } - - /** - * The access tuple from the request, including any provided context used to - * evaluate the condition. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AccessTuple access_tuple = 2; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple $var - * @return $this - */ - public function setAccessTuple($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AccessTuple::class); - $this->access_tuple = $var; - - return $this; - } - - /** - * An explanation of how the applicable IAM allow policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation|null - */ - public function getAllowPolicyExplanation() - { - return $this->allow_policy_explanation; - } - - public function hasAllowPolicyExplanation() - { - return isset($this->allow_policy_explanation); - } - - public function clearAllowPolicyExplanation() - { - unset($this->allow_policy_explanation); - } - - /** - * An explanation of how the applicable IAM allow policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.AllowPolicyExplanation allow_policy_explanation = 3; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation $var - * @return $this - */ - public function setAllowPolicyExplanation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\AllowPolicyExplanation::class); - $this->allow_policy_explanation = $var; - - return $this; - } - - /** - * An explanation of how the applicable IAM deny policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; - * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation|null - */ - public function getDenyPolicyExplanation() - { - return $this->deny_policy_explanation; - } - - public function hasDenyPolicyExplanation() - { - return isset($this->deny_policy_explanation); - } - - public function clearDenyPolicyExplanation() - { - unset($this->deny_policy_explanation); - } - - /** - * An explanation of how the applicable IAM deny policies affect the final - * access state. - * - * Generated from protobuf field .google.cloud.policytroubleshooter.iam.v3.DenyPolicyExplanation deny_policy_explanation = 4; - * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation $var - * @return $this - */ - public function setDenyPolicyExplanation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\DenyPolicyExplanation::class); - $this->deny_policy_explanation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php deleted file mode 100644 index 636bfee1907..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/proto/src/Google/Cloud/PolicyTroubleshooter/Iam/V3/TroubleshootIamPolicyResponse/OverallAccessState.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.policytroubleshooter.iam.v3.TroubleshootIamPolicyResponse.OverallAccessState - */ -class OverallAccessState -{ - /** - * Not specified. - * - * Generated from protobuf enum OVERALL_ACCESS_STATE_UNSPECIFIED = 0; - */ - const OVERALL_ACCESS_STATE_UNSPECIFIED = 0; - /** - * The principal has the permission. - * - * Generated from protobuf enum CAN_ACCESS = 1; - */ - const CAN_ACCESS = 1; - /** - * The principal doesn't have the permission. - * - * Generated from protobuf enum CANNOT_ACCESS = 2; - */ - const CANNOT_ACCESS = 2; - /** - * The principal might have the permission, but the sender can't access all - * of the information needed to fully evaluate the principal's access. - * - * Generated from protobuf enum UNKNOWN_INFO = 3; - */ - const UNKNOWN_INFO = 3; - /** - * The principal might have the permission, but Policy Troubleshooter can't - * fully evaluate the principal's access because the sender didn't provide - * the required context to evaluate the condition. - * - * Generated from protobuf enum UNKNOWN_CONDITIONAL = 4; - */ - const UNKNOWN_CONDITIONAL = 4; - - private static $valueToName = [ - self::OVERALL_ACCESS_STATE_UNSPECIFIED => 'OVERALL_ACCESS_STATE_UNSPECIFIED', - self::CAN_ACCESS => 'CAN_ACCESS', - self::CANNOT_ACCESS => 'CANNOT_ACCESS', - self::UNKNOWN_INFO => 'UNKNOWN_INFO', - self::UNKNOWN_CONDITIONAL => 'UNKNOWN_CONDITIONAL', - ]; - - 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(OverallAccessState::class, \Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse_OverallAccessState::class); - diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php deleted file mode 100644 index 091ecf5fcfd..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php +++ /dev/null @@ -1,59 +0,0 @@ -troubleshootIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END policytroubleshooter_v3_generated_PolicyTroubleshooter_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php deleted file mode 100644 index 9fb2b8e74d9..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/Client/PolicyTroubleshooterClient.php +++ /dev/null @@ -1,198 +0,0 @@ - troubleshootIamPolicyAsync(TroubleshootIamPolicyRequest $request, array $optionalArgs = []) - */ -final class PolicyTroubleshooterClient -{ - use GapicClientTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'policytroubleshooter.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'policytroubleshooter.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/policy_troubleshooter_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/policy_troubleshooter_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'policytroubleshooter.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Checks whether a principal has a specific permission for a specific - * resource, and explains why the principal does or doesn't have that - * permission. - * - * The async variant is - * {@see PolicyTroubleshooterClient::troubleshootIamPolicyAsync()} . - * - * @example samples/V3/PolicyTroubleshooterClient/troubleshoot_iam_policy.php - * - * @param TroubleshootIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TroubleshootIamPolicyResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function troubleshootIamPolicy(TroubleshootIamPolicyRequest $request, array $callOptions = []): TroubleshootIamPolicyResponse - { - return $this->startApiCall('TroubleshootIamPolicy', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json deleted file mode 100644 index 17bca5927d5..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/gapic_metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.policytroubleshooter.iam.v3", - "libraryPackage": "Google\\Cloud\\PolicyTroubleshooter\\Iam\\V3", - "services": { - "PolicyTroubleshooter": { - "clients": { - "grpc": { - "libraryClient": "PolicyTroubleshooterGapicClient", - "rpcs": { - "TroubleshootIamPolicy": { - "methods": [ - "troubleshootIamPolicy" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json deleted file mode 100644 index 8852fe92d97..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_client_config.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "interfaces": { - "google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "TroubleshootIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php deleted file mode 100644 index b6365012b5d..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_descriptor_config.php +++ /dev/null @@ -1,32 +0,0 @@ - [ - 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter' => [ - 'TroubleshootIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PolicyTroubleshooter\Iam\V3\TroubleshootIamPolicyResponse', - ], - ], - ], -]; diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php deleted file mode 100644 index 1fa971fc5cf..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/src/V3/resources/policy_troubleshooter_rest_client_config.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter' => [ - 'TroubleshootIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/iam:troubleshoot', - 'body' => '*', - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php b/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php deleted file mode 100644 index 1c6bcea3301..00000000000 --- a/owl-bot-staging/PolicyTroubleshooterIam/v3/tests/Unit/V3/Client/PolicyTroubleshooterClientTest.php +++ /dev/null @@ -1,138 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PolicyTroubleshooterClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PolicyTroubleshooterClient($options); - } - - /** @test */ - public function troubleshootIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TroubleshootIamPolicyResponse(); - $transport->addResponse($expectedResponse); - $request = new TroubleshootIamPolicyRequest(); - $response = $gapicClient->troubleshootIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter/TroubleshootIamPolicy', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function troubleshootIamPolicyExceptionTest() - { - $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); - $request = new TroubleshootIamPolicyRequest(); - try { - $gapicClient->troubleshootIamPolicy($request); - // 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 troubleshootIamPolicyAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TroubleshootIamPolicyResponse(); - $transport->addResponse($expectedResponse); - $request = new TroubleshootIamPolicyRequest(); - $response = $gapicClient->troubleshootIamPolicyAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.policytroubleshooter.iam.v3.PolicyTroubleshooter/TroubleshootIamPolicy', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php deleted file mode 100644 index d7336ea94188e456da8400f0bf46f85e86b854f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5198 zcmcIo&2!U66vsBs#|AO$|WE13S zWv;Nc%oNr(`V`i-@0XauMTBg}3PVk9FAIBUA8GKb3AEQh=T zN0+pg<%Aei96sCXx;7=At1*Ff*T(a=G@+B7z3zJe%#s$}aD!n5IMpgH#er)%wG|xN z0r9C9Y`{^|Y-1WD%vR=aNwZ8HX=(G~j;49&l1my5x;SZF(*jJpfxF1>%@iEOziLD9 zEBd5XbX||3;JKk`_I&E8I7)EYA=stqWS$W0G)uT+?Gi6YC%TCxn?}CmGtX@YUDqXU zySDB#4ySW6j$IXSwo`Z-3vLl0FSU03;jVJB+P%9u2~nLVA!JuF33Zu-bF)&v96KsDX%C9@g?egk6raFJ63psJ{YtT`j9wS zd4wip;R?Y_ZhmUvt}Z+}7I0l&SD8f@T>JyACrt92^&A6IHGzfi*|DCLo?`$yx17o` zspx3ONEESc9E2<}Pl%Y(7cmjVv|;O+>Up;-&8PBCDmvP`*I6_k#r7gP%eq*PemUhT zI@ctj?^t_vzQtqBe99>*nrg}x0jO{?a?a+I&(M?|U}&9n#(qx8sfD?SW)LObY4o`0 z2z?;c^`U7>sXP$*WGQp`ZSgU>&1=O#sSvD&0uk!a_>IU(C8EEvFMk~re#)WohzCPJ zm_-QsGp2RA=VOtG;>r)vOoYyk?D!mqsfF1?-iq2>8iS-}=s~&@+jHyPfQXzG8aL65 zFcn~!STJ<$P(?gVA4D3DtBZP(-E%XNje$*uV>Dn{5R>5;`=7%R!L0xtc+wjC^4CG( z?>w6BcSN~>vZR?L<^cN=ynKwti0gN0sERw^840)w7ZHGU(8XOCuz-s|>^d83x}iD_ z08B4D9Z6aLej-t$(vt-B?|&JgKa%%$!lCpnj~btyI>^GZ|$P<@xcMEL*Rvi9d3s2{b04 zDwt?Y@J;!YHSYk5E)3nQA+wryWbI&O7h3ydIYN(BkvPur(2#>_kJ{p6h*f5m8#%$2 zfuv>w#K|?b@GY2(Vy~P-X9MheA{W8IT$2QHIGI6XP-%Av70mz`0xONca_x?&ajCVrK*by>$NPokq%*g8Dp@hQ6n@RT{_EeL zv%h2%J^qH?k4D`kaPd0~)1qBmz*C_W37rP5o@{Eg06E?`Q=&B}b|P8>0tvJvb;DF>MM9@Rt0$WpEtxH0 zO0)*WPDE=!U~c{Y@5pPoWU=pV-FW4#lm_@al zP;E!a%+jU)@&Kfx-bUv6x@h;&=N}BoZ7+J>lDTNWB?cb8>s%O#&6kcW&Yl! zFSGY9z2B-X-@D#Kr)u(9EP5AP77t%Fco^d^ZEv$TggVpY`b@K5p=rv4jWOUT^&Z@e Z-y!ab7pKGn)sc@={G@n9IzR^q{Rblvs-yq_ diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php deleted file mode 100644 index 28de295119b..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php +++ /dev/null @@ -1,511 +0,0 @@ -google.cloud.privatecatalog.v1beta1.AssetReference - */ -class AssetReference extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. A unique identifier among asset references in a product. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $id = ''; - /** - * Output only. The human-readable description of the referenced asset. Maximum 256 - * characters in length. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $description = ''; - /** - * Output only. The definition of input parameters to hydrate the asset template. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $inputs = null; - /** - * Output only. The current state of the asset reference. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $validation_status = 0; - /** - * Output only. The validation process metadata. - * - * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $validation_operation = null; - /** - * Output only. The cloud storage source. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $gcs_source = null; - /** - * Output only. The creation timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * The version of the source used for this asset reference. - * - * Generated from protobuf field string version = 14 [deprecated = true]; - * @deprecated - */ - protected $version = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Output only. A unique identifier among asset references in a product. - * @type string $description - * Output only. The human-readable description of the referenced asset. Maximum 256 - * characters in length. - * @type \Google\Cloud\PrivateCatalog\V1beta1\Inputs $inputs - * Output only. The definition of input parameters to hydrate the asset template. - * @type int $validation_status - * Output only. The current state of the asset reference. - * @type \Google\LongRunning\Operation $validation_operation - * Output only. The validation process metadata. - * @type string $asset - * Output only. The asset resource name if an asset is hosted by Private Catalog. - * @type string $gcs_path - * Output only. The cloud storage object path. - * @type \Google\Cloud\PrivateCatalog\V1beta1\GitSource $git_source - * Output only. The git source. - * @type \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $gcs_source - * Output only. The cloud storage source. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the asset reference. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the asset reference. - * @type string $version - * The version of the source used for this asset reference. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A unique identifier among asset references in a product. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. A unique identifier among asset references in a product. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Output only. The human-readable description of the referenced asset. Maximum 256 - * characters in length. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Output only. The human-readable description of the referenced asset. Maximum 256 - * characters in length. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The definition of input parameters to hydrate the asset template. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivateCatalog\V1beta1\Inputs|null - */ - public function getInputs() - { - return $this->inputs; - } - - public function hasInputs() - { - return isset($this->inputs); - } - - public function clearInputs() - { - unset($this->inputs); - } - - /** - * Output only. The definition of input parameters to hydrate the asset template. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivateCatalog\V1beta1\Inputs $var - * @return $this - */ - public function setInputs($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\Inputs::class); - $this->inputs = $var; - - return $this; - } - - /** - * Output only. The current state of the asset reference. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getValidationStatus() - { - return $this->validation_status; - } - - /** - * Output only. The current state of the asset reference. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setValidationStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference\AssetValidationState::class); - $this->validation_status = $var; - - return $this; - } - - /** - * Output only. The validation process metadata. - * - * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\LongRunning\Operation|null - */ - public function getValidationOperation() - { - return $this->validation_operation; - } - - public function hasValidationOperation() - { - return isset($this->validation_operation); - } - - public function clearValidationOperation() - { - unset($this->validation_operation); - } - - /** - * Output only. The validation process metadata. - * - * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\LongRunning\Operation $var - * @return $this - */ - public function setValidationOperation($var) - { - GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); - $this->validation_operation = $var; - - return $this; - } - - /** - * Output only. The asset resource name if an asset is hosted by Private Catalog. - * - * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAsset() - { - return $this->readOneof(10); - } - - public function hasAsset() - { - return $this->hasOneof(10); - } - - /** - * Output only. The asset resource name if an asset is hosted by Private Catalog. - * - * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAsset($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Output only. The cloud storage object path. - * - * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - * @deprecated - */ - public function getGcsPath() - { - @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(11); - } - - public function hasGcsPath() - { - @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(11); - } - - /** - * Output only. The cloud storage object path. - * - * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - * @deprecated - */ - public function setGcsPath($var) - { - @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Output only. The git source. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivateCatalog\V1beta1\GitSource|null - */ - public function getGitSource() - { - return $this->readOneof(15); - } - - public function hasGitSource() - { - return $this->hasOneof(15); - } - - /** - * Output only. The git source. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivateCatalog\V1beta1\GitSource $var - * @return $this - */ - public function setGitSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GitSource::class); - $this->writeOneof(15, $var); - - return $this; - } - - /** - * Output only. The cloud storage source. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivateCatalog\V1beta1\GcsSource|null - */ - public function getGcsSource() - { - return $this->gcs_source; - } - - public function hasGcsSource() - { - return isset($this->gcs_source); - } - - public function clearGcsSource() - { - unset($this->gcs_source); - } - - /** - * Output only. The cloud storage source. - * - * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GcsSource::class); - $this->gcs_source = $var; - - return $this; - } - - /** - * Output only. The creation timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The creation timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last update timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last update timestamp of the asset reference. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The version of the source used for this asset reference. - * - * Generated from protobuf field string version = 14 [deprecated = true]; - * @return string - * @deprecated - */ - public function getVersion() - { - @trigger_error('version is deprecated.', E_USER_DEPRECATED); - return $this->version; - } - - /** - * The version of the source used for this asset reference. - * - * Generated from protobuf field string version = 14 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setVersion($var) - { - @trigger_error('version is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php deleted file mode 100644 index b7a471cf660..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState - */ -class AssetValidationState -{ - /** - * Unknown state. - * - * Generated from protobuf enum ASSET_VALIDATION_STATE_UNSPECIFIED = 0; - */ - const ASSET_VALIDATION_STATE_UNSPECIFIED = 0; - /** - * The validation is still in process. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The validation is done and the asset reference is valid. - * - * Generated from protobuf enum VALID = 2; - */ - const VALID = 2; - /** - * The validation is done and the asset reference is invalid. - * - * Generated from protobuf enum INVALID = 3; - */ - const INVALID = 3; - - private static $valueToName = [ - self::ASSET_VALIDATION_STATE_UNSPECIFIED => 'ASSET_VALIDATION_STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::VALID => 'VALID', - self::INVALID => 'INVALID', - ]; - - 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(AssetValidationState::class, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference_AssetValidationState::class); - diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php deleted file mode 100644 index 89c4e77f2ba..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php +++ /dev/null @@ -1,228 +0,0 @@ -google.cloud.privatecatalog.v1beta1.Catalog - */ -class Catalog extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the target catalog, in the format of - * `catalogs/{catalog}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The descriptive name of the catalog as it appears in UIs. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $display_name = ''; - /** - * Output only. The description of the catalog. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $description = ''; - /** - * Output only. The time when the catalog was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the catalog was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the target catalog, in the format of - * `catalogs/{catalog}'. - * @type string $display_name - * Output only. The descriptive name of the catalog as it appears in UIs. - * @type string $description - * Output only. The description of the catalog. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the catalog was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the catalog was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the target catalog, in the format of - * `catalogs/{catalog}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the target catalog, in the format of - * `catalogs/{catalog}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The descriptive name of the catalog as it appears in UIs. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Output only. The descriptive name of the catalog as it appears in UIs. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The description of the catalog. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Output only. The description of the catalog. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The time when the catalog was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the catalog was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the catalog was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the catalog was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php deleted file mode 100644 index 9439240968d..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php +++ /dev/null @@ -1,149 +0,0 @@ -google.cloud.privatecatalog.v1beta1.GcsSource - */ -class GcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. the cloud storage object path. - * - * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $gcs_path = ''; - /** - * Output only. Generation of the object, which is set when the content of an object starts - * being written. - * - * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Output only. The time when the object metadata was last changed. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_path - * Output only. the cloud storage object path. - * @type int|string $generation - * Output only. Generation of the object, which is set when the content of an object starts - * being written. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the object metadata was last changed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. the cloud storage object path. - * - * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getGcsPath() - { - return $this->gcs_path; - } - - /** - * Output only. the cloud storage object path. - * - * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setGcsPath($var) - { - GPBUtil::checkString($var, True); - $this->gcs_path = $var; - - return $this; - } - - /** - * Output only. Generation of the object, which is set when the content of an object starts - * being written. - * - * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. Generation of the object, which is set when the content of an object starts - * being written. - * - * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Output only. The time when the object metadata was last changed. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the object metadata was last changed. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php deleted file mode 100644 index 13cdd80dd4a..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php +++ /dev/null @@ -1,217 +0,0 @@ -google.cloud.privatecatalog.v1beta1.GitSource - */ -class GitSource extends \Google\Protobuf\Internal\Message -{ - /** - * Location of the Git repo to build. - * - * Generated from protobuf field string repo = 1; - */ - protected $repo = ''; - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 2; - */ - protected $dir = ''; - protected $ref; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repo - * Location of the Git repo to build. - * @type string $dir - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * @type string $commit - * The revision commit to use. - * @type string $branch - * The revision branch to use. - * @type string $tag - * The revision tag to use. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Location of the Git repo to build. - * - * Generated from protobuf field string repo = 1; - * @return string - */ - public function getRepo() - { - return $this->repo; - } - - /** - * Location of the Git repo to build. - * - * Generated from protobuf field string repo = 1; - * @param string $var - * @return $this - */ - public function setRepo($var) - { - GPBUtil::checkString($var, True); - $this->repo = $var; - - return $this; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 2; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 2; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * The revision commit to use. - * - * Generated from protobuf field string commit = 3; - * @return string - */ - public function getCommit() - { - return $this->readOneof(3); - } - - public function hasCommit() - { - return $this->hasOneof(3); - } - - /** - * The revision commit to use. - * - * Generated from protobuf field string commit = 3; - * @param string $var - * @return $this - */ - public function setCommit($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The revision branch to use. - * - * Generated from protobuf field string branch = 4; - * @return string - */ - public function getBranch() - { - return $this->readOneof(4); - } - - public function hasBranch() - { - return $this->hasOneof(4); - } - - /** - * The revision branch to use. - * - * Generated from protobuf field string branch = 4; - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * The revision tag to use. - * - * Generated from protobuf field string tag = 5; - * @return string - */ - public function getTag() - { - return $this->readOneof(5); - } - - public function hasTag() - { - return $this->hasOneof(5); - } - - /** - * The revision tag to use. - * - * Generated from protobuf field string tag = 5; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getRef() - { - return $this->whichOneof("ref"); - } - -} - diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php deleted file mode 100644 index 7fef7240488..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.privatecatalog.v1beta1.Inputs - */ -class Inputs extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The JSON schema defining the inputs and their formats. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $parameters = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $parameters - * Output only. The JSON schema defining the inputs and their formats. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The JSON schema defining the inputs and their formats. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Struct|null - */ - public function getParameters() - { - return $this->parameters; - } - - public function hasParameters() - { - return isset($this->parameters); - } - - public function clearParameters() - { - unset($this->parameters); - } - - /** - * Output only. The JSON schema defining the inputs and their formats. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->parameters = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php deleted file mode 100644 index d22f0ed59e7..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php +++ /dev/null @@ -1,922 +0,0 @@ -google.cloud.privatecatalog.v1beta1.Product - */ -class Product extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the target product, in the format of - * `products/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the product under a catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The type of the product asset. It can be one of the following values: - * * `google.deploymentmanager.Template` - * * `google.cloudprivatecatalog.ListingOnly` - * * `google.cloudprivatecatalog.Terraform` - * - * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $asset_type = ''; - /** - * Required. Output only. The display metadata to describe the product. The JSON schema of the - * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. - * When the type is `google.deploymentmanager.Template`, the schema is as - * follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * signup_url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * required: - * - name - * - description - * - signup_url - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: true - * - * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $display_metadata = null; - /** - * Output only. The icon URI of the product. - * - * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $icon_uri = ''; - /** - * Output only. A collection of assets referred by a product. - * This field is set for Terraform Products only. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $asset_references; - /** - * Output only. The time when the product was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the product was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the target product, in the format of - * `products/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the product under a catalog. - * @type string $asset_type - * Output only. The type of the product asset. It can be one of the following values: - * * `google.deploymentmanager.Template` - * * `google.cloudprivatecatalog.ListingOnly` - * * `google.cloudprivatecatalog.Terraform` - * @type \Google\Protobuf\Struct $display_metadata - * Required. Output only. The display metadata to describe the product. The JSON schema of the - * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. - * When the type is `google.deploymentmanager.Template`, the schema is as - * follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * signup_url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * required: - * - name - * - description - * - signup_url - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: true - * @type string $icon_uri - * Output only. The icon URI of the product. - * @type array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $asset_references - * Output only. A collection of assets referred by a product. - * This field is set for Terraform Products only. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the product was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the product was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the target product, in the format of - * `products/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the product under a catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the target product, in the format of - * `products/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the product under a catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The type of the product asset. It can be one of the following values: - * * `google.deploymentmanager.Template` - * * `google.cloudprivatecatalog.ListingOnly` - * * `google.cloudprivatecatalog.Terraform` - * - * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAssetType() - { - return $this->asset_type; - } - - /** - * Output only. The type of the product asset. It can be one of the following values: - * * `google.deploymentmanager.Template` - * * `google.cloudprivatecatalog.ListingOnly` - * * `google.cloudprivatecatalog.Terraform` - * - * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAssetType($var) - { - GPBUtil::checkString($var, True); - $this->asset_type = $var; - - return $this; - } - - /** - * Required. Output only. The display metadata to describe the product. The JSON schema of the - * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. - * When the type is `google.deploymentmanager.Template`, the schema is as - * follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * signup_url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * required: - * - name - * - description - * - signup_url - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: true - * - * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Struct|null - */ - public function getDisplayMetadata() - { - return $this->display_metadata; - } - - public function hasDisplayMetadata() - { - return isset($this->display_metadata); - } - - public function clearDisplayMetadata() - { - unset($this->display_metadata); - } - - /** - * Required. Output only. The display metadata to describe the product. The JSON schema of the - * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. - * When the type is `google.deploymentmanager.Template`, the schema is as - * follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * signup_url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * required: - * - name - * - description - * - signup_url - * additionalProperties: false - * ``` - * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema - * is as follows: - * ``` - * "$schema": http://json-schema.org/draft-04/schema# - * type: object - * properties: - * name: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * tagline: - * type: string - * minLength: 1 - * maxLength: 100 - * support_info: - * type: string - * minLength: 1 - * maxLength: 2048 - * creator: - * type: string - * minLength: 1 - * maxLength: 100 - * documentations: - * type: array - * items: - * type: object - * properties: - * url: - * type: string - * pattern: - * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - * title: - * type: string - * minLength: 1 - * maxLength: 64 - * description: - * type: string - * minLength: 1 - * maxLength: 2048 - * required: - * - name - * - description - * additionalProperties: true - * - * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDisplayMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->display_metadata = $var; - - return $this; - } - - /** - * Output only. The icon URI of the product. - * - * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIconUri() - { - return $this->icon_uri; - } - - /** - * Output only. The icon URI of the product. - * - * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIconUri($var) - { - GPBUtil::checkString($var, True); - $this->icon_uri = $var; - - return $this; - } - - /** - * Output only. A collection of assets referred by a product. - * This field is set for Terraform Products only. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssetReferences() - { - return $this->asset_references; - } - - /** - * Output only. A collection of assets referred by a product. - * This field is set for Terraform Products only. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssetReferences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference::class); - $this->asset_references = $arr; - - return $this; - } - - /** - * Output only. The time when the product was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the product was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the product was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the product was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php deleted file mode 100644 index 46c48ae71b1..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest - */ -class SearchCatalogsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource context. It can be in following formats: - * * `projects/{project}` - * * `folders/{folder}` - * * `organizations/{organization}` - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource = ''; - /** - * The query to filter the catalogs. The supported queries are: - * * Get a single catalog: `name=catalogs/{catalog}` - * - * Generated from protobuf field string query = 2; - */ - protected $query = ''; - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The name of the resource context. It can be in following formats: - * * `projects/{project}` - * * `folders/{folder}` - * * `organizations/{organization}` - * @type string $query - * The query to filter the catalogs. The supported queries are: - * * Get a single catalog: `name=catalogs/{catalog}` - * @type int $page_size - * The maximum number of entries that are requested. - * @type string $page_token - * A pagination token returned from a previous call to SearchCatalogs that - * indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource context. It can be in following formats: - * * `projects/{project}` - * * `folders/{folder}` - * * `organizations/{organization}` - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The name of the resource context. It can be in following formats: - * * `projects/{project}` - * * `folders/{folder}` - * * `organizations/{organization}` - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * The query to filter the catalogs. The supported queries are: - * * Get a single catalog: `name=catalogs/{catalog}` - * - * Generated from protobuf field string query = 2; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * The query to filter the catalogs. The supported queries are: - * * Get a single catalog: `name=catalogs/{catalog}` - * - * Generated from protobuf field string query = 2; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php deleted file mode 100644 index 073d9cfa206..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse - */ -class SearchCatalogsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The `Catalog`s computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; - */ - private $catalogs; - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates from where listing should continue. - * - * 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\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $catalogs - * The `Catalog`s computed from the resource context. - * @type string $next_page_token - * A pagination token returned from a previous call to SearchCatalogs that - * indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * The `Catalog`s computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCatalogs() - { - return $this->catalogs; - } - - /** - * The `Catalog`s computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; - * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCatalogs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Catalog::class); - $this->catalogs = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to SearchCatalogs that - * indicates from where listing should continue. - * - * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php deleted file mode 100644 index 38693b585c3..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchProductsRequest - */ -class SearchProductsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource = ''; - /** - * The query to filter the products. - * The supported queries are: - * * List products of all catalogs: empty - * * List products under a catalog: `parent=catalogs/{catalog}` - * * Get a product by name: - * `name=catalogs/{catalog}/products/{product}` - * - * Generated from protobuf field string query = 2; - */ - protected $query = ''; - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * @type string $query - * The query to filter the products. - * The supported queries are: - * * List products of all catalogs: empty - * * List products under a catalog: `parent=catalogs/{catalog}` - * * Get a product by name: - * `name=catalogs/{catalog}/products/{product}` - * @type int $page_size - * The maximum number of entries that are requested. - * @type string $page_token - * A pagination token returned from a previous call to SearchProducts that - * indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * The query to filter the products. - * The supported queries are: - * * List products of all catalogs: empty - * * List products under a catalog: `parent=catalogs/{catalog}` - * * Get a product by name: - * `name=catalogs/{catalog}/products/{product}` - * - * Generated from protobuf field string query = 2; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * The query to filter the products. - * The supported queries are: - * * List products of all catalogs: empty - * * List products under a catalog: `parent=catalogs/{catalog}` - * * Get a product by name: - * `name=catalogs/{catalog}/products/{product}` - * - * Generated from protobuf field string query = 2; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php deleted file mode 100644 index 8e3c9015929..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchProductsResponse - */ -class SearchProductsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The `Product` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; - */ - private $products; - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates from where listing should continue. - * - * 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\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $products - * The `Product` resources computed from the resource context. - * @type string $next_page_token - * A pagination token returned from a previous call to SearchProducts that - * indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * The `Product` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProducts() - { - return $this->products; - } - - /** - * The `Product` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; - * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProducts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Product::class); - $this->products = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to SearchProducts that - * indicates from where listing should continue. - * - * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php deleted file mode 100644 index 2a177f28643..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchVersionsRequest - */ -class SearchVersionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource = ''; - /** - * Required. The query to filter the versions. - * The supported queries are: - * * List versions under a product: - * `parent=catalogs/{catalog}/products/{product}` - * * Get a version by name: - * `name=catalogs/{catalog}/products/{product}/versions/{version}` - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A pagination token returned from a previous call to SearchVersions - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * @type string $query - * Required. The query to filter the versions. - * The supported queries are: - * * List versions under a product: - * `parent=catalogs/{catalog}/products/{product}` - * * Get a version by name: - * `name=catalogs/{catalog}/products/{product}/versions/{version}` - * @type int $page_size - * The maximum number of entries that are requested. - * @type string $page_token - * A pagination token returned from a previous call to SearchVersions - * that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Required. The query to filter the versions. - * The supported queries are: - * * List versions under a product: - * `parent=catalogs/{catalog}/products/{product}` - * * Get a version by name: - * `name=catalogs/{catalog}/products/{product}/versions/{version}` - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. The query to filter the versions. - * The supported queries are: - * * List versions under a product: - * `parent=catalogs/{catalog}/products/{product}` - * * Get a version by name: - * `name=catalogs/{catalog}/products/{product}/versions/{version}` - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of entries that are requested. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchVersions - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A pagination token returned from a previous call to SearchVersions - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 4; - * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php deleted file mode 100644 index da4bb06dd2a..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.privatecatalog.v1beta1.SearchVersionsResponse - */ -class SearchVersionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The `Version` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; - */ - private $versions; - /** - * A pagination token returned from a previous call to SearchVersions that - * indicates from where the listing should continue. - * - * 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\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $versions - * The `Version` resources computed from the resource context. - * @type string $next_page_token - * A pagination token returned from a previous call to SearchVersions that - * indicates from where the listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * The `Version` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVersions() - { - return $this->versions; - } - - /** - * The `Version` resources computed from the resource context. - * - * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; - * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Version::class); - $this->versions = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to SearchVersions that - * indicates from where the listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to SearchVersions that - * indicates from where the listing should continue. - * - * 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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php deleted file mode 100644 index 8d1ed9bcf83..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php +++ /dev/null @@ -1,254 +0,0 @@ -google.cloud.privatecatalog.v1beta1.Version - */ -class Version extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the version, in the format - * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the version under a product. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The user-supplied description of the version. Maximum of 256 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $description = ''; - /** - * Output only. The asset which has been validated and is ready to be - * provisioned. See - * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. - * - * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $asset = null; - /** - * Output only. The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the version, in the format - * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the version under a product. - * @type string $description - * Output only. The user-supplied description of the version. Maximum of 256 - * characters. - * @type \Google\Protobuf\Struct $asset - * Output only. The asset which has been validated and is ready to be - * provisioned. See - * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the version was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the version was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the version, in the format - * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the version under a product. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the version, in the format - * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. - * A unique identifier for the version under a product. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The user-supplied description of the version. Maximum of 256 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Output only. The user-supplied description of the version. Maximum of 256 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The asset which has been validated and is ready to be - * provisioned. See - * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. - * - * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Struct|null - */ - public function getAsset() - { - return $this->asset; - } - - public function hasAsset() - { - return isset($this->asset); - } - - public function clearAsset() - { - unset($this->asset); - } - - /** - * Output only. The asset which has been validated and is ready to be - * provisioned. See - * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. - * - * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setAsset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->asset = $var; - - return $this; - } - - /** - * Output only. The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php deleted file mode 100644 index 495a69102f5..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php +++ /dev/null @@ -1,80 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privateCatalogClient->searchCatalogs($request); - - /** @var Catalog $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - search_catalogs_sample($resource); -} -// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php deleted file mode 100644 index d60e004977f..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privateCatalogClient->searchProducts($request); - - /** @var Product $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - search_products_sample($resource); -} -// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php deleted file mode 100644 index 1177256e7aa..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php +++ /dev/null @@ -1,86 +0,0 @@ -setResource($resource) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privateCatalogClient->searchVersions($request); - - /** @var Version $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $query = '[QUERY]'; - - search_versions_sample($resource, $query); -} -// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php deleted file mode 100644 index 5667d9a1c8e..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php +++ /dev/null @@ -1,284 +0,0 @@ - searchCatalogsAsync(SearchCatalogsRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchProductsAsync(SearchProductsRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchVersionsAsync(SearchVersionsRequest $request, array $optionalArgs = []) - */ -final class PrivateCatalogClient -{ - use GapicClientTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudprivatecatalog.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * The async variant is {@see PrivateCatalogClient::searchCatalogsAsync()} . - * - * @example samples/V1beta1/PrivateCatalogClient/search_catalogs.php - * - * @param SearchCatalogsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function searchCatalogs(SearchCatalogsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchCatalogs', $request, $callOptions); - } - - /** - * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * The async variant is {@see PrivateCatalogClient::searchProductsAsync()} . - * - * @example samples/V1beta1/PrivateCatalogClient/search_products.php - * - * @param SearchProductsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function searchProducts(SearchProductsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchProducts', $request, $callOptions); - } - - /** - * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * The async variant is {@see PrivateCatalogClient::searchVersionsAsync()} . - * - * @example samples/V1beta1/PrivateCatalogClient/search_versions.php - * - * @param SearchVersionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function searchVersions(SearchVersionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchVersions', $request, $callOptions); - } -} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php deleted file mode 100644 index 971af4c4ea1..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php +++ /dev/null @@ -1,452 +0,0 @@ -searchCatalogs($resource); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $privateCatalogClient->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\PrivateCatalog\V1beta1\Client\PrivateCatalogClient}. - */ -class PrivateCatalogGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; - - /** 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 function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudprivatecatalog.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 - * $apiEndpoint 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); - } - - /** - * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * Sample code: - * ``` - * $privateCatalogClient = new PrivateCatalogClient(); - * try { - * $resource = 'resource'; - * // Iterate over pages of elements - * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $privateCatalogClient->close(); - * } - * ``` - * - * @param string $resource Required. The name of the resource context. It can be in following formats: - * - * * `projects/{project}` - * * `folders/{folder}` - * * `organizations/{organization}` - * @param array $optionalArgs { - * Optional. - * - * @type string $query - * The query to filter the catalogs. The supported queries are: - * - * * Get a single catalog: `name=catalogs/{catalog}` - * @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 searchCatalogs($resource, array $optionalArgs = []) - { - $request = new SearchCatalogsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - 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('SearchCatalogs', $optionalArgs, SearchCatalogsResponse::class, $request); - } - - /** - * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * Sample code: - * ``` - * $privateCatalogClient = new PrivateCatalogClient(); - * try { - * $resource = 'resource'; - * // Iterate over pages of elements - * $pagedResponse = $privateCatalogClient->searchProducts($resource); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $privateCatalogClient->searchProducts($resource); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $privateCatalogClient->close(); - * } - * ``` - * - * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * @param array $optionalArgs { - * Optional. - * - * @type string $query - * The query to filter the products. - * - * The supported queries are: - * * List products of all catalogs: empty - * * List products under a catalog: `parent=catalogs/{catalog}` - * * Get a product by name: - * `name=catalogs/{catalog}/products/{product}` - * @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 searchProducts($resource, array $optionalArgs = []) - { - $request = new SearchProductsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - 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('SearchProducts', $optionalArgs, SearchProductsResponse::class, $request); - } - - /** - * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the - * scope of the consumer cloud resource hierarchy context. - * - * Sample code: - * ``` - * $privateCatalogClient = new PrivateCatalogClient(); - * try { - * $resource = 'resource'; - * $query = 'query'; - * // Iterate over pages of elements - * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $privateCatalogClient->close(); - * } - * ``` - * - * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] - * for details. - * @param string $query Required. The query to filter the versions. - * - * The supported queries are: - * * List versions under a product: - * `parent=catalogs/{catalog}/products/{product}` - * * Get a version by name: - * `name=catalogs/{catalog}/products/{product}/versions/{version}` - * @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 searchVersions($resource, $query, array $optionalArgs = []) - { - $request = new SearchVersionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setQuery($query); - $requestParamHeaders['resource'] = $resource; - 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('SearchVersions', $optionalArgs, SearchVersionsResponse::class, $request); - } -} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php deleted file mode 100644 index cee80c95343..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ - 'SearchCatalogs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCatalogs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchCatalogsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'SearchProducts' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProducts', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchProductsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'SearchVersions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getVersions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchVersionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php deleted file mode 100644 index af11787e28b..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php +++ /dev/null @@ -1,92 +0,0 @@ - [ - 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ - 'SearchCatalogs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*}/catalogs:search', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=organizations/*}/catalogs:search', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=folders/*}/catalogs:search', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SearchProducts' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*}/products:search', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=organizations/*}/products:search', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=folders/*}/products:search', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SearchVersions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*}/versions:search', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=organizations/*}/versions:search', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=folders/*}/versions:search', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php deleted file mode 100644 index ff2d34f19a2..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php +++ /dev/null @@ -1,328 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PrivateCatalogClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PrivateCatalogClient($options); - } - - /** @test */ - public function searchCatalogsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $catalogsElement = new Catalog(); - $catalogs = [ - $catalogsElement, - ]; - $expectedResponse = new SearchCatalogsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCatalogs($catalogs); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new SearchCatalogsRequest()) - ->setResource($resource); - $response = $gapicClient->searchCatalogs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchCatalogsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new SearchCatalogsRequest()) - ->setResource($resource); - try { - $gapicClient->searchCatalogs($request); - // 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 searchProductsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $productsElement = new Product(); - $products = [ - $productsElement, - ]; - $expectedResponse = new SearchProductsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProducts($products); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new SearchProductsRequest()) - ->setResource($resource); - $response = $gapicClient->searchProducts($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchProductsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new SearchProductsRequest()) - ->setResource($resource); - try { - $gapicClient->searchProducts($request); - // 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 searchVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; - $expectedResponse = new SearchVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setVersions($versions); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $query = 'query107944136'; - $request = (new SearchVersionsRequest()) - ->setResource($resource) - ->setQuery($query); - $response = $gapicClient->searchVersions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchVersionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $query = 'query107944136'; - $request = (new SearchVersionsRequest()) - ->setResource($resource) - ->setQuery($query); - try { - $gapicClient->searchVersions($request); - // 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 searchCatalogsAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $catalogsElement = new Catalog(); - $catalogs = [ - $catalogsElement, - ]; - $expectedResponse = new SearchCatalogsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCatalogs($catalogs); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new SearchCatalogsRequest()) - ->setResource($resource); - $response = $gapicClient->searchCatalogsAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php deleted file mode 100644 index 16936fb6b15..00000000000 --- a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php +++ /dev/null @@ -1,274 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PrivateCatalogClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PrivateCatalogClient($options); - } - - /** @test */ - public function searchCatalogsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $catalogsElement = new Catalog(); - $catalogs = [ - $catalogsElement, - ]; - $expectedResponse = new SearchCatalogsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCatalogs($catalogs); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->searchCatalogs($resource); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchCatalogsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - try { - $gapicClient->searchCatalogs($resource); - // 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 searchProductsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $productsElement = new Product(); - $products = [ - $productsElement, - ]; - $expectedResponse = new SearchProductsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProducts($products); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->searchProducts($resource); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchProductsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - try { - $gapicClient->searchProducts($resource); - // 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 searchVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; - $expectedResponse = new SearchVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setVersions($versions); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $query = 'query107944136'; - $response = $gapicClient->searchVersions($resource, $query); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchVersionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $query = 'query107944136'; - try { - $gapicClient->searchVersions($resource, $query); - // 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/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/GPBMetadata/Google/Cloud/Privilegedaccessmanager/V1/Privilegedaccessmanager.php deleted file mode 100644 index f77582a051a69d42ce8def96ff1d24ad08bd978f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16268 zcmc&*U2G%Qb@q@et#ql?YVWSSTE=$hv76l}Hrb_}*x`CN9#YiLS}VyEcjKr;CL{7n z8ZS9BnHg%mStv+?96+xO7ZnPuV--wH`1vvWTa?vsq?yP;cmo0*;V z?k@2&b+_f&P2y)WnZ=FF`bITVURl~!Cdt*CZo855eER@i-y;pH zUME4&vK(uV__>3t!yaYXhzL1Wiv*rkCz<8V;w=(d4J)*2%Zz!gM48t%2Q#nTxq1zu zdeaJm%#c^m1C)V3uf5Z>>zN?5LiqQL9hkObhql$UzXTe%p4qjU0Rdk9@9wspdT6^& zh7xQzb#mq78P1cw`;6y;#;#|ixSLdopupOy6B6ICnzcm|)P36vU4Ii^Efn@h7^$A# zx$!0Fvb`m6)+>>< zP}{kT-a0_#hvL+@cA4|Zvfu!oJ}@|B53Z&!iUBRphDbt9jK_uaN0kS=)Q-#@VMyYI zOUetruom&?Y4NDpF^QZTnS^-hN%0a3L*TQyhFEv;T*kNPIhUdZt1I4+B1Uh7atXx? za&o>`&r!c_2mFEl270`-PwIC!oE_Kl8(^}087t(AZ7>3S6HR)S56YO=GTN2tV&Od_ z@mu2soFAr1J{M48kcGgVD?6bbHc1OO=>L^KPYf9>@E{Bjd=Z@uh<{+$i3!2mZOdWt z7tqwM?NIT8`9vmpC6!;#@{x{R*zA!*W|uhI^gn6nwD^r5pmVm>q9Q>4FdM|NNrTNl zmH+(19X7ja+%niOi)@sYN77kzw&y1P2s+=gg8*i4g6*)Mpe~Ro2`e&-W`t_Y@V-a% z|D8c8MeFz+Izqc zx&GbVrh9LGl1cUH_{;@|&k6>dbrqfK*tf8Q`O_n^?i2!i2KZ%kp=G^k`rNfl>E-iN zjPWHYbEJP6{;5m}ypATQ=aTtpczrfskgp%BKgAfb)VT>?&M%`Ug(So`-)IM+y=&K5 zsxs@Yvup3oBPQ2tV+|zY2k~#JoM91xF`v&@H1tuc(SYK|h4RFNVxS{HX!%f{1oJ5- zL1ionAjb&a>k8{C=ggOR2AzT`Z*P7EhM7+PD1jb7N^E=&odGFLC@8@TT>t*aAwgY< zqejYt#JA)qE05pH%Iskh zr_gD31$3wAquZN{oNl7<-NgIGUnI~Nc@G!Cqu(I)FvvX+zYcRvm-`yrlRpo0paYpK z;l6Tph+o-tn+=Gbxd;5m=p5Euf6sF4FY#(L_dvZIncKpQB3+PADOdV)2=|9!a`%s23(Rw2!6K0ABk=JNkCZ4QIu8%7q#Af0#mgzs&&?$O_x6rf{fa@%k zKY8AK0?kEQH6214BBD&t!4vpn=#m_>-$9cdxBH(2n(Iq(UqG{abx@+5*O-`9a&PIVkJrZ zJaeRw*$VJ3a@I_x=@LpQ_h>~%hgSuC3SEGt%M+GK-t<7~0P& z4P9KbgRrc`43SeFX3>rxL(?AMCuRTu1rvvviN^ey-Vfco#F?kXAP>j*Jeu6Kn*ch@ zpX%I%g>Zd{U*^tzsQ=`<`nNPR-#-b_4BSLrK?c-C>;4yFTauy~+E_T`&Cq01;Ud!{ zIt|jM+78sh^?eH}RG0^(75(c;bZLuNetloz5quEZ4H2$eO#ruKvq9IEsd+ZP6?>*b zWzCitbM8DaE6fwYX#EWc@NZdNw#z`cb2RSl&FP3=Rp58XnKE)&(sq!p}m zwN;`m9;ZCee+^DhV(pk>ZE~20*ndMCIZHax!nAoIDPrO}Qj<7y=rNs*+Zg0~Uo<)} zP$v}Ve+JWCBux^M0n>eGTBY$x8J{^j6^vTi#I6glF`FXK;rh2hrrWHy9UxPWW_TSk zRv6-%>GaVQ!C}rmsQZo(JVvGe>tkqQ*|(hV_ubG#oDhmtLwph!5SI5Fo!*wli&Xx& z-nN3ybTty9jsH~a2-wwS@^xO3{W9&_XGh2zOv`GgypEnr*#0^I_^Kh0xD&EBBs*Y#7dk_J2}QTL3ziR~a9A!r&OCTgBeqM7D+~sU02Mwo zmkr^cCtQRwX9k?BXo5Jjo#VJ!>12yrrmTRgJKU*L`OOoK5k-qzB3QtH&m+Xb0!OEL zzC8||P8(=C@=gj>a}|%o;(0VBeUNrBP?81Eg7JM17Pz5w05fs@PFt2tUqzGLz2cMP z(P`m0@o6^DbmR}Xh%QCG2Kj@z1vOlnrI@^f>IoWk0YGjsj3Jp$0S+cTAYA|qCSt=4 z6>xwF;`=aJz5rM*G;ATUo9T~#A~2BlS$y?alD zhXDW)&-Rq6`u8<-j$#9H7TIzS27gzJi_+C`+Zh2BBtSeQRZPa}d^Y7Nu517r@(&^N>l2x+>DE_AQR2W%MnZ2*MeFcS42k-{Ovshifqc}5F(x`WP( zbpEheD`~p}Ea-R998?1LKb*l@2=f}^!x`@HAXadUs%yN56XlAChhzbTj2Lie6_V(I zdpZ$O|4IU#iwc+n zFZE(CUI2Suv{t~sN}xvvo{+)u+meCw!j;qUyW$~ic=*wOsD16(HlQOfNmyoz%w;b5J1k>Ga| z2>0&|;9_i5^b<>U#&4Sk@em6A2X3u@tKk>bsm0M_Az)ii+c)sbDrszWO8S@Zr&RhF zS{0P|dkNT$>Du+cH)1Qcn@}osEWBL*D=h~E<@J)_KS`orA*SXZY5K^%Ur;xXwiosB0zo&I8~UhGp^F~>7&3p~M$-tZ(MKC|HGZna zS`F2%7r4Slvg-w|H^b2%7Apjj74Mj%U{wRf85sRO!|lv*urE zc^*cUm$D-$y33}vH}eLIseQ~wh%DV4Z|1KJ<`^sFbn(JJOCZ$g=yCibq8%c+GVzZY zsk9>b{Yy_Z5wB+J4W|OX8KGty#vxA4HiQ<#q4gP_=UL|y;Fo1AJ{AvA$)sN6Z*g@~ z3(fvJFDrhc;aAk$KDewHG9_6bEaS4uV+0EpDkB{2XT|BRm` zk=h-xb<}^{RbNDA8b3Tpj1dYA*; zC8%*m6c>9G#$l27Cz>9kQyXTa91_@G*5fv8$1pPVX2|6sU;O2%$hF8&}J} z;J*K^rt=&$j+GWHzR6tB7Pep2mzdj*ZLlh{vd#n27`Cghp&4vC0?}~%g9{POxXS%c zuH2t#!rsPGZUf*ys@WC2bVAKaPDTBChf|!u+6f5-!2|y{ga!pG93eC)R8p_UbRxfl z+BY2?RO;(NSX}rIO|_L+sY{ua&yE~WE#K66{uTkp2Eg4--t_k`yJzB@%H3? zZe;hv&V8A{N@7iXq=Bz?7e_Jn zCEqtbk3Km>Exki7u}?dq!Tvz{`H`P`>`a2^gzoc~qfcj_<)39MUvX1J*{%=xf}6d` LzqCF?hY0;YpF!iu diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php deleted file mode 100644 index cab2cd15588..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/AccessControlEntry.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.AccessControlEntry - */ -class AccessControlEntry extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Users who are allowed for the operation. Each entry should be a - * valid v1 IAM principal identifier. The format for these is documented at: - * https://cloud.google.com/iam/docs/principal-identifiers#v1 - * - * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $principals; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $principals - * Optional. Users who are allowed for the operation. Each entry should be a - * valid v1 IAM principal identifier. The format for these is documented at: - * https://cloud.google.com/iam/docs/principal-identifiers#v1 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Users who are allowed for the operation. Each entry should be a - * valid v1 IAM principal identifier. The format for these is documented at: - * https://cloud.google.com/iam/docs/principal-identifiers#v1 - * - * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPrincipals() - { - return $this->principals; - } - - /** - * Optional. Users who are allowed for the operation. Each entry should be a - * valid v1 IAM principal identifier. The format for these is documented at: - * https://cloud.google.com/iam/docs/principal-identifiers#v1 - * - * Generated from protobuf field repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPrincipals($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->principals = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php deleted file mode 100644 index e6c0ad9942d..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApprovalWorkflow.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow - */ -class ApprovalWorkflow extends \Google\Protobuf\Internal\Message -{ - protected $approval_workflow; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals $manual_approvals - * An approval workflow where users designated as approvers review and act - * on the grants. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * An approval workflow where users designated as approvers review and act - * on the grants. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ManualApprovals manual_approvals = 1; - * @return \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals|null - */ - public function getManualApprovals() - { - return $this->readOneof(1); - } - - public function hasManualApprovals() - { - return $this->hasOneof(1); - } - - /** - * An approval workflow where users designated as approvers review and act - * on the grants. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ManualApprovals manual_approvals = 1; - * @param \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals $var - * @return $this - */ - public function setManualApprovals($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getApprovalWorkflow() - { - return $this->whichOneof("approval_workflow"); - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php deleted file mode 100644 index 4a05d756293..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ApproveGrantRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest - */ -class ApproveGrantRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the grant resource which is being approved. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The reason for approving this grant. This is required if the - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reason = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the grant resource which is being approved. - * @type string $reason - * Optional. The reason for approving this grant. This is required if the - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the grant resource which is being approved. - * - * 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. Name of the grant resource which is being approved. - * - * 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; - } - - /** - * Optional. The reason for approving this grant. This is required if the - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Optional. The reason for approving this grant. This is required if the - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php deleted file mode 100644 index 3d0a9d42614..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest - */ -class CheckOnboardingStatusRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource for which the onboarding status should be checked. - * Should be in one of the following formats: - * * `projects/{project-number|project-id}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `organizations/{organization-number}/locations/{region}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource for which the onboarding status should be checked. - * Should be in one of the following formats: - * * `projects/{project-number|project-id}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `organizations/{organization-number}/locations/{region}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource for which the onboarding status should be checked. - * Should be in one of the following formats: - * * `projects/{project-number|project-id}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `organizations/{organization-number}/locations/{region}` - * - * 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 for which the onboarding status should be checked. - * Should be in one of the following formats: - * * `projects/{project-number|project-id}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `organizations/{organization-number}/locations/{region}` - * - * 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; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php deleted file mode 100644 index cbfa7d281b6..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse - */ -class CheckOnboardingStatusResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The service account that PAM uses to act on this resource. - * - * Generated from protobuf field string service_account = 1; - */ - protected $service_account = ''; - /** - * List of issues that are preventing PAM from functioning for this resource - * and need to be fixed to complete onboarding. Some issues might not be - * detected or reported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; - */ - private $findings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account - * The service account that PAM uses to act on this resource. - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding>|\Google\Protobuf\Internal\RepeatedField $findings - * List of issues that are preventing PAM from functioning for this resource - * and need to be fixed to complete onboarding. Some issues might not be - * detected or reported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The service account that PAM uses to act on this resource. - * - * Generated from protobuf field string service_account = 1; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * The service account that PAM uses to act on this resource. - * - * Generated from protobuf field string service_account = 1; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * List of issues that are preventing PAM from functioning for this resource - * and need to be fixed to complete onboarding. Some issues might not be - * detected or reported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFindings() - { - return $this->findings; - } - - /** - * List of issues that are preventing PAM from functioning for this resource - * and need to be fixed to complete onboarding. Some issues might not be - * detected or reported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding findings = 2; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding::class); - $this->findings = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php deleted file mode 100644 index f492c7e0f48..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding - */ -class Finding extends \Google\Protobuf\Internal\Message -{ - protected $finding_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied $iam_access_denied - * PAM's service account is being denied access by Cloud IAM. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * PAM's service account is being denied access by Cloud IAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied iam_access_denied = 1; - * @return \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied|null - */ - public function getIamAccessDenied() - { - return $this->readOneof(1); - } - - public function hasIamAccessDenied() - { - return $this->hasOneof(1); - } - - /** - * PAM's service account is being denied access by Cloud IAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied iam_access_denied = 1; - * @param \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied $var - * @return $this - */ - public function setIamAccessDenied($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse\Finding\IAMAccessDenied::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getFindingType() - { - return $this->whichOneof("finding_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Finding::class, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse_Finding::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php deleted file mode 100644 index ae3ada03a9e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CheckOnboardingStatusResponse/Finding/IAMAccessDenied.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied - */ -class IAMAccessDenied extends \Google\Protobuf\Internal\Message -{ - /** - * List of permissions that are being denied. - * - * Generated from protobuf field repeated string missing_permissions = 1; - */ - private $missing_permissions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $missing_permissions - * List of permissions that are being denied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * List of permissions that are being denied. - * - * Generated from protobuf field repeated string missing_permissions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMissingPermissions() - { - return $this->missing_permissions; - } - - /** - * List of permissions that are being denied. - * - * Generated from protobuf field repeated string missing_permissions = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMissingPermissions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->missing_permissions = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IAMAccessDenied::class, \Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse_Finding_IAMAccessDenied::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php deleted file mode 100644 index 0fdeca61930..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateEntitlementRequest.php +++ /dev/null @@ -1,289 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest - */ -class CreateEntitlementRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the parent resource for the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `projects/{project-id|project-number}/locations/{region}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The ID to use for this entitlement. This becomes the last part of - * the resource name. - * This value should be 4-63 characters in length, and valid characters are - * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - * This value should be unique among all other entitlements under the - * specified `parent`. - * - * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $entitlement_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $entitlement = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request and returns the - * previous operation's response. This prevents clients from accidentally - * creating duplicate entitlements. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. Name of the parent resource for the entitlement. - * Possible formats: - * - * * `organizations/{organization-number}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `projects/{project-id|project-number}/locations/{region}` - * Please see {@see PrivilegedAccessManagerClient::organizationLocationName()} for help formatting this field. - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement Required. The resource being created - * @param string $entitlementId Required. The ID to use for this entitlement. This becomes the last part of - * the resource name. - * - * This value should be 4-63 characters in length, and valid characters are - * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - * - * This value should be unique among all other entitlements under the - * specified `parent`. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\CreateEntitlementRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement, string $entitlementId): self - { - return (new self()) - ->setParent($parent) - ->setEntitlement($entitlement) - ->setEntitlementId($entitlementId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the parent resource for the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `projects/{project-id|project-number}/locations/{region}` - * @type string $entitlement_id - * Required. The ID to use for this entitlement. This becomes the last part of - * the resource name. - * This value should be 4-63 characters in length, and valid characters are - * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - * This value should be unique among all other entitlements under the - * specified `parent`. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement - * Required. The resource being created - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request and returns the - * previous operation's response. This prevents clients from accidentally - * creating duplicate entitlements. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the parent resource for the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `projects/{project-id|project-number}/locations/{region}` - * - * 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. Name of the parent resource for the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}` - * * `folders/{folder-number}/locations/{region}` - * * `projects/{project-id|project-number}/locations/{region}` - * - * 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 ID to use for this entitlement. This becomes the last part of - * the resource name. - * This value should be 4-63 characters in length, and valid characters are - * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - * This value should be unique among all other entitlements under the - * specified `parent`. - * - * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEntitlementId() - { - return $this->entitlement_id; - } - - /** - * Required. The ID to use for this entitlement. This becomes the last part of - * the resource name. - * This value should be 4-63 characters in length, and valid characters are - * "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - * This value should be unique among all other entitlements under the - * specified `parent`. - * - * Generated from protobuf field string entitlement_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEntitlementId($var) - { - GPBUtil::checkString($var, True); - $this->entitlement_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement|null - */ - public function getEntitlement() - { - return $this->entitlement; - } - - public function hasEntitlement() - { - return isset($this->entitlement); - } - - public function clearEntitlement() - { - unset($this->entitlement); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $var - * @return $this - */ - public function setEntitlement($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); - $this->entitlement = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request and returns the - * previous operation's response. This prevents clients from accidentally - * creating duplicate entitlements. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request and returns the - * previous operation's response. This prevents clients from accidentally - * creating duplicate entitlements. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php deleted file mode 100644 index 6f5feadca9b..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/CreateGrantRequest.php +++ /dev/null @@ -1,206 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.CreateGrantRequest - */ -class CreateGrantRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the parent entitlement for which this grant is being - * requested. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $grant = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. This prevents - * clients from accidentally creating duplicate grants. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. Name of the parent entitlement for which this grant is being - * requested. Please see - * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant Required. The resource being created. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\CreateGrantRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant): self - { - return (new self()) - ->setParent($parent) - ->setGrant($grant); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the parent entitlement for which this grant is being - * requested. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant $grant - * Required. The resource being created. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. This prevents - * clients from accidentally creating duplicate grants. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the parent entitlement for which this grant is being - * requested. - * - * 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. Name of the parent entitlement for which this grant is being - * requested. - * - * 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 resource being created. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant|null - */ - public function getGrant() - { - return $this->grant; - } - - public function hasGrant() - { - return isset($this->grant); - } - - public function clearGrant() - { - unset($this->grant); - } - - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant grant = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant $var - * @return $this - */ - public function setGrant($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); - $this->grant = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. This prevents - * clients from accidentally creating duplicate grants. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. This prevents - * clients from accidentally creating duplicate grants. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php deleted file mode 100644 index bc1fd4bf826..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DeleteEntitlementRequest.php +++ /dev/null @@ -1,193 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest - */ -class DeleteEntitlementRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set to true, any child grant under this entitlement is also - * deleted. (Otherwise, the request only works if the entitlement has no child - * grant.) - * - * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $force = false; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\DeleteEntitlementRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $force - * Optional. If set to true, any child grant under this entitlement is also - * deleted. (Otherwise, the request only works if the entitlement has no child - * grant.) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server knows to - * ignore the request if it has already been completed. The server guarantees - * this for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, ignores the second request. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - - /** - * Optional. If set to true, any child grant under this entitlement is also - * deleted. (Otherwise, the request only works if the entitlement has no child - * grant.) - * - * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Optional. If set to true, any child grant under this entitlement is also - * deleted. (Otherwise, the request only works if the entitlement has no child - * grant.) - * - * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php deleted file mode 100644 index 7167f8ccf2e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/DenyGrantRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.DenyGrantRequest - */ -class DenyGrantRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the grant resource which is being denied. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The reason for denying this grant. This is required if - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reason = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the grant resource which is being denied. - * @type string $reason - * Optional. The reason for denying this grant. This is required if - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the grant resource which is being denied. - * - * 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. Name of the grant resource which is being denied. - * - * 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; - } - - /** - * Optional. The reason for denying this grant. This is required if - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Optional. The reason for denying this grant. This is required if - * `require_approver_justification` field of the `ManualApprovals` workflow - * used in this grant is true. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php deleted file mode 100644 index aa33c4d4f69..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement.php +++ /dev/null @@ -1,531 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement - */ -class Entitlement extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. Name of the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Who can create grants using this entitlement. This list should - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $eligible_users; - /** - * Optional. The approvals needed before access are granted to a requester. No - * approvals are needed if this field is null. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $approval_workflow = null; - /** - * The access granted to a requester on successful approval. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; - */ - protected $privileged_access = null; - /** - * Required. The maximum amount of time that access is granted for a request. - * A requester can ask for a duration less than this, but never more. - * - * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $max_request_duration = null; - /** - * Output only. Current state of this entitlement. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The manner in which the requester should provide a justification - * for requesting access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $requester_justification_config = null; - /** - * Optional. Additional email addresses to be notified based on actions taken. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_notification_targets = null; - /** - * An `etag` is used for optimistic concurrency control as a way to prevent - * simultaneous updates to the same entitlement. An `etag` is returned in the - * response to `GetEntitlement` and the caller should put the `etag` in the - * request to `UpdateEntitlement` so that their change is applied on - * the same version. If this field is omitted or if there is a mismatch while - * updating an entitlement, then the server rejects the request. - * - * Generated from protobuf field string etag = 12; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. Name of the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp. - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $eligible_users - * Optional. Who can create grants using this entitlement. This list should - * contain at most one entry. - * @type \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow $approval_workflow - * Optional. The approvals needed before access are granted to a requester. No - * approvals are needed if this field is null. - * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $privileged_access - * The access granted to a requester on successful approval. - * @type \Google\Protobuf\Duration $max_request_duration - * Required. The maximum amount of time that access is granted for a request. - * A requester can ask for a duration less than this, but never more. - * @type int $state - * Output only. Current state of this entitlement. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig $requester_justification_config - * Required. The manner in which the requester should provide a justification - * for requesting access. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets $additional_notification_targets - * Optional. Additional email addresses to be notified based on actions taken. - * @type string $etag - * An `etag` is used for optimistic concurrency control as a way to prevent - * simultaneous updates to the same entitlement. An `etag` is returned in the - * response to `GetEntitlement` and the caller should put the `etag` in the - * request to `UpdateEntitlement` so that their change is applied on - * the same version. If this field is omitted or if there is a mismatch while - * updating an entitlement, then the server rejects the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. Name of the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. Name of the entitlement. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Who can create grants using this entitlement. This list should - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEligibleUsers() - { - return $this->eligible_users; - } - - /** - * Optional. Who can create grants using this entitlement. This list should - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry eligible_users = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEligibleUsers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry::class); - $this->eligible_users = $arr; - - return $this; - } - - /** - * Optional. The approvals needed before access are granted to a requester. No - * approvals are needed if this field is null. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow|null - */ - public function getApprovalWorkflow() - { - return $this->approval_workflow; - } - - public function hasApprovalWorkflow() - { - return isset($this->approval_workflow); - } - - public function clearApprovalWorkflow() - { - unset($this->approval_workflow); - } - - /** - * Optional. The approvals needed before access are granted to a requester. No - * approvals are needed if this field is null. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow approval_workflow = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow $var - * @return $this - */ - public function setApprovalWorkflow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\ApprovalWorkflow::class); - $this->approval_workflow = $var; - - return $this; - } - - /** - * The access granted to a requester on successful approval. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; - * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess|null - */ - public function getPrivilegedAccess() - { - return $this->privileged_access; - } - - public function hasPrivilegedAccess() - { - return isset($this->privileged_access); - } - - public function clearPrivilegedAccess() - { - unset($this->privileged_access); - } - - /** - * The access granted to a requester on successful approval. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 7; - * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $var - * @return $this - */ - public function setPrivilegedAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess::class); - $this->privileged_access = $var; - - return $this; - } - - /** - * Required. The maximum amount of time that access is granted for a request. - * A requester can ask for a duration less than this, but never more. - * - * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRequestDuration() - { - return $this->max_request_duration; - } - - public function hasMaxRequestDuration() - { - return isset($this->max_request_duration); - } - - public function clearMaxRequestDuration() - { - unset($this->max_request_duration); - } - - /** - * Required. The maximum amount of time that access is granted for a request. - * A requester can ask for a duration less than this, but never more. - * - * Generated from protobuf field .google.protobuf.Duration max_request_duration = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRequestDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_request_duration = $var; - - return $this; - } - - /** - * Output only. Current state of this entitlement. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. Current state of this entitlement. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The manner in which the requester should provide a justification - * for requesting access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig|null - */ - public function getRequesterJustificationConfig() - { - return $this->requester_justification_config; - } - - public function hasRequesterJustificationConfig() - { - return isset($this->requester_justification_config); - } - - public function clearRequesterJustificationConfig() - { - unset($this->requester_justification_config); - } - - /** - * Required. The manner in which the requester should provide a justification - * for requesting access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig requester_justification_config = 10 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig $var - * @return $this - */ - public function setRequesterJustificationConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig::class); - $this->requester_justification_config = $var; - - return $this; - } - - /** - * Optional. Additional email addresses to be notified based on actions taken. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets|null - */ - public function getAdditionalNotificationTargets() - { - return $this->additional_notification_targets; - } - - public function hasAdditionalNotificationTargets() - { - return isset($this->additional_notification_targets); - } - - public function clearAdditionalNotificationTargets() - { - unset($this->additional_notification_targets); - } - - /** - * Optional. Additional email addresses to be notified based on actions taken. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets additional_notification_targets = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets $var - * @return $this - */ - public function setAdditionalNotificationTargets($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\AdditionalNotificationTargets::class); - $this->additional_notification_targets = $var; - - return $this; - } - - /** - * An `etag` is used for optimistic concurrency control as a way to prevent - * simultaneous updates to the same entitlement. An `etag` is returned in the - * response to `GetEntitlement` and the caller should put the `etag` in the - * request to `UpdateEntitlement` so that their change is applied on - * the same version. If this field is omitted or if there is a mismatch while - * updating an entitlement, then the server rejects the request. - * - * Generated from protobuf field string etag = 12; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * An `etag` is used for optimistic concurrency control as a way to prevent - * simultaneous updates to the same entitlement. An `etag` is returned in the - * response to `GetEntitlement` and the caller should put the `etag` in the - * request to `UpdateEntitlement` so that their change is applied on - * the same version. If this field is omitted or if there is a mismatch while - * updating an entitlement, then the server rejects the request. - * - * Generated from protobuf field string etag = 12; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php deleted file mode 100644 index becc9a4668e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/AdditionalNotificationTargets.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets - */ -class AdditionalNotificationTargets extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Additional email addresses to be notified when a principal - * (requester) is granted access. - * - * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $admin_email_recipients; - /** - * Optional. Additional email address to be notified about an eligible - * entitlement. - * - * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $requester_email_recipients; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $admin_email_recipients - * Optional. Additional email addresses to be notified when a principal - * (requester) is granted access. - * @type array|\Google\Protobuf\Internal\RepeatedField $requester_email_recipients - * Optional. Additional email address to be notified about an eligible - * entitlement. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Additional email addresses to be notified when a principal - * (requester) is granted access. - * - * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdminEmailRecipients() - { - return $this->admin_email_recipients; - } - - /** - * Optional. Additional email addresses to be notified when a principal - * (requester) is granted access. - * - * Generated from protobuf field repeated string admin_email_recipients = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdminEmailRecipients($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->admin_email_recipients = $arr; - - return $this; - } - - /** - * Optional. Additional email address to be notified about an eligible - * entitlement. - * - * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRequesterEmailRecipients() - { - return $this->requester_email_recipients; - } - - /** - * Optional. Additional email address to be notified about an eligible - * entitlement. - * - * Generated from protobuf field repeated string requester_email_recipients = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRequesterEmailRecipients($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->requester_email_recipients = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AdditionalNotificationTargets::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_AdditionalNotificationTargets::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php deleted file mode 100644 index 41229f2d65e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig - */ -class RequesterJustificationConfig extends \Google\Protobuf\Internal\Message -{ - protected $justification_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory $not_mandatory - * This option means the requester isn't required to provide a - * justification. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured $unstructured - * This option means the requester must provide a string as - * justification. If this is selected, the server allows the requester - * to provide a justification but doesn't validate it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * This option means the requester isn't required to provide a - * justification. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory not_mandatory = 1; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory|null - */ - public function getNotMandatory() - { - return $this->readOneof(1); - } - - public function hasNotMandatory() - { - return $this->hasOneof(1); - } - - /** - * This option means the requester isn't required to provide a - * justification. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory not_mandatory = 1; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory $var - * @return $this - */ - public function setNotMandatory($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\NotMandatory::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * This option means the requester must provide a string as - * justification. If this is selected, the server allows the requester - * to provide a justification but doesn't validate it. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured unstructured = 2; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured|null - */ - public function getUnstructured() - { - return $this->readOneof(2); - } - - public function hasUnstructured() - { - return $this->hasOneof(2); - } - - /** - * This option means the requester must provide a string as - * justification. If this is selected, the server allows the requester - * to provide a justification but doesn't validate it. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured unstructured = 2; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured $var - * @return $this - */ - public function setUnstructured($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement\RequesterJustificationConfig\Unstructured::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getJustificationType() - { - return $this->whichOneof("justification_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RequesterJustificationConfig::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php deleted file mode 100644 index d129ccbacbe..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/NotMandatory.php +++ /dev/null @@ -1,37 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory - */ -class NotMandatory extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NotMandatory::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig_NotMandatory::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php deleted file mode 100644 index 4c98497f240..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/RequesterJustificationConfig/Unstructured.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured - */ -class Unstructured extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Unstructured::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_RequesterJustificationConfig_Unstructured::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php deleted file mode 100644 index 5a21d5c2b65..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Entitlement/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Entitlement.State - */ -class State -{ - /** - * Unspecified state. This value is never returned by the server. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The entitlement is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The entitlement is available for requesting access. - * - * Generated from protobuf enum AVAILABLE = 2; - */ - const AVAILABLE = 2; - /** - * The entitlement is being deleted. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * The entitlement has been deleted. - * - * Generated from protobuf enum DELETED = 4; - */ - const DELETED = 4; - /** - * The entitlement is being updated. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::AVAILABLE => 'AVAILABLE', - self::DELETING => 'DELETING', - self::DELETED => 'DELETED', - self::UPDATING => 'UPDATING', - ]; - - 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(State::class, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement_State::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php deleted file mode 100644 index 0d9c167a152..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetEntitlementRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest - */ -class GetEntitlementRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\GetEntitlementRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php deleted file mode 100644 index 0ae620397b2..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/GetGrantRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.GetGrantRequest - */ -class GetGrantRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see PrivilegedAccessManagerClient::grantName()} for help formatting this field. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\GetGrantRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php deleted file mode 100644 index a0a8bec2887..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant.php +++ /dev/null @@ -1,560 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant - */ -class Grant extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. Name of this grant. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * The last segment of this name (`{grant-id}`) is autogenerated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Username of the user who created this grant. - * - * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requester = ''; - /** - * Required. The amount of time access is needed for. This value should be - * less than the `max_request_duration` value of the entitlement. - * - * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $requested_duration = null; - /** - * Optional. Justification of why this access is needed. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $justification = null; - /** - * Output only. Current state of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Timeline of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $timeline = null; - /** - * Output only. The access that would be granted by this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $privileged_access = null; - /** - * Output only. Audit trail of access provided by this grant. If unspecified - * then access was never granted. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $audit_trail = null; - /** - * Optional. Additional email addresses to notify for all the actions - * performed on the grant. - * - * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $additional_email_recipients; - /** - * Output only. Flag set by the PAM system to indicate that policy bindings - * made by this grant have been modified from outside PAM. - * After it is set, this flag remains set forever irrespective of the grant - * state. A `true` value here indicates that PAM no longer has any certainty - * on the access a user has because of this grant. - * - * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $externally_modified = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. Name of this grant. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * The last segment of this name (`{grant-id}`) is autogenerated. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp. - * @type string $requester - * Output only. Username of the user who created this grant. - * @type \Google\Protobuf\Duration $requested_duration - * Required. The amount of time access is needed for. This value should be - * less than the `max_request_duration` value of the entitlement. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Justification $justification - * Optional. Justification of why this access is needed. - * @type int $state - * Output only. Current state of this grant. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline $timeline - * Output only. Timeline of this grant. - * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $privileged_access - * Output only. The access that would be granted by this grant. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail $audit_trail - * Output only. Audit trail of access provided by this grant. If unspecified - * then access was never granted. - * @type array|\Google\Protobuf\Internal\RepeatedField $additional_email_recipients - * Optional. Additional email addresses to notify for all the actions - * performed on the grant. - * @type bool $externally_modified - * Output only. Flag set by the PAM system to indicate that policy bindings - * made by this grant have been modified from outside PAM. - * After it is set, this flag remains set forever irrespective of the grant - * state. A `true` value here indicates that PAM no longer has any certainty - * on the access a user has because of this grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. Name of this grant. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * The last segment of this name (`{grant-id}`) is autogenerated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. Name of this grant. - * Possible formats: - * * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - * The last segment of this name (`{grant-id}`) is autogenerated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Username of the user who created this grant. - * - * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRequester() - { - return $this->requester; - } - - /** - * Output only. Username of the user who created this grant. - * - * Generated from protobuf field string requester = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRequester($var) - { - GPBUtil::checkString($var, True); - $this->requester = $var; - - return $this; - } - - /** - * Required. The amount of time access is needed for. This value should be - * less than the `max_request_duration` value of the entitlement. - * - * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getRequestedDuration() - { - return $this->requested_duration; - } - - public function hasRequestedDuration() - { - return isset($this->requested_duration); - } - - public function clearRequestedDuration() - { - unset($this->requested_duration); - } - - /** - * Required. The amount of time access is needed for. This value should be - * less than the `max_request_duration` value of the entitlement. - * - * Generated from protobuf field .google.protobuf.Duration requested_duration = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRequestedDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->requested_duration = $var; - - return $this; - } - - /** - * Optional. Justification of why this access is needed. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Justification|null - */ - public function getJustification() - { - return $this->justification; - } - - public function hasJustification() - { - return isset($this->justification); - } - - public function clearJustification() - { - unset($this->justification); - } - - /** - * Optional. Justification of why this access is needed. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Justification justification = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Justification $var - * @return $this - */ - public function setJustification($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Justification::class); - $this->justification = $var; - - return $this; - } - - /** - * Output only. Current state of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. Current state of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Timeline of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline|null - */ - public function getTimeline() - { - return $this->timeline; - } - - public function hasTimeline() - { - return isset($this->timeline); - } - - public function clearTimeline() - { - unset($this->timeline); - } - - /** - * Output only. Timeline of this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline timeline = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline $var - * @return $this - */ - public function setTimeline($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline::class); - $this->timeline = $var; - - return $this; - } - - /** - * Output only. The access that would be granted by this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess|null - */ - public function getPrivilegedAccess() - { - return $this->privileged_access; - } - - public function hasPrivilegedAccess() - { - return isset($this->privileged_access); - } - - public function clearPrivilegedAccess() - { - unset($this->privileged_access); - } - - /** - * Output only. The access that would be granted by this grant. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess privileged_access = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess $var - * @return $this - */ - public function setPrivilegedAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess::class); - $this->privileged_access = $var; - - return $this; - } - - /** - * Output only. Audit trail of access provided by this grant. If unspecified - * then access was never granted. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail|null - */ - public function getAuditTrail() - { - return $this->audit_trail; - } - - public function hasAuditTrail() - { - return isset($this->audit_trail); - } - - public function clearAuditTrail() - { - unset($this->audit_trail); - } - - /** - * Output only. Audit trail of access provided by this grant. If unspecified - * then access was never granted. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail audit_trail = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail $var - * @return $this - */ - public function setAuditTrail($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\AuditTrail::class); - $this->audit_trail = $var; - - return $this; - } - - /** - * Optional. Additional email addresses to notify for all the actions - * performed on the grant. - * - * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdditionalEmailRecipients() - { - return $this->additional_email_recipients; - } - - /** - * Optional. Additional email addresses to notify for all the actions - * performed on the grant. - * - * Generated from protobuf field repeated string additional_email_recipients = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdditionalEmailRecipients($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->additional_email_recipients = $arr; - - return $this; - } - - /** - * Output only. Flag set by the PAM system to indicate that policy bindings - * made by this grant have been modified from outside PAM. - * After it is set, this flag remains set forever irrespective of the grant - * state. A `true` value here indicates that PAM no longer has any certainty - * on the access a user has because of this grant. - * - * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getExternallyModified() - { - return $this->externally_modified; - } - - /** - * Output only. Flag set by the PAM system to indicate that policy bindings - * made by this grant have been modified from outside PAM. - * After it is set, this flag remains set forever irrespective of the grant - * state. A `true` value here indicates that PAM no longer has any certainty - * on the access a user has because of this grant. - * - * Generated from protobuf field bool externally_modified = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setExternallyModified($var) - { - GPBUtil::checkBool($var); - $this->externally_modified = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php deleted file mode 100644 index b4b424134c6..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/AuditTrail.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail - */ -class AuditTrail extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time at which access was given. - * - * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $access_grant_time = null; - /** - * Output only. The time at which the system removed access. This could be - * because of an automatic expiry or because of a revocation. - * If unspecified, then access hasn't been removed yet. - * - * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $access_remove_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $access_grant_time - * Output only. The time at which access was given. - * @type \Google\Protobuf\Timestamp $access_remove_time - * Output only. The time at which the system removed access. This could be - * because of an automatic expiry or because of a revocation. - * If unspecified, then access hasn't been removed yet. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time at which access was given. - * - * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getAccessGrantTime() - { - return $this->access_grant_time; - } - - public function hasAccessGrantTime() - { - return isset($this->access_grant_time); - } - - public function clearAccessGrantTime() - { - unset($this->access_grant_time); - } - - /** - * Output only. The time at which access was given. - * - * Generated from protobuf field .google.protobuf.Timestamp access_grant_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setAccessGrantTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->access_grant_time = $var; - - return $this; - } - - /** - * Output only. The time at which the system removed access. This could be - * because of an automatic expiry or because of a revocation. - * If unspecified, then access hasn't been removed yet. - * - * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getAccessRemoveTime() - { - return $this->access_remove_time; - } - - public function hasAccessRemoveTime() - { - return isset($this->access_remove_time); - } - - public function clearAccessRemoveTime() - { - unset($this->access_remove_time); - } - - /** - * Output only. The time at which the system removed access. This could be - * because of an automatic expiry or because of a revocation. - * If unspecified, then access hasn't been removed yet. - * - * Generated from protobuf field .google.protobuf.Timestamp access_remove_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setAccessRemoveTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->access_remove_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AuditTrail::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_AuditTrail::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php deleted file mode 100644 index 11c611d4a05..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/State.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.State - */ -class State -{ - /** - * Unspecified state. This value is never returned by the server. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The entitlement had an approval workflow configured and this grant is - * waiting for the workflow to complete. - * - * Generated from protobuf enum APPROVAL_AWAITED = 1; - */ - const APPROVAL_AWAITED = 1; - /** - * The approval workflow completed with a denied result. No access is - * granted for this grant. This is a terminal state. - * - * Generated from protobuf enum DENIED = 3; - */ - const DENIED = 3; - /** - * The approval workflow completed successfully with an approved result or - * none was configured. Access is provided at an appropriate time. - * - * Generated from protobuf enum SCHEDULED = 4; - */ - const SCHEDULED = 4; - /** - * Access is being given. - * - * Generated from protobuf enum ACTIVATING = 5; - */ - const ACTIVATING = 5; - /** - * Access was successfully given and is currently active. - * - * Generated from protobuf enum ACTIVE = 6; - */ - const ACTIVE = 6; - /** - * The system could not give access due to a non-retriable error. This is a - * terminal state. - * - * Generated from protobuf enum ACTIVATION_FAILED = 7; - */ - const ACTIVATION_FAILED = 7; - /** - * Expired after waiting for the approval workflow to complete. This is a - * terminal state. - * - * Generated from protobuf enum EXPIRED = 8; - */ - const EXPIRED = 8; - /** - * Access is being revoked. - * - * Generated from protobuf enum REVOKING = 9; - */ - const REVOKING = 9; - /** - * Access was revoked by a user. This is a terminal state. - * - * Generated from protobuf enum REVOKED = 10; - */ - const REVOKED = 10; - /** - * System took back access as the requested duration was over. This is a - * terminal state. - * - * Generated from protobuf enum ENDED = 11; - */ - const ENDED = 11; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::APPROVAL_AWAITED => 'APPROVAL_AWAITED', - self::DENIED => 'DENIED', - self::SCHEDULED => 'SCHEDULED', - self::ACTIVATING => 'ACTIVATING', - self::ACTIVE => 'ACTIVE', - self::ACTIVATION_FAILED => 'ACTIVATION_FAILED', - self::EXPIRED => 'EXPIRED', - self::REVOKING => 'REVOKING', - self::REVOKED => 'REVOKED', - self::ENDED => 'ENDED', - ]; - - 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(State::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_State::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php deleted file mode 100644 index 3ce375e8dd8..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline - */ -class Timeline extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The events that have occurred on this grant. This list - * contains entries in the same order as they occurred. The first entry is - * always be of type `Requested` and there is always at least one entry in - * this array. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $events; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event>|\Google\Protobuf\Internal\RepeatedField $events - * Output only. The events that have occurred on this grant. This list - * contains entries in the same order as they occurred. The first entry is - * always be of type `Requested` and there is always at least one entry in - * this array. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The events that have occurred on this grant. This list - * contains entries in the same order as they occurred. The first entry is - * always be of type `Requested` and there is always at least one entry in - * this array. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEvents() - { - return $this->events; - } - - /** - * Output only. The events that have occurred on this grant. This list - * contains entries in the same order as they occurred. The first entry is - * always be of type `Requested` and there is always at least one entry in - * this array. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event::class); - $this->events = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Timeline::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php deleted file mode 100644 index c1dfe5b7add..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event.php +++ /dev/null @@ -1,425 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event - */ -class Event extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time (as recorded at server) when this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $event_time = null; - protected $event; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested $requested - * The grant was requested. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved $approved - * The grant was approved. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied $denied - * The grant was denied. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked $revoked - * The grant was revoked. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled $scheduled - * The grant has been scheduled to give access. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated $activated - * The grant was successfully activated to give access. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed $activation_failed - * There was a non-retriable error while trying to give access. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired $expired - * The approval workflow did not complete in the necessary duration, - * and so the grant is expired. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended $ended - * Access given by the grant ended automatically as the approved - * duration was over. - * @type \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified $externally_modified - * The policy bindings made by grant have been modified outside of PAM. - * @type \Google\Protobuf\Timestamp $event_time - * Output only. The time (as recorded at server) when this event occurred. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The grant was requested. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested requested = 2; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested|null - */ - public function getRequested() - { - return $this->readOneof(2); - } - - public function hasRequested() - { - return $this->hasOneof(2); - } - - /** - * The grant was requested. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested requested = 2; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested $var - * @return $this - */ - public function setRequested($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Requested::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The grant was approved. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved approved = 3; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved|null - */ - public function getApproved() - { - return $this->readOneof(3); - } - - public function hasApproved() - { - return $this->hasOneof(3); - } - - /** - * The grant was approved. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved approved = 3; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved $var - * @return $this - */ - public function setApproved($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Approved::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The grant was denied. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied denied = 4; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied|null - */ - public function getDenied() - { - return $this->readOneof(4); - } - - public function hasDenied() - { - return $this->hasOneof(4); - } - - /** - * The grant was denied. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied denied = 4; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied $var - * @return $this - */ - public function setDenied($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Denied::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * The grant was revoked. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked revoked = 5; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked|null - */ - public function getRevoked() - { - return $this->readOneof(5); - } - - public function hasRevoked() - { - return $this->hasOneof(5); - } - - /** - * The grant was revoked. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked revoked = 5; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked $var - * @return $this - */ - public function setRevoked($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Revoked::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The grant has been scheduled to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled scheduled = 6; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled|null - */ - public function getScheduled() - { - return $this->readOneof(6); - } - - public function hasScheduled() - { - return $this->hasOneof(6); - } - - /** - * The grant has been scheduled to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled scheduled = 6; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled $var - * @return $this - */ - public function setScheduled($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Scheduled::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The grant was successfully activated to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated activated = 7; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated|null - */ - public function getActivated() - { - return $this->readOneof(7); - } - - public function hasActivated() - { - return $this->hasOneof(7); - } - - /** - * The grant was successfully activated to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated activated = 7; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated $var - * @return $this - */ - public function setActivated($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Activated::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * There was a non-retriable error while trying to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed activation_failed = 8; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed|null - */ - public function getActivationFailed() - { - return $this->readOneof(8); - } - - public function hasActivationFailed() - { - return $this->hasOneof(8); - } - - /** - * There was a non-retriable error while trying to give access. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed activation_failed = 8; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed $var - * @return $this - */ - public function setActivationFailed($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ActivationFailed::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The approval workflow did not complete in the necessary duration, - * and so the grant is expired. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired expired = 10; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired|null - */ - public function getExpired() - { - return $this->readOneof(10); - } - - public function hasExpired() - { - return $this->hasOneof(10); - } - - /** - * The approval workflow did not complete in the necessary duration, - * and so the grant is expired. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired expired = 10; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired $var - * @return $this - */ - public function setExpired($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Expired::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Access given by the grant ended automatically as the approved - * duration was over. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended ended = 11; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended|null - */ - public function getEnded() - { - return $this->readOneof(11); - } - - public function hasEnded() - { - return $this->hasOneof(11); - } - - /** - * Access given by the grant ended automatically as the approved - * duration was over. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended ended = 11; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended $var - * @return $this - */ - public function setEnded($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\Ended::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * The policy bindings made by grant have been modified outside of PAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified externally_modified = 12; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified|null - */ - public function getExternallyModified() - { - return $this->readOneof(12); - } - - public function hasExternallyModified() - { - return $this->hasOneof(12); - } - - /** - * The policy bindings made by grant have been modified outside of PAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified externally_modified = 12; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified $var - * @return $this - */ - public function setExternallyModified($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Grant\Timeline\Event\ExternallyModified::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Output only. The time (as recorded at server) when this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time (as recorded at server) when this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->event_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getEvent() - { - return $this->whichOneof("event"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Event::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php deleted file mode 100644 index e79a539e178..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Activated.php +++ /dev/null @@ -1,37 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated - */ -class Activated extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Activated::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Activated::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php deleted file mode 100644 index 2b32abb57ea..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ActivationFailed.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed - */ -class ActivationFailed extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The error that occurred while activating the grant. - * - * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $error = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Rpc\Status $error - * Output only. The error that occurred while activating the grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The error that occurred while activating the grant. - * - * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * Output only. The error that occurred while activating the grant. - * - * Generated from protobuf field .google.rpc.Status error = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ActivationFailed::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_ActivationFailed::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php deleted file mode 100644 index a3812c8643e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Approved.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved - */ -class Approved extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The reason provided by the approver for approving the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reason = ''; - /** - * Output only. Username of the user who approved the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $actor = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $reason - * Output only. The reason provided by the approver for approving the - * grant. - * @type string $actor - * Output only. Username of the user who approved the grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The reason provided by the approver for approving the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Output only. The reason provided by the approver for approving the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - - /** - * Output only. Username of the user who approved the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getActor() - { - return $this->actor; - } - - /** - * Output only. Username of the user who approved the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setActor($var) - { - GPBUtil::checkString($var, True); - $this->actor = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Approved::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Approved::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php deleted file mode 100644 index 4d47a1fc4ec..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Denied.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied - */ -class Denied extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The reason provided by the approver for denying the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reason = ''; - /** - * Output only. Username of the user who denied the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $actor = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $reason - * Output only. The reason provided by the approver for denying the - * grant. - * @type string $actor - * Output only. Username of the user who denied the grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The reason provided by the approver for denying the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Output only. The reason provided by the approver for denying the - * grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - - /** - * Output only. Username of the user who denied the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getActor() - { - return $this->actor; - } - - /** - * Output only. Username of the user who denied the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setActor($var) - { - GPBUtil::checkString($var, True); - $this->actor = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Denied::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Denied::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php deleted file mode 100644 index 12539fa8b28..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Ended.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended - */ -class Ended extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Ended::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Ended::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php deleted file mode 100644 index cfe04ff1100..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Expired.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired - */ -class Expired extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Expired::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Expired::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php deleted file mode 100644 index 9a95db356b5..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/ExternallyModified.php +++ /dev/null @@ -1,37 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified - */ -class ExternallyModified extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ExternallyModified::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_ExternallyModified::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php deleted file mode 100644 index e0e0b948ea4..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Requested.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested - */ -class Requested extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time at which this grant expires unless the approval - * workflow completes. If omitted, then the request never expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. The time at which this grant expires unless the approval - * workflow completes. If omitted, then the request never expires. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time at which this grant expires unless the approval - * workflow completes. If omitted, then the request never expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. The time at which this grant expires unless the approval - * workflow completes. If omitted, then the request never expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Requested::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Requested::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php deleted file mode 100644 index 857829bdf5c..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Revoked.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked - */ -class Revoked extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The reason provided by the user for revoking the grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reason = ''; - /** - * Output only. Username of the user who revoked the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $actor = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $reason - * Output only. The reason provided by the user for revoking the grant. - * @type string $actor - * Output only. Username of the user who revoked the grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The reason provided by the user for revoking the grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Output only. The reason provided by the user for revoking the grant. - * - * Generated from protobuf field string reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - - /** - * Output only. Username of the user who revoked the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getActor() - { - return $this->actor; - } - - /** - * Output only. Username of the user who revoked the grant. - * - * Generated from protobuf field string actor = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setActor($var) - { - GPBUtil::checkString($var, True); - $this->actor = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Revoked::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Revoked::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php deleted file mode 100644 index 1105621b35b..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Grant/Timeline/Event/Scheduled.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled - */ -class Scheduled extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time at which the access is granted. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $scheduled_activation_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $scheduled_activation_time - * Output only. The time at which the access is granted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time at which the access is granted. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduledActivationTime() - { - return $this->scheduled_activation_time; - } - - public function hasScheduledActivationTime() - { - return isset($this->scheduled_activation_time); - } - - public function clearScheduledActivationTime() - { - unset($this->scheduled_activation_time); - } - - /** - * Output only. The time at which the access is granted. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_activation_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduledActivationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->scheduled_activation_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Scheduled::class, \Google\Cloud\PrivilegedAccessManager\V1\Grant_Timeline_Event_Scheduled::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php deleted file mode 100644 index 1b5d05d4218..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/Justification.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.Justification - */ -class Justification extends \Google\Protobuf\Internal\Message -{ - protected $justification; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $unstructured_justification - * A free form textual justification. The system only ensures that this - * is not empty. No other kind of validation is performed on the string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * A free form textual justification. The system only ensures that this - * is not empty. No other kind of validation is performed on the string. - * - * Generated from protobuf field string unstructured_justification = 1; - * @return string - */ - public function getUnstructuredJustification() - { - return $this->readOneof(1); - } - - public function hasUnstructuredJustification() - { - return $this->hasOneof(1); - } - - /** - * A free form textual justification. The system only ensures that this - * is not empty. No other kind of validation is performed on the string. - * - * Generated from protobuf field string unstructured_justification = 1; - * @param string $var - * @return $this - */ - public function setUnstructuredJustification($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getJustification() - { - return $this->whichOneof("justification"); - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php deleted file mode 100644 index 73ed3cea30e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest - */ -class ListEntitlementsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent which owns the entitlement resources. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The parent which owns the entitlement resources. Please see - * {@see PrivilegedAccessManagerClient::organizationLocationName()} for help formatting this field. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\ListEntitlementsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent which owns the entitlement resources. - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filtering results. - * @type string $order_by - * Optional. Hint for how to order the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent which owns the entitlement resources. - * - * 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 which owns the entitlement resources. - * - * 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. Requested page size. Server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, the server picks an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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 results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering 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; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php deleted file mode 100644 index 6bd0e6f6811..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListEntitlementsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse - */ -class ListEntitlementsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - */ - private $entitlements; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $entitlements - * The list of entitlements. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntitlements() - { - return $this->entitlements; - } - - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntitlements($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); - $this->entitlements = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php deleted file mode 100644 index 7d6f0c928b2..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ListGrantsRequest - */ -class ListGrantsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource which owns the grants. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The parent resource which owns the grants. Please see - * {@see PrivilegedAccessManagerClient::entitlementName()} for help formatting this field. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\ListGrantsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource which owns the grants. - * @type int $page_size - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filtering results. - * @type string $order_by - * Optional. Hint for how to order the results - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource which owns the grants. - * - * 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 which owns the grants. - * - * 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. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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 results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering 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; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php deleted file mode 100644 index 607290c3055..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ListGrantsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ListGrantsResponse - */ -class ListGrantsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - */ - private $grants; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $grants - * The list of grants. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGrants() - { - return $this->grants; - } - - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGrants($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); - $this->grants = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php deleted file mode 100644 index cb35f1ca66d..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ManualApprovals - */ -class ManualApprovals extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Do the approvers need to provide a justification for their - * actions? - * - * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $require_approver_justification = false; - /** - * Optional. List of approval steps in this workflow. These steps are followed - * in the specified order sequentially. Only 1 step is supported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $steps; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $require_approver_justification - * Optional. Do the approvers need to provide a justification for their - * actions? - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step>|\Google\Protobuf\Internal\RepeatedField $steps - * Optional. List of approval steps in this workflow. These steps are followed - * in the specified order sequentially. Only 1 step is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Do the approvers need to provide a justification for their - * actions? - * - * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRequireApproverJustification() - { - return $this->require_approver_justification; - } - - /** - * Optional. Do the approvers need to provide a justification for their - * actions? - * - * Generated from protobuf field bool require_approver_justification = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRequireApproverJustification($var) - { - GPBUtil::checkBool($var); - $this->require_approver_justification = $var; - - return $this; - } - - /** - * Optional. List of approval steps in this workflow. These steps are followed - * in the specified order sequentially. Only 1 step is supported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSteps() - { - return $this->steps; - } - - /** - * Optional. List of approval steps in this workflow. These steps are followed - * in the specified order sequentially. Only 1 step is supported. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSteps($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals\Step::class); - $this->steps = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php deleted file mode 100644 index db5f51076a5..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/ManualApprovals/Step.php +++ /dev/null @@ -1,154 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step - */ -class Step extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The potential set of approvers in this step. This list must - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $approvers; - /** - * Required. How many users from the above list need to approve. If there - * aren't enough distinct users in the list, then the workflow indefinitely - * blocks. Should always be greater than 0. 1 is the only supported value. - * - * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $approvals_needed = 0; - /** - * Optional. Additional email addresses to be notified when a grant is - * pending approval. - * - * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $approver_email_recipients; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $approvers - * Optional. The potential set of approvers in this step. This list must - * contain at most one entry. - * @type int $approvals_needed - * Required. How many users from the above list need to approve. If there - * aren't enough distinct users in the list, then the workflow indefinitely - * blocks. Should always be greater than 0. 1 is the only supported value. - * @type array|\Google\Protobuf\Internal\RepeatedField $approver_email_recipients - * Optional. Additional email addresses to be notified when a grant is - * pending approval. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The potential set of approvers in this step. This list must - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getApprovers() - { - return $this->approvers; - } - - /** - * Optional. The potential set of approvers in this step. This list must - * contain at most one entry. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setApprovers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry::class); - $this->approvers = $arr; - - return $this; - } - - /** - * Required. How many users from the above list need to approve. If there - * aren't enough distinct users in the list, then the workflow indefinitely - * blocks. Should always be greater than 0. 1 is the only supported value. - * - * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getApprovalsNeeded() - { - return $this->approvals_needed; - } - - /** - * Required. How many users from the above list need to approve. If there - * aren't enough distinct users in the list, then the workflow indefinitely - * blocks. Should always be greater than 0. 1 is the only supported value. - * - * Generated from protobuf field int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setApprovalsNeeded($var) - { - GPBUtil::checkInt32($var); - $this->approvals_needed = $var; - - return $this; - } - - /** - * Optional. Additional email addresses to be notified when a grant is - * pending approval. - * - * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getApproverEmailRecipients() - { - return $this->approver_email_recipients; - } - - /** - * Optional. Additional email addresses to be notified when a grant is - * pending approval. - * - * Generated from protobuf field repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setApproverEmailRecipients($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->approver_email_recipients = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Step::class, \Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals_Step::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php deleted file mode 100644 index 1bae5490fa1..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php deleted file mode 100644 index 6c6c444a62b..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.PrivilegedAccess - */ -class PrivilegedAccess extends \Google\Protobuf\Internal\Message -{ - protected $access_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess $gcp_iam_access - * Access to a Google Cloud resource through IAM. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Access to a Google Cloud resource through IAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess gcp_iam_access = 1; - * @return \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess|null - */ - public function getGcpIamAccess() - { - return $this->readOneof(1); - } - - public function hasGcpIamAccess() - { - return $this->hasOneof(1); - } - - /** - * Access to a Google Cloud resource through IAM. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess gcp_iam_access = 1; - * @param \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess $var - * @return $this - */ - public function setGcpIamAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getAccessType() - { - return $this->whichOneof("access_type"); - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php deleted file mode 100644 index c0bf5e33ec2..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess - */ -class GcpIamAccess extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The type of this resource. - * - * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource_type = ''; - /** - * Required. Name of the resource. - * - * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource = ''; - /** - * Required. Role bindings that are created on successful grant. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $role_bindings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource_type - * Required. The type of this resource. - * @type string $resource - * Required. Name of the resource. - * @type array<\Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding>|\Google\Protobuf\Internal\RepeatedField $role_bindings - * Required. Role bindings that are created on successful grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The type of this resource. - * - * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Required. The type of this resource. - * - * Generated from protobuf field string resource_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkString($var, True); - $this->resource_type = $var; - - return $this; - } - - /** - * Required. Name of the resource. - * - * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. Name of the resource. - * - * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Required. Role bindings that are created on successful grant. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRoleBindings() - { - return $this->role_bindings; - } - - /** - * Required. Role bindings that are created on successful grant. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding role_bindings = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRoleBindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess\RoleBinding::class); - $this->role_bindings = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GcpIamAccess::class, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess_GcpIamAccess::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php deleted file mode 100644 index ac25ba237a7..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/PrivilegedAccess/GcpIamAccess/RoleBinding.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding - */ -class RoleBinding extends \Google\Protobuf\Internal\Message -{ - /** - * Required. IAM role to be granted. - * https://cloud.google.com/iam/docs/roles-overview. - * - * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $role = ''; - /** - * Optional. The expression field of the IAM condition to be associated - * with the role. If specified, a user with an active grant for this - * entitlement is able to access the resource only if this condition - * evaluates to true for their request. - * This field uses the same CEL format as IAM and supports all attributes - * that IAM supports, except tags. - * https://cloud.google.com/iam/docs/conditions-overview#attributes. - * - * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $condition_expression = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $role - * Required. IAM role to be granted. - * https://cloud.google.com/iam/docs/roles-overview. - * @type string $condition_expression - * Optional. The expression field of the IAM condition to be associated - * with the role. If specified, a user with an active grant for this - * entitlement is able to access the resource only if this condition - * evaluates to true for their request. - * This field uses the same CEL format as IAM and supports all attributes - * that IAM supports, except tags. - * https://cloud.google.com/iam/docs/conditions-overview#attributes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. IAM role to be granted. - * https://cloud.google.com/iam/docs/roles-overview. - * - * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRole() - { - return $this->role; - } - - /** - * Required. IAM role to be granted. - * https://cloud.google.com/iam/docs/roles-overview. - * - * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkString($var, True); - $this->role = $var; - - return $this; - } - - /** - * Optional. The expression field of the IAM condition to be associated - * with the role. If specified, a user with an active grant for this - * entitlement is able to access the resource only if this condition - * evaluates to true for their request. - * This field uses the same CEL format as IAM and supports all attributes - * that IAM supports, except tags. - * https://cloud.google.com/iam/docs/conditions-overview#attributes. - * - * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getConditionExpression() - { - return $this->condition_expression; - } - - /** - * Optional. The expression field of the IAM condition to be associated - * with the role. If specified, a user with an active grant for this - * entitlement is able to access the resource only if this condition - * evaluates to true for their request. - * This field uses the same CEL format as IAM and supports all attributes - * that IAM supports, except tags. - * https://cloud.google.com/iam/docs/conditions-overview#attributes. - * - * Generated from protobuf field string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setConditionExpression($var) - { - GPBUtil::checkString($var, True); - $this->condition_expression = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RoleBinding::class, \Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess_GcpIamAccess_RoleBinding::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php deleted file mode 100644 index 3dfd782de7b..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/RevokeGrantRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest - */ -class RevokeGrantRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the grant resource which is being revoked. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The reason for revoking this grant. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reason = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the grant resource which is being revoked. - * @type string $reason - * Optional. The reason for revoking this grant. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the grant resource which is being revoked. - * - * 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. Name of the grant resource which is being revoked. - * - * 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; - } - - /** - * Optional. The reason for revoking this grant. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Optional. The reason for revoking this grant. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php deleted file mode 100644 index 90961a6c953..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest.php +++ /dev/null @@ -1,215 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest - */ -class SearchEntitlementsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent which owns the entitlement resources. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Only entitlements where the calling user has this access are - * returned. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $caller_access_type = 0; - /** - * Optional. Only entitlements matching this filter are returned in the - * response. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.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 which owns the entitlement resources. - * @type int $caller_access_type - * Required. Only entitlements where the calling user has this access are - * returned. - * @type string $filter - * Optional. Only entitlements matching this filter are returned in the - * response. - * @type int $page_size - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent which owns the entitlement resources. - * - * 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 which owns the entitlement resources. - * - * 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. Only entitlements where the calling user has this access are - * returned. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getCallerAccessType() - { - return $this->caller_access_type; - } - - /** - * Required. Only entitlements where the calling user has this access are - * returned. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType caller_access_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setCallerAccessType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsRequest\CallerAccessType::class); - $this->caller_access_type = $var; - - return $this; - } - - /** - * Optional. Only entitlements matching this filter are returned in the - * response. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only entitlements matching this filter are returned in the - * response. - * - * 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. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, the server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php deleted file mode 100644 index 2c00d9d5925..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsRequest/CallerAccessType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType - */ -class CallerAccessType -{ - /** - * Unspecified access type. - * - * Generated from protobuf enum CALLER_ACCESS_TYPE_UNSPECIFIED = 0; - */ - const CALLER_ACCESS_TYPE_UNSPECIFIED = 0; - /** - * The user has access to create grants using this entitlement. - * - * Generated from protobuf enum GRANT_REQUESTER = 1; - */ - const GRANT_REQUESTER = 1; - /** - * The user has access to approve/deny grants created under this - * entitlement. - * - * Generated from protobuf enum GRANT_APPROVER = 2; - */ - const GRANT_APPROVER = 2; - - private static $valueToName = [ - self::CALLER_ACCESS_TYPE_UNSPECIFIED => 'CALLER_ACCESS_TYPE_UNSPECIFIED', - self::GRANT_REQUESTER => 'GRANT_REQUESTER', - self::GRANT_APPROVER => 'GRANT_APPROVER', - ]; - - 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(CallerAccessType::class, \Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsRequest_CallerAccessType::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php deleted file mode 100644 index d9db5ec0e7b..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchEntitlementsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse - */ -class SearchEntitlementsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - */ - private $entitlements; - /** - * A token identifying a page of results the server should return. - * - * 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\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $entitlements - * The list of entitlements. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntitlements() - { - return $this->entitlements; - } - - /** - * The list of entitlements. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Entitlement entitlements = 1; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Entitlement>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntitlements($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); - $this->entitlements = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php deleted file mode 100644 index 23a63d14ac2..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest.php +++ /dev/null @@ -1,211 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest - */ -class SearchGrantsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent which owns the grant resources. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Only grants which the caller is related to by this relationship - * are returned in the response. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $caller_relationship = 0; - /** - * Optional. Only grants matching this filter are returned in the response. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.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 which owns the grant resources. - * @type int $caller_relationship - * Required. Only grants which the caller is related to by this relationship - * are returned in the response. - * @type string $filter - * Optional. Only grants matching this filter are returned in the response. - * @type int $page_size - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, server picks an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent which owns the grant resources. - * - * 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 which owns the grant resources. - * - * 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. Only grants which the caller is related to by this relationship - * are returned in the response. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getCallerRelationship() - { - return $this->caller_relationship; - } - - /** - * Required. Only grants which the caller is related to by this relationship - * are returned in the response. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType caller_relationship = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setCallerRelationship($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsRequest\CallerRelationshipType::class); - $this->caller_relationship = $var; - - return $this; - } - - /** - * Optional. Only grants matching this filter are returned in the response. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only grants matching this filter are returned in the response. - * - * 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. Requested page size. The server may return fewer items than - * requested. If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. The server may return fewer items than - * requested. If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 5 [(.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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php deleted file mode 100644 index 418d3d22d20..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsRequest/CallerRelationshipType.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType - */ -class CallerRelationshipType -{ - /** - * Unspecified caller relationship type. - * - * Generated from protobuf enum CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0; - */ - const CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0; - /** - * The user created this grant by calling `CreateGrant` earlier. - * - * Generated from protobuf enum HAD_CREATED = 1; - */ - const HAD_CREATED = 1; - /** - * The user is an approver for the entitlement that this grant is parented - * under and can currently approve/deny it. - * - * Generated from protobuf enum CAN_APPROVE = 2; - */ - const CAN_APPROVE = 2; - /** - * The caller had successfully approved/denied this grant earlier. - * - * Generated from protobuf enum HAD_APPROVED = 3; - */ - const HAD_APPROVED = 3; - - private static $valueToName = [ - self::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED => 'CALLER_RELATIONSHIP_TYPE_UNSPECIFIED', - self::HAD_CREATED => 'HAD_CREATED', - self::CAN_APPROVE => 'CAN_APPROVE', - self::HAD_APPROVED => 'HAD_APPROVED', - ]; - - 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(CallerRelationshipType::class, \Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsRequest_CallerRelationshipType::class); - diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php deleted file mode 100644 index a1ae7f8fcf1..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/SearchGrantsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse - */ -class SearchGrantsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - */ - private $grants; - /** - * A token identifying a page of results the server should return. - * - * 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\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $grants - * The list of grants. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGrants() - { - return $this->grants; - } - - /** - * The list of grants. - * - * Generated from protobuf field repeated .google.cloud.privilegedaccessmanager.v1.Grant grants = 1; - * @param array<\Google\Cloud\PrivilegedAccessManager\V1\Grant>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGrants($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\Grant::class); - $this->grants = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php b/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php deleted file mode 100644 index 00995c2e21d..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/proto/src/Google/Cloud/PrivilegedAccessManager/V1/UpdateEntitlementRequest.php +++ /dev/null @@ -1,176 +0,0 @@ -google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest - */ -class UpdateEntitlementRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The entitlement resource that is updated. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $entitlement = null; - /** - * Required. The list of fields to update. A field is overwritten if, and only - * if, it is in the mask. Any immutable fields set in the mask are ignored by - * the server. Repeated fields and map fields are only allowed in the last - * position of a `paths` string and overwrite the existing values. Hence an - * update to a repeated field or a map should contain the entire list of - * values. The fields specified in the update_mask are relative to the - * resource and not to the request. - * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - * A value of '*' for this field refers to full replacement of the resource. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement Required. The entitlement resource that is updated. - * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. A field is overwritten if, and only - * if, it is in the mask. Any immutable fields set in the mask are ignored by - * the server. Repeated fields and map fields are only allowed in the last - * position of a `paths` string and overwrite the existing values. Hence an - * update to a repeated field or a map should contain the entire list of - * values. The fields specified in the update_mask are relative to the - * resource and not to the request. - * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - * A value of '*' for this field refers to full replacement of the resource. - * - * @return \Google\Cloud\PrivilegedAccessManager\V1\UpdateEntitlementRequest - * - * @experimental - */ - public static function build(\Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setEntitlement($entitlement) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $entitlement - * Required. The entitlement resource that is updated. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The list of fields to update. A field is overwritten if, and only - * if, it is in the mask. Any immutable fields set in the mask are ignored by - * the server. Repeated fields and map fields are only allowed in the last - * position of a `paths` string and overwrite the existing values. Hence an - * update to a repeated field or a map should contain the entire list of - * values. The fields specified in the update_mask are relative to the - * resource and not to the request. - * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - * A value of '*' for this field refers to full replacement of the resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce(); - parent::__construct($data); - } - - /** - * Required. The entitlement resource that is updated. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PrivilegedAccessManager\V1\Entitlement|null - */ - public function getEntitlement() - { - return $this->entitlement; - } - - public function hasEntitlement() - { - return isset($this->entitlement); - } - - public function clearEntitlement() - { - unset($this->entitlement); - } - - /** - * Required. The entitlement resource that is updated. - * - * Generated from protobuf field .google.cloud.privilegedaccessmanager.v1.Entitlement entitlement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PrivilegedAccessManager\V1\Entitlement $var - * @return $this - */ - public function setEntitlement($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PrivilegedAccessManager\V1\Entitlement::class); - $this->entitlement = $var; - - return $this; - } - - /** - * Required. The list of fields to update. A field is overwritten if, and only - * if, it is in the mask. Any immutable fields set in the mask are ignored by - * the server. Repeated fields and map fields are only allowed in the last - * position of a `paths` string and overwrite the existing values. Hence an - * update to a repeated field or a map should contain the entire list of - * values. The fields specified in the update_mask are relative to the - * resource and not to the request. - * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - * A value of '*' for this field refers to full replacement of the resource. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. The list of fields to update. A field is overwritten if, and only - * if, it is in the mask. Any immutable fields set in the mask are ignored by - * the server. Repeated fields and map fields are only allowed in the last - * position of a `paths` string and overwrite the existing values. Hence an - * update to a repeated field or a map should contain the entire list of - * values. The fields specified in the update_mask are relative to the - * resource and not to the request. - * (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - * A value of '*' for this field refers to full replacement of the resource. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php deleted file mode 100644 index 05834ac27ac..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/approve_grant.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Grant $response */ - $response = $privilegedAccessManagerClient->approveGrant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::grantName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]', - '[GRANT]' - ); - - approve_grant_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php deleted file mode 100644 index 27397e94e9e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var CheckOnboardingStatusResponse $response */ - $response = $privilegedAccessManagerClient->checkOnboardingStatus($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( - '[ORGANIZATION]', - '[LOCATION]' - ); - - check_onboarding_status_sample($formattedParent); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php deleted file mode 100644 index a0fe55e1571..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_entitlement.php +++ /dev/null @@ -1,110 +0,0 @@ -setMaxRequestDuration($entitlementMaxRequestDuration) - ->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $request = (new CreateEntitlementRequest()) - ->setParent($formattedParent) - ->setEntitlementId($entitlementId) - ->setEntitlement($entitlement); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $privilegedAccessManagerClient->createEntitlement($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Entitlement $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( - '[ORGANIZATION]', - '[LOCATION]' - ); - $entitlementId = '[ENTITLEMENT_ID]'; - - create_entitlement_sample($formattedParent, $entitlementId); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php deleted file mode 100644 index 17db7704940..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/create_grant.php +++ /dev/null @@ -1,82 +0,0 @@ -setRequestedDuration($grantRequestedDuration); - $request = (new CreateGrantRequest()) - ->setParent($formattedParent) - ->setGrant($grant); - - // Call the API and handle any network failures. - try { - /** @var Grant $response */ - $response = $privilegedAccessManagerClient->createGrant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::entitlementName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]' - ); - - create_grant_sample($formattedParent); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php deleted file mode 100644 index cd0537c801a..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $privilegedAccessManagerClient->deleteEntitlement($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Entitlement $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::entitlementName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]' - ); - - delete_entitlement_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php deleted file mode 100644 index 974f96ea468..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/deny_grant.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Grant $response */ - $response = $privilegedAccessManagerClient->denyGrant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::grantName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]', - '[GRANT]' - ); - - deny_grant_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php deleted file mode 100644 index c878c1ad474..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_entitlement.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Entitlement $response */ - $response = $privilegedAccessManagerClient->getEntitlement($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::entitlementName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]' - ); - - get_entitlement_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php deleted file mode 100644 index a9e743f430e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_grant.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Grant $response */ - $response = $privilegedAccessManagerClient->getGrant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::grantName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]', - '[GRANT]' - ); - - get_grant_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php deleted file mode 100644 index b02af6346a3..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetLocation_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php deleted file mode 100644 index 114740d454e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_entitlements.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privilegedAccessManagerClient->listEntitlements($request); - - /** @var Entitlement $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( - '[ORGANIZATION]', - '[LOCATION]' - ); - - list_entitlements_sample($formattedParent); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php deleted file mode 100644 index 66ca9108974..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_grants.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privilegedAccessManagerClient->listGrants($request); - - /** @var Grant $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::entitlementName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]' - ); - - list_grants_sample($formattedParent); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php deleted file mode 100644 index 70df0f2bbf5..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListLocations_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php deleted file mode 100644 index b1a0fc69e1f..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/revoke_grant.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $privilegedAccessManagerClient->revokeGrant($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Grant $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PrivilegedAccessManagerClient::grantName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]', - '[GRANT]' - ); - - revoke_grant_sample($formattedName); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php deleted file mode 100644 index cc8638429b2..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_entitlements.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($formattedParent) - ->setCallerAccessType($callerAccessType); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privilegedAccessManagerClient->searchEntitlements($request); - - /** @var Entitlement $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::organizationLocationName( - '[ORGANIZATION]', - '[LOCATION]' - ); - $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; - - search_entitlements_sample($formattedParent, $callerAccessType); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php deleted file mode 100644 index 8fe879c7997..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/search_grants.php +++ /dev/null @@ -1,86 +0,0 @@ -setParent($formattedParent) - ->setCallerRelationship($callerRelationship); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $privilegedAccessManagerClient->searchGrants($request); - - /** @var Grant $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PrivilegedAccessManagerClient::entitlementName( - '[PROJECT]', - '[LOCATION]', - '[ENTITLEMENT]' - ); - $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; - - search_grants_sample($formattedParent, $callerRelationship); -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php b/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php deleted file mode 100644 index 8fb6bacf144..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/samples/V1/PrivilegedAccessManagerClient/update_entitlement.php +++ /dev/null @@ -1,99 +0,0 @@ -setMaxRequestDuration($entitlementMaxRequestDuration) - ->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $updateMask = new FieldMask(); - $request = (new UpdateEntitlementRequest()) - ->setEntitlement($entitlement) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $privilegedAccessManagerClient->updateEntitlement($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Entitlement $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php deleted file mode 100644 index 6ea2e6dafe7..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/Client/PrivilegedAccessManagerClient.php +++ /dev/null @@ -1,982 +0,0 @@ - approveGrantAsync(ApproveGrantRequest $request, array $optionalArgs = []) - * @method PromiseInterface checkOnboardingStatusAsync(CheckOnboardingStatusRequest $request, array $optionalArgs = []) - * @method PromiseInterface createEntitlementAsync(CreateEntitlementRequest $request, array $optionalArgs = []) - * @method PromiseInterface createGrantAsync(CreateGrantRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteEntitlementAsync(DeleteEntitlementRequest $request, array $optionalArgs = []) - * @method PromiseInterface denyGrantAsync(DenyGrantRequest $request, array $optionalArgs = []) - * @method PromiseInterface getEntitlementAsync(GetEntitlementRequest $request, array $optionalArgs = []) - * @method PromiseInterface getGrantAsync(GetGrantRequest $request, array $optionalArgs = []) - * @method PromiseInterface listEntitlementsAsync(ListEntitlementsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listGrantsAsync(ListGrantsRequest $request, array $optionalArgs = []) - * @method PromiseInterface revokeGrantAsync(RevokeGrantRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchEntitlementsAsync(SearchEntitlementsRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchGrantsAsync(SearchGrantsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateEntitlementAsync(UpdateEntitlementRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class PrivilegedAccessManagerClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'privilegedaccessmanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'privilegedaccessmanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/privileged_access_manager_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/privileged_access_manager_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/privileged_access_manager_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/privileged_access_manager_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a entitlement - * resource. - * - * @param string $project - * @param string $location - * @param string $entitlement - * - * @return string The formatted entitlement resource. - */ - public static function entitlementName(string $project, string $location, string $entitlement): string - { - return self::getPathTemplate('entitlement')->render([ - 'project' => $project, - 'location' => $location, - 'entitlement' => $entitlement, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location resource. - * - * @param string $folder - * @param string $location - * - * @return string The formatted folder_location resource. - */ - public static function folderLocationName(string $folder, string $location): string - { - return self::getPathTemplate('folderLocation')->render([ - 'folder' => $folder, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_entitlement resource. - * - * @param string $folder - * @param string $location - * @param string $entitlement - * - * @return string The formatted folder_location_entitlement resource. - */ - public static function folderLocationEntitlementName(string $folder, string $location, string $entitlement): string - { - return self::getPathTemplate('folderLocationEntitlement')->render([ - 'folder' => $folder, - 'location' => $location, - 'entitlement' => $entitlement, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_entitlement_grant resource. - * - * @param string $folder - * @param string $location - * @param string $entitlement - * @param string $grant - * - * @return string The formatted folder_location_entitlement_grant resource. - */ - public static function folderLocationEntitlementGrantName(string $folder, string $location, string $entitlement, string $grant): string - { - return self::getPathTemplate('folderLocationEntitlementGrant')->render([ - 'folder' => $folder, - 'location' => $location, - 'entitlement' => $entitlement, - 'grant' => $grant, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a grant - * resource. - * - * @param string $project - * @param string $location - * @param string $entitlement - * @param string $grant - * - * @return string The formatted grant resource. - */ - public static function grantName(string $project, string $location, string $entitlement, string $grant): string - { - return self::getPathTemplate('grant')->render([ - 'project' => $project, - 'location' => $location, - 'entitlement' => $entitlement, - 'grant' => $grant, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location resource. - * - * @param string $organization - * @param string $location - * - * @return string The formatted organization_location resource. - */ - public static function organizationLocationName(string $organization, string $location): string - { - return self::getPathTemplate('organizationLocation')->render([ - 'organization' => $organization, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_entitlement resource. - * - * @param string $organization - * @param string $location - * @param string $entitlement - * - * @return string The formatted organization_location_entitlement resource. - */ - public static function organizationLocationEntitlementName(string $organization, string $location, string $entitlement): string - { - return self::getPathTemplate('organizationLocationEntitlement')->render([ - 'organization' => $organization, - 'location' => $location, - 'entitlement' => $entitlement, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_entitlement_grant resource. - * - * @param string $organization - * @param string $location - * @param string $entitlement - * @param string $grant - * - * @return string The formatted organization_location_entitlement_grant resource. - */ - public static function organizationLocationEntitlementGrantName(string $organization, string $location, string $entitlement, string $grant): string - { - return self::getPathTemplate('organizationLocationEntitlementGrant')->render([ - 'organization' => $organization, - 'location' => $location, - 'entitlement' => $entitlement, - 'grant' => $grant, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_entitlement resource. - * - * @param string $project - * @param string $location - * @param string $entitlement - * - * @return string The formatted project_location_entitlement resource. - */ - public static function projectLocationEntitlementName(string $project, string $location, string $entitlement): string - { - return self::getPathTemplate('projectLocationEntitlement')->render([ - 'project' => $project, - 'location' => $location, - 'entitlement' => $entitlement, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_entitlement_grant resource. - * - * @param string $project - * @param string $location - * @param string $entitlement - * @param string $grant - * - * @return string The formatted project_location_entitlement_grant resource. - */ - public static function projectLocationEntitlementGrantName(string $project, string $location, string $entitlement, string $grant): string - { - return self::getPathTemplate('projectLocationEntitlementGrant')->render([ - 'project' => $project, - 'location' => $location, - 'entitlement' => $entitlement, - 'grant' => $grant, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - entitlement: projects/{project}/locations/{location}/entitlements/{entitlement} - * - folderLocation: folders/{folder}/locations/{location} - * - folderLocationEntitlement: folders/{folder}/locations/{location}/entitlements/{entitlement} - * - folderLocationEntitlementGrant: folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant} - * - grant: projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant} - * - location: projects/{project}/locations/{location} - * - organizationLocation: organizations/{organization}/locations/{location} - * - organizationLocationEntitlement: organizations/{organization}/locations/{location}/entitlements/{entitlement} - * - organizationLocationEntitlementGrant: organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant} - * - projectLocationEntitlement: projects/{project}/locations/{location}/entitlements/{entitlement} - * - projectLocationEntitlementGrant: projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'privilegedaccessmanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * `ApproveGrant` is used to approve a grant. This method can only be called - * on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't - * be undone. - * - * The async variant is {@see PrivilegedAccessManagerClient::approveGrantAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/approve_grant.php - * - * @param ApproveGrantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Grant - * - * @throws ApiException Thrown if the API call fails. - */ - public function approveGrant(ApproveGrantRequest $request, array $callOptions = []): Grant - { - return $this->startApiCall('ApproveGrant', $request, $callOptions)->wait(); - } - - /** - * `CheckOnboardingStatus` reports the onboarding status for a - * project/folder/organization. Any findings reported by this API need to be - * fixed before PAM can be used on the resource. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::checkOnboardingStatusAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/check_onboarding_status.php - * - * @param CheckOnboardingStatusRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CheckOnboardingStatusResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function checkOnboardingStatus(CheckOnboardingStatusRequest $request, array $callOptions = []): CheckOnboardingStatusResponse - { - return $this->startApiCall('CheckOnboardingStatus', $request, $callOptions)->wait(); - } - - /** - * Creates a new entitlement in a given project/folder/organization and - * location. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::createEntitlementAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/create_entitlement.php - * - * @param CreateEntitlementRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createEntitlement(CreateEntitlementRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateEntitlement', $request, $callOptions)->wait(); - } - - /** - * Creates a new grant in a given project/folder/organization and - * location. - * - * The async variant is {@see PrivilegedAccessManagerClient::createGrantAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/create_grant.php - * - * @param CreateGrantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Grant - * - * @throws ApiException Thrown if the API call fails. - */ - public function createGrant(CreateGrantRequest $request, array $callOptions = []): Grant - { - return $this->startApiCall('CreateGrant', $request, $callOptions)->wait(); - } - - /** - * Deletes a single entitlement. This method can only be called when there - * are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the - * entitlement. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::deleteEntitlementAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/delete_entitlement.php - * - * @param DeleteEntitlementRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteEntitlement(DeleteEntitlementRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteEntitlement', $request, $callOptions)->wait(); - } - - /** - * `DenyGrant` is used to deny a grant. This method can only be called on a - * grant when it's in the `APPROVAL_AWAITED` state. This operation can't be - * undone. - * - * The async variant is {@see PrivilegedAccessManagerClient::denyGrantAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/deny_grant.php - * - * @param DenyGrantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Grant - * - * @throws ApiException Thrown if the API call fails. - */ - public function denyGrant(DenyGrantRequest $request, array $callOptions = []): Grant - { - return $this->startApiCall('DenyGrant', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single entitlement. - * - * The async variant is {@see PrivilegedAccessManagerClient::getEntitlementAsync()} - * . - * - * @example samples/V1/PrivilegedAccessManagerClient/get_entitlement.php - * - * @param GetEntitlementRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Entitlement - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEntitlement(GetEntitlementRequest $request, array $callOptions = []): Entitlement - { - return $this->startApiCall('GetEntitlement', $request, $callOptions)->wait(); - } - - /** - * Get details of a single grant. - * - * The async variant is {@see PrivilegedAccessManagerClient::getGrantAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/get_grant.php - * - * @param GetGrantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Grant - * - * @throws ApiException Thrown if the API call fails. - */ - public function getGrant(GetGrantRequest $request, array $callOptions = []): Grant - { - return $this->startApiCall('GetGrant', $request, $callOptions)->wait(); - } - - /** - * Lists entitlements in a given project/folder/organization and location. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::listEntitlementsAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/list_entitlements.php - * - * @param ListEntitlementsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEntitlements(ListEntitlementsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEntitlements', $request, $callOptions); - } - - /** - * Lists grants for a given entitlement. - * - * The async variant is {@see PrivilegedAccessManagerClient::listGrantsAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/list_grants.php - * - * @param ListGrantsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGrants(ListGrantsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGrants', $request, $callOptions); - } - - /** - * `RevokeGrant` is used to immediately revoke access for a grant. This method - * can be called when the grant is in a non-terminal state. - * - * The async variant is {@see PrivilegedAccessManagerClient::revokeGrantAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/revoke_grant.php - * - * @param RevokeGrantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function revokeGrant(RevokeGrantRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RevokeGrant', $request, $callOptions)->wait(); - } - - /** - * `SearchEntitlements` returns entitlements on which the caller has the - * specified access. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::searchEntitlementsAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/search_entitlements.php - * - * @param SearchEntitlementsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchEntitlements(SearchEntitlementsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchEntitlements', $request, $callOptions); - } - - /** - * `SearchGrants` returns grants that are related to the calling user in the - * specified way. - * - * The async variant is {@see PrivilegedAccessManagerClient::searchGrantsAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/search_grants.php - * - * @param SearchGrantsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchGrants(SearchGrantsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchGrants', $request, $callOptions); - } - - /** - * Updates the entitlement specified in the request. Updated fields in the - * entitlement need to be specified in an update mask. The changes made to an - * entitlement are applicable only on future grants of the entitlement. - * However, if new approvers are added or existing approvers are removed from - * the approval workflow, the changes are effective on existing grants. - * - * The following fields are not supported for updates: - * - * * All immutable fields - * * Entitlement name - * * Resource name - * * Resource type - * * Adding an approval workflow in an entitlement which previously had no - * approval workflow. - * * Deleting the approval workflow from an entitlement. - * * Adding or deleting a step in the approval workflow (only one step is - * supported) - * - * Note that updates are allowed on the list of approvers in an approval - * workflow step. - * - * The async variant is - * {@see PrivilegedAccessManagerClient::updateEntitlementAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/update_entitlement.php - * - * @param UpdateEntitlementRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEntitlement(UpdateEntitlementRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateEntitlement', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see PrivilegedAccessManagerClient::getLocationAsync()} . - * - * @example samples/V1/PrivilegedAccessManagerClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see PrivilegedAccessManagerClient::listLocationsAsync()} - * . - * - * @example samples/V1/PrivilegedAccessManagerClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 11348c76a35..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.privilegedaccessmanager.v1", - "libraryPackage": "Google\\Cloud\\PrivilegedAccessManager\\V1", - "services": { - "PrivilegedAccessManager": { - "clients": { - "grpc": { - "libraryClient": "PrivilegedAccessManagerGapicClient", - "rpcs": { - "ApproveGrant": { - "methods": [ - "approveGrant" - ] - }, - "CheckOnboardingStatus": { - "methods": [ - "checkOnboardingStatus" - ] - }, - "CreateEntitlement": { - "methods": [ - "createEntitlement" - ] - }, - "CreateGrant": { - "methods": [ - "createGrant" - ] - }, - "DeleteEntitlement": { - "methods": [ - "deleteEntitlement" - ] - }, - "DenyGrant": { - "methods": [ - "denyGrant" - ] - }, - "GetEntitlement": { - "methods": [ - "getEntitlement" - ] - }, - "GetGrant": { - "methods": [ - "getGrant" - ] - }, - "ListEntitlements": { - "methods": [ - "listEntitlements" - ] - }, - "ListGrants": { - "methods": [ - "listGrants" - ] - }, - "RevokeGrant": { - "methods": [ - "revokeGrant" - ] - }, - "SearchEntitlements": { - "methods": [ - "searchEntitlements" - ] - }, - "SearchGrants": { - "methods": [ - "searchGrants" - ] - }, - "UpdateEntitlement": { - "methods": [ - "updateEntitlement" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json deleted file mode 100644 index f0c28f65f16..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_client_config.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "interfaces": { - "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ApproveGrant": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckOnboardingStatus": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateEntitlement": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateGrant": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEntitlement": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DenyGrant": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEntitlement": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetGrant": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListEntitlements": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListGrants": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RevokeGrant": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchEntitlements": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SearchGrants": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateEntitlement": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php deleted file mode 100644 index d18ec8a088e..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_descriptor_config.php +++ /dev/null @@ -1,304 +0,0 @@ - [ - 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' => [ - 'CreateEntitlement' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', - 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', - 'initialPollDelayMillis' => '5000', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '45000', - 'totalPollTimeoutMillis' => '900000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteEntitlement' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', - 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', - 'initialPollDelayMillis' => '5000', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '45000', - 'totalPollTimeoutMillis' => '900000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RevokeGrant' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Grant', - 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', - 'initialPollDelayMillis' => '5000', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '45000', - 'totalPollTimeoutMillis' => '900000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateEntitlement' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\Entitlement', - 'metadataReturnType' => '\Google\Cloud\PrivilegedAccessManager\V1\OperationMetadata', - 'initialPollDelayMillis' => '5000', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '45000', - 'totalPollTimeoutMillis' => '900000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'entitlement.name', - 'fieldAccessors' => [ - 'getEntitlement', - 'getName', - ], - ], - ], - ], - 'ApproveGrant' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CheckOnboardingStatus' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\CheckOnboardingStatusResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateGrant' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DenyGrant' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetEntitlement' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Entitlement', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetGrant' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\Grant', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListEntitlements' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEntitlements', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\ListEntitlementsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListGrants' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGrants', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\ListGrantsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'SearchEntitlements' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEntitlements', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\SearchEntitlementsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'SearchGrants' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGrants', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PrivilegedAccessManager\V1\SearchGrantsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'entitlement' => 'projects/{project}/locations/{location}/entitlements/{entitlement}', - 'folderLocation' => 'folders/{folder}/locations/{location}', - 'folderLocationEntitlement' => 'folders/{folder}/locations/{location}/entitlements/{entitlement}', - 'folderLocationEntitlementGrant' => 'folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}', - 'grant' => 'projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}', - 'location' => 'projects/{project}/locations/{location}', - 'organizationLocation' => 'organizations/{organization}/locations/{location}', - 'organizationLocationEntitlement' => 'organizations/{organization}/locations/{location}/entitlements/{entitlement}', - 'organizationLocationEntitlementGrant' => 'organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}', - 'projectLocationEntitlement' => 'projects/{project}/locations/{location}/entitlements/{entitlement}', - 'projectLocationEntitlementGrant' => 'projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}', - ], - ], - ], -]; diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php b/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php deleted file mode 100644 index 646f631df4f..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/src/V1/resources/privileged_access_manager_rest_client_config.php +++ /dev/null @@ -1,469 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*}/locations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*}/locations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' => [ - 'ApproveGrant' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:approve', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:approve', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:approve', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CheckOnboardingStatus' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:checkOnboardingStatus', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}:checkOnboardingStatus', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}:checkOnboardingStatus', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateEntitlement' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements', - 'body' => 'entitlement', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements', - 'body' => 'entitlement', - 'queryParams' => [ - 'entitlement_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements', - 'body' => 'entitlement', - 'queryParams' => [ - 'entitlement_id', - ], - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'entitlement_id', - ], - ], - 'CreateGrant' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants', - 'body' => 'grant', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants', - 'body' => 'grant', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants', - 'body' => 'grant', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteEntitlement' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DenyGrant' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:deny', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:deny', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:deny', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetEntitlement' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetGrant' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEntitlements' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListGrants' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RevokeGrant' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:revoke', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:revoke', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:revoke', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchEntitlements' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/entitlements:search', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/entitlements:search', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/entitlements:search', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SearchGrants' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entitlements/*}/grants:search', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:search', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/entitlements/*}/grants:search', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateEntitlement' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{entitlement.name=projects/*/locations/*/entitlements/*}', - 'body' => 'entitlement', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{entitlement.name=organizations/*/locations/*/entitlements/*}', - 'body' => 'entitlement', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{entitlement.name=folders/*/locations/*/entitlements/*}', - 'body' => 'entitlement', - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'placeholders' => [ - 'entitlement.name' => [ - 'getters' => [ - 'getEntitlement', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php b/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php deleted file mode 100644 index 28f485267b0..00000000000 --- a/owl-bot-staging/PrivilegedAccessManager/v1/tests/Unit/V1/Client/PrivilegedAccessManagerClientTest.php +++ /dev/null @@ -1,1499 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PrivilegedAccessManagerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PrivilegedAccessManagerClient($options); - } - - /** @test */ - public function approveGrantTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name2); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new ApproveGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->approveGrant($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ApproveGrant', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function approveGrantExceptionTest() - { - $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new ApproveGrantRequest()) - ->setName($formattedName); - try { - $gapicClient->approveGrant($request); - // 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 checkOnboardingStatusTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new CheckOnboardingStatusResponse(); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new CheckOnboardingStatusRequest()) - ->setParent($formattedParent); - $response = $gapicClient->checkOnboardingStatus($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/CheckOnboardingStatus', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkOnboardingStatusExceptionTest() - { - $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new CheckOnboardingStatusRequest()) - ->setParent($formattedParent); - try { - $gapicClient->checkOnboardingStatus($request); - // 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 createEntitlementTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createEntitlementTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new Entitlement(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEntitlementTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $entitlementId = 'entitlementId-1715775123'; - $entitlement = new Entitlement(); - $entitlementMaxRequestDuration = new Duration(); - $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); - $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); - $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $request = (new CreateEntitlementRequest()) - ->setParent($formattedParent) - ->setEntitlementId($entitlementId) - ->setEntitlement($entitlement); - $response = $gapicClient->createEntitlement($request); - $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.privilegedaccessmanager.v1.PrivilegedAccessManager/CreateEntitlement', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEntitlementId(); - $this->assertProtobufEquals($entitlementId, $actualValue); - $actualValue = $actualApiRequestObject->getEntitlement(); - $this->assertProtobufEquals($entitlement, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntitlementTest'); - $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 createEntitlementExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createEntitlementTest'); - $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $entitlementId = 'entitlementId-1715775123'; - $entitlement = new Entitlement(); - $entitlementMaxRequestDuration = new Duration(); - $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); - $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); - $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $request = (new CreateEntitlementRequest()) - ->setParent($formattedParent) - ->setEntitlementId($entitlementId) - ->setEntitlement($entitlement); - $response = $gapicClient->createEntitlement($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntitlementTest'); - 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 createGrantTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $grant = new Grant(); - $grantRequestedDuration = new Duration(); - $grant->setRequestedDuration($grantRequestedDuration); - $request = (new CreateGrantRequest()) - ->setParent($formattedParent) - ->setGrant($grant); - $response = $gapicClient->createGrant($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/CreateGrant', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getGrant(); - $this->assertProtobufEquals($grant, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createGrantExceptionTest() - { - $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $grant = new Grant(); - $grantRequestedDuration = new Duration(); - $grant->setRequestedDuration($grantRequestedDuration); - $request = (new CreateGrantRequest()) - ->setParent($formattedParent) - ->setGrant($grant); - try { - $gapicClient->createGrant($request); - // 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 deleteEntitlementTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteEntitlementTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Entitlement(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEntitlementTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new DeleteEntitlementRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteEntitlement($request); - $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.privilegedaccessmanager.v1.PrivilegedAccessManager/DeleteEntitlement', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntitlementTest'); - $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 deleteEntitlementExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteEntitlementTest'); - $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 - $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new DeleteEntitlementRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteEntitlement($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntitlementTest'); - 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 denyGrantTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name2); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new DenyGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->denyGrant($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/DenyGrant', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function denyGrantExceptionTest() - { - $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new DenyGrantRequest()) - ->setName($formattedName); - try { - $gapicClient->denyGrant($request); - // 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 getEntitlementTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Entitlement(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new GetEntitlementRequest()) - ->setName($formattedName); - $response = $gapicClient->getEntitlement($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/GetEntitlement', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntitlementExceptionTest() - { - $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new GetEntitlementRequest()) - ->setName($formattedName); - try { - $gapicClient->getEntitlement($request); - // 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 getGrantTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name2); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new GetGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->getGrant($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/GetGrant', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGrantExceptionTest() - { - $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->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new GetGrantRequest()) - ->setName($formattedName); - try { - $gapicClient->getGrant($request); - // 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 listEntitlementsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entitlementsElement = new Entitlement(); - $entitlements = [ - $entitlementsElement, - ]; - $expectedResponse = new ListEntitlementsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntitlements($entitlements); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListEntitlementsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listEntitlements($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntitlements()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ListEntitlements', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntitlementsExceptionTest() - { - $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListEntitlementsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listEntitlements($request); - // 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 listGrantsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $grantsElement = new Grant(); - $grants = [ - $grantsElement, - ]; - $expectedResponse = new ListGrantsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGrants($grants); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new ListGrantsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listGrants($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGrants()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ListGrants', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGrantsExceptionTest() - { - $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $request = (new ListGrantsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listGrants($request); - // 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 revokeGrantTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/revokeGrantTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name2); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/revokeGrantTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new RevokeGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->revokeGrant($request); - $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.privilegedaccessmanager.v1.PrivilegedAccessManager/RevokeGrant', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/revokeGrantTest'); - $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 revokeGrantExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/revokeGrantTest'); - $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 - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new RevokeGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->revokeGrant($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/revokeGrantTest'); - 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 searchEntitlementsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entitlementsElement = new Entitlement(); - $entitlements = [ - $entitlementsElement, - ]; - $expectedResponse = new SearchEntitlementsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntitlements($entitlements); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; - $request = (new SearchEntitlementsRequest()) - ->setParent($formattedParent) - ->setCallerAccessType($callerAccessType); - $response = $gapicClient->searchEntitlements($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntitlements()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/SearchEntitlements', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCallerAccessType(); - $this->assertProtobufEquals($callerAccessType, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchEntitlementsExceptionTest() - { - $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $callerAccessType = CallerAccessType::CALLER_ACCESS_TYPE_UNSPECIFIED; - $request = (new SearchEntitlementsRequest()) - ->setParent($formattedParent) - ->setCallerAccessType($callerAccessType); - try { - $gapicClient->searchEntitlements($request); - // 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 searchGrantsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $grantsElement = new Grant(); - $grants = [ - $grantsElement, - ]; - $expectedResponse = new SearchGrantsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGrants($grants); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; - $request = (new SearchGrantsRequest()) - ->setParent($formattedParent) - ->setCallerRelationship($callerRelationship); - $response = $gapicClient->searchGrants($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGrants()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/SearchGrants', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCallerRelationship(); - $this->assertProtobufEquals($callerRelationship, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchGrantsExceptionTest() - { - $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->entitlementName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]'); - $callerRelationship = CallerRelationshipType::CALLER_RELATIONSHIP_TYPE_UNSPECIFIED; - $request = (new SearchGrantsRequest()) - ->setParent($formattedParent) - ->setCallerRelationship($callerRelationship); - try { - $gapicClient->searchGrants($request); - // 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 updateEntitlementTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateEntitlementTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new Entitlement(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateEntitlementTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $entitlement = new Entitlement(); - $entitlementMaxRequestDuration = new Duration(); - $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); - $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); - $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $updateMask = new FieldMask(); - $request = (new UpdateEntitlementRequest()) - ->setEntitlement($entitlement) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateEntitlement($request); - $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.privilegedaccessmanager.v1.PrivilegedAccessManager/UpdateEntitlement', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntitlement(); - $this->assertProtobufEquals($entitlement, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntitlementTest'); - $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 updateEntitlementExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateEntitlementTest'); - $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 - $entitlement = new Entitlement(); - $entitlementMaxRequestDuration = new Duration(); - $entitlement->setMaxRequestDuration($entitlementMaxRequestDuration); - $entitlementRequesterJustificationConfig = new RequesterJustificationConfig(); - $entitlement->setRequesterJustificationConfig($entitlementRequesterJustificationConfig); - $updateMask = new FieldMask(); - $request = (new UpdateEntitlementRequest()) - ->setEntitlement($entitlement) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateEntitlement($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntitlementTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 approveGrantAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $requester = 'requester693933948'; - $externallyModified = true; - $expectedResponse = new Grant(); - $expectedResponse->setName($name2); - $expectedResponse->setRequester($requester); - $expectedResponse->setExternallyModified($externallyModified); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->grantName('[PROJECT]', '[LOCATION]', '[ENTITLEMENT]', '[GRANT]'); - $request = (new ApproveGrantRequest()) - ->setName($formattedName); - $response = $gapicClient->approveGrantAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager/ApproveGrant', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php b/owl-bot-staging/Profiler/v2/proto/src/GPBMetadata/Google/Devtools/Cloudprofiler/V2/Profiler.php deleted file mode 100644 index 2ccee3ee6a7c23632bd0a812ccfc4687680aa274..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4189 zcmdT{&2!sC6i0SGnst-9TW0FI9S|m+x@jVVGcZLVfMPpoAdNkVTL#868d+W^BC;f; zb<)tufsf(9l>-M3oMDC;{)gUrESz$o2Tnb3;K+gDt+Z0)q``J>F?y|=&jdtbY6 zzw2x}=v8rrSj5#RX^G8!k!};wacyerwkbBd?KW{m-R?MsNnA-3%T;l`S{Ezj)%q)- z>e*daC$hL@+gm0nw8$>CZPP30rrm9UnKn}^>=p~*TJmipWN97ZIhszymDLbaAg zwZ@8Xrcvf*8l||I#{J>~Lb|DWo>=3i(L*G{pVMuchAw(kqwq6rc&cF;)X+@hGw^Cr zY-^@RK>4I>yKCvxuq}}(R4tw4Z;F9UCOhqbH=rK^gJY=;q%>A7N?c1b0jj6FhC^+) z2BNaOMQB7P`;x!Ok7eeJwwMnv%JK=2iz0QqB!0Rmx`cLJYr)6O3>-wO#&c*>9HXIF zmd#kOEl-w@d^$35nqtW`h((9fSvH8-S|Z!pu3@{wscsOSIs=1@xG#4hS;4`<4~$fO zz;`uo=M1`a12UFs9q0MFeyYs9WAMaKTCFG#mZ1ppQRG-0Z=mn4pu&(vgL#!nVU$lfTg70pR;#@kjf? z0Ue>ia=#1c#ga>)2SKP<&)6WJc7bjD9vX8r7yQVKh(dm1>9xO=IdseS zJ4D&hENu&VQ-BgY_ax|71u*mp(U}F*B93YAcbF9ctfY#wT=;Y*rE;W$OXxfRXQ))V z?~qJFOy;MGbNy{_U+SQg`(8j-0}re1wrN4b=1OqLbG!y6*GiWD7i!S z1IF%m@kZaGByJ)(%=bS7$Rwwv6IL)fhD?H?@gYX6rd}2}uxgQ0D zVugkg;?kYm)(nsG5O`sSDn%VC zDBSs{N@D0HbrDTC(8N>^?km2dqnMGwK2dvzSQ(b66S=RUOnWhS4h(vN7tlFij*;pC zZ!DRHsME{nf<+!sHFlgIbeutHZ^v*P(o!Sq49MurR{~0LB3O6B*HEUmQC(hLtElyl zY8Ca~`evOI1d|&2^ z`M{T;E+jThVj($dM>7YJ7ulbM$I7+;>Tpk#Z-i}19ZxP4_V)I8z@kfs)}`CQ+h@)( zHQKh_&TK#Njtwsl+cm7MAw;D;*Px{MR{~8|9yqp3!}R|}K1}K_d zwV)H_UO!a$jm?ij4)-mI{~PH`zX>n}?M~lfU78Gg6Z}%UCVaf&r&g%QZmC=Lv8OVm z610$>6m*&k$Nv8*ky-Iy%2J6vki%<%E8Qgoogle.devtools.cloudprofiler.v2.CreateOfflineProfileRequest - */ -class CreateOfflineProfileRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Contents of the profile to create. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; - */ - protected $profile = null; - - /** - * @param string $parent Parent project to create the profile in. - * @param \Google\Cloud\Profiler\V2\Profile $profile Contents of the profile to create. - * - * @return \Google\Cloud\Profiler\V2\CreateOfflineProfileRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Profiler\V2\Profile $profile): self - { - return (new self()) - ->setParent($parent) - ->setProfile($profile); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Parent project to create the profile in. - * @type \Google\Cloud\Profiler\V2\Profile $profile - * Contents of the profile to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Contents of the profile to create. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; - * @return \Google\Cloud\Profiler\V2\Profile|null - */ - public function getProfile() - { - return $this->profile; - } - - public function hasProfile() - { - return isset($this->profile); - } - - public function clearProfile() - { - unset($this->profile); - } - - /** - * Contents of the profile to create. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 2; - * @param \Google\Cloud\Profiler\V2\Profile $var - * @return $this - */ - public function setProfile($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Profile::class); - $this->profile = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php deleted file mode 100644 index ef1a7c79063..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/CreateProfileRequest.php +++ /dev/null @@ -1,148 +0,0 @@ -google.devtools.cloudprofiler.v2.CreateProfileRequest - */ -class CreateProfileRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Deployment details. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; - */ - protected $deployment = null; - /** - * One or more profile types that the agent is capable of providing. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - */ - private $profile_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Parent project to create the profile in. - * @type \Google\Cloud\Profiler\V2\Deployment $deployment - * Deployment details. - * @type array|\Google\Protobuf\Internal\RepeatedField $profile_type - * One or more profile types that the agent is capable of providing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Parent project to create the profile in. - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Deployment details. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; - * @return \Google\Cloud\Profiler\V2\Deployment|null - */ - public function getDeployment() - { - return $this->deployment; - } - - public function hasDeployment() - { - return isset($this->deployment); - } - - public function clearDeployment() - { - unset($this->deployment); - } - - /** - * Deployment details. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 1; - * @param \Google\Cloud\Profiler\V2\Deployment $var - * @return $this - */ - public function setDeployment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Deployment::class); - $this->deployment = $var; - - return $this; - } - - /** - * One or more profile types that the agent is capable of providing. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProfileType() - { - return $this->profile_type; - } - - /** - * One or more profile types that the agent is capable of providing. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProfileType($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Profiler\V2\ProfileType::class); - $this->profile_type = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php deleted file mode 100644 index 4ee6e5aaebc..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Deployment.php +++ /dev/null @@ -1,199 +0,0 @@ -google.devtools.cloudprofiler.v2.Deployment - */ -class Deployment extends \Google\Protobuf\Internal\Message -{ - /** - * Project ID is the ID of a cloud project. - * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. - * - * Generated from protobuf field string project_id = 1; - */ - protected $project_id = ''; - /** - * Target is the service name used to group related deployments: - * * Service name for App Engine Flex / Standard. - * * Cluster and container name for GKE. - * * User-specified string for direct Compute Engine profiling (e.g. Java). - * * Job name for Dataflow. - * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. - * - * Generated from protobuf field string target = 2; - */ - protected $target = ''; - /** - * Labels identify the deployment within the user universe and same target. - * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - * Value for an individual label must be <= 512 bytes, the total - * size of all label names and values must be <= 1024 bytes. - * Label named "language" can be used to record the programming language of - * the profiled deployment. The standard choices for the value include "java", - * "go", "python", "ruby", "nodejs", "php", "dotnet". - * For deployments running on Google Cloud Platform, "zone" or "region" label - * should be present describing the deployment location. An example of a zone - * is "us-central1-a", an example of a region is "us-central1" or - * "us-central". - * - * Generated from protobuf field map labels = 3; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Project ID is the ID of a cloud project. - * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. - * @type string $target - * Target is the service name used to group related deployments: - * * Service name for App Engine Flex / Standard. - * * Cluster and container name for GKE. - * * User-specified string for direct Compute Engine profiling (e.g. Java). - * * Job name for Dataflow. - * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels identify the deployment within the user universe and same target. - * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - * Value for an individual label must be <= 512 bytes, the total - * size of all label names and values must be <= 1024 bytes. - * Label named "language" can be used to record the programming language of - * the profiled deployment. The standard choices for the value include "java", - * "go", "python", "ruby", "nodejs", "php", "dotnet". - * For deployments running on Google Cloud Platform, "zone" or "region" label - * should be present describing the deployment location. An example of a zone - * is "us-central1-a", an example of a region is "us-central1" or - * "us-central". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Project ID is the ID of a cloud project. - * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project ID is the ID of a cloud project. - * Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Target is the service name used to group related deployments: - * * Service name for App Engine Flex / Standard. - * * Cluster and container name for GKE. - * * User-specified string for direct Compute Engine profiling (e.g. Java). - * * Job name for Dataflow. - * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. - * - * Generated from protobuf field string target = 2; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Target is the service name used to group related deployments: - * * Service name for App Engine Flex / Standard. - * * Cluster and container name for GKE. - * * User-specified string for direct Compute Engine profiling (e.g. Java). - * * Job name for Dataflow. - * Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. - * - * Generated from protobuf field string target = 2; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Labels identify the deployment within the user universe and same target. - * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - * Value for an individual label must be <= 512 bytes, the total - * size of all label names and values must be <= 1024 bytes. - * Label named "language" can be used to record the programming language of - * the profiled deployment. The standard choices for the value include "java", - * "go", "python", "ruby", "nodejs", "php", "dotnet". - * For deployments running on Google Cloud Platform, "zone" or "region" label - * should be present describing the deployment location. An example of a zone - * is "us-central1-a", an example of a region is "us-central1" or - * "us-central". - * - * Generated from protobuf field map labels = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels identify the deployment within the user universe and same target. - * Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - * Value for an individual label must be <= 512 bytes, the total - * size of all label names and values must be <= 1024 bytes. - * Label named "language" can be used to record the programming language of - * the profiled deployment. The standard choices for the value include "java", - * "go", "python", "ruby", "nodejs", "php", "dotnet". - * For deployments running on Google Cloud Platform, "zone" or "region" label - * should be present describing the deployment location. An example of a zone - * is "us-central1-a", an example of a region is "us-central1" or - * "us-central". - * - * Generated from protobuf field map labels = 3; - * @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/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php deleted file mode 100644 index ff53a3c48f1..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -google.devtools.cloudprofiler.v2.ListProfilesRequest - */ -class ListProfilesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent, which owns this collection of profiles. - * Format: projects/{user_project_id} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of items to return. - * Default page_size is 1000. - * Max limit is 1000. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The token to continue pagination and get profiles from a particular page. - * When paginating, all other parameters provided to `ListProfiles` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The parent, which owns this collection of profiles. - * Format: projects/{user_project_id} - * Please see {@see ExportServiceClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\Profiler\V2\ListProfilesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent, which owns this collection of profiles. - * Format: projects/{user_project_id} - * @type int $page_size - * The maximum number of items to return. - * Default page_size is 1000. - * Max limit is 1000. - * @type string $page_token - * The token to continue pagination and get profiles from a particular page. - * When paginating, all other parameters provided to `ListProfiles` must match - * the call that provided the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent, which owns this collection of profiles. - * Format: projects/{user_project_id} - * - * 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, which owns this collection of profiles. - * Format: projects/{user_project_id} - * - * 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; - } - - /** - * The maximum number of items to return. - * Default page_size is 1000. - * Max limit is 1000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * Default page_size is 1000. - * Max limit is 1000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The token to continue pagination and get profiles from a particular page. - * When paginating, all other parameters provided to `ListProfiles` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The token to continue pagination and get profiles from a particular page. - * When paginating, all other parameters provided to `ListProfiles` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @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/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php deleted file mode 100644 index a52a9ccd27a..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ListProfilesResponse.php +++ /dev/null @@ -1,152 +0,0 @@ -google.devtools.cloudprofiler.v2.ListProfilesResponse - */ -class ListProfilesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of profiles fetched. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; - */ - private $profiles; - /** - * Token to receive the next page of results. - * This field maybe empty if there are no more profiles to fetch. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Number of profiles that were skipped in the current page since they were - * not able to be fetched successfully. This should typically be zero. A - * non-zero value may indicate a transient failure, in which case if the - * number is too high for your use case, the call may be retried. - * - * Generated from protobuf field int32 skipped_profiles = 3; - */ - protected $skipped_profiles = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Profiler\V2\Profile>|\Google\Protobuf\Internal\RepeatedField $profiles - * List of profiles fetched. - * @type string $next_page_token - * Token to receive the next page of results. - * This field maybe empty if there are no more profiles to fetch. - * @type int $skipped_profiles - * Number of profiles that were skipped in the current page since they were - * not able to be fetched successfully. This should typically be zero. A - * non-zero value may indicate a transient failure, in which case if the - * number is too high for your use case, the call may be retried. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * List of profiles fetched. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProfiles() - { - return $this->profiles; - } - - /** - * List of profiles fetched. - * - * Generated from protobuf field repeated .google.devtools.cloudprofiler.v2.Profile profiles = 1; - * @param array<\Google\Cloud\Profiler\V2\Profile>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProfiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Profiler\V2\Profile::class); - $this->profiles = $arr; - - return $this; - } - - /** - * Token to receive the next page of results. - * This field maybe empty if there are no more profiles to fetch. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to receive the next page of results. - * This field maybe empty if there are no more profiles to fetch. - * - * 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; - } - - /** - * Number of profiles that were skipped in the current page since they were - * not able to be fetched successfully. This should typically be zero. A - * non-zero value may indicate a transient failure, in which case if the - * number is too high for your use case, the call may be retried. - * - * Generated from protobuf field int32 skipped_profiles = 3; - * @return int - */ - public function getSkippedProfiles() - { - return $this->skipped_profiles; - } - - /** - * Number of profiles that were skipped in the current page since they were - * not able to be fetched successfully. This should typically be zero. A - * non-zero value may indicate a transient failure, in which case if the - * number is too high for your use case, the call may be retried. - * - * Generated from protobuf field int32 skipped_profiles = 3; - * @param int $var - * @return $this - */ - public function setSkippedProfiles($var) - { - GPBUtil::checkInt32($var); - $this->skipped_profiles = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php deleted file mode 100644 index 90f9a635a62..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/Profile.php +++ /dev/null @@ -1,345 +0,0 @@ -google.devtools.cloudprofiler.v2.Profile - */ -class Profile extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Opaque, server-assigned, unique ID for this profile. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Type of profile. - * For offline mode, this must be specified when creating the profile. For - * online mode it is assigned and returned by the server. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - */ - protected $profile_type = 0; - /** - * Deployment this profile corresponds to. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; - */ - protected $deployment = null; - /** - * Duration of the profiling session. - * Input (for the offline mode) or output (for the online mode). - * The field represents requested profiling duration. It may slightly differ - * from the effective profiling duration, which is recorded in the profile - * data, in case the profiling can't be stopped immediately (e.g. in case - * stopping the profiling is handled asynchronously). - * - * Generated from protobuf field .google.protobuf.Duration duration = 4; - */ - protected $duration = null; - /** - * Input only. Profile bytes, as a gzip compressed serialized proto, the - * format is https://github.com/google/pprof/blob/master/proto/profile.proto. - * - * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $profile_bytes = ''; - /** - * Input only. Labels associated to this specific profile. These labels will - * get merged with the deployment labels for the final data set. See - * documentation on deployment labels for validation rules and limits. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $labels; - /** - * Output only. Start time for the profile. - * This output is only present in response from the ListProfiles method. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Opaque, server-assigned, unique ID for this profile. - * @type int $profile_type - * Type of profile. - * For offline mode, this must be specified when creating the profile. For - * online mode it is assigned and returned by the server. - * @type \Google\Cloud\Profiler\V2\Deployment $deployment - * Deployment this profile corresponds to. - * @type \Google\Protobuf\Duration $duration - * Duration of the profiling session. - * Input (for the offline mode) or output (for the online mode). - * The field represents requested profiling duration. It may slightly differ - * from the effective profiling duration, which is recorded in the profile - * data, in case the profiling can't be stopped immediately (e.g. in case - * stopping the profiling is handled asynchronously). - * @type string $profile_bytes - * Input only. Profile bytes, as a gzip compressed serialized proto, the - * format is https://github.com/google/pprof/blob/master/proto/profile.proto. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Input only. Labels associated to this specific profile. These labels will - * get merged with the deployment labels for the final data set. See - * documentation on deployment labels for validation rules and limits. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Start time for the profile. - * This output is only present in response from the ListProfiles method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Opaque, server-assigned, unique ID for this profile. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Opaque, server-assigned, unique ID for this profile. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Type of profile. - * For offline mode, this must be specified when creating the profile. For - * online mode it is assigned and returned by the server. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - * @return int - */ - public function getProfileType() - { - return $this->profile_type; - } - - /** - * Type of profile. - * For offline mode, this must be specified when creating the profile. For - * online mode it is assigned and returned by the server. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.ProfileType profile_type = 2; - * @param int $var - * @return $this - */ - public function setProfileType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Profiler\V2\ProfileType::class); - $this->profile_type = $var; - - return $this; - } - - /** - * Deployment this profile corresponds to. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; - * @return \Google\Cloud\Profiler\V2\Deployment|null - */ - public function getDeployment() - { - return $this->deployment; - } - - public function hasDeployment() - { - return isset($this->deployment); - } - - public function clearDeployment() - { - unset($this->deployment); - } - - /** - * Deployment this profile corresponds to. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Deployment deployment = 3; - * @param \Google\Cloud\Profiler\V2\Deployment $var - * @return $this - */ - public function setDeployment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Deployment::class); - $this->deployment = $var; - - return $this; - } - - /** - * Duration of the profiling session. - * Input (for the offline mode) or output (for the online mode). - * The field represents requested profiling duration. It may slightly differ - * from the effective profiling duration, which is recorded in the profile - * data, in case the profiling can't be stopped immediately (e.g. in case - * stopping the profiling is handled asynchronously). - * - * Generated from protobuf field .google.protobuf.Duration duration = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Duration of the profiling session. - * Input (for the offline mode) or output (for the online mode). - * The field represents requested profiling duration. It may slightly differ - * from the effective profiling duration, which is recorded in the profile - * data, in case the profiling can't be stopped immediately (e.g. in case - * stopping the profiling is handled asynchronously). - * - * Generated from protobuf field .google.protobuf.Duration duration = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * Input only. Profile bytes, as a gzip compressed serialized proto, the - * format is https://github.com/google/pprof/blob/master/proto/profile.proto. - * - * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getProfileBytes() - { - return $this->profile_bytes; - } - - /** - * Input only. Profile bytes, as a gzip compressed serialized proto, the - * format is https://github.com/google/pprof/blob/master/proto/profile.proto. - * - * Generated from protobuf field bytes profile_bytes = 5 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProfileBytes($var) - { - GPBUtil::checkString($var, False); - $this->profile_bytes = $var; - - return $this; - } - - /** - * Input only. Labels associated to this specific profile. These labels will - * get merged with the deployment labels for the final data set. See - * documentation on deployment labels for validation rules and limits. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Input only. Labels associated to this specific profile. These labels will - * get merged with the deployment labels for the final data set. See - * documentation on deployment labels for validation rules and limits. - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - * @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; - } - - /** - * Output only. Start time for the profile. - * This output is only present in response from the ListProfiles method. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Start time for the profile. - * This output is only present in response from the ListProfiles method. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php deleted file mode 100644 index c2adbcdd0cc..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/ProfileType.php +++ /dev/null @@ -1,104 +0,0 @@ -google.devtools.cloudprofiler.v2.ProfileType - */ -class ProfileType -{ - /** - * Unspecified profile type. - * - * Generated from protobuf enum PROFILE_TYPE_UNSPECIFIED = 0; - */ - const PROFILE_TYPE_UNSPECIFIED = 0; - /** - * Thread CPU time sampling. - * - * Generated from protobuf enum CPU = 1; - */ - const CPU = 1; - /** - * Wallclock time sampling. More expensive as stops all threads. - * - * Generated from protobuf enum WALL = 2; - */ - const WALL = 2; - /** - * In-use heap profile. Represents a snapshot of the allocations that are - * live at the time of the profiling. - * - * Generated from protobuf enum HEAP = 3; - */ - const HEAP = 3; - /** - * Single-shot collection of all thread stacks. - * - * Generated from protobuf enum THREADS = 4; - */ - const THREADS = 4; - /** - * Synchronization contention profile. - * - * Generated from protobuf enum CONTENTION = 5; - */ - const CONTENTION = 5; - /** - * Peak heap profile. - * - * Generated from protobuf enum PEAK_HEAP = 6; - */ - const PEAK_HEAP = 6; - /** - * Heap allocation profile. It represents the aggregation of all allocations - * made over the duration of the profile. All allocations are included, - * including those that might have been freed by the end of the profiling - * interval. The profile is in particular useful for garbage collecting - * languages to understand which parts of the code create most of the garbage - * collection pressure to see if those can be optimized. - * - * Generated from protobuf enum HEAP_ALLOC = 7; - */ - const HEAP_ALLOC = 7; - - private static $valueToName = [ - self::PROFILE_TYPE_UNSPECIFIED => 'PROFILE_TYPE_UNSPECIFIED', - self::CPU => 'CPU', - self::WALL => 'WALL', - self::HEAP => 'HEAP', - self::THREADS => 'THREADS', - self::CONTENTION => 'CONTENTION', - self::PEAK_HEAP => 'PEAK_HEAP', - self::HEAP_ALLOC => 'HEAP_ALLOC', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php b/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php deleted file mode 100644 index 3db9dcecdd2..00000000000 --- a/owl-bot-staging/Profiler/v2/proto/src/Google/Cloud/Profiler/V2/UpdateProfileRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.devtools.cloudprofiler.v2.UpdateProfileRequest - */ -class UpdateProfileRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Profile to update. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; - */ - protected $profile = null; - /** - * Field mask used to specify the fields to be overwritten. Currently only - * profile_bytes and labels fields are supported by UpdateProfile, so only - * those fields can be specified in the mask. When no mask is provided, all - * fields are overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Profiler\V2\Profile $profile Profile to update. - * @param \Google\Protobuf\FieldMask $updateMask Field mask used to specify the fields to be overwritten. Currently only - * profile_bytes and labels fields are supported by UpdateProfile, so only - * those fields can be specified in the mask. When no mask is provided, all - * fields are overwritten. - * - * @return \Google\Cloud\Profiler\V2\UpdateProfileRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Profiler\V2\Profile $profile, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setProfile($profile) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Profiler\V2\Profile $profile - * Profile to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Field mask used to specify the fields to be overwritten. Currently only - * profile_bytes and labels fields are supported by UpdateProfile, so only - * those fields can be specified in the mask. When no mask is provided, all - * fields are overwritten. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudprofiler\V2\Profiler::initOnce(); - parent::__construct($data); - } - - /** - * Profile to update. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; - * @return \Google\Cloud\Profiler\V2\Profile|null - */ - public function getProfile() - { - return $this->profile; - } - - public function hasProfile() - { - return isset($this->profile); - } - - public function clearProfile() - { - unset($this->profile); - } - - /** - * Profile to update. - * - * Generated from protobuf field .google.devtools.cloudprofiler.v2.Profile profile = 1; - * @param \Google\Cloud\Profiler\V2\Profile $var - * @return $this - */ - public function setProfile($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Profiler\V2\Profile::class); - $this->profile = $var; - - return $this; - } - - /** - * Field mask used to specify the fields to be overwritten. Currently only - * profile_bytes and labels fields are supported by UpdateProfile, so only - * those fields can be specified in the mask. When no mask is provided, all - * fields are overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Field mask used to specify the fields to be overwritten. Currently only - * profile_bytes and labels fields are supported by UpdateProfile, so only - * those fields can be specified in the mask. When no mask is provided, all - * fields are overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php b/owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php deleted file mode 100644 index 53e4656ca44..00000000000 --- a/owl-bot-staging/Profiler/v2/samples/V2/ExportServiceClient/list_profiles.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $exportServiceClient->listProfiles($request); - - /** @var Profile $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ExportServiceClient::projectName('[PROJECT]'); - - list_profiles_sample($formattedParent); -} -// [END cloudprofiler_v2_generated_ExportService_ListProfiles_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php deleted file mode 100644 index 153364e2d38..00000000000 --- a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_offline_profile.php +++ /dev/null @@ -1,64 +0,0 @@ -createOfflineProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php deleted file mode 100644 index 9405319b606..00000000000 --- a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/create_profile.php +++ /dev/null @@ -1,75 +0,0 @@ -createProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php b/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php deleted file mode 100644 index 957343f00a4..00000000000 --- a/owl-bot-staging/Profiler/v2/samples/V2/ProfilerServiceClient/update_profile.php +++ /dev/null @@ -1,65 +0,0 @@ -updateProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php b/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php deleted file mode 100644 index 2c4c7dfc1ec..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/Client/ExportServiceClient.php +++ /dev/null @@ -1,243 +0,0 @@ - listProfilesAsync(ListProfilesRequest $request, array $optionalArgs = []) - */ -final class ExportServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.devtools.cloudprofiler.v2.ExportService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudprofiler.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudprofiler.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/export_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/export_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/export_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/export_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - project: projects/{project} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudprofiler.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Lists profiles which have been collected so far and for which the caller - * has permission to view. - * - * The async variant is {@see ExportServiceClient::listProfilesAsync()} . - * - * @example samples/V2/ExportServiceClient/list_profiles.php - * - * @param ListProfilesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProfiles(ListProfilesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProfiles', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php b/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php deleted file mode 100644 index 0c34774d14f..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/Client/ProfilerServiceClient.php +++ /dev/null @@ -1,352 +0,0 @@ - createOfflineProfileAsync(CreateOfflineProfileRequest $request, array $optionalArgs = []) - * @method PromiseInterface createProfileAsync(CreateProfileRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateProfileAsync(UpdateProfileRequest $request, array $optionalArgs = []) - */ -final class ProfilerServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.devtools.cloudprofiler.v2.ProfilerService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudprofiler.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudprofiler.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/profiler_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/profiler_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/profiler_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/profiler_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a profile - * resource. - * - * @param string $project - * @param string $profile - * - * @return string The formatted profile resource. - */ - public static function profileName(string $project, string $profile): string - { - return self::getPathTemplate('profile')->render([ - 'project' => $project, - 'profile' => $profile, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - profile: projects/{project}/profiles/{profile} - * - project: projects/{project} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudprofiler.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * CreateOfflineProfile creates a new profile resource in the offline - * mode. The client provides the profile to create along with the profile - * bytes, the server records it. - * - * _Direct use of this API is discouraged, please use a [supported - * profiler - * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - * instead for profile collection._ - * - * The async variant is {@see ProfilerServiceClient::createOfflineProfileAsync()} . - * - * @example samples/V2/ProfilerServiceClient/create_offline_profile.php - * - * @param CreateOfflineProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Profile - * - * @throws ApiException Thrown if the API call fails. - */ - public function createOfflineProfile(CreateOfflineProfileRequest $request, array $callOptions = []): Profile - { - return $this->startApiCall('CreateOfflineProfile', $request, $callOptions)->wait(); - } - - /** - * CreateProfile creates a new profile resource in the online mode. - * - * _Direct use of this API is discouraged, please use a [supported - * profiler - * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - * instead for profile collection._ - * - * The server ensures that the new profiles are created at a constant rate per - * deployment, so the creation request may hang for some time until the next - * profile session is available. - * - * The request may fail with ABORTED error if the creation is not available - * within ~1m, the response will indicate the duration of the backoff the - * client should take before attempting creating a profile again. The backoff - * duration is returned in google.rpc.RetryInfo extension on the response - * status. To a gRPC client, the extension will be return as a - * binary-serialized proto in the trailing metadata item named - * "google.rpc.retryinfo-bin". - * - * - * The async variant is {@see ProfilerServiceClient::createProfileAsync()} . - * - * @example samples/V2/ProfilerServiceClient/create_profile.php - * - * @param CreateProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Profile - * - * @throws ApiException Thrown if the API call fails. - */ - public function createProfile(CreateProfileRequest $request, array $callOptions = []): Profile - { - return $this->startApiCall('CreateProfile', $request, $callOptions)->wait(); - } - - /** - * UpdateProfile updates the profile bytes and labels on the profile resource - * created in the online mode. Updating the bytes for profiles created in the - * offline mode is currently not supported: the profile content must be - * provided at the time of the profile creation. - * - * _Direct use of this API is discouraged, please use a [supported - * profiler - * agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - * instead for profile collection._ - * - * The async variant is {@see ProfilerServiceClient::updateProfileAsync()} . - * - * @example samples/V2/ProfilerServiceClient/update_profile.php - * - * @param UpdateProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Profile - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateProfile(UpdateProfileRequest $request, array $callOptions = []): Profile - { - return $this->startApiCall('UpdateProfile', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json deleted file mode 100644 index 30bcd0779a5..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.devtools.cloudprofiler.v2", - "libraryPackage": "Google\\Cloud\\Profiler\\V2", - "services": { - "ProfilerService": { - "clients": { - "grpc": { - "libraryClient": "ProfilerServiceGapicClient", - "rpcs": { - "CreateOfflineProfile": { - "methods": [ - "createOfflineProfile" - ] - }, - "CreateProfile": { - "methods": [ - "createProfile" - ] - }, - "UpdateProfile": { - "methods": [ - "updateProfile" - ] - } - } - } - } - }, - "ExportService": { - "clients": { - "grpc": { - "libraryClient": "ExportServiceGapicClient", - "rpcs": { - "ListProfiles": { - "methods": [ - "listProfiles" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json deleted file mode 100644 index 22dc5634732..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_client_config.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "interfaces": { - "google.devtools.cloudprofiler.v2.ExportService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_2_codes": [ - "UNAVAILABLE" - ] - }, - "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_2_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 130000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 130000, - "total_timeout_millis": 130000 - } - }, - "methods": { - "ListProfiles": { - "timeout_millis": 130000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - } - } - } - } -} diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php deleted file mode 100644 index 1770633a584..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_descriptor_config.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'google.devtools.cloudprofiler.v2.ExportService' => [ - 'ListProfiles' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProfiles', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Profiler\V2\ListProfilesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'project' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php deleted file mode 100644 index a2ee763f060..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/export_service_rest_client_config.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'google.devtools.cloudprofiler.v2.ExportService' => [ - 'ListProfiles' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/profiles', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json deleted file mode 100644 index 3d4414a2036..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.devtools.cloudprofiler.v2.ProfilerService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [], - "no_retry_2_codes": [] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 3610000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 3610000, - "total_timeout_millis": 3610000 - }, - "no_retry_2_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 30000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 30000, - "total_timeout_millis": 30000 - } - }, - "methods": { - "CreateOfflineProfile": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_2_codes", - "retry_params_name": "no_retry_2_params" - }, - "CreateProfile": { - "timeout_millis": 3610000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateProfile": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_2_codes", - "retry_params_name": "no_retry_2_params" - } - } - } - } -} diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php deleted file mode 100644 index 5caac201269..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_descriptor_config.php +++ /dev/null @@ -1,69 +0,0 @@ - [ - 'google.devtools.cloudprofiler.v2.ProfilerService' => [ - 'CreateOfflineProfile' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Profiler\V2\Profile', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateProfile' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Profiler\V2\Profile', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateProfile' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Profiler\V2\Profile', - 'headerParams' => [ - [ - 'keyName' => 'profile.name', - 'fieldAccessors' => [ - 'getProfile', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'profile' => 'projects/{project}/profiles/{profile}', - 'project' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php b/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php deleted file mode 100644 index 95b5868f63e..00000000000 --- a/owl-bot-staging/Profiler/v2/src/V2/resources/profiler_service_rest_client_config.php +++ /dev/null @@ -1,66 +0,0 @@ - [ - 'google.devtools.cloudprofiler.v2.ProfilerService' => [ - 'CreateOfflineProfile' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/profiles:createOffline', - 'body' => 'profile', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateProfile' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/profiles', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateProfile' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{profile.name=projects/*/profiles/*}', - 'body' => 'profile', - 'placeholders' => [ - 'profile.name' => [ - 'getters' => [ - 'getProfile', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php deleted file mode 100644 index 8545dd2bd7a..00000000000 --- a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ExportServiceClientTest.php +++ /dev/null @@ -1,176 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ExportServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ExportServiceClient($options); - } - - /** @test */ - public function listProfilesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $skippedProfiles = 852593689; - $profilesElement = new Profile(); - $profiles = [ - $profilesElement, - ]; - $expectedResponse = new ListProfilesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSkippedProfiles($skippedProfiles); - $expectedResponse->setProfiles($profiles); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListProfilesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProfiles($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProfiles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ExportService/ListProfiles', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProfilesExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ListProfilesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProfiles($request); - // 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 listProfilesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $skippedProfiles = 852593689; - $profilesElement = new Profile(); - $profiles = [ - $profilesElement, - ]; - $expectedResponse = new ListProfilesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSkippedProfiles($skippedProfiles); - $expectedResponse->setProfiles($profiles); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListProfilesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProfilesAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProfiles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ExportService/ListProfiles', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php b/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php deleted file mode 100644 index 6dbf9f964f9..00000000000 --- a/owl-bot-staging/Profiler/v2/tests/Unit/V2/Client/ProfilerServiceClientTest.php +++ /dev/null @@ -1,264 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ProfilerServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ProfilerServiceClient($options); - } - - /** @test */ - public function createOfflineProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $profileBytes = '85'; - $expectedResponse = new Profile(); - $expectedResponse->setName($name); - $expectedResponse->setProfileBytes($profileBytes); - $transport->addResponse($expectedResponse); - $request = new CreateOfflineProfileRequest(); - $response = $gapicClient->createOfflineProfile($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createOfflineProfileExceptionTest() - { - $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); - $request = new CreateOfflineProfileRequest(); - try { - $gapicClient->createOfflineProfile($request); - // 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 createProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $profileBytes = '85'; - $expectedResponse = new Profile(); - $expectedResponse->setName($name); - $expectedResponse->setProfileBytes($profileBytes); - $transport->addResponse($expectedResponse); - $request = new CreateProfileRequest(); - $response = $gapicClient->createProfile($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProfileExceptionTest() - { - $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); - $request = new CreateProfileRequest(); - try { - $gapicClient->createProfile($request); - // 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 updateProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $profileBytes = '85'; - $expectedResponse = new Profile(); - $expectedResponse->setName($name); - $expectedResponse->setProfileBytes($profileBytes); - $transport->addResponse($expectedResponse); - $request = new UpdateProfileRequest(); - $response = $gapicClient->updateProfile($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProfileExceptionTest() - { - $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); - $request = new UpdateProfileRequest(); - try { - $gapicClient->updateProfile($request); - // 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 createOfflineProfileAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $profileBytes = '85'; - $expectedResponse = new Profile(); - $expectedResponse->setName($name); - $expectedResponse->setProfileBytes($profileBytes); - $transport->addResponse($expectedResponse); - $request = new CreateOfflineProfileRequest(); - $response = $gapicClient->createOfflineProfileAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php b/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Pubsub.php deleted file mode 100644 index 97038a175348fafc46d33a797451a9d8d62cd80c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17622 zcmc&+&2L-Tb@!trTRM~_`P#B+jz8!(&RCXhYRqvn9!_izDbW^d>tjU9nM{?wK9Wz; zt0_K)@6obmVl*wfn0^95nij~SMNyz=Q?#oV2+~E-O$%hxBHd|~MK_(lpvbD{em!3D zU6GRQCbO}I_v_sA`8(%a@@o&8+f8^o^~h;BEjw^(smfj|*mhFQmKS(cub!&3H#ePD zs_N}D-MZ6Cr&0?mspXY&s<2QjU%{om*KSpvY--E%w(8DYvt9AqmAU7)#b0T*6F|e> zar~xTbyAO3^Gi-(*X+RFc*GWMtg=NLPj7z+P_5g(pW>gu=a9nxaL>A1P5FTx;6GPg z-*Ovn;M#TfGo<)lYSXU!4la$(-E23if$KF=biqoa>dahE@jdC>t4$AYcrO)_K`)IL z-Y7N#r`53Q8w-wKZMn_BYpvqcY<9~DLRQgFX0D54>2~gBYKGI8%|?j4mkL^KM?F22 zYB@o>)%cLnO*eQM{4_&8T%RAfl zbJuGfZRwgL)Z)-Yu1el7v{4c9f`>maT#8I9>@DjRkxiTTfdU&=dJs$(8gS?7AoIEG{%`wU8wS0gMa#M11|P8Lo&sO)7(na&u=Hs zi3N7kovSh>;TD^`tPE^YO|U9L6~u(|%7m7Xw-~x4hM4W6LCw{KP{sILz2goQn-~l| ziO`5Se)#;+eZqqWbKS&h7e-`Fck3;xY0GoUGQpcFpp+ zNZ4iLne5T_ou^v}p~{^f!`Wut4p3SJA$U#Tg?hIK5SE;-y>9T~t@QTJ_qEATc5Z9y9;cfDv{+nTAuPa;{vk z)|X4Gh56#cVqszG7y&q*n=coi7N!hx5zap@E*DD0lC@e`TPl`H#g%1ip|DJ+#^~_s zdj3hVw5S;#B4=Q#R9-9OmMnx2*29(c<%OwXau&$^%5rIasj#MeK9c)p4@l4@04lLtt57}l?G4TlddCQYW zaBX~@BXYP~_Yn;s+`CxnNmTan%;VR%%xb$*YFDD?%|mhrVaZN=$MPz_=~M%&ikcia z7WL4HNR&(m^j*D1LxK!%i z7LR>l82NDkD;!PY|8;0h5}4|x-~7Q*Y~XFUJpW{6eZeY~SJrZm3K~^Ej3wmP=N}i! zipCF9`zWuhSWCI(Z&)k&UoFg+OH(8H2^e=9&9+p={3u2e=9A5TG2o2OS&@e@>O0S! zmK*E|-!vB$w{B&+B$hE*m==u64@d&elnPG^YsK<6dK|yX6#~BUU8@ zMgp(tRy(qdktCdSS}m_-A>yL(TXl~%Om{^PYm@ILZ1=k7qtO?3E+riwhGA&LAMMFah8?( zhMe1(SRVms|-6Etud7`i@Tm!w)|!8V|YuC zzPb8c!3={&F@NrJ@z=|_fGQ?_!2W$nCTW;KNz`t!4=nRLF*u3g1&bg;d8iUoma!|1 za}g{8*g?>8EA7CMimY?c>OSdQxI$5C1ZPqqB+4i6!Z_Zl?)uw2?s8<&C+<>c>9uMY zE*e`@r90@*NZy9Yo`VO9r~s3XoPe=#&G}XvGYOLEcII!h+~;Cn?wh+n)|<#Vr)#Gh z>Q3>@xv0jm>6Fhg%(>!iwuMF0N9I`LN&+SA;~~v&Y4*=nncs#9lpy8bYmiUA3Zp_Y zQo@&`w03Cz5%D6V4}+I>`QVN;Dpdu5j@{x{JsS@ zScH_>`i|Ye7}^q4g_-9nS9*lyV@({ld@Qpu){SuGMSR9S54>j%4@Mj_o4)}>r9}{b z6OISWW{?)@u=`2OAQxb=L2Xint;yVVM@6gb&oBp;J{9@U#21y+Sf&-{N zz9dWBo`IeI5?%zdz#M9q(Z7OJ&2Pf_1*|hyw^gP}3;77fRq+TjLFr&g=1|fxFF;ba zJ-@v9cL3w+xjG~hUWzODVSFMwm3Xs_ejN(|o9>pVU|i7o6@Po4&EYnSn55!vp)YRj z$+d(P_eJN(G^6L)n^zq?OGixKnNgkr<%_q zj_@xgOe40jv9N|Su@)D4(Kn2P9)w78j5(&+=q*$cMgiqjIOjC%3f5etca}jkLE%sc z*-kkxnl7(uOT-yxd^4jb7Q(5#D9Oc#S;MAVr-|-3E)*q-c_5UH7Qzo4kvpF}Xy*l- z`-DwZcfJeb$ZXUK0fi^nat$V2qqEeN(=b|N_T|(PlekJ;_c~k@4}# zcDrJ!ZUKwCn_l7^BSDitcI}yyyDYNWNEn%lxCIsBP;vz>^qYjq|A{(=a>QW59Wi%_ z&`c#sNe+*SobMk2ITM(O;N?%g%&i|PaLs98vw8$1_gV@ z40mPb1DNVHXmSIFf}no58<{^C23SRh&s`|3e=zs&G-^!``$8%`1x-$IGwNVEyXg~( z9DwK6s#XWx=}Y7xQRx+&UZz-(`6{gC7h!_K8*8^^H?fr>;*`e0D%5Z&{B^#9Z)Fgq zrs0L#@WQ1gPgk~C_PV!7K7_H5LV`l;sf1hDesj4vgkMF+X18nDFRiMjnB=6)>%{)a z85j!>!)oNjE>_!UDB!(qCK~P&Um=IepMz<;jh%SR@T;uYL^s~{YP3!wxN83K5KMFj zYgRO)5lK}H?Dw>NEWuI`ZiyBY)luQFqm3XSfCUo7DZW7hXyQGZ8P(c|jm58km6cz;nA|t>A=~H9r7AH}VVLM_7OLUW^ z`NhIg&cgP_Qm#C|h$Ty``4*S0@>*`WR4iLhR_1fEs8C)jVsm6=8H<_!GlHEAr3EFd zR#WqfQFMMgOru#y1?OmfjKEc4zu-#*juRtPPOA};TU6*YHiadlOKNdX< zL|7fLs3|iy949QcZ#;K=nM>U@0d~0Rh2zj zG@&{mil7)G>E|I%q-8KMgfY)&4LV-y(s&@vM3v-?BLta;%{xBmw{c#K{(p1Bka zwCZANM6X(n`mO;9nr5r}g?aujsnXNtwTB*(MB<;-l|Bx|qCw>!meSK|t9tO86a4oK zIJbmPEjIT$c;b!i-kZ8}U^*~$kC}gDKzy}bufI7;t^mPI3!k1@?#_-=b1{O{_n38# z=0_3+ec;mTQfcsErWZ3mhH*|#Sm`>|5{{tbf_bU$O4KTPdIpcHHXB3Fj z(!iU$FD6#pFHztk-tff8L6r#Qs&(x5RVnbPJGHISnYFLs!^N6RroNR}waXl6yYY0$S*^3_V;@=lCaTlqsX8Yn2*6KDlN4UOU$ zWiVnl=!2(@Iw`?kq+RMX4hT9?-~99AFx|t+H>Rv)6B2lTsT91LM&F3g&MZeo529+X zr6#Q?7sE$l8)g(FfRvC9Wj9SlS;36qFL@r-RqeAB{do}^i=JA8bG}lyMri6`0vEW5 zxOf{$^TtVknChdkr66`;cT4^WdfEdnPsT0^J&|3bIi}lQCCs zH(2ov>xFWh>TpN5XmXB^{jkzS+sw+e&?Okj&){NT7QGT}sMiOc-61jg49@B~MrPrn zwv=Y^IvYn@B4wgRB>Ka$78y?KWL0PJ^ol!*J}qGGb3P2EK&?Vs z_>qLZF5|OLzRVQ|D%Qp|T`f`Yiq;XupD)d2AT%TBk>TAQ8II)-snQg7onf$B9wsg1 zmjt<8nC>A*gtSa=pKYL?4uaVq!!+-~y*Y0F8-m!9<2;j0>~$DCVLU?rjm*I?dsN7A z^dQZ~s$^DC1!@jV70{3ddbh=6^qEp%xA5B^Cceev_u$;m{3s4%Sh>W){kGF0--0;z zQmlJP4r+BL4;nDv-OsTXPrvhD|NXt#+sRAxi!`6p8qvMb4rb*Ol-ZYAW0qig7+0Q2 z5KZqx85aCMn1K2H+$mNmyxHzNoM6;k&s=5Hu+em1nlO<%A(%om4Ms5}Y0+c};SA1Y z6RDcuRLLR_Bk88Oajip>o<&VA9LlO)7?tl*h~`i^Ch0m*NOSu+{xp#hafMtSKm)-_ z4p8G|THzDTleNyMJY6G4b&_Dr?fsm5>d{4v&=!Ry^5qiwu>ohpom9x-6HPf!KT{I< zZZt|Cv_KGiuZwqczgp;2Y%n zK!W8KlJsVy{zD{D_X)=41Zg!y3{XMcO`a(g+s^~09jD}UZ$%0j1 zV=DMn^A2N?DmXdmp#t*F0_xn$C~O{B#;X7(fM`_dg=T1jbY{ATpq|mmDx|{`!9I2KAOVxdUr< zo^RZwnM#=0iI)(JhqKAAFdp`LS(T?g(ma&Rgh~_w)t)I*!h@(^ z*w1zKpBZ`5Y*ljliJ1H|vQ~g>m9-kPjm|nOrJwBQ5-LHF0QP<+6H&}a98-6Y9R6$Z z$WCRkPc*#*>PEUIN!m3R)yx%UbhpQ+&yaT*-8!G%MK1XZX7arSQoYId&XS}aFA4K$_AMx28RxHbPN|e<6 z{s!?EekAKbIxnvb54y##?dQ(uZo$m%zWKq?2uA-R>7u0mrvbyXu1GY`dz5;k&ZDUn zU-JuNKX%4j+HrrMF)&zCWMv#%(ccnx}`O*q+AeIlC20bLWM05+~g zU1ZNhVUEXUjCT#{!KS!Qc6tNkdUTK8Ir6-N%&OMwwUqe4STk?lKbp|FmUgJ5Z2CP^ zQW^jRG|?%kGAwECBvoM)kvo{^q{8Y5qjTdL;W5h>hjhtLVj_%L1ix>1l6gP*p-yOB z6C^=8q4i7@Lc7!BL$4C^U>_RN@n`t0-R>$A(H+@6MH1JKTOVOo#V~+s28?a*B(E^S zB9UGaC8GRaA!#BuiV-bo-BS)j+7s$=#FmkeIhUE`$|oj7!(|Vde}H6m*ABE~c2ALH z9%LgLU7J0muHl36VVbY&T%J;o(78M{%{TA8nw#?RXtcjyJhshaqI3qoMjmlcdF&-p zjJ-;;i&f*(41>;c8vWw=mM4G20|9vWJ08u-ha5FGEB|X4Ka8Dy#D2Pie_Jk%dzKKl zKfV1EIk2(89#(A7-}b8*I{u>xC;U&QT0mJ*2rT_o{ diff --git a/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php b/owl-bot-staging/PubSub/v1/proto/src/GPBMetadata/Google/Pubsub/V1/Schema.php deleted file mode 100644 index b487097c7ca030f8c5f2d660ff2c131071ffb9b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5034 zcmcIo%TwD%7>~>&VM&6skl>i4Q54#M19l)eiI9wJY~l{V9`op=;~9@EFQCSjR7r-= z440ldeav*GxAxXvI+-5&5A@Pwj_r*Tho15mbb9Ki-IZ*EjUlC6@MyosZ-3uwcON~m zwk&iSd>1PHfL49Bqr#)Ht<-kfGLyW2qVu7xT$y#8oS*s}>ijQZY}J zit96T2x(Q-al{p>j9wuT{=jBc*F?uvUHCVyJ0;!FU0to}p8?`|aYL;-1XPd8ZqyCU z)lEb66mo_}CMHE@(~}*yOxWSP7{Ks04I3_I4VT!4S}iURN3(UyHSIiz%JL?01FF0) z6O-JnXHMS`Cm2RqJ_2%HbnQB6_AZJxaqG4*M{#=w_JUuA!Jrf<}3aX_iG)g(k|LCoz zg$<9_QkfIW1+F&<*qlASG{%=`B|&;7h{w+%!@;8KlfVR|-$JOLRTI8~dc87?2%<1C zknA~7Liir)b$2Zi3Bjk!vp3_+RbxkSrW#)bA&e2KkPTXUrV;7!tl%*;Xp?Q-fs`!i zl}Il&-G89;9Vk6`9*qQxnoXd=lstHmevlfRjRxL$?BhWIJ#anJ9O|WhM^Je6c|KiQ zTVBbhQ`t;5y%0W!htW{JkXy~Aa!aM;S|*b&gav#7^(yOyTsS0W-YO|{gNKG~3!>u0 zp_3&zA9sMXPl)C^iC6sB9`9Q4#i1Q&Px?kc!zqfLX%)z)b;vUO5cONC4MoN290xl8 zQQpJHyPQV-%rIqqa5fTfKwBW>5NDi)=L#BN;vTn@aLGpDMdG$%nQaLyN77~UG1R-Q zlN}!U8=Y{hgN*cxfbf#;aIcO}LFy0%4=4rG=$=+J>lHtXYpS7c!sIvze}W}?VR;Rgabv8vS_%~9qTgh;70mNKv&n{ za0Dl;06epHCIx%Sa7ECy!(dn%N?(Q=OV5boKxO;vo(a$y-W6F;Z$ooFz9l|A2hGTD z&t9`VrbB@25IPUX4G%SKI~Va3xA%=et(B;-)gNt{Ma?&c&9am;w2~%8l z`S$rVz{fxc1_qt-(aFwW14)inrsy6@2^z~2pyLJrWYl`2Ty1;3 z`a@aUa$U=j6N#Oj9S$bAd#QDI3+~2nL729xs=Hy@wW)66%uUiucc{%H+e;3zfWno+ zHS@y9v(&sV1{#S?(|?!(9573mL90CH|M*)FUWcwN(&wmn%0m~=*UKyQa(sQ}jlWPV z(v_n3UIj}Vvj&gZ$=&8i>M@f*V#jR G2>lC@lYv_R diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php deleted file mode 100644 index bcea3e12824..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/AcknowledgeRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.pubsub.v1.AcknowledgeRequest - */ -class AcknowledgeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $ack_ids; - - /** - * @param string $subscription Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * @param string[] $ackIds Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * - * @return \Google\Cloud\PubSub\V1\AcknowledgeRequest - * - * @experimental - */ - public static function build(string $subscription, array $ackIds): self - { - return (new self()) - ->setSubscription($subscription) - ->setAckIds($ackIds); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAckIds() - { - return $this->ack_ids; - } - - /** - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ack_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php deleted file mode 100644 index 1f206785c59..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig.php +++ /dev/null @@ -1,347 +0,0 @@ -google.pubsub.v1.BigQueryConfig - */ -class BigQueryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the table to which to write data, of the form - * {projectId}.{datasetId}.{tableId} - * - * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $table = ''; - /** - * Optional. When true, use the topic's schema as the columns to write to in - * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_topic_schema = false; - /** - * Optional. When true, write the subscription name, message_id, publish_time, - * attributes, and ordering_key to additional columns in the table. The - * subscription name, message_id, and publish_time fields are put in their own - * columns while all other message properties (other than data) are written to - * a JSON object in the attributes column. - * - * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $write_metadata = false; - /** - * Optional. When true and use_topic_schema is true, any fields that are a - * part of the topic schema that are not part of the BigQuery table schema are - * dropped when writing to BigQuery. Otherwise, the schemas must be kept in - * sync and any messages with extra fields are not written and remain in the - * subscription's backlog. - * - * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $drop_unknown_fields = false; - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. When true, use the BigQuery table's schema as the columns to - * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_table_schema = false; - /** - * Optional. The service account to use to write to BigQuery. The subscription - * creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub [service - * agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account_email = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $table - * Optional. The name of the table to which to write data, of the form - * {projectId}.{datasetId}.{tableId} - * @type bool $use_topic_schema - * Optional. When true, use the topic's schema as the columns to write to in - * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - * enabled at the same time. - * @type bool $write_metadata - * Optional. When true, write the subscription name, message_id, publish_time, - * attributes, and ordering_key to additional columns in the table. The - * subscription name, message_id, and publish_time fields are put in their own - * columns while all other message properties (other than data) are written to - * a JSON object in the attributes column. - * @type bool $drop_unknown_fields - * Optional. When true and use_topic_schema is true, any fields that are a - * part of the topic schema that are not part of the BigQuery table schema are - * dropped when writing to BigQuery. Otherwise, the schemas must be kept in - * sync and any messages with extra fields are not written and remain in the - * subscription's backlog. - * @type int $state - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * @type bool $use_table_schema - * Optional. When true, use the BigQuery table's schema as the columns to - * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - * enabled at the same time. - * @type string $service_account_email - * Optional. The service account to use to write to BigQuery. The subscription - * creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub [service - * agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the table to which to write data, of the form - * {projectId}.{datasetId}.{tableId} - * - * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getTable() - { - return $this->table; - } - - /** - * Optional. The name of the table to which to write data, of the form - * {projectId}.{datasetId}.{tableId} - * - * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setTable($var) - { - GPBUtil::checkString($var, True); - $this->table = $var; - - return $this; - } - - /** - * Optional. When true, use the topic's schema as the columns to write to in - * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseTopicSchema() - { - return $this->use_topic_schema; - } - - /** - * Optional. When true, use the topic's schema as the columns to write to in - * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseTopicSchema($var) - { - GPBUtil::checkBool($var); - $this->use_topic_schema = $var; - - return $this; - } - - /** - * Optional. When true, write the subscription name, message_id, publish_time, - * attributes, and ordering_key to additional columns in the table. The - * subscription name, message_id, and publish_time fields are put in their own - * columns while all other message properties (other than data) are written to - * a JSON object in the attributes column. - * - * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getWriteMetadata() - { - return $this->write_metadata; - } - - /** - * Optional. When true, write the subscription name, message_id, publish_time, - * attributes, and ordering_key to additional columns in the table. The - * subscription name, message_id, and publish_time fields are put in their own - * columns while all other message properties (other than data) are written to - * a JSON object in the attributes column. - * - * Generated from protobuf field bool write_metadata = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setWriteMetadata($var) - { - GPBUtil::checkBool($var); - $this->write_metadata = $var; - - return $this; - } - - /** - * Optional. When true and use_topic_schema is true, any fields that are a - * part of the topic schema that are not part of the BigQuery table schema are - * dropped when writing to BigQuery. Otherwise, the schemas must be kept in - * sync and any messages with extra fields are not written and remain in the - * subscription's backlog. - * - * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDropUnknownFields() - { - return $this->drop_unknown_fields; - } - - /** - * Optional. When true and use_topic_schema is true, any fields that are a - * part of the topic schema that are not part of the BigQuery table schema are - * dropped when writing to BigQuery. Otherwise, the schemas must be kept in - * sync and any messages with extra fields are not written and remain in the - * subscription's backlog. - * - * Generated from protobuf field bool drop_unknown_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDropUnknownFields($var) - { - GPBUtil::checkBool($var); - $this->drop_unknown_fields = $var; - - return $this; - } - - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\BigQueryConfig\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. When true, use the BigQuery table's schema as the columns to - * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseTableSchema() - { - return $this->use_table_schema; - } - - /** - * Optional. When true, use the BigQuery table's schema as the columns to - * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - * enabled at the same time. - * - * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseTableSchema($var) - { - GPBUtil::checkBool($var); - $this->use_table_schema = $var; - - return $this; - } - - /** - * Optional. The service account to use to write to BigQuery. The subscription - * creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub [service - * agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * Optional. The service account to use to write to BigQuery. The subscription - * creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub [service - * agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php deleted file mode 100644 index e92d03742eb..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/BigQueryConfig/State.php +++ /dev/null @@ -1,91 +0,0 @@ -google.pubsub.v1.BigQueryConfig.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The subscription can actively send messages to BigQuery - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Cannot write to the BigQuery table because of permission denied errors. - * This can happen if - * - Pub/Sub SA has not been granted the [appropriate BigQuery IAM - * permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) - * - bigquery.googleapis.com API is not enabled for the project - * ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) - * - * Generated from protobuf enum PERMISSION_DENIED = 2; - */ - const PERMISSION_DENIED = 2; - /** - * Cannot write to the BigQuery table because it does not exist. - * - * Generated from protobuf enum NOT_FOUND = 3; - */ - const NOT_FOUND = 3; - /** - * Cannot write to the BigQuery table due to a schema mismatch. - * - * Generated from protobuf enum SCHEMA_MISMATCH = 4; - */ - const SCHEMA_MISMATCH = 4; - /** - * Cannot write to the destination because enforce_in_transit is set to true - * and the destination locations are not in the allowed regions. - * - * Generated from protobuf enum IN_TRANSIT_LOCATION_RESTRICTION = 5; - */ - const IN_TRANSIT_LOCATION_RESTRICTION = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::PERMISSION_DENIED => 'PERMISSION_DENIED', - self::NOT_FOUND => 'NOT_FOUND', - self::SCHEMA_MISMATCH => 'SCHEMA_MISMATCH', - self::IN_TRANSIT_LOCATION_RESTRICTION => 'IN_TRANSIT_LOCATION_RESTRICTION', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\BigQueryConfig_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php deleted file mode 100644 index ca8c225b2fe..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig.php +++ /dev/null @@ -1,506 +0,0 @@ -google.pubsub.v1.CloudStorageConfig - */ -class CloudStorageConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. User-provided name for the Cloud Storage bucket. - * The bucket must be created by the user. The bucket name must be without - * any prefix like "gs://". See the [bucket naming - * requirements] (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $bucket = ''; - /** - * Optional. User-provided prefix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * - * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filename_prefix = ''; - /** - * Optional. User-provided suffix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * Must not end in "/". - * - * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filename_suffix = ''; - /** - * Optional. User-provided format string specifying how to represent datetimes - * in Cloud Storage filenames. See the [datetime format - * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - * - * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filename_datetime_format = ''; - /** - * Optional. The maximum duration that can elapse before a new Cloud Storage - * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - * exceed the subscription's acknowledgement deadline. - * - * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_duration = null; - /** - * Optional. The maximum bytes that can be written to a Cloud Storage file - * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - * be exceeded in cases where messages are larger than the limit. - * - * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_bytes = 0; - /** - * Optional. The maximum number of messages that can be written to a Cloud - * Storage file before a new file is created. Min 1000 messages. - * - * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_messages = 0; - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. The service account to use to write to Cloud Storage. The - * subscription creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub - * [service agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account_email = ''; - protected $output_format; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Required. User-provided name for the Cloud Storage bucket. - * The bucket must be created by the user. The bucket name must be without - * any prefix like "gs://". See the [bucket naming - * requirements] (https://cloud.google.com/storage/docs/buckets#naming). - * @type string $filename_prefix - * Optional. User-provided prefix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * @type string $filename_suffix - * Optional. User-provided suffix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * Must not end in "/". - * @type string $filename_datetime_format - * Optional. User-provided format string specifying how to represent datetimes - * in Cloud Storage filenames. See the [datetime format - * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - * @type \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig $text_config - * Optional. If set, message data will be written to Cloud Storage in text - * format. - * @type \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig $avro_config - * Optional. If set, message data will be written to Cloud Storage in Avro - * format. - * @type \Google\Protobuf\Duration $max_duration - * Optional. The maximum duration that can elapse before a new Cloud Storage - * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - * exceed the subscription's acknowledgement deadline. - * @type int|string $max_bytes - * Optional. The maximum bytes that can be written to a Cloud Storage file - * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - * be exceeded in cases where messages are larger than the limit. - * @type int|string $max_messages - * Optional. The maximum number of messages that can be written to a Cloud - * Storage file before a new file is created. Min 1000 messages. - * @type int $state - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * @type string $service_account_email - * Optional. The service account to use to write to Cloud Storage. The - * subscription creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub - * [service agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. User-provided name for the Cloud Storage bucket. - * The bucket must be created by the user. The bucket name must be without - * any prefix like "gs://". See the [bucket naming - * requirements] (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Required. User-provided name for the Cloud Storage bucket. - * The bucket must be created by the user. The bucket name must be without - * any prefix like "gs://". See the [bucket naming - * requirements] (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Optional. User-provided prefix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * - * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilenamePrefix() - { - return $this->filename_prefix; - } - - /** - * Optional. User-provided prefix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * - * Generated from protobuf field string filename_prefix = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilenamePrefix($var) - { - GPBUtil::checkString($var, True); - $this->filename_prefix = $var; - - return $this; - } - - /** - * Optional. User-provided suffix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * Must not end in "/". - * - * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilenameSuffix() - { - return $this->filename_suffix; - } - - /** - * Optional. User-provided suffix for Cloud Storage filename. See the [object - * naming requirements](https://cloud.google.com/storage/docs/objects#naming). - * Must not end in "/". - * - * Generated from protobuf field string filename_suffix = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilenameSuffix($var) - { - GPBUtil::checkString($var, True); - $this->filename_suffix = $var; - - return $this; - } - - /** - * Optional. User-provided format string specifying how to represent datetimes - * in Cloud Storage filenames. See the [datetime format - * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - * - * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilenameDatetimeFormat() - { - return $this->filename_datetime_format; - } - - /** - * Optional. User-provided format string specifying how to represent datetimes - * in Cloud Storage filenames. See the [datetime format - * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - * - * Generated from protobuf field string filename_datetime_format = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilenameDatetimeFormat($var) - { - GPBUtil::checkString($var, True); - $this->filename_datetime_format = $var; - - return $this; - } - - /** - * Optional. If set, message data will be written to Cloud Storage in text - * format. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig|null - */ - public function getTextConfig() - { - return $this->readOneof(4); - } - - public function hasTextConfig() - { - return $this->hasOneof(4); - } - - /** - * Optional. If set, message data will be written to Cloud Storage in text - * format. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig $var - * @return $this - */ - public function setTextConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\TextConfig::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Optional. If set, message data will be written to Cloud Storage in Avro - * format. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig|null - */ - public function getAvroConfig() - { - return $this->readOneof(5); - } - - public function hasAvroConfig() - { - return $this->hasOneof(5); - } - - /** - * Optional. If set, message data will be written to Cloud Storage in Avro - * format. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig $var - * @return $this - */ - public function setAvroConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\AvroConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. The maximum duration that can elapse before a new Cloud Storage - * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - * exceed the subscription's acknowledgement deadline. - * - * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxDuration() - { - return $this->max_duration; - } - - public function hasMaxDuration() - { - return isset($this->max_duration); - } - - public function clearMaxDuration() - { - unset($this->max_duration); - } - - /** - * Optional. The maximum duration that can elapse before a new Cloud Storage - * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - * exceed the subscription's acknowledgement deadline. - * - * Generated from protobuf field .google.protobuf.Duration max_duration = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_duration = $var; - - return $this; - } - - /** - * Optional. The maximum bytes that can be written to a Cloud Storage file - * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - * be exceeded in cases where messages are larger than the limit. - * - * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getMaxBytes() - { - return $this->max_bytes; - } - - /** - * Optional. The maximum bytes that can be written to a Cloud Storage file - * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - * be exceeded in cases where messages are larger than the limit. - * - * Generated from protobuf field int64 max_bytes = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setMaxBytes($var) - { - GPBUtil::checkInt64($var); - $this->max_bytes = $var; - - return $this; - } - - /** - * Optional. The maximum number of messages that can be written to a Cloud - * Storage file before a new file is created. Min 1000 messages. - * - * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getMaxMessages() - { - return $this->max_messages; - } - - /** - * Optional. The maximum number of messages that can be written to a Cloud - * Storage file before a new file is created. Min 1000 messages. - * - * Generated from protobuf field int64 max_messages = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setMaxMessages($var) - { - GPBUtil::checkInt64($var); - $this->max_messages = $var; - - return $this; - } - - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field that indicates whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\CloudStorageConfig\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. The service account to use to write to Cloud Storage. The - * subscription creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub - * [service agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * Optional. The service account to use to write to Cloud Storage. The - * subscription creator or updater that specifies this field must have - * `iam.serviceAccounts.actAs` permission on the service account. If not - * specified, the Pub/Sub - * [service agent](https://cloud.google.com/iam/docs/service-agents), - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - * - * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * @return string - */ - public function getOutputFormat() - { - return $this->whichOneof("output_format"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php deleted file mode 100644 index 03971b1d3dc..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/AvroConfig.php +++ /dev/null @@ -1,129 +0,0 @@ -google.pubsub.v1.CloudStorageConfig.AvroConfig - */ -class AvroConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. When true, write the subscription name, message_id, - * publish_time, attributes, and ordering_key as additional fields in the - * output. The subscription name, message_id, and publish_time fields are - * put in their own fields while all other message properties other than - * data (for example, an ordering_key, if present) are added as entries in - * the attributes map. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $write_metadata = false; - /** - * Optional. When true, the output Cloud Storage file will be serialized - * using the topic schema, if it exists. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_topic_schema = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $write_metadata - * Optional. When true, write the subscription name, message_id, - * publish_time, attributes, and ordering_key as additional fields in the - * output. The subscription name, message_id, and publish_time fields are - * put in their own fields while all other message properties other than - * data (for example, an ordering_key, if present) are added as entries in - * the attributes map. - * @type bool $use_topic_schema - * Optional. When true, the output Cloud Storage file will be serialized - * using the topic schema, if it exists. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. When true, write the subscription name, message_id, - * publish_time, attributes, and ordering_key as additional fields in the - * output. The subscription name, message_id, and publish_time fields are - * put in their own fields while all other message properties other than - * data (for example, an ordering_key, if present) are added as entries in - * the attributes map. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getWriteMetadata() - { - return $this->write_metadata; - } - - /** - * Optional. When true, write the subscription name, message_id, - * publish_time, attributes, and ordering_key as additional fields in the - * output. The subscription name, message_id, and publish_time fields are - * put in their own fields while all other message properties other than - * data (for example, an ordering_key, if present) are added as entries in - * the attributes map. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setWriteMetadata($var) - { - GPBUtil::checkBool($var); - $this->write_metadata = $var; - - return $this; - } - - /** - * Optional. When true, the output Cloud Storage file will be serialized - * using the topic schema, if it exists. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseTopicSchema() - { - return $this->use_topic_schema; - } - - /** - * Optional. When true, the output Cloud Storage file will be serialized - * using the topic schema, if it exists. - * - * Generated from protobuf field bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseTopicSchema($var) - { - GPBUtil::checkBool($var); - $this->use_topic_schema = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AvroConfig::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_AvroConfig::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php deleted file mode 100644 index 394d25dbcc1..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/State.php +++ /dev/null @@ -1,88 +0,0 @@ -google.pubsub.v1.CloudStorageConfig.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The subscription can actively send messages to Cloud Storage. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Cannot write to the Cloud Storage bucket because of permission denied - * errors. - * - * Generated from protobuf enum PERMISSION_DENIED = 2; - */ - const PERMISSION_DENIED = 2; - /** - * Cannot write to the Cloud Storage bucket because it does not exist. - * - * Generated from protobuf enum NOT_FOUND = 3; - */ - const NOT_FOUND = 3; - /** - * Cannot write to the destination because enforce_in_transit is set to true - * and the destination locations are not in the allowed regions. - * - * Generated from protobuf enum IN_TRANSIT_LOCATION_RESTRICTION = 4; - */ - const IN_TRANSIT_LOCATION_RESTRICTION = 4; - /** - * Cannot write to the Cloud Storage bucket due to an incompatibility - * between the topic schema and subscription settings. - * - * Generated from protobuf enum SCHEMA_MISMATCH = 5; - */ - const SCHEMA_MISMATCH = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::PERMISSION_DENIED => 'PERMISSION_DENIED', - self::NOT_FOUND => 'NOT_FOUND', - self::IN_TRANSIT_LOCATION_RESTRICTION => 'IN_TRANSIT_LOCATION_RESTRICTION', - self::SCHEMA_MISMATCH => 'SCHEMA_MISMATCH', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php deleted file mode 100644 index b76638c3113..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CloudStorageConfig/TextConfig.php +++ /dev/null @@ -1,38 +0,0 @@ -google.pubsub.v1.CloudStorageConfig.TextConfig - */ -class TextConfig extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TextConfig::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_TextConfig::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php deleted file mode 100644 index 29f01208b3c..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CommitSchemaRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.pubsub.v1.CommitSchemaRequest - */ -class CommitSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The schema revision to commit. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schema = null; - - /** - * @param string $name Required. The name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. Please see - * {@see SchemaServiceClient::schemaName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema revision to commit. - * - * @return \Google\Cloud\PubSub\V1\CommitSchemaRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\PubSub\V1\Schema $schema): self - { - return (new self()) - ->setName($name) - ->setSchema($schema); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. - * @type \Google\Cloud\PubSub\V1\Schema $schema - * Required. The schema revision to commit. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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 name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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 schema revision to commit. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Schema|null - */ - public function getSchema() - { - return $this->schema; - } - - public function hasSchema() - { - return isset($this->schema); - } - - public function clearSchema() - { - unset($this->schema); - } - - /** - * Required. The schema revision to commit. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Schema $var - * @return $this - */ - public function setSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); - $this->schema = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php deleted file mode 100644 index 486fe277daa..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSchemaRequest.php +++ /dev/null @@ -1,200 +0,0 @@ -google.pubsub.v1.CreateSchemaRequest - */ -class CreateSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to create the schema. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The schema object to create. - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schema = null; - /** - * The ID to use for the schema, which will become the final component of - * the schema's resource name. - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * - * Generated from protobuf field string schema_id = 3; - */ - protected $schema_id = ''; - - /** - * @param string $parent Required. The name of the project in which to create the schema. - * Format is `projects/{project-id}`. Please see - * {@see SchemaServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema object to create. - * - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * @param string $schemaId The ID to use for the schema, which will become the final component of - * the schema's resource name. - * - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * - * @return \Google\Cloud\PubSub\V1\CreateSchemaRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\PubSub\V1\Schema $schema, string $schemaId): self - { - return (new self()) - ->setParent($parent) - ->setSchema($schema) - ->setSchemaId($schemaId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which to create the schema. - * Format is `projects/{project-id}`. - * @type \Google\Cloud\PubSub\V1\Schema $schema - * Required. The schema object to create. - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * @type string $schema_id - * The ID to use for the schema, which will become the final component of - * the schema's resource name. - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to create the schema. - * Format is `projects/{project-id}`. - * - * 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 name of the project in which to create the schema. - * Format is `projects/{project-id}`. - * - * 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 schema object to create. - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Schema|null - */ - public function getSchema() - { - return $this->schema; - } - - public function hasSchema() - { - return isset($this->schema); - } - - public function clearSchema() - { - unset($this->schema); - } - - /** - * Required. The schema object to create. - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Schema $var - * @return $this - */ - public function setSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); - $this->schema = $var; - - return $this; - } - - /** - * The ID to use for the schema, which will become the final component of - * the schema's resource name. - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * - * Generated from protobuf field string schema_id = 3; - * @return string - */ - public function getSchemaId() - { - return $this->schema_id; - } - - /** - * The ID to use for the schema, which will become the final component of - * the schema's resource name. - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * - * Generated from protobuf field string schema_id = 3; - * @param string $var - * @return $this - */ - public function setSchemaId($var) - { - GPBUtil::checkString($var, True); - $this->schema_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php deleted file mode 100644 index d886092613f..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/CreateSnapshotRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.pubsub.v1.CreateSnapshotRequest - */ -class CreateSnapshotRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * @param string $name Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. Please see - * {@see SubscriberClient::snapshotName()} for help formatting this field. - * @param string $subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\CreateSnapshotRequest - * - * @experimental - */ - public static function build(string $name, string $subscription): self - { - return (new self()) - ->setName($name) - ->setSubscription($subscription); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. - * @type string $subscription - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. - * - * 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. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. - * - * 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 subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 3 [(.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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php deleted file mode 100644 index b7286c36759..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeadLetterPolicy.php +++ /dev/null @@ -1,164 +0,0 @@ -google.pubsub.v1.DeadLetterPolicy - */ -class DeadLetterPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the topic to which dead letter messages should be - * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - * service account associated with the enclosing subscription's parent project - * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - * have permission to Publish() to this topic. - * The operation will fail if the topic does not exist. - * Users should ensure that there is a subscription attached to this topic - * since messages published to a topic with no subscriptions are lost. - * - * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $dead_letter_topic = ''; - /** - * Optional. The maximum number of delivery attempts for any message. The - * value must be between 5 and 100. - * The number of delivery attempts is defined as 1 + (the sum of number of - * NACKs and number of times the acknowledgement deadline has been exceeded - * for the message). - * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - * client libraries may automatically extend ack_deadlines. - * This field will be honored on a best effort basis. - * If this parameter is 0, a default value of 5 is used. - * - * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_delivery_attempts = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $dead_letter_topic - * Optional. The name of the topic to which dead letter messages should be - * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - * service account associated with the enclosing subscription's parent project - * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - * have permission to Publish() to this topic. - * The operation will fail if the topic does not exist. - * Users should ensure that there is a subscription attached to this topic - * since messages published to a topic with no subscriptions are lost. - * @type int $max_delivery_attempts - * Optional. The maximum number of delivery attempts for any message. The - * value must be between 5 and 100. - * The number of delivery attempts is defined as 1 + (the sum of number of - * NACKs and number of times the acknowledgement deadline has been exceeded - * for the message). - * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - * client libraries may automatically extend ack_deadlines. - * This field will be honored on a best effort basis. - * If this parameter is 0, a default value of 5 is used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the topic to which dead letter messages should be - * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - * service account associated with the enclosing subscription's parent project - * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - * have permission to Publish() to this topic. - * The operation will fail if the topic does not exist. - * Users should ensure that there is a subscription attached to this topic - * since messages published to a topic with no subscriptions are lost. - * - * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDeadLetterTopic() - { - return $this->dead_letter_topic; - } - - /** - * Optional. The name of the topic to which dead letter messages should be - * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - * service account associated with the enclosing subscription's parent project - * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - * have permission to Publish() to this topic. - * The operation will fail if the topic does not exist. - * Users should ensure that there is a subscription attached to this topic - * since messages published to a topic with no subscriptions are lost. - * - * Generated from protobuf field string dead_letter_topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDeadLetterTopic($var) - { - GPBUtil::checkString($var, True); - $this->dead_letter_topic = $var; - - return $this; - } - - /** - * Optional. The maximum number of delivery attempts for any message. The - * value must be between 5 and 100. - * The number of delivery attempts is defined as 1 + (the sum of number of - * NACKs and number of times the acknowledgement deadline has been exceeded - * for the message). - * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - * client libraries may automatically extend ack_deadlines. - * This field will be honored on a best effort basis. - * If this parameter is 0, a default value of 5 is used. - * - * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxDeliveryAttempts() - { - return $this->max_delivery_attempts; - } - - /** - * Optional. The maximum number of delivery attempts for any message. The - * value must be between 5 and 100. - * The number of delivery attempts is defined as 1 + (the sum of number of - * NACKs and number of times the acknowledgement deadline has been exceeded - * for the message). - * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - * client libraries may automatically extend ack_deadlines. - * This field will be honored on a best effort basis. - * If this parameter is 0, a default value of 5 is used. - * - * Generated from protobuf field int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxDeliveryAttempts($var) - { - GPBUtil::checkInt32($var); - $this->max_delivery_attempts = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php deleted file mode 100644 index ff8bdac822d..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.DeleteSchemaRequest - */ -class DeleteSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. Please see - * {@see SchemaServiceClient::schemaName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\DeleteSchemaRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php deleted file mode 100644 index fdb3da46606..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSchemaRevisionRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.pubsub.v1.DeleteSchemaRevisionRequest - */ -class DeleteSchemaRevisionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * - * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $revision_id = ''; - - /** - * @param string $name Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - * - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * Please see {@see SchemaServiceClient::schemaName()} for help formatting this field. - * @param string $revisionId Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * - * @return \Google\Cloud\PubSub\V1\DeleteSchemaRevisionRequest - * - * @experimental - */ - public static function build(string $name, string $revisionId): self - { - return (new self()) - ->setName($name) - ->setRevisionId($revisionId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * @type string $revision_id - * Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * - * 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 name of the schema revision to be deleted, with a revision ID - * explicitly included. - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * - * 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; - } - - /** - * Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * - * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getRevisionId() - { - @trigger_error('revision_id is deprecated.', E_USER_DEPRECATED); - return $this->revision_id; - } - - /** - * Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * - * Generated from protobuf field string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setRevisionId($var) - { - @trigger_error('revision_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php deleted file mode 100644 index 3b766a68341..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSnapshotRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.DeleteSnapshotRequest - */ -class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $snapshot = ''; - - /** - * @param string $snapshot Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. Please see - * {@see SubscriberClient::snapshotName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\DeleteSnapshotRequest - * - * @experimental - */ - public static function build(string $snapshot): self - { - return (new self()) - ->setSnapshot($snapshot); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $snapshot - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSnapshot() - { - return $this->snapshot; - } - - /** - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSnapshot($var) - { - GPBUtil::checkString($var, True); - $this->snapshot = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php deleted file mode 100644 index 9bef784bfab..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteSubscriptionRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.DeleteSubscriptionRequest - */ -class DeleteSubscriptionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - - /** - * @param string $subscription Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\DeleteSubscriptionRequest - * - * @experimental - */ - public static function build(string $subscription): self - { - return (new self()) - ->setSubscription($subscription); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php deleted file mode 100644 index bdd8fbafdf8..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DeleteTopicRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.DeleteTopicRequest - */ -class DeleteTopicRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - - /** - * @param string $topic Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. Please see - * {@see PublisherClient::topicName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\DeleteTopicRequest - * - * @experimental - */ - public static function build(string $topic): self - { - return (new self()) - ->setTopic($topic); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php deleted file mode 100644 index 4279c67be0e..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.pubsub.v1.DetachSubscriptionRequest - */ -class DetachSubscriptionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription to detach. - * Format is `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription to detach. - * Format is `projects/{project}/subscriptions/{subscription}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription to detach. - * Format is `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription to detach. - * Format is `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php deleted file mode 100644 index 99d903a39c5..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/DetachSubscriptionResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.pubsub.v1.DetachSubscriptionResponse - */ -class DetachSubscriptionResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php deleted file mode 100644 index 44b74224b4a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Encoding.php +++ /dev/null @@ -1,62 +0,0 @@ -google.pubsub.v1.Encoding - */ -class Encoding -{ - /** - * Unspecified - * - * Generated from protobuf enum ENCODING_UNSPECIFIED = 0; - */ - const ENCODING_UNSPECIFIED = 0; - /** - * JSON encoding - * - * Generated from protobuf enum JSON = 1; - */ - const JSON = 1; - /** - * Binary encoding, as defined by the schema type. For some schema types, - * binary encoding may not be available. - * - * Generated from protobuf enum BINARY = 2; - */ - const BINARY = 2; - - private static $valueToName = [ - self::ENCODING_UNSPECIFIED => 'ENCODING_UNSPECIFIED', - self::JSON => 'JSON', - self::BINARY => 'BINARY', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php deleted file mode 100644 index dd88b82331f..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ExpirationPolicy.php +++ /dev/null @@ -1,98 +0,0 @@ -google.pubsub.v1.ExpirationPolicy - */ -class ExpirationPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Specifies the "time-to-live" duration for an associated resource. - * The resource expires if it is not active for a period of `ttl`. The - * definition of "activity" depends on the type of the associated resource. - * The minimum and maximum allowed values for `ttl` depend on the type of the - * associated resource, as well. If `ttl` is not set, the associated resource - * never expires. - * - * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ttl = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $ttl - * Optional. Specifies the "time-to-live" duration for an associated resource. - * The resource expires if it is not active for a period of `ttl`. The - * definition of "activity" depends on the type of the associated resource. - * The minimum and maximum allowed values for `ttl` depend on the type of the - * associated resource, as well. If `ttl` is not set, the associated resource - * never expires. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Specifies the "time-to-live" duration for an associated resource. - * The resource expires if it is not active for a period of `ttl`. The - * definition of "activity" depends on the type of the associated resource. - * The minimum and maximum allowed values for `ttl` depend on the type of the - * associated resource, as well. If `ttl` is not set, the associated resource - * never expires. - * - * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getTtl() - { - return $this->ttl; - } - - public function hasTtl() - { - return isset($this->ttl); - } - - public function clearTtl() - { - unset($this->ttl); - } - - /** - * Optional. Specifies the "time-to-live" duration for an associated resource. - * The resource expires if it is not active for a period of `ttl`. The - * definition of "activity" depends on the type of the associated resource. - * The minimum and maximum allowed values for `ttl` depend on the type of the - * associated resource, as well. If `ttl` is not set, the associated resource - * never expires. - * - * Generated from protobuf field .google.protobuf.Duration ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->ttl = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php deleted file mode 100644 index afbe7ce6056..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSchemaRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.pubsub.v1.GetSchemaRequest - */ -class GetSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The set of fields to return in the response. If not set, returns a Schema - * with all fields filled out. Set to `BASIC` to omit the `definition`. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - */ - protected $view = 0; - - /** - * @param string $name Required. The name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. Please see - * {@see SchemaServiceClient::schemaName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\GetSchemaRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. - * @type int $view - * The set of fields to return in the response. If not set, returns a Schema - * with all fields filled out. Set to `BASIC` to omit the `definition`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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 name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. - * - * 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; - } - - /** - * The set of fields to return in the response. If not set, returns a Schema - * with all fields filled out. Set to `BASIC` to omit the `definition`. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The set of fields to return in the response. If not set, returns a Schema - * with all fields filled out. Set to `BASIC` to omit the `definition`. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php deleted file mode 100644 index 55f4ab4e63a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSnapshotRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.GetSnapshotRequest - */ -class GetSnapshotRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $snapshot = ''; - - /** - * @param string $snapshot Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. Please see - * {@see SubscriberClient::snapshotName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\GetSnapshotRequest - * - * @experimental - */ - public static function build(string $snapshot): self - { - return (new self()) - ->setSnapshot($snapshot); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $snapshot - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSnapshot() - { - return $this->snapshot; - } - - /** - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSnapshot($var) - { - GPBUtil::checkString($var, True); - $this->snapshot = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php deleted file mode 100644 index e9a42ecdf58..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetSubscriptionRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.GetSubscriptionRequest - */ -class GetSubscriptionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - - /** - * @param string $subscription Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\GetSubscriptionRequest - * - * @experimental - */ - public static function build(string $subscription): self - { - return (new self()) - ->setSubscription($subscription); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php deleted file mode 100644 index 0686a920c4e..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/GetTopicRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.pubsub.v1.GetTopicRequest - */ -class GetTopicRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - - /** - * @param string $topic Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. Please see - * {@see PublisherClient::topicName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\GetTopicRequest - * - * @experimental - */ - public static function build(string $topic): self - { - return (new self()) - ->setTopic($topic); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php deleted file mode 100644 index be496bec384..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings.php +++ /dev/null @@ -1,156 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings - */ -class IngestionDataSourceSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Platform Logs settings. If unset, no Platform Logs will be - * generated. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $platform_logs_settings = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis $aws_kinesis - * Optional. Amazon Kinesis Data Streams. - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $cloud_storage - * Optional. Cloud Storage. - * @type \Google\Cloud\PubSub\V1\PlatformLogsSettings $platform_logs_settings - * Optional. Platform Logs settings. If unset, no Platform Logs will be - * generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Amazon Kinesis Data Streams. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis aws_kinesis = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis|null - */ - public function getAwsKinesis() - { - return $this->readOneof(1); - } - - public function hasAwsKinesis() - { - return $this->hasOneof(1); - } - - /** - * Optional. Amazon Kinesis Data Streams. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis aws_kinesis = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis $var - * @return $this - */ - public function setAwsKinesis($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. Cloud Storage. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage|null - */ - public function getCloudStorage() - { - return $this->readOneof(2); - } - - public function hasCloudStorage() - { - return $this->hasOneof(2); - } - - /** - * Optional. Cloud Storage. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $var - * @return $this - */ - public function setCloudStorage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Optional. Platform Logs settings. If unset, no Platform Logs will be - * generated. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PlatformLogsSettings|null - */ - public function getPlatformLogsSettings() - { - return $this->platform_logs_settings; - } - - public function hasPlatformLogsSettings() - { - return isset($this->platform_logs_settings); - } - - public function clearPlatformLogsSettings() - { - unset($this->platform_logs_settings); - } - - /** - * Optional. Platform Logs settings. If unset, no Platform Logs will be - * generated. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PlatformLogsSettings $var - * @return $this - */ - public function setPlatformLogsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings::class); - $this->platform_logs_settings = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php deleted file mode 100644 index ce30e3b1619..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis.php +++ /dev/null @@ -1,234 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - */ -class AwsKinesis extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. An output-only field that indicates the state of the Kinesis - * ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The Kinesis stream ARN to ingest data from. - * - * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $stream_arn = ''; - /** - * Required. The Kinesis consumer ARN to used for ingestion in Enhanced - * Fan-Out mode. The consumer must be already created and ready to be used. - * - * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $consumer_arn = ''; - /** - * Required. AWS role ARN to be used for Federated Identity authentication - * with Kinesis. Check the Pub/Sub docs for how to set up this role and the - * required permissions that need to be attached to it. - * - * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $aws_role_arn = ''; - /** - * Required. The GCP service account to be used for Federated Identity - * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - * the provided role). The `aws_role_arn` must be set up with - * `accounts.google.com:sub` equals to this service account number. - * - * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $gcp_service_account = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. An output-only field that indicates the state of the Kinesis - * ingestion source. - * @type string $stream_arn - * Required. The Kinesis stream ARN to ingest data from. - * @type string $consumer_arn - * Required. The Kinesis consumer ARN to used for ingestion in Enhanced - * Fan-Out mode. The consumer must be already created and ready to be used. - * @type string $aws_role_arn - * Required. AWS role ARN to be used for Federated Identity authentication - * with Kinesis. Check the Pub/Sub docs for how to set up this role and the - * required permissions that need to be attached to it. - * @type string $gcp_service_account - * Required. The GCP service account to be used for Federated Identity - * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - * the provided role). The `aws_role_arn` must be set up with - * `accounts.google.com:sub` equals to this service account number. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Output only. An output-only field that indicates the state of the Kinesis - * ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field that indicates the state of the Kinesis - * ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The Kinesis stream ARN to ingest data from. - * - * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getStreamArn() - { - return $this->stream_arn; - } - - /** - * Required. The Kinesis stream ARN to ingest data from. - * - * Generated from protobuf field string stream_arn = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setStreamArn($var) - { - GPBUtil::checkString($var, True); - $this->stream_arn = $var; - - return $this; - } - - /** - * Required. The Kinesis consumer ARN to used for ingestion in Enhanced - * Fan-Out mode. The consumer must be already created and ready to be used. - * - * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getConsumerArn() - { - return $this->consumer_arn; - } - - /** - * Required. The Kinesis consumer ARN to used for ingestion in Enhanced - * Fan-Out mode. The consumer must be already created and ready to be used. - * - * Generated from protobuf field string consumer_arn = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setConsumerArn($var) - { - GPBUtil::checkString($var, True); - $this->consumer_arn = $var; - - return $this; - } - - /** - * Required. AWS role ARN to be used for Federated Identity authentication - * with Kinesis. Check the Pub/Sub docs for how to set up this role and the - * required permissions that need to be attached to it. - * - * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAwsRoleArn() - { - return $this->aws_role_arn; - } - - /** - * Required. AWS role ARN to be used for Federated Identity authentication - * with Kinesis. Check the Pub/Sub docs for how to set up this role and the - * required permissions that need to be attached to it. - * - * Generated from protobuf field string aws_role_arn = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAwsRoleArn($var) - { - GPBUtil::checkString($var, True); - $this->aws_role_arn = $var; - - return $this; - } - - /** - * Required. The GCP service account to be used for Federated Identity - * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - * the provided role). The `aws_role_arn` must be set up with - * `accounts.google.com:sub` equals to this service account number. - * - * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getGcpServiceAccount() - { - return $this->gcp_service_account; - } - - /** - * Required. The GCP service account to be used for Federated Identity - * authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - * the provided role). The `aws_role_arn` must be set up with - * `accounts.google.com:sub` equals to this service account number. - * - * Generated from protobuf field string gcp_service_account = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setGcpServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->gcp_service_account = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AwsKinesis::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_AwsKinesis::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php deleted file mode 100644 index b53ce8c6788..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/AwsKinesis/State.php +++ /dev/null @@ -1,95 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Ingestion is active. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Permission denied encountered while consuming data from Kinesis. - * This can happen if: - * - The provided `aws_role_arn` does not exist or does not have the - * appropriate permissions attached. - * - The provided `aws_role_arn` is not set up properly for Identity - * Federation using `gcp_service_account`. - * - The Pub/Sub SA is not granted the - * `iam.serviceAccounts.getOpenIdToken` permission on - * `gcp_service_account`. - * - * Generated from protobuf enum KINESIS_PERMISSION_DENIED = 2; - */ - const KINESIS_PERMISSION_DENIED = 2; - /** - * Permission denied encountered while publishing to the topic. This can - * happen if the Pub/Sub SA has not been granted the [appropriate publish - * permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) - * - * Generated from protobuf enum PUBLISH_PERMISSION_DENIED = 3; - */ - const PUBLISH_PERMISSION_DENIED = 3; - /** - * The Kinesis stream does not exist. - * - * Generated from protobuf enum STREAM_NOT_FOUND = 4; - */ - const STREAM_NOT_FOUND = 4; - /** - * The Kinesis consumer does not exist. - * - * Generated from protobuf enum CONSUMER_NOT_FOUND = 5; - */ - const CONSUMER_NOT_FOUND = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::KINESIS_PERMISSION_DENIED => 'KINESIS_PERMISSION_DENIED', - self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED', - self::STREAM_NOT_FOUND => 'STREAM_NOT_FOUND', - self::CONSUMER_NOT_FOUND => 'CONSUMER_NOT_FOUND', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_AwsKinesis_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php deleted file mode 100644 index bb8882fb169..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage.php +++ /dev/null @@ -1,320 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.CloudStorage - */ -class CloudStorage extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. An output-only field that indicates the state of the Cloud - * Storage ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. Cloud Storage bucket. The bucket name must be without any - * prefix like "gs://". See the [bucket naming requirements] - * (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bucket = ''; - /** - * Optional. Only objects with a larger or equal creation timestamp will be - * ingested. - * - * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $minimum_object_create_time = null; - /** - * Optional. Glob pattern used to match objects that will be ingested. If - * unset, all objects will be ingested. See the [supported - * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). - * - * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $match_glob = ''; - protected $input_format; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. An output-only field that indicates the state of the Cloud - * Storage ingestion source. - * @type string $bucket - * Optional. Cloud Storage bucket. The bucket name must be without any - * prefix like "gs://". See the [bucket naming requirements] - * (https://cloud.google.com/storage/docs/buckets#naming). - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $text_format - * Optional. Data from Cloud Storage will be interpreted as text. - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $avro_format - * Optional. Data from Cloud Storage will be interpreted in Avro format. - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $pubsub_avro_format - * Optional. It will be assumed data from Cloud Storage was written via - * [Cloud Storage - * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). - * @type \Google\Protobuf\Timestamp $minimum_object_create_time - * Optional. Only objects with a larger or equal creation timestamp will be - * ingested. - * @type string $match_glob - * Optional. Glob pattern used to match objects that will be ingested. If - * unset, all objects will be ingested. See the [supported - * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Output only. An output-only field that indicates the state of the Cloud - * Storage ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field that indicates the state of the Cloud - * Storage ingestion source. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. Cloud Storage bucket. The bucket name must be without any - * prefix like "gs://". See the [bucket naming requirements] - * (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Optional. Cloud Storage bucket. The bucket name must be without any - * prefix like "gs://". See the [bucket naming requirements] - * (https://cloud.google.com/storage/docs/buckets#naming). - * - * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Optional. Data from Cloud Storage will be interpreted as text. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat|null - */ - public function getTextFormat() - { - return $this->readOneof(3); - } - - public function hasTextFormat() - { - return $this->hasOneof(3); - } - - /** - * Optional. Data from Cloud Storage will be interpreted as text. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $var - * @return $this - */ - public function setTextFormat($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. Data from Cloud Storage will be interpreted in Avro format. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat|null - */ - public function getAvroFormat() - { - return $this->readOneof(4); - } - - public function hasAvroFormat() - { - return $this->hasOneof(4); - } - - /** - * Optional. Data from Cloud Storage will be interpreted in Avro format. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $var - * @return $this - */ - public function setAvroFormat($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Optional. It will be assumed data from Cloud Storage was written via - * [Cloud Storage - * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat|null - */ - public function getPubsubAvroFormat() - { - return $this->readOneof(5); - } - - public function hasPubsubAvroFormat() - { - return $this->hasOneof(5); - } - - /** - * Optional. It will be assumed data from Cloud Storage was written via - * [Cloud Storage - * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $var - * @return $this - */ - public function setPubsubAvroFormat($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. Only objects with a larger or equal creation timestamp will be - * ingested. - * - * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getMinimumObjectCreateTime() - { - return $this->minimum_object_create_time; - } - - public function hasMinimumObjectCreateTime() - { - return isset($this->minimum_object_create_time); - } - - public function clearMinimumObjectCreateTime() - { - unset($this->minimum_object_create_time); - } - - /** - * Optional. Only objects with a larger or equal creation timestamp will be - * ingested. - * - * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setMinimumObjectCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->minimum_object_create_time = $var; - - return $this; - } - - /** - * Optional. Glob pattern used to match objects that will be ingested. If - * unset, all objects will be ingested. See the [supported - * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). - * - * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getMatchGlob() - { - return $this->match_glob; - } - - /** - * Optional. Glob pattern used to match objects that will be ingested. If - * unset, all objects will be ingested. See the [supported - * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). - * - * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setMatchGlob($var) - { - GPBUtil::checkString($var, True); - $this->match_glob = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputFormat() - { - return $this->whichOneof("input_format"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CloudStorage::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php deleted file mode 100644 index 6154e9ecb6b..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php +++ /dev/null @@ -1,38 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat - */ -class AvroFormat extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AvroFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_AvroFormat::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php deleted file mode 100644 index 907387cb33f..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php +++ /dev/null @@ -1,39 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat - */ -class PubSubAvroFormat extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PubSubAvroFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_PubSubAvroFormat::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php deleted file mode 100644 index ed995e4efc5..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/State.php +++ /dev/null @@ -1,94 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Ingestion is active. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Permission denied encountered while calling the Cloud Storage API. This - * can happen if the Pub/Sub SA has not been granted the - * [appropriate - * permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions): - * - storage.objects.list: to list the objects in a bucket. - * - storage.objects.get: to read the objects in a bucket. - * - storage.buckets.get: to verify the bucket exists. - * - * Generated from protobuf enum CLOUD_STORAGE_PERMISSION_DENIED = 2; - */ - const CLOUD_STORAGE_PERMISSION_DENIED = 2; - /** - * Permission denied encountered while publishing to the topic. This can - * happen if the Pub/Sub SA has not been granted the [appropriate publish - * permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) - * - * Generated from protobuf enum PUBLISH_PERMISSION_DENIED = 3; - */ - const PUBLISH_PERMISSION_DENIED = 3; - /** - * The provided Cloud Storage bucket doesn't exist. - * - * Generated from protobuf enum BUCKET_NOT_FOUND = 4; - */ - const BUCKET_NOT_FOUND = 4; - /** - * The Cloud Storage bucket has too many objects, ingestion will be - * paused. - * - * Generated from protobuf enum TOO_MANY_OBJECTS = 5; - */ - const TOO_MANY_OBJECTS = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::CLOUD_STORAGE_PERMISSION_DENIED => 'CLOUD_STORAGE_PERMISSION_DENIED', - self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED', - self::BUCKET_NOT_FOUND => 'BUCKET_NOT_FOUND', - self::TOO_MANY_OBJECTS => 'TOO_MANY_OBJECTS', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php deleted file mode 100644 index 7ed0fe63dea..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php +++ /dev/null @@ -1,82 +0,0 @@ -google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat - */ -class TextFormat extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. When unset, '\n' is used. - * - * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $delimiter = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $delimiter - * Optional. When unset, '\n' is used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. When unset, '\n' is used. - * - * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDelimiter() - { - return isset($this->delimiter) ? $this->delimiter : ''; - } - - public function hasDelimiter() - { - return isset($this->delimiter); - } - - public function clearDelimiter() - { - unset($this->delimiter); - } - - /** - * Optional. When unset, '\n' is used. - * - * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDelimiter($var) - { - GPBUtil::checkString($var, True); - $this->delimiter = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TextFormat::class, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings_CloudStorage_TextFormat::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php deleted file mode 100644 index c37496d79bd..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent.php +++ /dev/null @@ -1,148 +0,0 @@ -google.pubsub.v1.IngestionFailureEvent - */ -class IngestionFailureEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the import topic. Format is: - * projects/{project_name}/topics/{topic_name}. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $topic = ''; - /** - * Required. Error details explaining why ingestion to Pub/Sub has failed. - * - * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $error_message = ''; - protected $failure; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. Name of the import topic. Format is: - * projects/{project_name}/topics/{topic_name}. - * @type string $error_message - * Required. Error details explaining why ingestion to Pub/Sub has failed. - * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $cloud_storage_failure - * Optional. Failure when ingesting from Cloud Storage. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the import topic. Format is: - * projects/{project_name}/topics/{topic_name}. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. Name of the import topic. Format is: - * projects/{project_name}/topics/{topic_name}. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Required. Error details explaining why ingestion to Pub/Sub has failed. - * - * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getErrorMessage() - { - return $this->error_message; - } - - /** - * Required. Error details explaining why ingestion to Pub/Sub has failed. - * - * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setErrorMessage($var) - { - GPBUtil::checkString($var, True); - $this->error_message = $var; - - return $this; - } - - /** - * Optional. Failure when ingesting from Cloud Storage. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure|null - */ - public function getCloudStorageFailure() - { - return $this->readOneof(3); - } - - public function hasCloudStorageFailure() - { - return $this->hasOneof(3); - } - - /** - * Optional. Failure when ingesting from Cloud Storage. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $var - * @return $this - */ - public function setCloudStorageFailure($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getFailure() - { - return $this->whichOneof("failure"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php deleted file mode 100644 index 53cf93bd1cc..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/ApiViolationReason.php +++ /dev/null @@ -1,43 +0,0 @@ -google.pubsub.v1.IngestionFailureEvent.ApiViolationReason - */ -class ApiViolationReason extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ApiViolationReason::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_ApiViolationReason::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php deleted file mode 100644 index 2c47803b4fe..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/AvroFailureReason.php +++ /dev/null @@ -1,37 +0,0 @@ -google.pubsub.v1.IngestionFailureEvent.AvroFailureReason - */ -class AvroFailureReason extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AvroFailureReason::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_AvroFailureReason::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php deleted file mode 100644 index c973b736a1b..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/IngestionFailureEvent/CloudStorageFailure.php +++ /dev/null @@ -1,224 +0,0 @@ -google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure - */ -class CloudStorageFailure extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Name of the Cloud Storage bucket used for ingestion. - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bucket = ''; - /** - * Optional. Name of the Cloud Storage object which contained the section - * that couldn't be ingested. - * - * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $object_name = ''; - /** - * Optional. Generation of the Cloud Storage object which contained the - * section that couldn't be ingested. - * - * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $object_generation = 0; - protected $reason; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Optional. Name of the Cloud Storage bucket used for ingestion. - * @type string $object_name - * Optional. Name of the Cloud Storage object which contained the section - * that couldn't be ingested. - * @type int|string $object_generation - * Optional. Generation of the Cloud Storage object which contained the - * section that couldn't be ingested. - * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $avro_failure_reason - * Optional. Failure encountered when parsing an Avro file. - * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $api_violation_reason - * Optional. The Pub/Sub API limits prevented the desired message from - * being published. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Name of the Cloud Storage bucket used for ingestion. - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Optional. Name of the Cloud Storage bucket used for ingestion. - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Optional. Name of the Cloud Storage object which contained the section - * that couldn't be ingested. - * - * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getObjectName() - { - return $this->object_name; - } - - /** - * Optional. Name of the Cloud Storage object which contained the section - * that couldn't be ingested. - * - * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setObjectName($var) - { - GPBUtil::checkString($var, True); - $this->object_name = $var; - - return $this; - } - - /** - * Optional. Generation of the Cloud Storage object which contained the - * section that couldn't be ingested. - * - * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getObjectGeneration() - { - return $this->object_generation; - } - - /** - * Optional. Generation of the Cloud Storage object which contained the - * section that couldn't be ingested. - * - * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setObjectGeneration($var) - { - GPBUtil::checkInt64($var); - $this->object_generation = $var; - - return $this; - } - - /** - * Optional. Failure encountered when parsing an Avro file. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason|null - */ - public function getAvroFailureReason() - { - return $this->readOneof(5); - } - - public function hasAvroFailureReason() - { - return $this->hasOneof(5); - } - - /** - * Optional. Failure encountered when parsing an Avro file. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $var - * @return $this - */ - public function setAvroFailureReason($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. The Pub/Sub API limits prevented the desired message from - * being published. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason|null - */ - public function getApiViolationReason() - { - return $this->readOneof(6); - } - - public function hasApiViolationReason() - { - return $this->hasOneof(6); - } - - /** - * Optional. The Pub/Sub API limits prevented the desired message from - * being published. - * - * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $var - * @return $this - */ - public function setApiViolationReason($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getReason() - { - return $this->whichOneof("reason"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CloudStorageFailure::class, \Google\Cloud\PubSub\V1\IngestionFailureEvent_CloudStorageFailure::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php deleted file mode 100644 index b9f24a77534..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsRequest.php +++ /dev/null @@ -1,195 +0,0 @@ -google.pubsub.v1.ListSchemaRevisionsRequest - */ -class ListSchemaRevisionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the schema to list revisions for. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - */ - protected $view = 0; - /** - * The maximum number of revisions to return per page. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $name Required. The name of the schema to list revisions for. Please see - * {@see SchemaServiceClient::schemaName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListSchemaRevisionsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the schema to list revisions for. - * @type int $view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @type int $page_size - * The maximum number of revisions to return per page. - * @type string $page_token - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the schema to list revisions for. - * - * 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 name of the schema to list revisions for. - * - * 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; - } - - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); - $this->view = $var; - - return $this; - } - - /** - * The maximum number of revisions to return per page. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of revisions to return per page. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 4; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php deleted file mode 100644 index 634dc721e15..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemaRevisionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.pubsub.v1.ListSchemaRevisionsResponse - */ -class ListSchemaRevisionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The revisions of the schema. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - */ - private $schemas; - /** - * A token that can be sent as `page_token` to retrieve the next page. - * If this field is empty, there are no subsequent pages. - * - * 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\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $schemas - * The revisions of the schema. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. - * If this field is empty, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * The revisions of the schema. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchemas() - { - return $this->schemas; - } - - /** - * The revisions of the schema. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - * @param array<\Google\Cloud\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchemas($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Schema::class); - $this->schemas = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. - * If this field is empty, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. - * If this field is empty, there are no subsequent pages. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php deleted file mode 100644 index 32b97def03f..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasRequest.php +++ /dev/null @@ -1,204 +0,0 @@ -google.pubsub.v1.ListSchemasRequest - */ -class ListSchemasRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - */ - protected $view = 0; - /** - * Maximum number of schemas to return. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. Please see - * {@see SchemaServiceClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListSchemasRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * @type int $view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @type int $page_size - * Maximum number of schemas to return. - * @type string $page_token - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * - * 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 name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * - * 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; - } - - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * - * Generated from protobuf field .google.pubsub.v1.SchemaView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\SchemaView::class); - $this->view = $var; - - return $this; - } - - /** - * Maximum number of schemas to return. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of schemas to return. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 4; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php deleted file mode 100644 index c61109d326d..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSchemasResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.pubsub.v1.ListSchemasResponse - */ -class ListSchemasResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting schemas. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - */ - private $schemas; - /** - * If not empty, indicates that there may be more schemas that match the - * request; this value should be passed in a new `ListSchemasRequest`. - * - * 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\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $schemas - * The resulting schemas. - * @type string $next_page_token - * If not empty, indicates that there may be more schemas that match the - * request; this value should be passed in a new `ListSchemasRequest`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * The resulting schemas. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchemas() - { - return $this->schemas; - } - - /** - * The resulting schemas. - * - * Generated from protobuf field repeated .google.pubsub.v1.Schema schemas = 1; - * @param array<\Google\Cloud\PubSub\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchemas($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Schema::class); - $this->schemas = $arr; - - return $this; - } - - /** - * If not empty, indicates that there may be more schemas that match the - * request; this value should be passed in a new `ListSchemasRequest`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If not empty, indicates that there may be more schemas that match the - * request; this value should be passed in a new `ListSchemasRequest`. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php deleted file mode 100644 index b0bbf7bdb44..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.pubsub.v1.ListSnapshotsRequest - */ -class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $project = ''; - /** - * Optional. Maximum number of snapshots to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $project Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. Please see - * {@see SubscriberClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListSnapshotsRequest - * - * @experimental - */ - public static function build(string $project): self - { - return (new self()) - ->setProject($project); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @type int $page_size - * Optional. Maximum number of snapshots to return. - * @type string $page_token - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->project = $var; - - return $this; - } - - /** - * Optional. Maximum number of snapshots to return. - * - * 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 snapshots to return. - * - * 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 value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php deleted file mode 100644 index caf5bbb50e3..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSnapshotsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.pubsub.v1.ListSnapshotsResponse - */ -class ListSnapshotsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The resulting snapshots. - * - * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $snapshots; - /** - * Optional. If not empty, indicates that there may be more snapshot that - * match the request; this value should be passed in a new - * `ListSnapshotsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PubSub\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $snapshots - * Optional. The resulting snapshots. - * @type string $next_page_token - * Optional. If not empty, indicates that there may be more snapshot that - * match the request; this value should be passed in a new - * `ListSnapshotsRequest`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The resulting snapshots. - * - * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSnapshots() - { - return $this->snapshots; - } - - /** - * Optional. The resulting snapshots. - * - * Generated from protobuf field repeated .google.pubsub.v1.Snapshot snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PubSub\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSnapshots($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Snapshot::class); - $this->snapshots = $arr; - - return $this; - } - - /** - * Optional. If not empty, indicates that there may be more snapshot that - * match the request; this value should be passed in a new - * `ListSnapshotsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. If not empty, indicates that there may be more snapshot that - * match the request; this value should be passed in a new - * `ListSnapshotsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php deleted file mode 100644 index d1cce8a45b0..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.pubsub.v1.ListSubscriptionsRequest - */ -class ListSubscriptionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $project = ''; - /** - * Optional. Maximum number of subscriptions to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $project Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. Please see - * {@see SubscriberClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListSubscriptionsRequest - * - * @experimental - */ - public static function build(string $project): self - { - return (new self()) - ->setProject($project); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @type int $page_size - * Optional. Maximum number of subscriptions to return. - * @type string $page_token - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->project = $var; - - return $this; - } - - /** - * Optional. Maximum number of subscriptions to return. - * - * 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 subscriptions to return. - * - * 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 value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php deleted file mode 100644 index e875730c48c..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListSubscriptionsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.pubsub.v1.ListSubscriptionsResponse - */ -class ListSubscriptionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The subscriptions that match the request. - * - * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $subscriptions; - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PubSub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $subscriptions - * Optional. The subscriptions that match the request. - * @type string $next_page_token - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListSubscriptionsRequest` to get more subscriptions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The subscriptions that match the request. - * - * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSubscriptions() - { - return $this->subscriptions; - } - - /** - * Optional. The subscriptions that match the request. - * - * Generated from protobuf field repeated .google.pubsub.v1.Subscription subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PubSub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSubscriptions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Subscription::class); - $this->subscriptions = $arr; - - return $this; - } - - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php deleted file mode 100644 index be1957c835c..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.pubsub.v1.ListTopicSnapshotsRequest - */ -class ListTopicSnapshotsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - /** - * Optional. Maximum number of snapshot names to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $topic Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. Please see - * {@see PublisherClient::topicName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListTopicSnapshotsRequest - * - * @experimental - */ - public static function build(string $topic): self - { - return (new self()) - ->setTopic($topic); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @type int $page_size - * Optional. Maximum number of snapshot names to return. - * @type string $page_token - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Optional. Maximum number of snapshot names to return. - * - * 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 snapshot names to return. - * - * 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 value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php deleted file mode 100644 index cb08491e566..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSnapshotsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.pubsub.v1.ListTopicSnapshotsResponse - */ -class ListTopicSnapshotsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The names of the snapshots that match the request. - * - * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $snapshots; - /** - * Optional. If not empty, indicates that there may be more snapshots that - * match the request; this value should be passed in a new - * `ListTopicSnapshotsRequest` to get more snapshots. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $snapshots - * Optional. The names of the snapshots that match the request. - * @type string $next_page_token - * Optional. If not empty, indicates that there may be more snapshots that - * match the request; this value should be passed in a new - * `ListTopicSnapshotsRequest` to get more snapshots. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The names of the snapshots that match the request. - * - * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSnapshots() - { - return $this->snapshots; - } - - /** - * Optional. The names of the snapshots that match the request. - * - * Generated from protobuf field repeated string snapshots = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSnapshots($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->snapshots = $arr; - - return $this; - } - - /** - * Optional. If not empty, indicates that there may be more snapshots that - * match the request; this value should be passed in a new - * `ListTopicSnapshotsRequest` to get more snapshots. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. If not empty, indicates that there may be more snapshots that - * match the request; this value should be passed in a new - * `ListTopicSnapshotsRequest` to get more snapshots. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php deleted file mode 100644 index 2a3775252eb..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.pubsub.v1.ListTopicSubscriptionsRequest - */ -class ListTopicSubscriptionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - /** - * Optional. Maximum number of subscription names to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $topic Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. Please see - * {@see PublisherClient::topicName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListTopicSubscriptionsRequest - * - * @experimental - */ - public static function build(string $topic): self - { - return (new self()) - ->setTopic($topic); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @type int $page_size - * Optional. Maximum number of subscription names to return. - * @type string $page_token - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Optional. Maximum number of subscription names to return. - * - * 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 subscription names to return. - * - * 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 value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php deleted file mode 100644 index 2b7f1c2324e..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicSubscriptionsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -google.pubsub.v1.ListTopicSubscriptionsResponse - */ -class ListTopicSubscriptionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The names of subscriptions attached to the topic specified in the - * request. - * - * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $subscriptions; - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $subscriptions - * Optional. The names of subscriptions attached to the topic specified in the - * request. - * @type string $next_page_token - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The names of subscriptions attached to the topic specified in the - * request. - * - * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSubscriptions() - { - return $this->subscriptions; - } - - /** - * Optional. The names of subscriptions attached to the topic specified in the - * request. - * - * Generated from protobuf field repeated string subscriptions = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSubscriptions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->subscriptions = $arr; - - return $this; - } - - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. If not empty, indicates that there may be more subscriptions that - * match the request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php deleted file mode 100644 index fe2336bce34..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.pubsub.v1.ListTopicsRequest - */ -class ListTopicsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $project = ''; - /** - * Optional. Maximum number of topics to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $project Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. Please see - * {@see PublisherClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\PubSub\V1\ListTopicsRequest - * - * @experimental - */ - public static function build(string $project): self - { - return (new self()) - ->setProject($project); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @type int $page_size - * Optional. Maximum number of topics to return. - * @type string $page_token - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->project = $var; - - return $this; - } - - /** - * Optional. Maximum number of topics to return. - * - * 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 topics to return. - * - * 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 value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * - * 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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php deleted file mode 100644 index 79a07799e34..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ListTopicsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.pubsub.v1.ListTopicsResponse - */ -class ListTopicsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The resulting topics. - * - * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $topics; - /** - * Optional. If not empty, indicates that there may be more topics that match - * the request; this value should be passed in a new `ListTopicsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PubSub\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $topics - * Optional. The resulting topics. - * @type string $next_page_token - * Optional. If not empty, indicates that there may be more topics that match - * the request; this value should be passed in a new `ListTopicsRequest`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The resulting topics. - * - * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTopics() - { - return $this->topics; - } - - /** - * Optional. The resulting topics. - * - * Generated from protobuf field repeated .google.pubsub.v1.Topic topics = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PubSub\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTopics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Topic::class); - $this->topics = $arr; - - return $this; - } - - /** - * Optional. If not empty, indicates that there may be more topics that match - * the request; this value should be passed in a new `ListTopicsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. If not empty, indicates that there may be more topics that match - * the request; this value should be passed in a new `ListTopicsRequest`. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php deleted file mode 100644 index b31b0ad0391..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/MessageStoragePolicy.php +++ /dev/null @@ -1,137 +0,0 @@ -google.pubsub.v1.MessageStoragePolicy - */ -class MessageStoragePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A list of IDs of Google Cloud regions where messages that are - * published to the topic may be persisted in storage. Messages published by - * publishers running in non-allowed Google Cloud regions (or running outside - * of Google Cloud altogether) are routed for storage in one of the allowed - * regions. An empty list means that no regions are allowed, and is not a - * valid configuration. - * - * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $allowed_persistence_regions; - /** - * Optional. If true, `allowed_persistence_regions` is also used to enforce - * in-transit guarantees for messages. That is, Pub/Sub will fail - * Publish operations on this topic and subscribe operations - * on any subscription attached to this topic in any region that is - * not in `allowed_persistence_regions`. - * - * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enforce_in_transit = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_persistence_regions - * Optional. A list of IDs of Google Cloud regions where messages that are - * published to the topic may be persisted in storage. Messages published by - * publishers running in non-allowed Google Cloud regions (or running outside - * of Google Cloud altogether) are routed for storage in one of the allowed - * regions. An empty list means that no regions are allowed, and is not a - * valid configuration. - * @type bool $enforce_in_transit - * Optional. If true, `allowed_persistence_regions` is also used to enforce - * in-transit guarantees for messages. That is, Pub/Sub will fail - * Publish operations on this topic and subscribe operations - * on any subscription attached to this topic in any region that is - * not in `allowed_persistence_regions`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A list of IDs of Google Cloud regions where messages that are - * published to the topic may be persisted in storage. Messages published by - * publishers running in non-allowed Google Cloud regions (or running outside - * of Google Cloud altogether) are routed for storage in one of the allowed - * regions. An empty list means that no regions are allowed, and is not a - * valid configuration. - * - * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedPersistenceRegions() - { - return $this->allowed_persistence_regions; - } - - /** - * Optional. A list of IDs of Google Cloud regions where messages that are - * published to the topic may be persisted in storage. Messages published by - * publishers running in non-allowed Google Cloud regions (or running outside - * of Google Cloud altogether) are routed for storage in one of the allowed - * regions. An empty list means that no regions are allowed, and is not a - * valid configuration. - * - * Generated from protobuf field repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedPersistenceRegions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_persistence_regions = $arr; - - return $this; - } - - /** - * Optional. If true, `allowed_persistence_regions` is also used to enforce - * in-transit guarantees for messages. That is, Pub/Sub will fail - * Publish operations on this topic and subscribe operations - * on any subscription attached to this topic in any region that is - * not in `allowed_persistence_regions`. - * - * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnforceInTransit() - { - return $this->enforce_in_transit; - } - - /** - * Optional. If true, `allowed_persistence_regions` is also used to enforce - * in-transit guarantees for messages. That is, Pub/Sub will fail - * Publish operations on this topic and subscribe operations - * on any subscription attached to this topic in any region that is - * not in `allowed_persistence_regions`. - * - * Generated from protobuf field bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnforceInTransit($var) - { - GPBUtil::checkBool($var); - $this->enforce_in_transit = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php deleted file mode 100644 index 91c8c3e18e2..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyAckDeadlineRequest.php +++ /dev/null @@ -1,198 +0,0 @@ -google.pubsub.v1.ModifyAckDeadlineRequest - */ -class ModifyAckDeadlineRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Required. List of acknowledgment IDs. - * - * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $ack_ids; - /** - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * - * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ack_deadline_seconds = 0; - - /** - * @param string $subscription Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * @param string[] $ackIds Required. List of acknowledgment IDs. - * @param int $ackDeadlineSeconds Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * - * @return \Google\Cloud\PubSub\V1\ModifyAckDeadlineRequest - * - * @experimental - */ - public static function build(string $subscription, array $ackIds, int $ackDeadlineSeconds): self - { - return (new self()) - ->setSubscription($subscription) - ->setAckIds($ackIds) - ->setAckDeadlineSeconds($ackDeadlineSeconds); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids - * Required. List of acknowledgment IDs. - * @type int $ack_deadline_seconds - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Required. List of acknowledgment IDs. - * - * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAckIds() - { - return $this->ack_ids; - } - - /** - * Required. List of acknowledgment IDs. - * - * Generated from protobuf field repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ack_ids = $arr; - - return $this; - } - - /** - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * - * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAckDeadlineSeconds() - { - return $this->ack_deadline_seconds; - } - - /** - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * - * Generated from protobuf field int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAckDeadlineSeconds($var) - { - GPBUtil::checkInt32($var); - $this->ack_deadline_seconds = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php deleted file mode 100644 index 7a2f636dcaf..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ModifyPushConfigRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -google.pubsub.v1.ModifyPushConfigRequest - */ -class ModifyPushConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Required. The push configuration for future deliveries. - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $push_config = null; - - /** - * @param string $subscription Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\PushConfig $pushConfig Required. The push configuration for future deliveries. - * - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * @return \Google\Cloud\PubSub\V1\ModifyPushConfigRequest - * - * @experimental - */ - public static function build(string $subscription, \Google\Cloud\PubSub\V1\PushConfig $pushConfig): self - { - return (new self()) - ->setSubscription($subscription) - ->setPushConfig($pushConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type \Google\Cloud\PubSub\V1\PushConfig $push_config - * Required. The push configuration for future deliveries. - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Required. The push configuration for future deliveries. - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\PushConfig|null - */ - public function getPushConfig() - { - return $this->push_config; - } - - public function hasPushConfig() - { - return isset($this->push_config); - } - - public function clearPushConfig() - { - unset($this->push_config); - } - - /** - * Required. The push configuration for future deliveries. - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\PushConfig $var - * @return $this - */ - public function setPushConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class); - $this->push_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php deleted file mode 100644 index 24f383ac5be..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings.php +++ /dev/null @@ -1,67 +0,0 @@ -google.pubsub.v1.PlatformLogsSettings - */ -class PlatformLogsSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The minimum severity level of Platform Logs that will be written. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $severity = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $severity - * Optional. The minimum severity level of Platform Logs that will be written. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The minimum severity level of Platform Logs that will be written. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Optional. The minimum severity level of Platform Logs that will be written. - * - * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings\Severity::class); - $this->severity = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php deleted file mode 100644 index 81ecb94be83..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PlatformLogsSettings/Severity.php +++ /dev/null @@ -1,85 +0,0 @@ -google.pubsub.v1.PlatformLogsSettings.Severity - */ -class Severity -{ - /** - * Default value. Logs level is unspecified. Logs will be disabled. - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * Logs will be disabled. - * - * Generated from protobuf enum DISABLED = 1; - */ - const DISABLED = 1; - /** - * Debug logs and higher-severity logs will be written. - * - * Generated from protobuf enum DEBUG = 2; - */ - const DEBUG = 2; - /** - * Info logs and higher-severity logs will be written. - * - * Generated from protobuf enum INFO = 3; - */ - const INFO = 3; - /** - * Warning logs and higher-severity logs will be written. - * - * Generated from protobuf enum WARNING = 4; - */ - const WARNING = 4; - /** - * Only error logs will be written. - * - * Generated from protobuf enum ERROR = 5; - */ - const ERROR = 5; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::DISABLED => 'DISABLED', - self::DEBUG => 'DEBUG', - self::INFO => 'INFO', - self::WARNING => 'WARNING', - self::ERROR => 'ERROR', - ]; - - 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(Severity::class, \Google\Cloud\PubSub\V1\PlatformLogsSettings_Severity::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php deleted file mode 100644 index c548ceb7fcb..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.pubsub.v1.PublishRequest - */ -class PublishRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - /** - * Required. The messages to publish. - * - * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $messages; - - /** - * @param string $topic Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. Please see - * {@see PublisherClient::topicName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\PubsubMessage[] $messages Required. The messages to publish. - * - * @return \Google\Cloud\PubSub\V1\PublishRequest - * - * @experimental - */ - public static function build(string $topic, array $messages): self - { - return (new self()) - ->setTopic($topic) - ->setMessages($messages); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * @type array<\Google\Cloud\PubSub\V1\PubsubMessage>|\Google\Protobuf\Internal\RepeatedField $messages - * Required. The messages to publish. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Required. The messages to publish. - * - * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Required. The messages to publish. - * - * Generated from protobuf field repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\PubSub\V1\PubsubMessage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMessages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\PubsubMessage::class); - $this->messages = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php deleted file mode 100644 index c36633c7d98..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PublishResponse.php +++ /dev/null @@ -1,75 +0,0 @@ -google.pubsub.v1.PublishResponse - */ -class PublishResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The server-assigned ID of each published message, in the same - * order as the messages in the request. IDs are guaranteed to be unique - * within the topic. - * - * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $message_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $message_ids - * Optional. The server-assigned ID of each published message, in the same - * order as the messages in the request. IDs are guaranteed to be unique - * within the topic. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The server-assigned ID of each published message, in the same - * order as the messages in the request. IDs are guaranteed to be unique - * within the topic. - * - * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMessageIds() - { - return $this->message_ids; - } - - /** - * Optional. The server-assigned ID of each published message, in the same - * order as the messages in the request. IDs are guaranteed to be unique - * within the topic. - * - * Generated from protobuf field repeated string message_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMessageIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->message_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php deleted file mode 100644 index 4c05dc58da3..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PubsubMessage.php +++ /dev/null @@ -1,280 +0,0 @@ -google.pubsub.v1.PubsubMessage - */ -class PubsubMessage extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The message data field. If this field is empty, the message must - * contain at least one attribute. - * - * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data = ''; - /** - * Optional. Attributes for this message. If this field is empty, the message - * must contain non-empty data. This can be used to filter messages on the - * subscription. - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $attributes; - /** - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - * - * Generated from protobuf field string message_id = 3; - */ - protected $message_id = ''; - /** - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the - * publisher in a `Publish` call. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; - */ - protected $publish_time = null; - /** - * Optional. If non-empty, identifies related messages for which publish order - * should be respected. If a `Subscription` has `enable_message_ordering` set - * to `true`, messages published with the same non-empty `ordering_key` value - * will be delivered to subscribers in the order in which they are received by - * the Pub/Sub system. All `PubsubMessage`s published in a given - * `PublishRequest` must specify the same `ordering_key` value. For more - * information, see [ordering - * messages](https://cloud.google.com/pubsub/docs/ordering). - * - * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ordering_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $data - * Optional. The message data field. If this field is empty, the message must - * contain at least one attribute. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. Attributes for this message. If this field is empty, the message - * must contain non-empty data. This can be used to filter messages on the - * subscription. - * @type string $message_id - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - * @type \Google\Protobuf\Timestamp $publish_time - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the - * publisher in a `Publish` call. - * @type string $ordering_key - * Optional. If non-empty, identifies related messages for which publish order - * should be respected. If a `Subscription` has `enable_message_ordering` set - * to `true`, messages published with the same non-empty `ordering_key` value - * will be delivered to subscribers in the order in which they are received by - * the Pub/Sub system. All `PubsubMessage`s published in a given - * `PublishRequest` must specify the same `ordering_key` value. For more - * information, see [ordering - * messages](https://cloud.google.com/pubsub/docs/ordering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The message data field. If this field is empty, the message must - * contain at least one attribute. - * - * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * Optional. The message data field. If this field is empty, the message must - * contain at least one attribute. - * - * Generated from protobuf field bytes data = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Optional. Attributes for this message. If this field is empty, the message - * must contain non-empty data. This can be used to filter messages on the - * subscription. - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Optional. Attributes for this message. If this field is empty, the message - * must contain non-empty data. This can be used to filter messages on the - * subscription. - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->attributes = $arr; - - return $this; - } - - /** - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - * - * Generated from protobuf field string message_id = 3; - * @return string - */ - public function getMessageId() - { - return $this->message_id; - } - - /** - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - * - * Generated from protobuf field string message_id = 3; - * @param string $var - * @return $this - */ - public function setMessageId($var) - { - GPBUtil::checkString($var, True); - $this->message_id = $var; - - return $this; - } - - /** - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the - * publisher in a `Publish` call. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPublishTime() - { - return $this->publish_time; - } - - public function hasPublishTime() - { - return isset($this->publish_time); - } - - public function clearPublishTime() - { - unset($this->publish_time); - } - - /** - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the - * publisher in a `Publish` call. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPublishTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->publish_time = $var; - - return $this; - } - - /** - * Optional. If non-empty, identifies related messages for which publish order - * should be respected. If a `Subscription` has `enable_message_ordering` set - * to `true`, messages published with the same non-empty `ordering_key` value - * will be delivered to subscribers in the order in which they are received by - * the Pub/Sub system. All `PubsubMessage`s published in a given - * `PublishRequest` must specify the same `ordering_key` value. For more - * information, see [ordering - * messages](https://cloud.google.com/pubsub/docs/ordering). - * - * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderingKey() - { - return $this->ordering_key; - } - - /** - * Optional. If non-empty, identifies related messages for which publish order - * should be respected. If a `Subscription` has `enable_message_ordering` set - * to `true`, messages published with the same non-empty `ordering_key` value - * will be delivered to subscribers in the order in which they are received by - * the Pub/Sub system. All `PubsubMessage`s published in a given - * `PublishRequest` must specify the same `ordering_key` value. For more - * information, see [ordering - * messages](https://cloud.google.com/pubsub/docs/ordering). - * - * Generated from protobuf field string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderingKey($var) - { - GPBUtil::checkString($var, True); - $this->ordering_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php deleted file mode 100644 index 5d0f8c33aeb..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullRequest.php +++ /dev/null @@ -1,222 +0,0 @@ -google.pubsub.v1.PullRequest - */ -class PullRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * - * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $return_immediately = false; - /** - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $max_messages = 0; - - /** - * @param string $subscription Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * @param bool $returnImmediately Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * @param int $maxMessages Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * @return \Google\Cloud\PubSub\V1\PullRequest - * - * @experimental - */ - public static function build(string $subscription, bool $returnImmediately, int $maxMessages): self - { - return (new self()) - ->setSubscription($subscription) - ->setReturnImmediately($returnImmediately) - ->setMaxMessages($maxMessages); - } - - /** - * @param string $subscription Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. Please see - * {@see SubscriberClient::subscriptionName()} for help formatting this field. - * @param int $maxMessages Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * @return \Google\Cloud\PubSub\V1\PullRequest - * - * @experimental - */ - public static function buildFromSubscriptionMaxMessages(string $subscription, int $maxMessages): self - { - return (new self()) - ->setSubscription($subscription) - ->setMaxMessages($maxMessages); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type bool $return_immediately - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * @type int $max_messages - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * - * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return bool - * @deprecated - */ - public function getReturnImmediately() - { - @trigger_error('return_immediately is deprecated.', E_USER_DEPRECATED); - return $this->return_immediately; - } - - /** - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * - * Generated from protobuf field bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setReturnImmediately($var) - { - @trigger_error('return_immediately is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->return_immediately = $var; - - return $this; - } - - /** - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getMaxMessages() - { - return $this->max_messages; - } - - /** - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * Generated from protobuf field int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setMaxMessages($var) - { - GPBUtil::checkInt32($var); - $this->max_messages = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php deleted file mode 100644 index 44c90cd8571..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PullResponse.php +++ /dev/null @@ -1,83 +0,0 @@ -google.pubsub.v1.PullResponse - */ -class PullResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Received Pub/Sub messages. The list will be empty if there are no - * more messages available in the backlog, or if no messages could be returned - * before the request timeout. For JSON, the response can be entirely - * empty. The Pub/Sub system may return fewer than the `maxMessages` requested - * even if there are more messages available in the backlog. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $received_messages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $received_messages - * Optional. Received Pub/Sub messages. The list will be empty if there are no - * more messages available in the backlog, or if no messages could be returned - * before the request timeout. For JSON, the response can be entirely - * empty. The Pub/Sub system may return fewer than the `maxMessages` requested - * even if there are more messages available in the backlog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Received Pub/Sub messages. The list will be empty if there are no - * more messages available in the backlog, or if no messages could be returned - * before the request timeout. For JSON, the response can be entirely - * empty. The Pub/Sub system may return fewer than the `maxMessages` requested - * even if there are more messages available in the backlog. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReceivedMessages() - { - return $this->received_messages; - } - - /** - * Optional. Received Pub/Sub messages. The list will be empty if there are no - * more messages available in the backlog, or if no messages could be returned - * before the request timeout. For JSON, the response can be entirely - * empty. The Pub/Sub system may return fewer than the `maxMessages` requested - * even if there are more messages available in the backlog. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReceivedMessages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\ReceivedMessage::class); - $this->received_messages = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php deleted file mode 100644 index c0dd0f9777d..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig.php +++ /dev/null @@ -1,294 +0,0 @@ -google.pubsub.v1.PushConfig - */ -class PushConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A URL locating the endpoint to which messages should be pushed. - * For example, a Webhook endpoint might use `https://example.com/push`. - * - * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $push_endpoint = ''; - /** - * Optional. Endpoint configuration attributes that can be used to control - * different aspects of the message delivery. - * The only currently supported attribute is `x-goog-version`, which you can - * use to change the format of the pushed message. This attribute - * indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * If not present during the `CreateSubscription` call, it will default to - * the version of the Pub/Sub API used to make such call. If not present in a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. - * The only supported values for the `x-goog-version` attribute are: - * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - * For example: - * `attributes { "x-goog-version": "v1" }` - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $attributes; - protected $authentication_method; - protected $wrapper; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $push_endpoint - * Optional. A URL locating the endpoint to which messages should be pushed. - * For example, a Webhook endpoint might use `https://example.com/push`. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. Endpoint configuration attributes that can be used to control - * different aspects of the message delivery. - * The only currently supported attribute is `x-goog-version`, which you can - * use to change the format of the pushed message. This attribute - * indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * If not present during the `CreateSubscription` call, it will default to - * the version of the Pub/Sub API used to make such call. If not present in a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. - * The only supported values for the `x-goog-version` attribute are: - * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - * For example: - * `attributes { "x-goog-version": "v1" }` - * @type \Google\Cloud\PubSub\V1\PushConfig\OidcToken $oidc_token - * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT - * token as an `Authorization` header in the HTTP request for every pushed - * message. - * @type \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper $pubsub_wrapper - * Optional. When set, the payload to the push endpoint is in the form of - * the JSON representation of a PubsubMessage - * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - * @type \Google\Cloud\PubSub\V1\PushConfig\NoWrapper $no_wrapper - * Optional. When set, the payload to the push endpoint is not wrapped. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A URL locating the endpoint to which messages should be pushed. - * For example, a Webhook endpoint might use `https://example.com/push`. - * - * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPushEndpoint() - { - return $this->push_endpoint; - } - - /** - * Optional. A URL locating the endpoint to which messages should be pushed. - * For example, a Webhook endpoint might use `https://example.com/push`. - * - * Generated from protobuf field string push_endpoint = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPushEndpoint($var) - { - GPBUtil::checkString($var, True); - $this->push_endpoint = $var; - - return $this; - } - - /** - * Optional. Endpoint configuration attributes that can be used to control - * different aspects of the message delivery. - * The only currently supported attribute is `x-goog-version`, which you can - * use to change the format of the pushed message. This attribute - * indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * If not present during the `CreateSubscription` call, it will default to - * the version of the Pub/Sub API used to make such call. If not present in a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. - * The only supported values for the `x-goog-version` attribute are: - * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - * For example: - * `attributes { "x-goog-version": "v1" }` - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Optional. Endpoint configuration attributes that can be used to control - * different aspects of the message delivery. - * The only currently supported attribute is `x-goog-version`, which you can - * use to change the format of the pushed message. This attribute - * indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * If not present during the `CreateSubscription` call, it will default to - * the version of the Pub/Sub API used to make such call. If not present in a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. - * The only supported values for the `x-goog-version` attribute are: - * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - * For example: - * `attributes { "x-goog-version": "v1" }` - * - * Generated from protobuf field map attributes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->attributes = $arr; - - return $this; - } - - /** - * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT - * token as an `Authorization` header in the HTTP request for every pushed - * message. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PushConfig\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(3); - } - - public function hasOidcToken() - { - return $this->hasOneof(3); - } - - /** - * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT - * token as an `Authorization` header in the HTTP request for every pushed - * message. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PushConfig\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\OidcToken::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. When set, the payload to the push endpoint is in the form of - * the JSON representation of a PubsubMessage - * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper|null - */ - public function getPubsubWrapper() - { - return $this->readOneof(4); - } - - public function hasPubsubWrapper() - { - return $this->hasOneof(4); - } - - /** - * Optional. When set, the payload to the push endpoint is in the form of - * the JSON representation of a PubsubMessage - * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper $var - * @return $this - */ - public function setPubsubWrapper($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\PubsubWrapper::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Optional. When set, the payload to the push endpoint is not wrapped. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PushConfig\NoWrapper|null - */ - public function getNoWrapper() - { - return $this->readOneof(5); - } - - public function hasNoWrapper() - { - return $this->hasOneof(5); - } - - /** - * Optional. When set, the payload to the push endpoint is not wrapped. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PushConfig\NoWrapper $var - * @return $this - */ - public function setNoWrapper($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig\NoWrapper::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthenticationMethod() - { - return $this->whichOneof("authentication_method"); - } - - /** - * @return string - */ - public function getWrapper() - { - return $this->whichOneof("wrapper"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php deleted file mode 100644 index ccb4573e0a1..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/NoWrapper.php +++ /dev/null @@ -1,78 +0,0 @@ -google.pubsub.v1.PushConfig.NoWrapper - */ -class NoWrapper extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. When true, writes the Pub/Sub message metadata to - * `x-goog-pubsub-:` headers of the HTTP request. Writes the - * Pub/Sub message attributes to `:` headers of the HTTP request. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $write_metadata = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $write_metadata - * Optional. When true, writes the Pub/Sub message metadata to - * `x-goog-pubsub-:` headers of the HTTP request. Writes the - * Pub/Sub message attributes to `:` headers of the HTTP request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. When true, writes the Pub/Sub message metadata to - * `x-goog-pubsub-:` headers of the HTTP request. Writes the - * Pub/Sub message attributes to `:` headers of the HTTP request. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getWriteMetadata() - { - return $this->write_metadata; - } - - /** - * Optional. When true, writes the Pub/Sub message metadata to - * `x-goog-pubsub-:` headers of the HTTP request. Writes the - * Pub/Sub message attributes to `:` headers of the HTTP request. - * - * Generated from protobuf field bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setWriteMetadata($var) - { - GPBUtil::checkBool($var); - $this->write_metadata = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NoWrapper::class, \Google\Cloud\PubSub\V1\PushConfig_NoWrapper::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php deleted file mode 100644 index b9558bb3a7d..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/OidcToken.php +++ /dev/null @@ -1,146 +0,0 @@ -google.pubsub.v1.PushConfig.OidcToken - */ -class OidcToken extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. [Service account - * email](https://cloud.google.com/iam/docs/service-accounts) - * used for generating the OIDC token. For more information - * on setting up authentication, see - * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - * - * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account_email = ''; - /** - * Optional. Audience to be used when generating OIDC token. The audience - * claim identifies the recipients that the JWT is intended for. The - * audience value is a single case-sensitive string. Having multiple values - * (array) for the audience field is not supported. More info about the OIDC - * JWT token audience here: - * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - * the Push endpoint URL will be used. - * - * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $audience = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * Optional. [Service account - * email](https://cloud.google.com/iam/docs/service-accounts) - * used for generating the OIDC token. For more information - * on setting up authentication, see - * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - * @type string $audience - * Optional. Audience to be used when generating OIDC token. The audience - * claim identifies the recipients that the JWT is intended for. The - * audience value is a single case-sensitive string. Having multiple values - * (array) for the audience field is not supported. More info about the OIDC - * JWT token audience here: - * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - * the Push endpoint URL will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. [Service account - * email](https://cloud.google.com/iam/docs/service-accounts) - * used for generating the OIDC token. For more information - * on setting up authentication, see - * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - * - * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * Optional. [Service account - * email](https://cloud.google.com/iam/docs/service-accounts) - * used for generating the OIDC token. For more information - * on setting up authentication, see - * [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - * - * Generated from protobuf field string service_account_email = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Optional. Audience to be used when generating OIDC token. The audience - * claim identifies the recipients that the JWT is intended for. The - * audience value is a single case-sensitive string. Having multiple values - * (array) for the audience field is not supported. More info about the OIDC - * JWT token audience here: - * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - * the Push endpoint URL will be used. - * - * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Optional. Audience to be used when generating OIDC token. The audience - * claim identifies the recipients that the JWT is intended for. The - * audience value is a single case-sensitive string. Having multiple values - * (array) for the audience field is not supported. More info about the OIDC - * JWT token audience here: - * https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - * the Push endpoint URL will be used. - * - * Generated from protobuf field string audience = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkString($var, True); - $this->audience = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OidcToken::class, \Google\Cloud\PubSub\V1\PushConfig_OidcToken::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php deleted file mode 100644 index 5053bfb8578..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/PushConfig/PubsubWrapper.php +++ /dev/null @@ -1,38 +0,0 @@ -google.pubsub.v1.PushConfig.PubsubWrapper - */ -class PubsubWrapper extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PubsubWrapper::class, \Google\Cloud\PubSub\V1\PushConfig_PubsubWrapper::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php deleted file mode 100644 index 3531a302af6..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ReceivedMessage.php +++ /dev/null @@ -1,189 +0,0 @@ -google.pubsub.v1.ReceivedMessage - */ -class ReceivedMessage extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. This ID can be used to acknowledge the received message. - * - * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ack_id = ''; - /** - * Optional. The message. - * - * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $message = null; - /** - * Optional. The approximate number of times that Pub/Sub has attempted to - * deliver the associated message to a subscriber. - * More precisely, this is 1 + (number of NACKs) + - * (number of ack_deadline exceeds) for this message. - * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - * exceeds event is whenever a message is not acknowledged within - * ack_deadline. Note that ack_deadline is initially - * Subscription.ackDeadlineSeconds, but may get extended automatically by - * the client library. - * Upon the first delivery of a given message, `delivery_attempt` will have a - * value of 1. The value is calculated at best effort and is approximate. - * If a DeadLetterPolicy is not set on the subscription, this will be 0. - * - * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $delivery_attempt = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $ack_id - * Optional. This ID can be used to acknowledge the received message. - * @type \Google\Cloud\PubSub\V1\PubsubMessage $message - * Optional. The message. - * @type int $delivery_attempt - * Optional. The approximate number of times that Pub/Sub has attempted to - * deliver the associated message to a subscriber. - * More precisely, this is 1 + (number of NACKs) + - * (number of ack_deadline exceeds) for this message. - * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - * exceeds event is whenever a message is not acknowledged within - * ack_deadline. Note that ack_deadline is initially - * Subscription.ackDeadlineSeconds, but may get extended automatically by - * the client library. - * Upon the first delivery of a given message, `delivery_attempt` will have a - * value of 1. The value is calculated at best effort and is approximate. - * If a DeadLetterPolicy is not set on the subscription, this will be 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. This ID can be used to acknowledge the received message. - * - * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAckId() - { - return $this->ack_id; - } - - /** - * Optional. This ID can be used to acknowledge the received message. - * - * Generated from protobuf field string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAckId($var) - { - GPBUtil::checkString($var, True); - $this->ack_id = $var; - - return $this; - } - - /** - * Optional. The message. - * - * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PubsubMessage|null - */ - public function getMessage() - { - return $this->message; - } - - public function hasMessage() - { - return isset($this->message); - } - - public function clearMessage() - { - unset($this->message); - } - - /** - * Optional. The message. - * - * Generated from protobuf field .google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PubsubMessage $var - * @return $this - */ - public function setMessage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PubsubMessage::class); - $this->message = $var; - - return $this; - } - - /** - * Optional. The approximate number of times that Pub/Sub has attempted to - * deliver the associated message to a subscriber. - * More precisely, this is 1 + (number of NACKs) + - * (number of ack_deadline exceeds) for this message. - * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - * exceeds event is whenever a message is not acknowledged within - * ack_deadline. Note that ack_deadline is initially - * Subscription.ackDeadlineSeconds, but may get extended automatically by - * the client library. - * Upon the first delivery of a given message, `delivery_attempt` will have a - * value of 1. The value is calculated at best effort and is approximate. - * If a DeadLetterPolicy is not set on the subscription, this will be 0. - * - * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDeliveryAttempt() - { - return $this->delivery_attempt; - } - - /** - * Optional. The approximate number of times that Pub/Sub has attempted to - * deliver the associated message to a subscriber. - * More precisely, this is 1 + (number of NACKs) + - * (number of ack_deadline exceeds) for this message. - * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - * exceeds event is whenever a message is not acknowledged within - * ack_deadline. Note that ack_deadline is initially - * Subscription.ackDeadlineSeconds, but may get extended automatically by - * the client library. - * Upon the first delivery of a given message, `delivery_attempt` will have a - * value of 1. The value is calculated at best effort and is approximate. - * If a DeadLetterPolicy is not set on the subscription, this will be 0. - * - * Generated from protobuf field int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDeliveryAttempt($var) - { - GPBUtil::checkInt32($var); - $this->delivery_attempt = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php deleted file mode 100644 index db6cf2e3d73..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RetryPolicy.php +++ /dev/null @@ -1,140 +0,0 @@ -google.pubsub.v1.RetryPolicy - */ -class RetryPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The minimum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - * - * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $minimum_backoff = null; - /** - * Optional. The maximum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 600 - * seconds. - * - * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $maximum_backoff = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $minimum_backoff - * Optional. The minimum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - * @type \Google\Protobuf\Duration $maximum_backoff - * Optional. The maximum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 600 - * seconds. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The minimum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - * - * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getMinimumBackoff() - { - return $this->minimum_backoff; - } - - public function hasMinimumBackoff() - { - return isset($this->minimum_backoff); - } - - public function clearMinimumBackoff() - { - unset($this->minimum_backoff); - } - - /** - * Optional. The minimum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - * - * Generated from protobuf field .google.protobuf.Duration minimum_backoff = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMinimumBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->minimum_backoff = $var; - - return $this; - } - - /** - * Optional. The maximum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 600 - * seconds. - * - * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getMaximumBackoff() - { - return $this->maximum_backoff; - } - - public function hasMaximumBackoff() - { - return isset($this->maximum_backoff); - } - - public function clearMaximumBackoff() - { - unset($this->maximum_backoff); - } - - /** - * Optional. The maximum delay between consecutive deliveries of a given - * message. Value should be between 0 and 600 seconds. Defaults to 600 - * seconds. - * - * Generated from protobuf field .google.protobuf.Duration maximum_backoff = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaximumBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->maximum_backoff = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php deleted file mode 100644 index 2bf316de83d..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/RollbackSchemaRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.pubsub.v1.RollbackSchemaRequest - */ -class RollbackSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The schema being rolled back with revision id. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The revision ID to roll back to. - * It must be a revision of the same schema. - * Example: c7cfa2a8 - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $revision_id = ''; - - /** - * @param string $name Required. The schema being rolled back with revision id. Please see - * {@see SchemaServiceClient::schemaName()} for help formatting this field. - * @param string $revisionId Required. The revision ID to roll back to. - * It must be a revision of the same schema. - * - * Example: c7cfa2a8 - * - * @return \Google\Cloud\PubSub\V1\RollbackSchemaRequest - * - * @experimental - */ - public static function build(string $name, string $revisionId): self - { - return (new self()) - ->setName($name) - ->setRevisionId($revisionId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The schema being rolled back with revision id. - * @type string $revision_id - * Required. The revision ID to roll back to. - * It must be a revision of the same schema. - * Example: c7cfa2a8 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The schema being rolled back with revision 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. The schema being rolled back with revision 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 revision ID to roll back to. - * It must be a revision of the same schema. - * Example: c7cfa2a8 - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Required. The revision ID to roll back to. - * It must be a revision of the same schema. - * Example: c7cfa2a8 - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php deleted file mode 100644 index 9521db88c5a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema.php +++ /dev/null @@ -1,225 +0,0 @@ -google.pubsub.v1.Schema - */ -class Schema extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the schema. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * The type of the schema definition. - * - * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; - */ - protected $type = 0; - /** - * The definition of the schema. This should contain a string representing - * the full definition of the schema that is a valid schema definition of - * the type specified in `type`. - * - * Generated from protobuf field string definition = 3; - */ - protected $definition = ''; - /** - * Output only. Immutable. The revision ID of the schema. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Output only. The timestamp that the revision was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the schema. - * Format is `projects/{project}/schemas/{schema}`. - * @type int $type - * The type of the schema definition. - * @type string $definition - * The definition of the schema. This should contain a string representing - * the full definition of the schema that is a valid schema definition of - * the type specified in `type`. - * @type string $revision_id - * Output only. Immutable. The revision ID of the schema. - * @type \Google\Protobuf\Timestamp $revision_create_time - * Output only. The timestamp that the revision was created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the schema. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the schema. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the schema definition. - * - * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of the schema definition. - * - * Generated from protobuf field .google.pubsub.v1.Schema.Type type = 2; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Schema\Type::class); - $this->type = $var; - - return $this; - } - - /** - * The definition of the schema. This should contain a string representing - * the full definition of the schema that is a valid schema definition of - * the type specified in `type`. - * - * Generated from protobuf field string definition = 3; - * @return string - */ - public function getDefinition() - { - return $this->definition; - } - - /** - * The definition of the schema. This should contain a string representing - * the full definition of the schema that is a valid schema definition of - * the type specified in `type`. - * - * Generated from protobuf field string definition = 3; - * @param string $var - * @return $this - */ - public function setDefinition($var) - { - GPBUtil::checkString($var, True); - $this->definition = $var; - - return $this; - } - - /** - * Output only. Immutable. The revision ID of the schema. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. Immutable. The revision ID of the schema. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Output only. The timestamp that the revision was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRevisionCreateTime() - { - return $this->revision_create_time; - } - - public function hasRevisionCreateTime() - { - return isset($this->revision_create_time); - } - - public function clearRevisionCreateTime() - { - unset($this->revision_create_time); - } - - /** - * Output only. The timestamp that the revision was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRevisionCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->revision_create_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php deleted file mode 100644 index 31945e1e640..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Schema/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.pubsub.v1.Schema.Type - */ -class Type -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * A Protocol Buffer schema definition. - * - * Generated from protobuf enum PROTOCOL_BUFFER = 1; - */ - const PROTOCOL_BUFFER = 1; - /** - * An Avro schema definition. - * - * Generated from protobuf enum AVRO = 2; - */ - const AVRO = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::PROTOCOL_BUFFER => 'PROTOCOL_BUFFER', - self::AVRO => 'AVRO', - ]; - - 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(Type::class, \Google\Cloud\PubSub\V1\Schema_Type::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php deleted file mode 100644 index f32a917284c..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaSettings.php +++ /dev/null @@ -1,197 +0,0 @@ -google.pubsub.v1.SchemaSettings - */ -class SchemaSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the schema that messages published should be - * validated against. Format is `projects/{project}/schemas/{schema}`. The - * value of this field will be `_deleted-schema_` if the schema has been - * deleted. - * - * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $schema = ''; - /** - * Optional. The encoding of messages validated against `schema`. - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encoding = 0; - /** - * Optional. The minimum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * last_revision or any revision created before. - * - * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $first_revision_id = ''; - /** - * Optional. The maximum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * first_revision or any revision created after. - * - * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $last_revision_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $schema - * Required. The name of the schema that messages published should be - * validated against. Format is `projects/{project}/schemas/{schema}`. The - * value of this field will be `_deleted-schema_` if the schema has been - * deleted. - * @type int $encoding - * Optional. The encoding of messages validated against `schema`. - * @type string $first_revision_id - * Optional. The minimum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * last_revision or any revision created before. - * @type string $last_revision_id - * Optional. The maximum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * first_revision or any revision created after. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the schema that messages published should be - * validated against. Format is `projects/{project}/schemas/{schema}`. The - * value of this field will be `_deleted-schema_` if the schema has been - * deleted. - * - * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSchema() - { - return $this->schema; - } - - /** - * Required. The name of the schema that messages published should be - * validated against. Format is `projects/{project}/schemas/{schema}`. The - * value of this field will be `_deleted-schema_` if the schema has been - * deleted. - * - * Generated from protobuf field string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSchema($var) - { - GPBUtil::checkString($var, True); - $this->schema = $var; - - return $this; - } - - /** - * Optional. The encoding of messages validated against `schema`. - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getEncoding() - { - return $this->encoding; - } - - /** - * Optional. The encoding of messages validated against `schema`. - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Encoding::class); - $this->encoding = $var; - - return $this; - } - - /** - * Optional. The minimum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * last_revision or any revision created before. - * - * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFirstRevisionId() - { - return $this->first_revision_id; - } - - /** - * Optional. The minimum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * last_revision or any revision created before. - * - * Generated from protobuf field string first_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFirstRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->first_revision_id = $var; - - return $this; - } - - /** - * Optional. The maximum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * first_revision or any revision created after. - * - * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLastRevisionId() - { - return $this->last_revision_id; - } - - /** - * Optional. The maximum (inclusive) revision allowed for validating messages. - * If empty or not present, allow any revision to be validated against - * first_revision or any revision created after. - * - * Generated from protobuf field string last_revision_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLastRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->last_revision_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php deleted file mode 100644 index 5434e27c62b..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SchemaView.php +++ /dev/null @@ -1,62 +0,0 @@ -google.pubsub.v1.SchemaView - */ -class SchemaView -{ - /** - * The default / unset value. - * The API will default to the BASIC view. - * - * Generated from protobuf enum SCHEMA_VIEW_UNSPECIFIED = 0; - */ - const SCHEMA_VIEW_UNSPECIFIED = 0; - /** - * Include the name and type of the schema, but not the definition. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * Include all Schema object fields. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::SCHEMA_VIEW_UNSPECIFIED => 'SCHEMA_VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php deleted file mode 100644 index 0f726f6024e..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.pubsub.v1.SeekRequest - */ -class SeekRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription to affect. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - protected $target; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription to affect. - * @type \Google\Protobuf\Timestamp $time - * Optional. The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * @type string $snapshot - * Optional. The snapshot to seek to. The snapshot's topic must be the same - * as that of the provided subscription. Format is - * `projects/{project}/snapshots/{snap}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription to affect. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription to affect. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Optional. The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * - * Generated from protobuf field .google.protobuf.Timestamp time = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getTime() - { - return $this->readOneof(2); - } - - public function hasTime() - { - return $this->hasOneof(2); - } - - /** - * Optional. The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * - * Generated from protobuf field .google.protobuf.Timestamp time = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Optional. The snapshot to seek to. The snapshot's topic must be the same - * as that of the provided subscription. Format is - * `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getSnapshot() - { - return $this->readOneof(3); - } - - public function hasSnapshot() - { - return $this->hasOneof(3); - } - - /** - * Optional. The snapshot to seek to. The snapshot's topic must be the same - * as that of the provided subscription. Format is - * `projects/{project}/snapshots/{snap}`. - * - * Generated from protobuf field string snapshot = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSnapshot($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getTarget() - { - return $this->whichOneof("target"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php deleted file mode 100644 index cf1f98bba3c..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/SeekResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.pubsub.v1.SeekResponse - */ -class SeekResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php deleted file mode 100644 index 0861e885aad..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Snapshot.php +++ /dev/null @@ -1,227 +0,0 @@ -google.pubsub.v1.Snapshot - */ -class Snapshot extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the snapshot. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $name = ''; - /** - * Optional. The name of the topic from which this snapshot is retaining - * messages. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $topic = ''; - /** - * Optional. The snapshot is guaranteed to exist up until this time. - * A newly-created snapshot expires no later than 7 days from the time of its - * creation. Its exact lifetime is determined at creation by the existing - * backlog in the source subscription. Specifically, the lifetime of the - * snapshot is `7 days - (age of oldest unacked message in the subscription)`. - * For example, consider a subscription whose oldest unacked message is 3 days - * old. If a snapshot is created from this subscription, the snapshot -- which - * will always capture this 3-day-old backlog as long as the snapshot - * exists -- will expire in 4 days. The service will refuse to create a - * snapshot that would expire in less than 1 hour after creation. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $expire_time = null; - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The name of the snapshot. - * @type string $topic - * Optional. The name of the topic from which this snapshot is retaining - * messages. - * @type \Google\Protobuf\Timestamp $expire_time - * Optional. The snapshot is guaranteed to exist up until this time. - * A newly-created snapshot expires no later than 7 days from the time of its - * creation. Its exact lifetime is determined at creation by the existing - * backlog in the source subscription. Specifically, the lifetime of the - * snapshot is `7 days - (age of oldest unacked message in the subscription)`. - * For example, consider a subscription whose oldest unacked message is 3 days - * old. If a snapshot is created from this subscription, the snapshot -- which - * will always capture this 3-day-old backlog as long as the snapshot - * exists -- will expire in 4 days. The service will refuse to create a - * snapshot that would expire in less than 1 hour after creation. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the snapshot. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The name of the snapshot. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The name of the topic from which this snapshot is retaining - * messages. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Optional. The name of the topic from which this snapshot is retaining - * messages. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Optional. The snapshot is guaranteed to exist up until this time. - * A newly-created snapshot expires no later than 7 days from the time of its - * creation. Its exact lifetime is determined at creation by the existing - * backlog in the source subscription. Specifically, the lifetime of the - * snapshot is `7 days - (age of oldest unacked message in the subscription)`. - * For example, consider a subscription whose oldest unacked message is 3 days - * old. If a snapshot is created from this subscription, the snapshot -- which - * will always capture this 3-day-old backlog as long as the snapshot - * exists -- will expire in 4 days. The service will refuse to create a - * snapshot that would expire in less than 1 hour after creation. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Optional. The snapshot is guaranteed to exist up until this time. - * A newly-created snapshot expires no later than 7 days from the time of its - * creation. Its exact lifetime is determined at creation by the existing - * backlog in the source subscription. Specifically, the lifetime of the - * snapshot is `7 days - (age of oldest unacked message in the subscription)`. - * For example, consider a subscription whose oldest unacked message is 3 days - * old. If a snapshot is created from this subscription, the snapshot -- which - * will always capture this 3-day-old backlog as long as the snapshot - * exists -- will expire in 4 days. The service will refuse to create a - * snapshot that would expire in less than 1 hour after creation. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 4 [(.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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php deleted file mode 100644 index f51c899b073..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullRequest.php +++ /dev/null @@ -1,491 +0,0 @@ -google.pubsub.v1.StreamingPullRequest - */ -class StreamingPullRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The subscription for which to initialize the new stream. This - * must be provided in the first request on the stream, and must not be set in - * subsequent requests from client to server. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $subscription = ''; - /** - * Optional. List of acknowledgement IDs for acknowledging previously received - * messages (received on this stream or a different stream). If an ack ID has - * expired, the corresponding message may be redelivered later. Acknowledging - * a message more than once will not result in an error. If the - * acknowledgement ID is malformed, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $ack_ids; - /** - * Optional. The list of new ack deadlines for the IDs listed in - * `modify_deadline_ack_ids`. The size of this list must be the same as the - * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - * with `INVALID_ARGUMENT`. Each element in this list is applied to the - * element in the same position in `modify_deadline_ack_ids`. The new ack - * deadline is with respect to the time this request was sent to the Pub/Sub - * system. Must be >= 0. For example, if the value is 10, the new ack deadline - * will expire 10 seconds after this request is received. If the value is 0, - * the message is immediately made available for another streaming or - * non-streaming pull request. If the value is < 0 (an error), the stream will - * be aborted with status `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $modify_deadline_seconds; - /** - * Optional. List of acknowledgement IDs whose deadline will be modified based - * on the corresponding element in `modify_deadline_seconds`. This field can - * be used to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. - * - * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $modify_deadline_ack_ids; - /** - * Required. The ack deadline to use for the stream. This must be provided in - * the first request on the stream, but it can also be updated on subsequent - * requests from client to server. The minimum deadline you can specify is 10 - * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - * - * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $stream_ack_deadline_seconds = 0; - /** - * Optional. A unique identifier that is used to distinguish client instances - * from each other. Only needs to be provided on the initial request. When a - * stream disconnects and reconnects for the same stream, the client_id should - * be set to the same value so that state associated with the old stream can - * be transferred to the new stream. The same client_id should not be used for - * different client instances. - * - * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $client_id = ''; - /** - * Optional. Flow control settings for the maximum number of outstanding - * messages. When there are `max_outstanding_messages` currently sent to the - * streaming pull client that have not yet been acked or nacked, the server - * stops sending more messages. The sending of messages resumes once the - * number of outstanding messages is less than this value. If the value is - * <= 0, there is no limit to the number of outstanding messages. This - * property can only be set on the initial StreamingPullRequest. If it is set - * on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_outstanding_messages = 0; - /** - * Optional. Flow control settings for the maximum number of outstanding - * bytes. When there are `max_outstanding_bytes` or more worth of messages - * currently sent to the streaming pull client that have not yet been acked or - * nacked, the server will stop sending more messages. The sending of messages - * resumes once the number of outstanding bytes is less than this value. If - * the value is <= 0, there is no limit to the number of outstanding bytes. - * This property can only be set on the initial StreamingPullRequest. If it is - * set on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_outstanding_bytes = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Required. The subscription for which to initialize the new stream. This - * must be provided in the first request on the stream, and must not be set in - * subsequent requests from client to server. - * Format is `projects/{project}/subscriptions/{sub}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids - * Optional. List of acknowledgement IDs for acknowledging previously received - * messages (received on this stream or a different stream). If an ack ID has - * expired, the corresponding message may be redelivered later. Acknowledging - * a message more than once will not result in an error. If the - * acknowledgement ID is malformed, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * @type array|\Google\Protobuf\Internal\RepeatedField $modify_deadline_seconds - * Optional. The list of new ack deadlines for the IDs listed in - * `modify_deadline_ack_ids`. The size of this list must be the same as the - * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - * with `INVALID_ARGUMENT`. Each element in this list is applied to the - * element in the same position in `modify_deadline_ack_ids`. The new ack - * deadline is with respect to the time this request was sent to the Pub/Sub - * system. Must be >= 0. For example, if the value is 10, the new ack deadline - * will expire 10 seconds after this request is received. If the value is 0, - * the message is immediately made available for another streaming or - * non-streaming pull request. If the value is < 0 (an error), the stream will - * be aborted with status `INVALID_ARGUMENT`. - * @type array|\Google\Protobuf\Internal\RepeatedField $modify_deadline_ack_ids - * Optional. List of acknowledgement IDs whose deadline will be modified based - * on the corresponding element in `modify_deadline_seconds`. This field can - * be used to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. - * @type int $stream_ack_deadline_seconds - * Required. The ack deadline to use for the stream. This must be provided in - * the first request on the stream, but it can also be updated on subsequent - * requests from client to server. The minimum deadline you can specify is 10 - * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - * @type string $client_id - * Optional. A unique identifier that is used to distinguish client instances - * from each other. Only needs to be provided on the initial request. When a - * stream disconnects and reconnects for the same stream, the client_id should - * be set to the same value so that state associated with the old stream can - * be transferred to the new stream. The same client_id should not be used for - * different client instances. - * @type int|string $max_outstanding_messages - * Optional. Flow control settings for the maximum number of outstanding - * messages. When there are `max_outstanding_messages` currently sent to the - * streaming pull client that have not yet been acked or nacked, the server - * stops sending more messages. The sending of messages resumes once the - * number of outstanding messages is less than this value. If the value is - * <= 0, there is no limit to the number of outstanding messages. This - * property can only be set on the initial StreamingPullRequest. If it is set - * on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * @type int|string $max_outstanding_bytes - * Optional. Flow control settings for the maximum number of outstanding - * bytes. When there are `max_outstanding_bytes` or more worth of messages - * currently sent to the streaming pull client that have not yet been acked or - * nacked, the server will stop sending more messages. The sending of messages - * resumes once the number of outstanding bytes is less than this value. If - * the value is <= 0, there is no limit to the number of outstanding bytes. - * This property can only be set on the initial StreamingPullRequest. If it is - * set on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The subscription for which to initialize the new stream. This - * must be provided in the first request on the stream, and must not be set in - * subsequent requests from client to server. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Required. The subscription for which to initialize the new stream. This - * must be provided in the first request on the stream, and must not be set in - * subsequent requests from client to server. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs for acknowledging previously received - * messages (received on this stream or a different stream). If an ack ID has - * expired, the corresponding message may be redelivered later. Acknowledging - * a message more than once will not result in an error. If the - * acknowledgement ID is malformed, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAckIds() - { - return $this->ack_ids; - } - - /** - * Optional. List of acknowledgement IDs for acknowledging previously received - * messages (received on this stream or a different stream). If an ack ID has - * expired, the corresponding message may be redelivered later. Acknowledging - * a message more than once will not result in an error. If the - * acknowledgement ID is malformed, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ack_ids = $arr; - - return $this; - } - - /** - * Optional. The list of new ack deadlines for the IDs listed in - * `modify_deadline_ack_ids`. The size of this list must be the same as the - * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - * with `INVALID_ARGUMENT`. Each element in this list is applied to the - * element in the same position in `modify_deadline_ack_ids`. The new ack - * deadline is with respect to the time this request was sent to the Pub/Sub - * system. Must be >= 0. For example, if the value is 10, the new ack deadline - * will expire 10 seconds after this request is received. If the value is 0, - * the message is immediately made available for another streaming or - * non-streaming pull request. If the value is < 0 (an error), the stream will - * be aborted with status `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getModifyDeadlineSeconds() - { - return $this->modify_deadline_seconds; - } - - /** - * Optional. The list of new ack deadlines for the IDs listed in - * `modify_deadline_ack_ids`. The size of this list must be the same as the - * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - * with `INVALID_ARGUMENT`. Each element in this list is applied to the - * element in the same position in `modify_deadline_ack_ids`. The new ack - * deadline is with respect to the time this request was sent to the Pub/Sub - * system. Must be >= 0. For example, if the value is 10, the new ack deadline - * will expire 10 seconds after this request is received. If the value is 0, - * the message is immediately made available for another streaming or - * non-streaming pull request. If the value is < 0 (an error), the stream will - * be aborted with status `INVALID_ARGUMENT`. - * - * Generated from protobuf field repeated int32 modify_deadline_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setModifyDeadlineSeconds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->modify_deadline_seconds = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs whose deadline will be modified based - * on the corresponding element in `modify_deadline_seconds`. This field can - * be used to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. - * - * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getModifyDeadlineAckIds() - { - return $this->modify_deadline_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs whose deadline will be modified based - * on the corresponding element in `modify_deadline_seconds`. This field can - * be used to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. - * - * Generated from protobuf field repeated string modify_deadline_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setModifyDeadlineAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->modify_deadline_ack_ids = $arr; - - return $this; - } - - /** - * Required. The ack deadline to use for the stream. This must be provided in - * the first request on the stream, but it can also be updated on subsequent - * requests from client to server. The minimum deadline you can specify is 10 - * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - * - * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getStreamAckDeadlineSeconds() - { - return $this->stream_ack_deadline_seconds; - } - - /** - * Required. The ack deadline to use for the stream. This must be provided in - * the first request on the stream, but it can also be updated on subsequent - * requests from client to server. The minimum deadline you can specify is 10 - * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - * - * Generated from protobuf field int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setStreamAckDeadlineSeconds($var) - { - GPBUtil::checkInt32($var); - $this->stream_ack_deadline_seconds = $var; - - return $this; - } - - /** - * Optional. A unique identifier that is used to distinguish client instances - * from each other. Only needs to be provided on the initial request. When a - * stream disconnects and reconnects for the same stream, the client_id should - * be set to the same value so that state associated with the old stream can - * be transferred to the new stream. The same client_id should not be used for - * different client instances. - * - * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getClientId() - { - return $this->client_id; - } - - /** - * Optional. A unique identifier that is used to distinguish client instances - * from each other. Only needs to be provided on the initial request. When a - * stream disconnects and reconnects for the same stream, the client_id should - * be set to the same value so that state associated with the old stream can - * be transferred to the new stream. The same client_id should not be used for - * different client instances. - * - * Generated from protobuf field string client_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setClientId($var) - { - GPBUtil::checkString($var, True); - $this->client_id = $var; - - return $this; - } - - /** - * Optional. Flow control settings for the maximum number of outstanding - * messages. When there are `max_outstanding_messages` currently sent to the - * streaming pull client that have not yet been acked or nacked, the server - * stops sending more messages. The sending of messages resumes once the - * number of outstanding messages is less than this value. If the value is - * <= 0, there is no limit to the number of outstanding messages. This - * property can only be set on the initial StreamingPullRequest. If it is set - * on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getMaxOutstandingMessages() - { - return $this->max_outstanding_messages; - } - - /** - * Optional. Flow control settings for the maximum number of outstanding - * messages. When there are `max_outstanding_messages` currently sent to the - * streaming pull client that have not yet been acked or nacked, the server - * stops sending more messages. The sending of messages resumes once the - * number of outstanding messages is less than this value. If the value is - * <= 0, there is no limit to the number of outstanding messages. This - * property can only be set on the initial StreamingPullRequest. If it is set - * on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setMaxOutstandingMessages($var) - { - GPBUtil::checkInt64($var); - $this->max_outstanding_messages = $var; - - return $this; - } - - /** - * Optional. Flow control settings for the maximum number of outstanding - * bytes. When there are `max_outstanding_bytes` or more worth of messages - * currently sent to the streaming pull client that have not yet been acked or - * nacked, the server will stop sending more messages. The sending of messages - * resumes once the number of outstanding bytes is less than this value. If - * the value is <= 0, there is no limit to the number of outstanding bytes. - * This property can only be set on the initial StreamingPullRequest. If it is - * set on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getMaxOutstandingBytes() - { - return $this->max_outstanding_bytes; - } - - /** - * Optional. Flow control settings for the maximum number of outstanding - * bytes. When there are `max_outstanding_bytes` or more worth of messages - * currently sent to the streaming pull client that have not yet been acked or - * nacked, the server will stop sending more messages. The sending of messages - * resumes once the number of outstanding bytes is less than this value. If - * the value is <= 0, there is no limit to the number of outstanding bytes. - * This property can only be set on the initial StreamingPullRequest. If it is - * set on a subsequent request, the stream will be aborted with status - * `INVALID_ARGUMENT`. - * - * Generated from protobuf field int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setMaxOutstandingBytes($var) - { - GPBUtil::checkInt64($var); - $this->max_outstanding_bytes = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php deleted file mode 100644 index 009b14fcc2a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse.php +++ /dev/null @@ -1,208 +0,0 @@ -google.pubsub.v1.StreamingPullResponse - */ -class StreamingPullResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Received Pub/Sub messages. This will not be empty. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $received_messages; - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $acknowledge_confirmation = null; - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $modify_ack_deadline_confirmation = null; - /** - * Optional. Properties associated with this subscription. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $subscription_properties = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $received_messages - * Optional. Received Pub/Sub messages. This will not be empty. - * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $acknowledge_confirmation - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation $modify_ack_deadline_confirmation - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties $subscription_properties - * Optional. Properties associated with this subscription. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Received Pub/Sub messages. This will not be empty. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReceivedMessages() - { - return $this->received_messages; - } - - /** - * Optional. Received Pub/Sub messages. This will not be empty. - * - * Generated from protobuf field repeated .google.pubsub.v1.ReceivedMessage received_messages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\PubSub\V1\ReceivedMessage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReceivedMessages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\ReceivedMessage::class); - $this->received_messages = $arr; - - return $this; - } - - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation|null - */ - public function getAcknowledgeConfirmation() - { - return $this->acknowledge_confirmation; - } - - public function hasAcknowledgeConfirmation() - { - return isset($this->acknowledge_confirmation); - } - - public function clearAcknowledgeConfirmation() - { - unset($this->acknowledge_confirmation); - } - - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $var - * @return $this - */ - public function setAcknowledgeConfirmation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation::class); - $this->acknowledge_confirmation = $var; - - return $this; - } - - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation|null - */ - public function getModifyAckDeadlineConfirmation() - { - return $this->modify_ack_deadline_confirmation; - } - - public function hasModifyAckDeadlineConfirmation() - { - return isset($this->modify_ack_deadline_confirmation); - } - - public function clearModifyAckDeadlineConfirmation() - { - unset($this->modify_ack_deadline_confirmation); - } - - /** - * Optional. This field will only be set if `enable_exactly_once_delivery` is - * set to `true`. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation $var - * @return $this - */ - public function setModifyAckDeadlineConfirmation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation::class); - $this->modify_ack_deadline_confirmation = $var; - - return $this; - } - - /** - * Optional. Properties associated with this subscription. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties|null - */ - public function getSubscriptionProperties() - { - return $this->subscription_properties; - } - - public function hasSubscriptionProperties() - { - return isset($this->subscription_properties); - } - - public function clearSubscriptionProperties() - { - unset($this->subscription_properties); - } - - /** - * Optional. Properties associated with this subscription. - * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties $var - * @return $this - */ - public function setSubscriptionProperties($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\SubscriptionProperties::class); - $this->subscription_properties = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php deleted file mode 100644 index fd94ce279a9..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/AcknowledgeConfirmation.php +++ /dev/null @@ -1,181 +0,0 @@ -google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - */ -class AcknowledgeConfirmation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $ack_ids; - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $invalid_ack_ids; - /** - * Optional. List of acknowledgement IDs that were out of order. - * - * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $unordered_ack_ids; - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $temporary_failed_ack_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids - * Optional. Successfully processed acknowledgement IDs. - * @type array|\Google\Protobuf\Internal\RepeatedField $invalid_ack_ids - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * @type array|\Google\Protobuf\Internal\RepeatedField $unordered_ack_ids - * Optional. List of acknowledgement IDs that were out of order. - * @type array|\Google\Protobuf\Internal\RepeatedField $temporary_failed_ack_ids - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAckIds() - { - return $this->ack_ids; - } - - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ack_ids = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInvalidAckIds() - { - return $this->invalid_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInvalidAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->invalid_ack_ids = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs that were out of order. - * - * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnorderedAckIds() - { - return $this->unordered_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs that were out of order. - * - * Generated from protobuf field repeated string unordered_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnorderedAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unordered_ack_ids = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTemporaryFailedAckIds() - { - return $this->temporary_failed_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTemporaryFailedAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->temporary_failed_ack_ids = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcknowledgeConfirmation::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_AcknowledgeConfirmation::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php deleted file mode 100644 index 1fd67ae753a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/ModifyAckDeadlineConfirmation.php +++ /dev/null @@ -1,147 +0,0 @@ -google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - */ -class ModifyAckDeadlineConfirmation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $ack_ids; - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $invalid_ack_ids; - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $temporary_failed_ack_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $ack_ids - * Optional. Successfully processed acknowledgement IDs. - * @type array|\Google\Protobuf\Internal\RepeatedField $invalid_ack_ids - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * @type array|\Google\Protobuf\Internal\RepeatedField $temporary_failed_ack_ids - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAckIds() - { - return $this->ack_ids; - } - - /** - * Optional. Successfully processed acknowledgement IDs. - * - * Generated from protobuf field repeated string ack_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ack_ids = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInvalidAckIds() - { - return $this->invalid_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs that were malformed or whose - * acknowledgement deadline has expired. - * - * Generated from protobuf field repeated string invalid_ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInvalidAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->invalid_ack_ids = $arr; - - return $this; - } - - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTemporaryFailedAckIds() - { - return $this->temporary_failed_ack_ids; - } - - /** - * Optional. List of acknowledgement IDs that failed processing with - * temporary issues. - * - * Generated from protobuf field repeated string temporary_failed_ack_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTemporaryFailedAckIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->temporary_failed_ack_ids = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ModifyAckDeadlineConfirmation::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_ModifyAckDeadlineConfirmation::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php deleted file mode 100644 index f531ca2a7d5..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/StreamingPullResponse/SubscriptionProperties.php +++ /dev/null @@ -1,108 +0,0 @@ -google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - */ -class SubscriptionProperties extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. True iff exactly once delivery is enabled for this - * subscription. - * - * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $exactly_once_delivery_enabled = false; - /** - * Optional. True iff message ordering is enabled for this subscription. - * - * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $message_ordering_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $exactly_once_delivery_enabled - * Optional. True iff exactly once delivery is enabled for this - * subscription. - * @type bool $message_ordering_enabled - * Optional. True iff message ordering is enabled for this subscription. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. True iff exactly once delivery is enabled for this - * subscription. - * - * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getExactlyOnceDeliveryEnabled() - { - return $this->exactly_once_delivery_enabled; - } - - /** - * Optional. True iff exactly once delivery is enabled for this - * subscription. - * - * Generated from protobuf field bool exactly_once_delivery_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setExactlyOnceDeliveryEnabled($var) - { - GPBUtil::checkBool($var); - $this->exactly_once_delivery_enabled = $var; - - return $this; - } - - /** - * Optional. True iff message ordering is enabled for this subscription. - * - * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getMessageOrderingEnabled() - { - return $this->message_ordering_enabled; - } - - /** - * Optional. True iff message ordering is enabled for this subscription. - * - * Generated from protobuf field bool message_ordering_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setMessageOrderingEnabled($var) - { - GPBUtil::checkBool($var); - $this->message_ordering_enabled = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SubscriptionProperties::class, \Google\Cloud\PubSub\V1\StreamingPullResponse_SubscriptionProperties::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php deleted file mode 100644 index 5beaed0dcde..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription.php +++ /dev/null @@ -1,1138 +0,0 @@ -google.pubsub.v1.Subscription - */ -class Subscription extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $topic = ''; - /** - * Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $push_config = null; - /** - * Optional. If delivery to BigQuery is used with this subscription, this - * field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bigquery_config = null; - /** - * Optional. If delivery to Google Cloud Storage is used with this - * subscription, this field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cloud_storage_config = null; - /** - * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ack_deadline_seconds = 0; - /** - * Optional. Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to [`Seek` to a timestamp] - * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - * the past to replay previously-acknowledged messages. - * - * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $retain_acked_messages = false; - /** - * Optional. How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $message_retention_duration = null; - /** - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. If true, messages published with the same `ordering_key` in - * `PubsubMessage` will be delivered to the subscribers in the order in which - * they are received by the Pub/Sub system. Otherwise, they may be delivered - * in any order. - * - * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_message_ordering = false; - /** - * Optional. A policy that specifies the conditions for this subscription's - * expiration. A subscription is considered active as long as any connected - * subscriber is successfully consuming messages from the subscription or is - * issuing operations on the subscription. If `expiration_policy` is not set, - * a *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - * but `expiration_policy.ttl` is not set, the subscription never expires. - * - * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $expiration_policy = null; - /** - * Optional. An expression written in the Pub/Sub [filter - * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - * then only `PubsubMessage`s whose `attributes` field matches the filter are - * delivered on this subscription. If empty, then no messages are filtered - * out. - * - * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. A policy that specifies the conditions for dead lettering - * messages in this subscription. If dead_letter_policy is not set, dead - * lettering is disabled. - * The Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * - * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $dead_letter_policy = null; - /** - * Optional. A policy that specifies how Pub/Sub retries message delivery for - * this subscription. - * If not set, the default retry policy is applied. This generally implies - * that messages will be retried as soon as possible for healthy subscribers. - * RetryPolicy will be triggered on NACKs or acknowledgement deadline - * exceeded events for a given message. - * - * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $retry_policy = null; - /** - * Optional. Indicates whether the subscription is detached from its topic. - * Detached subscriptions don't receive messages from their topic and don't - * retain any backlog. `Pull` and `StreamingPull` requests will return - * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - * the endpoint will not be made. - * - * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $detached = false; - /** - * Optional. If true, Pub/Sub provides the following guarantees for the - * delivery of a message with a given value of `message_id` on this - * subscription: - * * The message sent to a subscriber is guaranteed not to be resent - * before the message's acknowledgement deadline expires. - * * An acknowledged message will not be resent to a subscriber. - * Note that subscribers may still receive multiple copies of a message - * when `enable_exactly_once_delivery` is true if the message was published - * multiple times by a publisher client. These copies are considered distinct - * by Pub/Sub and have distinct `message_id` values. - * - * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_exactly_once_delivery = false; - /** - * Output only. Indicates the minimum duration for which a message is retained - * after it is published to the subscription's topic. If this field is set, - * messages published to the subscription's topic in the last - * `topic_message_retention_duration` are always available to subscribers. See - * the `message_retention_duration` field in `Topic`. This field is set only - * in responses from the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $topic_message_retention_duration = null; - /** - * Output only. An output-only field indicating whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Information about the associated Analytics Hub subscription. - * Only set if the subscritpion is created by Analytics Hub. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $analytics_hub_subscription_info = null; - - /** - * @param string $name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * @param string $topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. Please see - * {@see SubscriberClient::topicName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\PushConfig $pushConfig Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * @param int $ackDeadlineSeconds Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * @return \Google\Cloud\PubSub\V1\Subscription - * - * @experimental - */ - public static function build(string $name, string $topic, \Google\Cloud\PubSub\V1\PushConfig $pushConfig, int $ackDeadlineSeconds): self - { - return (new self()) - ->setName($name) - ->setTopic($topic) - ->setPushConfig($pushConfig) - ->setAckDeadlineSeconds($ackDeadlineSeconds); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * @type string $topic - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * @type \Google\Cloud\PubSub\V1\PushConfig $push_config - * Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * @type \Google\Cloud\PubSub\V1\BigQueryConfig $bigquery_config - * Optional. If delivery to BigQuery is used with this subscription, this - * field is used to configure it. - * @type \Google\Cloud\PubSub\V1\CloudStorageConfig $cloud_storage_config - * Optional. If delivery to Google Cloud Storage is used with this - * subscription, this field is used to configure it. - * @type int $ack_deadline_seconds - * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * @type bool $retain_acked_messages - * Optional. Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to [`Seek` to a timestamp] - * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - * the past to replay previously-acknowledged messages. - * @type \Google\Protobuf\Duration $message_retention_duration - * Optional. How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 31 days or less than 10 minutes. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * @type bool $enable_message_ordering - * Optional. If true, messages published with the same `ordering_key` in - * `PubsubMessage` will be delivered to the subscribers in the order in which - * they are received by the Pub/Sub system. Otherwise, they may be delivered - * in any order. - * @type \Google\Cloud\PubSub\V1\ExpirationPolicy $expiration_policy - * Optional. A policy that specifies the conditions for this subscription's - * expiration. A subscription is considered active as long as any connected - * subscriber is successfully consuming messages from the subscription or is - * issuing operations on the subscription. If `expiration_policy` is not set, - * a *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - * but `expiration_policy.ttl` is not set, the subscription never expires. - * @type string $filter - * Optional. An expression written in the Pub/Sub [filter - * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - * then only `PubsubMessage`s whose `attributes` field matches the filter are - * delivered on this subscription. If empty, then no messages are filtered - * out. - * @type \Google\Cloud\PubSub\V1\DeadLetterPolicy $dead_letter_policy - * Optional. A policy that specifies the conditions for dead lettering - * messages in this subscription. If dead_letter_policy is not set, dead - * lettering is disabled. - * The Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * @type \Google\Cloud\PubSub\V1\RetryPolicy $retry_policy - * Optional. A policy that specifies how Pub/Sub retries message delivery for - * this subscription. - * If not set, the default retry policy is applied. This generally implies - * that messages will be retried as soon as possible for healthy subscribers. - * RetryPolicy will be triggered on NACKs or acknowledgement deadline - * exceeded events for a given message. - * @type bool $detached - * Optional. Indicates whether the subscription is detached from its topic. - * Detached subscriptions don't receive messages from their topic and don't - * retain any backlog. `Pull` and `StreamingPull` requests will return - * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - * the endpoint will not be made. - * @type bool $enable_exactly_once_delivery - * Optional. If true, Pub/Sub provides the following guarantees for the - * delivery of a message with a given value of `message_id` on this - * subscription: - * * The message sent to a subscriber is guaranteed not to be resent - * before the message's acknowledgement deadline expires. - * * An acknowledged message will not be resent to a subscriber. - * Note that subscribers may still receive multiple copies of a message - * when `enable_exactly_once_delivery` is true if the message was published - * multiple times by a publisher client. These copies are considered distinct - * by Pub/Sub and have distinct `message_id` values. - * @type \Google\Protobuf\Duration $topic_message_retention_duration - * Output only. Indicates the minimum duration for which a message is retained - * after it is published to the subscription's topic. If this field is set, - * messages published to the subscription's topic in the last - * `topic_message_retention_duration` are always available to subscribers. See - * the `message_retention_duration` field in `Topic`. This field is set only - * in responses from the server; it is ignored if it is set in any requests. - * @type int $state - * Output only. An output-only field indicating whether or not the - * subscription can receive messages. - * @type \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo $analytics_hub_subscription_info - * Output only. Information about the associated Analytics Hub subscription. - * Only set if the subscritpion is created by Analytics Hub. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * - * Generated from protobuf field string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\PushConfig|null - */ - public function getPushConfig() - { - return $this->push_config; - } - - public function hasPushConfig() - { - return isset($this->push_config); - } - - public function clearPushConfig() - { - unset($this->push_config); - } - - /** - * Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\PushConfig $var - * @return $this - */ - public function setPushConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class); - $this->push_config = $var; - - return $this; - } - - /** - * Optional. If delivery to BigQuery is used with this subscription, this - * field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\BigQueryConfig|null - */ - public function getBigqueryConfig() - { - return $this->bigquery_config; - } - - public function hasBigqueryConfig() - { - return isset($this->bigquery_config); - } - - public function clearBigqueryConfig() - { - unset($this->bigquery_config); - } - - /** - * Optional. If delivery to BigQuery is used with this subscription, this - * field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\BigQueryConfig $var - * @return $this - */ - public function setBigqueryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\BigQueryConfig::class); - $this->bigquery_config = $var; - - return $this; - } - - /** - * Optional. If delivery to Google Cloud Storage is used with this - * subscription, this field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\CloudStorageConfig|null - */ - public function getCloudStorageConfig() - { - return $this->cloud_storage_config; - } - - public function hasCloudStorageConfig() - { - return isset($this->cloud_storage_config); - } - - public function clearCloudStorageConfig() - { - unset($this->cloud_storage_config); - } - - /** - * Optional. If delivery to Google Cloud Storage is used with this - * subscription, this field is used to configure it. - * - * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\CloudStorageConfig $var - * @return $this - */ - public function setCloudStorageConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\CloudStorageConfig::class); - $this->cloud_storage_config = $var; - - return $this; - } - - /** - * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAckDeadlineSeconds() - { - return $this->ack_deadline_seconds; - } - - /** - * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * Generated from protobuf field int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAckDeadlineSeconds($var) - { - GPBUtil::checkInt32($var); - $this->ack_deadline_seconds = $var; - - return $this; - } - - /** - * Optional. Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to [`Seek` to a timestamp] - * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - * the past to replay previously-acknowledged messages. - * - * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRetainAckedMessages() - { - return $this->retain_acked_messages; - } - - /** - * Optional. Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to [`Seek` to a timestamp] - * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - * the past to replay previously-acknowledged messages. - * - * Generated from protobuf field bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRetainAckedMessages($var) - { - GPBUtil::checkBool($var); - $this->retain_acked_messages = $var; - - return $this; - } - - /** - * Optional. How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getMessageRetentionDuration() - { - return $this->message_retention_duration; - } - - public function hasMessageRetentionDuration() - { - return isset($this->message_retention_duration); - } - - public function clearMessageRetentionDuration() - { - unset($this->message_retention_duration); - } - - /** - * Optional. How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMessageRetentionDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->message_retention_duration = $var; - - return $this; - } - - /** - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/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. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/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; - } - - /** - * Optional. If true, messages published with the same `ordering_key` in - * `PubsubMessage` will be delivered to the subscribers in the order in which - * they are received by the Pub/Sub system. Otherwise, they may be delivered - * in any order. - * - * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableMessageOrdering() - { - return $this->enable_message_ordering; - } - - /** - * Optional. If true, messages published with the same `ordering_key` in - * `PubsubMessage` will be delivered to the subscribers in the order in which - * they are received by the Pub/Sub system. Otherwise, they may be delivered - * in any order. - * - * Generated from protobuf field bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableMessageOrdering($var) - { - GPBUtil::checkBool($var); - $this->enable_message_ordering = $var; - - return $this; - } - - /** - * Optional. A policy that specifies the conditions for this subscription's - * expiration. A subscription is considered active as long as any connected - * subscriber is successfully consuming messages from the subscription or is - * issuing operations on the subscription. If `expiration_policy` is not set, - * a *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - * but `expiration_policy.ttl` is not set, the subscription never expires. - * - * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\ExpirationPolicy|null - */ - public function getExpirationPolicy() - { - return $this->expiration_policy; - } - - public function hasExpirationPolicy() - { - return isset($this->expiration_policy); - } - - public function clearExpirationPolicy() - { - unset($this->expiration_policy); - } - - /** - * Optional. A policy that specifies the conditions for this subscription's - * expiration. A subscription is considered active as long as any connected - * subscriber is successfully consuming messages from the subscription or is - * issuing operations on the subscription. If `expiration_policy` is not set, - * a *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - * but `expiration_policy.ttl` is not set, the subscription never expires. - * - * Generated from protobuf field .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\ExpirationPolicy $var - * @return $this - */ - public function setExpirationPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\ExpirationPolicy::class); - $this->expiration_policy = $var; - - return $this; - } - - /** - * Optional. An expression written in the Pub/Sub [filter - * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - * then only `PubsubMessage`s whose `attributes` field matches the filter are - * delivered on this subscription. If empty, then no messages are filtered - * out. - * - * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. An expression written in the Pub/Sub [filter - * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - * then only `PubsubMessage`s whose `attributes` field matches the filter are - * delivered on this subscription. If empty, then no messages are filtered - * out. - * - * Generated from protobuf field string filter = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. A policy that specifies the conditions for dead lettering - * messages in this subscription. If dead_letter_policy is not set, dead - * lettering is disabled. - * The Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * - * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\DeadLetterPolicy|null - */ - public function getDeadLetterPolicy() - { - return $this->dead_letter_policy; - } - - public function hasDeadLetterPolicy() - { - return isset($this->dead_letter_policy); - } - - public function clearDeadLetterPolicy() - { - unset($this->dead_letter_policy); - } - - /** - * Optional. A policy that specifies the conditions for dead lettering - * messages in this subscription. If dead_letter_policy is not set, dead - * lettering is disabled. - * The Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * - * Generated from protobuf field .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\DeadLetterPolicy $var - * @return $this - */ - public function setDeadLetterPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\DeadLetterPolicy::class); - $this->dead_letter_policy = $var; - - return $this; - } - - /** - * Optional. A policy that specifies how Pub/Sub retries message delivery for - * this subscription. - * If not set, the default retry policy is applied. This generally implies - * that messages will be retried as soon as possible for healthy subscribers. - * RetryPolicy will be triggered on NACKs or acknowledgement deadline - * exceeded events for a given message. - * - * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\RetryPolicy|null - */ - public function getRetryPolicy() - { - return $this->retry_policy; - } - - public function hasRetryPolicy() - { - return isset($this->retry_policy); - } - - public function clearRetryPolicy() - { - unset($this->retry_policy); - } - - /** - * Optional. A policy that specifies how Pub/Sub retries message delivery for - * this subscription. - * If not set, the default retry policy is applied. This generally implies - * that messages will be retried as soon as possible for healthy subscribers. - * RetryPolicy will be triggered on NACKs or acknowledgement deadline - * exceeded events for a given message. - * - * Generated from protobuf field .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\RetryPolicy $var - * @return $this - */ - public function setRetryPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\RetryPolicy::class); - $this->retry_policy = $var; - - return $this; - } - - /** - * Optional. Indicates whether the subscription is detached from its topic. - * Detached subscriptions don't receive messages from their topic and don't - * retain any backlog. `Pull` and `StreamingPull` requests will return - * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - * the endpoint will not be made. - * - * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDetached() - { - return $this->detached; - } - - /** - * Optional. Indicates whether the subscription is detached from its topic. - * Detached subscriptions don't receive messages from their topic and don't - * retain any backlog. `Pull` and `StreamingPull` requests will return - * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - * the endpoint will not be made. - * - * Generated from protobuf field bool detached = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDetached($var) - { - GPBUtil::checkBool($var); - $this->detached = $var; - - return $this; - } - - /** - * Optional. If true, Pub/Sub provides the following guarantees for the - * delivery of a message with a given value of `message_id` on this - * subscription: - * * The message sent to a subscriber is guaranteed not to be resent - * before the message's acknowledgement deadline expires. - * * An acknowledged message will not be resent to a subscriber. - * Note that subscribers may still receive multiple copies of a message - * when `enable_exactly_once_delivery` is true if the message was published - * multiple times by a publisher client. These copies are considered distinct - * by Pub/Sub and have distinct `message_id` values. - * - * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableExactlyOnceDelivery() - { - return $this->enable_exactly_once_delivery; - } - - /** - * Optional. If true, Pub/Sub provides the following guarantees for the - * delivery of a message with a given value of `message_id` on this - * subscription: - * * The message sent to a subscriber is guaranteed not to be resent - * before the message's acknowledgement deadline expires. - * * An acknowledged message will not be resent to a subscriber. - * Note that subscribers may still receive multiple copies of a message - * when `enable_exactly_once_delivery` is true if the message was published - * multiple times by a publisher client. These copies are considered distinct - * by Pub/Sub and have distinct `message_id` values. - * - * Generated from protobuf field bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableExactlyOnceDelivery($var) - { - GPBUtil::checkBool($var); - $this->enable_exactly_once_delivery = $var; - - return $this; - } - - /** - * Output only. Indicates the minimum duration for which a message is retained - * after it is published to the subscription's topic. If this field is set, - * messages published to the subscription's topic in the last - * `topic_message_retention_duration` are always available to subscribers. See - * the `message_retention_duration` field in `Topic`. This field is set only - * in responses from the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Duration|null - */ - public function getTopicMessageRetentionDuration() - { - return $this->topic_message_retention_duration; - } - - public function hasTopicMessageRetentionDuration() - { - return isset($this->topic_message_retention_duration); - } - - public function clearTopicMessageRetentionDuration() - { - unset($this->topic_message_retention_duration); - } - - /** - * Output only. Indicates the minimum duration for which a message is retained - * after it is published to the subscription's topic. If this field is set, - * messages published to the subscription's topic in the last - * `topic_message_retention_duration` are always available to subscribers. See - * the `message_retention_duration` field in `Topic`. This field is set only - * in responses from the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTopicMessageRetentionDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->topic_message_retention_duration = $var; - - return $this; - } - - /** - * Output only. An output-only field indicating whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field indicating whether or not the - * subscription can receive messages. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Subscription\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Information about the associated Analytics Hub subscription. - * Only set if the subscritpion is created by Analytics Hub. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo|null - */ - public function getAnalyticsHubSubscriptionInfo() - { - return $this->analytics_hub_subscription_info; - } - - public function hasAnalyticsHubSubscriptionInfo() - { - return isset($this->analytics_hub_subscription_info); - } - - public function clearAnalyticsHubSubscriptionInfo() - { - unset($this->analytics_hub_subscription_info); - } - - /** - * Output only. Information about the associated Analytics Hub subscription. - * Only set if the subscritpion is created by Analytics Hub. - * - * Generated from protobuf field .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo $var - * @return $this - */ - public function setAnalyticsHubSubscriptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription\AnalyticsHubSubscriptionInfo::class); - $this->analytics_hub_subscription_info = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php deleted file mode 100644 index 78ff21e92e4..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/AnalyticsHubSubscriptionInfo.php +++ /dev/null @@ -1,121 +0,0 @@ -google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo - */ -class AnalyticsHubSubscriptionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the associated Analytics Hub listing resource. - * Pattern: - * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" - * - * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $listing = ''; - /** - * Optional. The name of the associated Analytics Hub subscription resource. - * Pattern: - * "projects/{project}/locations/{location}/subscriptions/{subscription}" - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $subscription = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $listing - * Optional. The name of the associated Analytics Hub listing resource. - * Pattern: - * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" - * @type string $subscription - * Optional. The name of the associated Analytics Hub subscription resource. - * Pattern: - * "projects/{project}/locations/{location}/subscriptions/{subscription}" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the associated Analytics Hub listing resource. - * Pattern: - * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" - * - * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getListing() - { - return $this->listing; - } - - /** - * Optional. The name of the associated Analytics Hub listing resource. - * Pattern: - * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" - * - * Generated from protobuf field string listing = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setListing($var) - { - GPBUtil::checkString($var, True); - $this->listing = $var; - - return $this; - } - - /** - * Optional. The name of the associated Analytics Hub subscription resource. - * Pattern: - * "projects/{project}/locations/{location}/subscriptions/{subscription}" - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Optional. The name of the associated Analytics Hub subscription resource. - * Pattern: - * "projects/{project}/locations/{location}/subscriptions/{subscription}" - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnalyticsHubSubscriptionInfo::class, \Google\Cloud\PubSub\V1\Subscription_AnalyticsHubSubscriptionInfo::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php deleted file mode 100644 index 9dd0c05877e..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Subscription/State.php +++ /dev/null @@ -1,66 +0,0 @@ -google.pubsub.v1.Subscription.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The subscription can actively receive messages - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The subscription cannot receive messages because of an error with the - * resource to which it pushes messages. See the more detailed error state - * in the corresponding configuration. - * - * Generated from protobuf enum RESOURCE_ERROR = 2; - */ - const RESOURCE_ERROR = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::RESOURCE_ERROR => 'RESOURCE_ERROR', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\Subscription_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php deleted file mode 100644 index aa0e5f0fca3..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic.php +++ /dev/null @@ -1,473 +0,0 @@ -google.pubsub.v1.Topic - */ -class Topic extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. Policy constraining the set of Google Cloud Platform regions - * where messages published to the topic may be stored. If not present, then - * no constraints are in effect. - * - * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $message_storage_policy = null; - /** - * Optional. The resource name of the Cloud KMS CryptoKey to be used to - * protect access to messages published on this topic. - * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $kms_key_name = ''; - /** - * Optional. Settings for validating messages published against a schema. - * - * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $schema_settings = null; - /** - * Optional. Reserved for future use. This field is set only in responses from - * the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $satisfies_pzs = false; - /** - * Optional. Indicates the minimum duration to retain a message after it is - * published to the topic. If this field is set, messages published to the - * topic in the last `message_retention_duration` are always available to - * subscribers. For instance, it allows any attached subscription to [seek to - * a - * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - * that is up to `message_retention_duration` in the past. If this field is - * not set, message retention is controlled by settings on individual - * subscriptions. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $message_retention_duration = null; - /** - * Output only. An output-only field indicating the state of the topic. - * - * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. Settings for ingestion from a data source into this topic. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ingestion_data_source_settings = null; - - /** - * @param string $name Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * - * @return \Google\Cloud\PubSub\V1\Topic - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * @type \Google\Cloud\PubSub\V1\MessageStoragePolicy $message_storage_policy - * Optional. Policy constraining the set of Google Cloud Platform regions - * where messages published to the topic may be stored. If not present, then - * no constraints are in effect. - * @type string $kms_key_name - * Optional. The resource name of the Cloud KMS CryptoKey to be used to - * protect access to messages published on this topic. - * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * @type \Google\Cloud\PubSub\V1\SchemaSettings $schema_settings - * Optional. Settings for validating messages published against a schema. - * @type bool $satisfies_pzs - * Optional. Reserved for future use. This field is set only in responses from - * the server; it is ignored if it is set in any requests. - * @type \Google\Protobuf\Duration $message_retention_duration - * Optional. Indicates the minimum duration to retain a message after it is - * published to the topic. If this field is set, messages published to the - * topic in the last `message_retention_duration` are always available to - * subscribers. For instance, it allows any attached subscription to [seek to - * a - * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - * that is up to `message_retention_duration` in the past. If this field is - * not set, message retention is controlled by settings on individual - * subscriptions. Cannot be more than 31 days or less than 10 minutes. - * @type int $state - * Output only. An output-only field indicating the state of the topic. - * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings $ingestion_data_source_settings - * Optional. Settings for ingestion from a data source into this topic. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * - * Generated from protobuf field map labels = 2 [(.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; - } - - /** - * Optional. Policy constraining the set of Google Cloud Platform regions - * where messages published to the topic may be stored. If not present, then - * no constraints are in effect. - * - * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\MessageStoragePolicy|null - */ - public function getMessageStoragePolicy() - { - return $this->message_storage_policy; - } - - public function hasMessageStoragePolicy() - { - return isset($this->message_storage_policy); - } - - public function clearMessageStoragePolicy() - { - unset($this->message_storage_policy); - } - - /** - * Optional. Policy constraining the set of Google Cloud Platform regions - * where messages published to the topic may be stored. If not present, then - * no constraints are in effect. - * - * Generated from protobuf field .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\MessageStoragePolicy $var - * @return $this - */ - public function setMessageStoragePolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\MessageStoragePolicy::class); - $this->message_storage_policy = $var; - - return $this; - } - - /** - * Optional. The resource name of the Cloud KMS CryptoKey to be used to - * protect access to messages published on this topic. - * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Optional. The resource name of the Cloud KMS CryptoKey to be used to - * protect access to messages published on this topic. - * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string kms_key_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Optional. Settings for validating messages published against a schema. - * - * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\SchemaSettings|null - */ - public function getSchemaSettings() - { - return $this->schema_settings; - } - - public function hasSchemaSettings() - { - return isset($this->schema_settings); - } - - public function clearSchemaSettings() - { - unset($this->schema_settings); - } - - /** - * Optional. Settings for validating messages published against a schema. - * - * Generated from protobuf field .google.pubsub.v1.SchemaSettings schema_settings = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\SchemaSettings $var - * @return $this - */ - public function setSchemaSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\SchemaSettings::class); - $this->schema_settings = $var; - - return $this; - } - - /** - * Optional. Reserved for future use. This field is set only in responses from - * the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Optional. Reserved for future use. This field is set only in responses from - * the server; it is ignored if it is set in any requests. - * - * Generated from protobuf field bool satisfies_pzs = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Optional. Indicates the minimum duration to retain a message after it is - * published to the topic. If this field is set, messages published to the - * topic in the last `message_retention_duration` are always available to - * subscribers. For instance, it allows any attached subscription to [seek to - * a - * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - * that is up to `message_retention_duration` in the past. If this field is - * not set, message retention is controlled by settings on individual - * subscriptions. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getMessageRetentionDuration() - { - return $this->message_retention_duration; - } - - public function hasMessageRetentionDuration() - { - return isset($this->message_retention_duration); - } - - public function clearMessageRetentionDuration() - { - unset($this->message_retention_duration); - } - - /** - * Optional. Indicates the minimum duration to retain a message after it is - * published to the topic. If this field is set, messages published to the - * topic in the last `message_retention_duration` are always available to - * subscribers. For instance, it allows any attached subscription to [seek to - * a - * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - * that is up to `message_retention_duration` in the past. If this field is - * not set, message retention is controlled by settings on individual - * subscriptions. Cannot be more than 31 days or less than 10 minutes. - * - * Generated from protobuf field .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMessageRetentionDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->message_retention_duration = $var; - - return $this; - } - - /** - * Output only. An output-only field indicating the state of the topic. - * - * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. An output-only field indicating the state of the topic. - * - * Generated from protobuf field .google.pubsub.v1.Topic.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Topic\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. Settings for ingestion from a data source into this topic. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings|null - */ - public function getIngestionDataSourceSettings() - { - return $this->ingestion_data_source_settings; - } - - public function hasIngestionDataSourceSettings() - { - return isset($this->ingestion_data_source_settings); - } - - public function clearIngestionDataSourceSettings() - { - unset($this->ingestion_data_source_settings); - } - - /** - * Optional. Settings for ingestion from a data source into this topic. - * - * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings ingestion_data_source_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings $var - * @return $this - */ - public function setIngestionDataSourceSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings::class); - $this->ingestion_data_source_settings = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php deleted file mode 100644 index ca6a253e650..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/Topic/State.php +++ /dev/null @@ -1,66 +0,0 @@ -google.pubsub.v1.Topic.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The topic does not have any persistent errors. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Ingestion from the data source has encountered a permanent error. - * See the more detailed error state in the corresponding ingestion - * source configuration. - * - * Generated from protobuf enum INGESTION_RESOURCE_ERROR = 2; - */ - const INGESTION_RESOURCE_ERROR = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::INGESTION_RESOURCE_ERROR => 'INGESTION_RESOURCE_ERROR', - ]; - - 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(State::class, \Google\Cloud\PubSub\V1\Topic_State::class); - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php deleted file mode 100644 index aa2378043b3..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.pubsub.v1.UpdateSnapshotRequest - */ -class UpdateSnapshotRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated snapshot object. - * - * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $snapshot = null; - /** - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\PubSub\V1\Snapshot $snapshot Required. The updated snapshot object. - * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * @return \Google\Cloud\PubSub\V1\UpdateSnapshotRequest - * - * @experimental - */ - public static function build(\Google\Cloud\PubSub\V1\Snapshot $snapshot, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setSnapshot($snapshot) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PubSub\V1\Snapshot $snapshot - * Required. The updated snapshot object. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated snapshot object. - * - * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Snapshot|null - */ - public function getSnapshot() - { - return $this->snapshot; - } - - public function hasSnapshot() - { - return isset($this->snapshot); - } - - public function clearSnapshot() - { - unset($this->snapshot); - } - - /** - * Required. The updated snapshot object. - * - * Generated from protobuf field .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Snapshot $var - * @return $this - */ - public function setSnapshot($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Snapshot::class); - $this->snapshot = $var; - - return $this; - } - - /** - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php deleted file mode 100644 index d6400874635..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateSubscriptionRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.pubsub.v1.UpdateSubscriptionRequest - */ -class UpdateSubscriptionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated subscription object. - * - * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $subscription = null; - /** - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\PubSub\V1\Subscription $subscription Required. The updated subscription object. - * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * @return \Google\Cloud\PubSub\V1\UpdateSubscriptionRequest - * - * @experimental - */ - public static function build(\Google\Cloud\PubSub\V1\Subscription $subscription, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setSubscription($subscription) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PubSub\V1\Subscription $subscription - * Required. The updated subscription object. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated subscription object. - * - * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Subscription|null - */ - public function getSubscription() - { - return $this->subscription; - } - - public function hasSubscription() - { - return isset($this->subscription); - } - - public function clearSubscription() - { - unset($this->subscription); - } - - /** - * Required. The updated subscription object. - * - * Generated from protobuf field .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Subscription $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription::class); - $this->subscription = $var; - - return $this; - } - - /** - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php deleted file mode 100644 index 1a09ea4292a..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/UpdateTopicRequest.php +++ /dev/null @@ -1,156 +0,0 @@ -google.pubsub.v1.UpdateTopicRequest - */ -class UpdateTopicRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated topic object. - * - * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $topic = null; - /** - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\PubSub\V1\Topic $topic Required. The updated topic object. - * @param \Google\Protobuf\FieldMask $updateMask Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * - * @return \Google\Cloud\PubSub\V1\UpdateTopicRequest - * - * @experimental - */ - public static function build(\Google\Cloud\PubSub\V1\Topic $topic, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setTopic($topic) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\PubSub\V1\Topic $topic - * Required. The updated topic object. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated topic object. - * - * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Topic|null - */ - public function getTopic() - { - return $this->topic; - } - - public function hasTopic() - { - return isset($this->topic); - } - - public function clearTopic() - { - unset($this->topic); - } - - /** - * Required. The updated topic object. - * - * Generated from protobuf field .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Topic $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Topic::class); - $this->topic = $var; - - return $this; - } - - /** - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php deleted file mode 100644 index cc85b3a7abd..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageRequest.php +++ /dev/null @@ -1,217 +0,0 @@ -google.pubsub.v1.ValidateMessageRequest - */ -class ValidateMessageRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Message to validate against the provided `schema_spec`. - * - * Generated from protobuf field bytes message = 4; - */ - protected $message = ''; - /** - * The encoding expected for messages - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; - */ - protected $encoding = 0; - protected $schema_spec; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * @type string $name - * Name of the schema against which to validate. - * Format is `projects/{project}/schemas/{schema}`. - * @type \Google\Cloud\PubSub\V1\Schema $schema - * Ad-hoc schema against which to validate - * @type string $message - * Message to validate against the provided `schema_spec`. - * @type int $encoding - * The encoding expected for messages - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * 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 name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * 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; - } - - /** - * Name of the schema against which to validate. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->readOneof(2); - } - - public function hasName() - { - return $this->hasOneof(2); - } - - /** - * Name of the schema against which to validate. - * Format is `projects/{project}/schemas/{schema}`. - * - * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Ad-hoc schema against which to validate - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 3; - * @return \Google\Cloud\PubSub\V1\Schema|null - */ - public function getSchema() - { - return $this->readOneof(3); - } - - public function hasSchema() - { - return $this->hasOneof(3); - } - - /** - * Ad-hoc schema against which to validate - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 3; - * @param \Google\Cloud\PubSub\V1\Schema $var - * @return $this - */ - public function setSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Message to validate against the provided `schema_spec`. - * - * Generated from protobuf field bytes message = 4; - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * Message to validate against the provided `schema_spec`. - * - * Generated from protobuf field bytes message = 4; - * @param string $var - * @return $this - */ - public function setMessage($var) - { - GPBUtil::checkString($var, False); - $this->message = $var; - - return $this; - } - - /** - * The encoding expected for messages - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; - * @return int - */ - public function getEncoding() - { - return $this->encoding; - } - - /** - * The encoding expected for messages - * - * Generated from protobuf field .google.pubsub.v1.Encoding encoding = 5; - * @param int $var - * @return $this - */ - public function setEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\Encoding::class); - $this->encoding = $var; - - return $this; - } - - /** - * @return string - */ - public function getSchemaSpec() - { - return $this->whichOneof("schema_spec"); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php deleted file mode 100644 index 3447bdcc8e1..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateMessageResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.pubsub.v1.ValidateMessageResponse - */ -class ValidateMessageResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php deleted file mode 100644 index 25fd4f172a7..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.pubsub.v1.ValidateSchemaRequest - */ -class ValidateSchemaRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The schema object to validate. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schema = null; - - /** - * @param string $parent Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. Please see - * {@see SchemaServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\PubSub\V1\Schema $schema Required. The schema object to validate. - * - * @return \Google\Cloud\PubSub\V1\ValidateSchemaRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\PubSub\V1\Schema $schema): self - { - return (new self()) - ->setParent($parent) - ->setSchema($schema); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * @type \Google\Cloud\PubSub\V1\Schema $schema - * Required. The schema object to validate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * 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 name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * - * 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 schema object to validate. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\PubSub\V1\Schema|null - */ - public function getSchema() - { - return $this->schema; - } - - public function hasSchema() - { - return isset($this->schema); - } - - public function clearSchema() - { - unset($this->schema); - } - - /** - * Required. The schema object to validate. - * - * Generated from protobuf field .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\PubSub\V1\Schema $var - * @return $this - */ - public function setSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Schema::class); - $this->schema = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php b/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php deleted file mode 100644 index 777511b5f98..00000000000 --- a/owl-bot-staging/PubSub/v1/proto/src/Google/Cloud/PubSub/V1/ValidateSchemaResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.pubsub.v1.ValidateSchemaResponse - */ -class ValidateSchemaResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Pubsub\V1\Schema::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php deleted file mode 100644 index 316f4cb7a67..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/create_topic.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var Topic $response */ - $response = $publisherClient->createTopic($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_topic_sample($name); -} -// [END pubsub_v1_generated_Publisher_CreateTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php deleted file mode 100644 index 128ab5472a7..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/delete_topic.php +++ /dev/null @@ -1,74 +0,0 @@ -setTopic($formattedTopic); - - // Call the API and handle any network failures. - try { - $publisherClient->deleteTopic($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); - - delete_topic_sample($formattedTopic); -} -// [END pubsub_v1_generated_Publisher_DeleteTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php deleted file mode 100644 index 4c1c766c4bc..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/detach_subscription.php +++ /dev/null @@ -1,75 +0,0 @@ -setSubscription($formattedSubscription); - - // Call the API and handle any network failures. - try { - /** @var DetachSubscriptionResponse $response */ - $response = $publisherClient->detachSubscription($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = PublisherClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - detach_subscription_sample($formattedSubscription); -} -// [END pubsub_v1_generated_Publisher_DetachSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php deleted file mode 100644 index 54e97ffbd1c..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $publisherClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_Publisher_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php deleted file mode 100644 index 5b08a9beef4..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/get_topic.php +++ /dev/null @@ -1,72 +0,0 @@ -setTopic($formattedTopic); - - // Call the API and handle any network failures. - try { - /** @var Topic $response */ - $response = $publisherClient->getTopic($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); - - get_topic_sample($formattedTopic); -} -// [END pubsub_v1_generated_Publisher_GetTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php deleted file mode 100644 index 640c0a2f75a..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_snapshots.php +++ /dev/null @@ -1,80 +0,0 @@ -setTopic($formattedTopic); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $publisherClient->listTopicSnapshots($request); - - /** @var string $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); - - list_topic_snapshots_sample($formattedTopic); -} -// [END pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php deleted file mode 100644 index 4c808e9a7ca..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topic_subscriptions.php +++ /dev/null @@ -1,76 +0,0 @@ -setTopic($formattedTopic); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $publisherClient->listTopicSubscriptions($request); - - /** @var string $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); - - list_topic_subscriptions_sample($formattedTopic); -} -// [END pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php deleted file mode 100644 index 84f7989720d..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/list_topics.php +++ /dev/null @@ -1,77 +0,0 @@ -setProject($formattedProject); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $publisherClient->listTopics($request); - - /** @var Topic $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProject = PublisherClient::projectName('[PROJECT]'); - - list_topics_sample($formattedProject); -} -// [END pubsub_v1_generated_Publisher_ListTopics_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php deleted file mode 100644 index c58244cd996..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/publish.php +++ /dev/null @@ -1,76 +0,0 @@ -setTopic($formattedTopic) - ->setMessages($messages); - - // Call the API and handle any network failures. - try { - /** @var PublishResponse $response */ - $response = $publisherClient->publish($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedTopic = PublisherClient::topicName('[PROJECT]', '[TOPIC]'); - - publish_sample($formattedTopic); -} -// [END pubsub_v1_generated_Publisher_Publish_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php deleted file mode 100644 index a5dc7d4bf3e..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $publisherClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_Publisher_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php deleted file mode 100644 index 42eb4aacb66..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $publisherClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END pubsub_v1_generated_Publisher_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php b/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php deleted file mode 100644 index 2685411cef6..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/PublisherClient/update_topic.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($topicName); - $updateMask = new FieldMask(); - $request = (new UpdateTopicRequest()) - ->setTopic($topic) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Topic $response */ - $response = $publisherClient->updateTopic($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $topicName = '[NAME]'; - - update_topic_sample($topicName); -} -// [END pubsub_v1_generated_Publisher_UpdateTopic_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php deleted file mode 100644 index de8d6bd5fe4..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/commit_schema.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($schemaName); - $request = (new CommitSchemaRequest()) - ->setName($formattedName) - ->setSchema($schema); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->commitSchema($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - $schemaName = '[NAME]'; - - commit_schema_sample($formattedName, $schemaName); -} -// [END pubsub_v1_generated_SchemaService_CommitSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php deleted file mode 100644 index 3daea89e090..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/create_schema.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($schemaName); - $request = (new CreateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->createSchema($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); - $schemaName = '[NAME]'; - - create_schema_sample($formattedParent, $schemaName); -} -// [END pubsub_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php deleted file mode 100644 index 5ffc378dba8..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema.php +++ /dev/null @@ -1,70 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $schemaServiceClient->deleteSchema($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - - delete_schema_sample($formattedName); -} -// [END pubsub_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php deleted file mode 100644 index 86c02a21127..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/delete_schema_revision.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName) - ->setRevisionId($revisionId); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->deleteSchemaRevision($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = '[REVISION_ID]'; - - delete_schema_revision_sample($formattedName, $revisionId); -} -// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php deleted file mode 100644 index 64bf89b99ec..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $schemaServiceClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_SchemaService_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php deleted file mode 100644 index bcff150482e..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/get_schema.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->getSchema($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - - get_schema_sample($formattedName); -} -// [END pubsub_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php deleted file mode 100644 index f2c3c2eec7e..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schema_revisions.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $schemaServiceClient->listSchemaRevisions($request); - - /** @var Schema $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - - list_schema_revisions_sample($formattedName); -} -// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php deleted file mode 100644 index 530a62b9392..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/list_schemas.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $schemaServiceClient->listSchemas($request); - - /** @var Schema $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); - - list_schemas_sample($formattedParent); -} -// [END pubsub_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php deleted file mode 100644 index 7fb67a43d5c..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/rollback_schema.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName) - ->setRevisionId($revisionId); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->rollbackSchema($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = '[REVISION_ID]'; - - rollback_schema_sample($formattedName, $revisionId); -} -// [END pubsub_v1_generated_SchemaService_RollbackSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php deleted file mode 100644 index 330633f3b16..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $schemaServiceClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_SchemaService_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php deleted file mode 100644 index 6adbcab9c43..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $schemaServiceClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END pubsub_v1_generated_SchemaService_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php deleted file mode 100644 index 276757f2673..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_message.php +++ /dev/null @@ -1,72 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ValidateMessageResponse $response */ - $response = $schemaServiceClient->validateMessage($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); - - validate_message_sample($formattedParent); -} -// [END pubsub_v1_generated_SchemaService_ValidateMessage_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php b/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php deleted file mode 100644 index fc186436fb9..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SchemaServiceClient/validate_schema.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($schemaName); - $request = (new ValidateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - - // Call the API and handle any network failures. - try { - /** @var ValidateSchemaResponse $response */ - $response = $schemaServiceClient->validateSchema($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SchemaServiceClient::projectName('[PROJECT]'); - $schemaName = '[NAME]'; - - validate_schema_sample($formattedParent, $schemaName); -} -// [END pubsub_v1_generated_SchemaService_ValidateSchema_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php deleted file mode 100644 index c06acebd45c..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/acknowledge.php +++ /dev/null @@ -1,82 +0,0 @@ -setSubscription($formattedSubscription) - ->setAckIds($ackIds); - - // Call the API and handle any network failures. - try { - $subscriberClient->acknowledge($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIdsElement = '[ACK_IDS]'; - - acknowledge_sample($formattedSubscription, $ackIdsElement); -} -// [END pubsub_v1_generated_Subscriber_Acknowledge_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php deleted file mode 100644 index 1616d96fe49..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_snapshot.php +++ /dev/null @@ -1,103 +0,0 @@ -setName($formattedName) - ->setSubscription($formattedSubscription); - - // Call the API and handle any network failures. - try { - /** @var Snapshot $response */ - $response = $subscriberClient->createSnapshot($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - create_snapshot_sample($formattedName, $formattedSubscription); -} -// [END pubsub_v1_generated_Subscriber_CreateSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php deleted file mode 100644 index 3d740e589e8..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/create_subscription.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($name) - ->setTopic($formattedTopic); - - // Call the API and handle any network failures. - try { - /** @var Subscription $response */ - $response = $subscriberClient->createSubscription($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $formattedTopic = SubscriberClient::topicName('[PROJECT]', '[TOPIC]'); - - create_subscription_sample($name, $formattedTopic); -} -// [END pubsub_v1_generated_Subscriber_CreateSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php deleted file mode 100644 index e76cd30d0f1..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_snapshot.php +++ /dev/null @@ -1,78 +0,0 @@ -setSnapshot($formattedSnapshot); - - // Call the API and handle any network failures. - try { - $subscriberClient->deleteSnapshot($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSnapshot = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); - - delete_snapshot_sample($formattedSnapshot); -} -// [END pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php deleted file mode 100644 index 052c67f9c8b..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/delete_subscription.php +++ /dev/null @@ -1,74 +0,0 @@ -setSubscription($formattedSubscription); - - // Call the API and handle any network failures. - try { - $subscriberClient->deleteSubscription($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - delete_subscription_sample($formattedSubscription); -} -// [END pubsub_v1_generated_Subscriber_DeleteSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php deleted file mode 100644 index 8e003f43b71..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $subscriberClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_Subscriber_GetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php deleted file mode 100644 index 8b2da513c2b..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_snapshot.php +++ /dev/null @@ -1,76 +0,0 @@ -setSnapshot($formattedSnapshot); - - // Call the API and handle any network failures. - try { - /** @var Snapshot $response */ - $response = $subscriberClient->getSnapshot($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSnapshot = SubscriberClient::snapshotName('[PROJECT]', '[SNAPSHOT]'); - - get_snapshot_sample($formattedSnapshot); -} -// [END pubsub_v1_generated_Subscriber_GetSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php deleted file mode 100644 index 63d0dcfdf6a..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/get_subscription.php +++ /dev/null @@ -1,72 +0,0 @@ -setSubscription($formattedSubscription); - - // Call the API and handle any network failures. - try { - /** @var Subscription $response */ - $response = $subscriberClient->getSubscription($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - get_subscription_sample($formattedSubscription); -} -// [END pubsub_v1_generated_Subscriber_GetSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php deleted file mode 100644 index 781a23c3e60..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_snapshots.php +++ /dev/null @@ -1,81 +0,0 @@ -setProject($formattedProject); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $subscriberClient->listSnapshots($request); - - /** @var Snapshot $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProject = SubscriberClient::projectName('[PROJECT]'); - - list_snapshots_sample($formattedProject); -} -// [END pubsub_v1_generated_Subscriber_ListSnapshots_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php deleted file mode 100644 index 2ea97dfabe5..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/list_subscriptions.php +++ /dev/null @@ -1,77 +0,0 @@ -setProject($formattedProject); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $subscriberClient->listSubscriptions($request); - - /** @var Subscription $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProject = SubscriberClient::projectName('[PROJECT]'); - - list_subscriptions_sample($formattedProject); -} -// [END pubsub_v1_generated_Subscriber_ListSubscriptions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php deleted file mode 100644 index 531956b0e38..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_ack_deadline.php +++ /dev/null @@ -1,92 +0,0 @@ -setSubscription($formattedSubscription) - ->setAckIds($ackIds) - ->setAckDeadlineSeconds($ackDeadlineSeconds); - - // Call the API and handle any network failures. - try { - $subscriberClient->modifyAckDeadline($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIdsElement = '[ACK_IDS]'; - $ackDeadlineSeconds = 0; - - modify_ack_deadline_sample($formattedSubscription, $ackIdsElement, $ackDeadlineSeconds); -} -// [END pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php deleted file mode 100644 index efaef2f965d..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/modify_push_config.php +++ /dev/null @@ -1,78 +0,0 @@ -setSubscription($formattedSubscription) - ->setPushConfig($pushConfig); - - // Call the API and handle any network failures. - try { - $subscriberClient->modifyPushConfig($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - modify_push_config_sample($formattedSubscription); -} -// [END pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php deleted file mode 100644 index 36a57b63ff4..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/pull.php +++ /dev/null @@ -1,77 +0,0 @@ -setSubscription($formattedSubscription) - ->setMaxMessages($maxMessages); - - // Call the API and handle any network failures. - try { - /** @var PullResponse $response */ - $response = $subscriberClient->pull($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $maxMessages = 0; - - pull_sample($formattedSubscription, $maxMessages); -} -// [END pubsub_v1_generated_Subscriber_Pull_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php deleted file mode 100644 index 0a17e35acc6..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/seek.php +++ /dev/null @@ -1,77 +0,0 @@ -setSubscription($formattedSubscription); - - // Call the API and handle any network failures. - try { - /** @var SeekResponse $response */ - $response = $subscriberClient->seek($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - - seek_sample($formattedSubscription); -} -// [END pubsub_v1_generated_Subscriber_Seek_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php deleted file mode 100644 index 2f60a915d17..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $subscriberClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END pubsub_v1_generated_Subscriber_SetIamPolicy_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php deleted file mode 100644 index 1c4ebff6908..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/streaming_pull.php +++ /dev/null @@ -1,92 +0,0 @@ -setSubscription($formattedSubscription) - ->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $subscriberClient->streamingPull(); - $stream->writeAll([$request,]); - - /** @var StreamingPullResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSubscription = SubscriberClient::subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $streamAckDeadlineSeconds = 0; - - streaming_pull_sample($formattedSubscription, $streamAckDeadlineSeconds); -} -// [END pubsub_v1_generated_Subscriber_StreamingPull_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php deleted file mode 100644 index 32207175dd0..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $subscriberClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END pubsub_v1_generated_Subscriber_TestIamPermissions_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php deleted file mode 100644 index bdd5bb3027d..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_snapshot.php +++ /dev/null @@ -1,67 +0,0 @@ -setSnapshot($snapshot) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Snapshot $response */ - $response = $subscriberClient->updateSnapshot($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] diff --git a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php b/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php deleted file mode 100644 index e3eb7cee7f6..00000000000 --- a/owl-bot-staging/PubSub/v1/samples/V1/SubscriberClient/update_subscription.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($subscriptionName) - ->setTopic($formattedSubscriptionTopic); - $updateMask = new FieldMask(); - $request = (new UpdateSubscriptionRequest()) - ->setSubscription($subscription) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Subscription $response */ - $response = $subscriberClient->updateSubscription($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $subscriptionName = '[NAME]'; - $formattedSubscriptionTopic = SubscriberClient::topicName('[PROJECT]', '[TOPIC]'); - - update_subscription_sample($subscriptionName, $formattedSubscriptionTopic); -} -// [END pubsub_v1_generated_Subscriber_UpdateSubscription_sync] diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php deleted file mode 100644 index cb154fd306c..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/Client/PublisherClient.php +++ /dev/null @@ -1,660 +0,0 @@ - createTopicAsync(Topic $request, array $optionalArgs = []) - * @method PromiseInterface deleteTopicAsync(DeleteTopicRequest $request, array $optionalArgs = []) - * @method PromiseInterface detachSubscriptionAsync(DetachSubscriptionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getTopicAsync(GetTopicRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTopicSnapshotsAsync(ListTopicSnapshotsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTopicSubscriptionsAsync(ListTopicSubscriptionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTopicsAsync(ListTopicsRequest $request, array $optionalArgs = []) - * @method PromiseInterface publishAsync(PublishRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateTopicAsync(UpdateTopicRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - */ -final class PublisherClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.pubsub.v1.Publisher'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/publisher_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/publisher_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/publisher_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/publisher_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * _deleted-topic_ resource. - * - * @return string The formatted _deleted-topic_ resource. - */ - public static function deletedTopicName(): string - { - return self::getPathTemplate('deletedTopic')->render([]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_topic resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted project_topic resource. - */ - public static function projectTopicName(string $project, string $topic): string - { - return self::getPathTemplate('projectTopic')->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a schema - * resource. - * - * @param string $project - * @param string $schema - * - * @return string The formatted schema resource. - */ - public static function schemaName(string $project, string $schema): string - { - return self::getPathTemplate('schema')->render([ - 'project' => $project, - 'schema' => $schema, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subscription - * resource. - * - * @param string $project - * @param string $subscription - * - * @return string The formatted subscription resource. - */ - public static function subscriptionName(string $project, string $subscription): string - { - return self::getPathTemplate('subscription')->render([ - 'project' => $project, - 'subscription' => $subscription, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a topic - * resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted topic resource. - */ - public static function topicName(string $project, string $topic): string - { - return self::getPathTemplate('topic')->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - deletedTopic: _deleted-topic_ - * - project: projects/{project} - * - projectTopic: projects/{project}/topics/{topic} - * - schema: projects/{project}/schemas/{schema} - * - subscription: projects/{project}/subscriptions/{subscription} - * - topic: projects/{project}/topics/{topic} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'pubsub.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates the given topic with the given name. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * - * The async variant is {@see PublisherClient::createTopicAsync()} . - * - * @example samples/V1/PublisherClient/create_topic.php - * - * @param Topic $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Topic - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTopic(Topic $request, array $callOptions = []): Topic - { - return $this->startApiCall('CreateTopic', $request, $callOptions)->wait(); - } - - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - * The async variant is {@see PublisherClient::deleteTopicAsync()} . - * - * @example samples/V1/PublisherClient/delete_topic.php - * - * @param DeleteTopicRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteTopic(DeleteTopicRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteTopic', $request, $callOptions)->wait(); - } - - /** - * Detaches a subscription from this topic. All messages retained in the - * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - * will return FAILED_PRECONDITION. If the subscription is a push - * subscription, pushes to the endpoint will stop. - * - * The async variant is {@see PublisherClient::detachSubscriptionAsync()} . - * - * @example samples/V1/PublisherClient/detach_subscription.php - * - * @param DetachSubscriptionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 DetachSubscriptionResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function detachSubscription(DetachSubscriptionRequest $request, array $callOptions = []): DetachSubscriptionResponse - { - return $this->startApiCall('DetachSubscription', $request, $callOptions)->wait(); - } - - /** - * Gets the configuration of a topic. - * - * The async variant is {@see PublisherClient::getTopicAsync()} . - * - * @example samples/V1/PublisherClient/get_topic.php - * - * @param GetTopicRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Topic - * - * @throws ApiException Thrown if the API call fails. - */ - public function getTopic(GetTopicRequest $request, array $callOptions = []): Topic - { - return $this->startApiCall('GetTopic', $request, $callOptions)->wait(); - } - - /** - * Lists the names of the snapshots on this topic. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * The async variant is {@see PublisherClient::listTopicSnapshotsAsync()} . - * - * @example samples/V1/PublisherClient/list_topic_snapshots.php - * - * @param ListTopicSnapshotsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTopicSnapshots(ListTopicSnapshotsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTopicSnapshots', $request, $callOptions); - } - - /** - * Lists the names of the attached subscriptions on this topic. - * - * The async variant is {@see PublisherClient::listTopicSubscriptionsAsync()} . - * - * @example samples/V1/PublisherClient/list_topic_subscriptions.php - * - * @param ListTopicSubscriptionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTopicSubscriptions(ListTopicSubscriptionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTopicSubscriptions', $request, $callOptions); - } - - /** - * Lists matching topics. - * - * The async variant is {@see PublisherClient::listTopicsAsync()} . - * - * @example samples/V1/PublisherClient/list_topics.php - * - * @param ListTopicsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTopics(ListTopicsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTopics', $request, $callOptions); - } - - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. - * - * The async variant is {@see PublisherClient::publishAsync()} . - * - * @example samples/V1/PublisherClient/publish.php - * - * @param PublishRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PublishResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function publish(PublishRequest $request, array $callOptions = []): PublishResponse - { - return $this->startApiCall('Publish', $request, $callOptions)->wait(); - } - - /** - * Updates an existing topic by updating the fields specified in the update - * mask. Note that certain properties of a topic are not modifiable. - * - * The async variant is {@see PublisherClient::updateTopicAsync()} . - * - * @example samples/V1/PublisherClient/update_topic.php - * - * @param UpdateTopicRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Topic - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateTopic(UpdateTopicRequest $request, array $callOptions = []): Topic - { - return $this->startApiCall('UpdateTopic', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see PublisherClient::getIamPolicyAsync()} . - * - * @example samples/V1/PublisherClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see PublisherClient::setIamPolicyAsync()} . - * - * @example samples/V1/PublisherClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is {@see PublisherClient::testIamPermissionsAsync()} . - * - * @example samples/V1/PublisherClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php deleted file mode 100644 index a234595fc98..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/Client/SchemaServiceClient.php +++ /dev/null @@ -1,608 +0,0 @@ - commitSchemaAsync(CommitSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface createSchemaAsync(CreateSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteSchemaAsync(DeleteSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteSchemaRevisionAsync(DeleteSchemaRevisionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getSchemaAsync(GetSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface listSchemaRevisionsAsync(ListSchemaRevisionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listSchemasAsync(ListSchemasRequest $request, array $optionalArgs = []) - * @method PromiseInterface rollbackSchemaAsync(RollbackSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface validateMessageAsync(ValidateMessageRequest $request, array $optionalArgs = []) - * @method PromiseInterface validateSchemaAsync(ValidateSchemaRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - */ -final class SchemaServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.pubsub.v1.SchemaService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/schema_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/schema_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/schema_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/schema_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a schema - * resource. - * - * @param string $project - * @param string $schema - * - * @return string The formatted schema resource. - */ - public static function schemaName(string $project, string $schema): string - { - return self::getPathTemplate('schema')->render([ - 'project' => $project, - 'schema' => $schema, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - project: projects/{project} - * - schema: projects/{project}/schemas/{schema} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'pubsub.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Commits a new schema revision to an existing schema. - * - * The async variant is {@see SchemaServiceClient::commitSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/commit_schema.php - * - * @param CommitSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Schema - * - * @throws ApiException Thrown if the API call fails. - */ - public function commitSchema(CommitSchemaRequest $request, array $callOptions = []): Schema - { - return $this->startApiCall('CommitSchema', $request, $callOptions)->wait(); - } - - /** - * Creates a schema. - * - * The async variant is {@see SchemaServiceClient::createSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/create_schema.php - * - * @param CreateSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Schema - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSchema(CreateSchemaRequest $request, array $callOptions = []): Schema - { - return $this->startApiCall('CreateSchema', $request, $callOptions)->wait(); - } - - /** - * Deletes a schema. - * - * The async variant is {@see SchemaServiceClient::deleteSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/delete_schema.php - * - * @param DeleteSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteSchema(DeleteSchemaRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteSchema', $request, $callOptions)->wait(); - } - - /** - * Deletes a specific schema revision. - * - * The async variant is {@see SchemaServiceClient::deleteSchemaRevisionAsync()} . - * - * @example samples/V1/SchemaServiceClient/delete_schema_revision.php - * - * @param DeleteSchemaRevisionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Schema - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteSchemaRevision(DeleteSchemaRevisionRequest $request, array $callOptions = []): Schema - { - return $this->startApiCall('DeleteSchemaRevision', $request, $callOptions)->wait(); - } - - /** - * Gets a schema. - * - * The async variant is {@see SchemaServiceClient::getSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/get_schema.php - * - * @param GetSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Schema - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSchema(GetSchemaRequest $request, array $callOptions = []): Schema - { - return $this->startApiCall('GetSchema', $request, $callOptions)->wait(); - } - - /** - * Lists all schema revisions for the named schema. - * - * The async variant is {@see SchemaServiceClient::listSchemaRevisionsAsync()} . - * - * @example samples/V1/SchemaServiceClient/list_schema_revisions.php - * - * @param ListSchemaRevisionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSchemaRevisions(ListSchemaRevisionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSchemaRevisions', $request, $callOptions); - } - - /** - * Lists schemas in a project. - * - * The async variant is {@see SchemaServiceClient::listSchemasAsync()} . - * - * @example samples/V1/SchemaServiceClient/list_schemas.php - * - * @param ListSchemasRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSchemas(ListSchemasRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSchemas', $request, $callOptions); - } - - /** - * Creates a new schema revision that is a copy of the provided revision_id. - * - * The async variant is {@see SchemaServiceClient::rollbackSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/rollback_schema.php - * - * @param RollbackSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Schema - * - * @throws ApiException Thrown if the API call fails. - */ - public function rollbackSchema(RollbackSchemaRequest $request, array $callOptions = []): Schema - { - return $this->startApiCall('RollbackSchema', $request, $callOptions)->wait(); - } - - /** - * Validates a message against a schema. - * - * The async variant is {@see SchemaServiceClient::validateMessageAsync()} . - * - * @example samples/V1/SchemaServiceClient/validate_message.php - * - * @param ValidateMessageRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ValidateMessageResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function validateMessage(ValidateMessageRequest $request, array $callOptions = []): ValidateMessageResponse - { - return $this->startApiCall('ValidateMessage', $request, $callOptions)->wait(); - } - - /** - * Validates a schema. - * - * The async variant is {@see SchemaServiceClient::validateSchemaAsync()} . - * - * @example samples/V1/SchemaServiceClient/validate_schema.php - * - * @param ValidateSchemaRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ValidateSchemaResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function validateSchema(ValidateSchemaRequest $request, array $callOptions = []): ValidateSchemaResponse - { - return $this->startApiCall('ValidateSchema', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see SchemaServiceClient::getIamPolicyAsync()} . - * - * @example samples/V1/SchemaServiceClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see SchemaServiceClient::setIamPolicyAsync()} . - * - * @example samples/V1/SchemaServiceClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is {@see SchemaServiceClient::testIamPermissionsAsync()} . - * - * @example samples/V1/SchemaServiceClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php b/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php deleted file mode 100644 index 58397867d91..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/Client/SubscriberClient.php +++ /dev/null @@ -1,909 +0,0 @@ - acknowledgeAsync(AcknowledgeRequest $request, array $optionalArgs = []) - * @method PromiseInterface createSnapshotAsync(CreateSnapshotRequest $request, array $optionalArgs = []) - * @method PromiseInterface createSubscriptionAsync(Subscription $request, array $optionalArgs = []) - * @method PromiseInterface deleteSnapshotAsync(DeleteSnapshotRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteSubscriptionAsync(DeleteSubscriptionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getSnapshotAsync(GetSnapshotRequest $request, array $optionalArgs = []) - * @method PromiseInterface getSubscriptionAsync(GetSubscriptionRequest $request, array $optionalArgs = []) - * @method PromiseInterface listSnapshotsAsync(ListSnapshotsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listSubscriptionsAsync(ListSubscriptionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface modifyAckDeadlineAsync(ModifyAckDeadlineRequest $request, array $optionalArgs = []) - * @method PromiseInterface modifyPushConfigAsync(ModifyPushConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface pullAsync(PullRequest $request, array $optionalArgs = []) - * @method PromiseInterface seekAsync(SeekRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateSnapshotAsync(UpdateSnapshotRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateSubscriptionAsync(UpdateSubscriptionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - */ -final class SubscriberClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.pubsub.v1.Subscriber'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'pubsub.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'pubsub.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/subscriber_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/subscriber_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/subscriber_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/subscriber_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * _deleted-topic_ resource. - * - * @return string The formatted _deleted-topic_ resource. - */ - public static function deletedTopicName(): string - { - return self::getPathTemplate('deletedTopic')->render([]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_topic resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted project_topic resource. - */ - public static function projectTopicName(string $project, string $topic): string - { - return self::getPathTemplate('projectTopic')->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snapshot - * resource. - * - * @param string $project - * @param string $snapshot - * - * @return string The formatted snapshot resource. - */ - public static function snapshotName(string $project, string $snapshot): string - { - return self::getPathTemplate('snapshot')->render([ - 'project' => $project, - 'snapshot' => $snapshot, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subscription - * resource. - * - * @param string $project - * @param string $subscription - * - * @return string The formatted subscription resource. - */ - public static function subscriptionName(string $project, string $subscription): string - { - return self::getPathTemplate('subscription')->render([ - 'project' => $project, - 'subscription' => $subscription, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a topic - * resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted topic resource. - */ - public static function topicName(string $project, string $topic): string - { - return self::getPathTemplate('topic')->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - deletedTopic: _deleted-topic_ - * - project: projects/{project} - * - projectTopic: projects/{project}/topics/{topic} - * - snapshot: projects/{project}/snapshots/{snapshot} - * - subscription: projects/{project}/subscriptions/{subscription} - * - topic: projects/{project}/topics/{topic} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'pubsub.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. - * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. - * - * The async variant is {@see SubscriberClient::acknowledgeAsync()} . - * - * @example samples/V1/SubscriberClient/acknowledge.php - * - * @param AcknowledgeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function acknowledge(AcknowledgeRequest $request, array $callOptions = []): void - { - $this->startApiCall('Acknowledge', $request, $callOptions)->wait(); - } - - /** - * Creates a snapshot from the requested subscription. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * If the snapshot already exists, returns `ALREADY_EXISTS`. - * If the requested subscription doesn't exist, returns `NOT_FOUND`. - * If the backlog in the subscription is too old -- and the resulting snapshot - * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - * See also the `Snapshot.expire_time` field. If the name is not provided in - * the request, the server will assign a random - * name for this snapshot on the same project as the subscription, conforming - * to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for - * REST API requests, you must specify a name in the request. - * - * The async variant is {@see SubscriberClient::createSnapshotAsync()} . - * - * @example samples/V1/SubscriberClient/create_snapshot.php - * - * @param CreateSnapshotRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Snapshot - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSnapshot(CreateSnapshotRequest $request, array $callOptions = []): Snapshot - { - return $this->startApiCall('CreateSnapshot', $request, $callOptions)->wait(); - } - - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. - * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic, conforming - * to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - * generated name is populated in the returned Subscription object. Note that - * for REST API requests, you must specify a name in the request. - * - * The async variant is {@see SubscriberClient::createSubscriptionAsync()} . - * - * @example samples/V1/SubscriberClient/create_subscription.php - * - * @param Subscription $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Subscription - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSubscription(Subscription $request, array $callOptions = []): Subscription - { - return $this->startApiCall('CreateSubscription', $request, $callOptions)->wait(); - } - - /** - * Removes an existing snapshot. Snapshots are used in [Seek] - * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * When the snapshot is deleted, all messages retained in the snapshot - * are immediately dropped. After a snapshot is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * snapshot or its subscription, unless the same subscription is specified. - * - * The async variant is {@see SubscriberClient::deleteSnapshotAsync()} . - * - * @example samples/V1/SubscriberClient/delete_snapshot.php - * - * @param DeleteSnapshotRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteSnapshot(DeleteSnapshotRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteSnapshot', $request, $callOptions)->wait(); - } - - /** - * Deletes an existing subscription. All messages retained in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription or its topic unless the same topic is specified. - * - * The async variant is {@see SubscriberClient::deleteSubscriptionAsync()} . - * - * @example samples/V1/SubscriberClient/delete_subscription.php - * - * @param DeleteSubscriptionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteSubscription(DeleteSubscriptionRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteSubscription', $request, $callOptions)->wait(); - } - - /** - * Gets the configuration details of a snapshot. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * The async variant is {@see SubscriberClient::getSnapshotAsync()} . - * - * @example samples/V1/SubscriberClient/get_snapshot.php - * - * @param GetSnapshotRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Snapshot - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSnapshot(GetSnapshotRequest $request, array $callOptions = []): Snapshot - { - return $this->startApiCall('GetSnapshot', $request, $callOptions)->wait(); - } - - /** - * Gets the configuration details of a subscription. - * - * The async variant is {@see SubscriberClient::getSubscriptionAsync()} . - * - * @example samples/V1/SubscriberClient/get_subscription.php - * - * @param GetSubscriptionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Subscription - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSubscription(GetSubscriptionRequest $request, array $callOptions = []): Subscription - { - return $this->startApiCall('GetSubscription', $request, $callOptions)->wait(); - } - - /** - * Lists the existing snapshots. Snapshots are used in [Seek]( - * https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * The async variant is {@see SubscriberClient::listSnapshotsAsync()} . - * - * @example samples/V1/SubscriberClient/list_snapshots.php - * - * @param ListSnapshotsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSnapshots(ListSnapshotsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSnapshots', $request, $callOptions); - } - - /** - * Lists matching subscriptions. - * - * The async variant is {@see SubscriberClient::listSubscriptionsAsync()} . - * - * @example samples/V1/SubscriberClient/list_subscriptions.php - * - * @param ListSubscriptionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSubscriptions(ListSubscriptionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSubscriptions', $request, $callOptions); - } - - /** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - * The async variant is {@see SubscriberClient::modifyAckDeadlineAsync()} . - * - * @example samples/V1/SubscriberClient/modify_ack_deadline.php - * - * @param ModifyAckDeadlineRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function modifyAckDeadline(ModifyAckDeadlineRequest $request, array $callOptions = []): void - { - $this->startApiCall('ModifyAckDeadline', $request, $callOptions)->wait(); - } - - /** - * Modifies the `PushConfig` for a specified subscription. - * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. - * - * The async variant is {@see SubscriberClient::modifyPushConfigAsync()} . - * - * @example samples/V1/SubscriberClient/modify_push_config.php - * - * @param ModifyPushConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function modifyPushConfig(ModifyPushConfigRequest $request, array $callOptions = []): void - { - $this->startApiCall('ModifyPushConfig', $request, $callOptions)->wait(); - } - - /** - * Pulls messages from the server. - * - * The async variant is {@see SubscriberClient::pullAsync()} . - * - * @example samples/V1/SubscriberClient/pull.php - * - * @param PullRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PullResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function pull(PullRequest $request, array $callOptions = []): PullResponse - { - return $this->startApiCall('Pull', $request, $callOptions)->wait(); - } - - /** - * Seeks an existing subscription to a point in time or to a given snapshot, - * whichever is provided in the request. Snapshots are used in [Seek] - * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. Note that both the subscription and the - * snapshot must be on the same topic. - * - * The async variant is {@see SubscriberClient::seekAsync()} . - * - * @example samples/V1/SubscriberClient/seek.php - * - * @param SeekRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 SeekResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function seek(SeekRequest $request, array $callOptions = []): SeekResponse - { - return $this->startApiCall('Seek', $request, $callOptions)->wait(); - } - - /** - * Establishes a stream with the server, which sends messages down to the - * client. The client streams acknowledgements and ack deadline modifications - * back to the server. The server will close the stream and return the status - * on any error. The server may close the stream with status `UNAVAILABLE` to - * reassign server-side resources, in which case, the client should - * re-establish the stream. Flow control can be achieved by configuring the - * underlying RPC channel. - * - * @example samples/V1/SubscriberClient/streaming_pull.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingPull(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingPull', null, $callOptions); - } - - /** - * Updates an existing snapshot by updating the fields specified in the update - * mask. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * The async variant is {@see SubscriberClient::updateSnapshotAsync()} . - * - * @example samples/V1/SubscriberClient/update_snapshot.php - * - * @param UpdateSnapshotRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Snapshot - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSnapshot(UpdateSnapshotRequest $request, array $callOptions = []): Snapshot - { - return $this->startApiCall('UpdateSnapshot', $request, $callOptions)->wait(); - } - - /** - * Updates an existing subscription by updating the fields specified in the - * update mask. Note that certain properties of a subscription, such as its - * topic, are not modifiable. - * - * The async variant is {@see SubscriberClient::updateSubscriptionAsync()} . - * - * @example samples/V1/SubscriberClient/update_subscription.php - * - * @param UpdateSubscriptionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Subscription - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSubscription(UpdateSubscriptionRequest $request, array $callOptions = []): Subscription - { - return $this->startApiCall('UpdateSubscription', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see SubscriberClient::getIamPolicyAsync()} . - * - * @example samples/V1/SubscriberClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see SubscriberClient::setIamPolicyAsync()} . - * - * @example samples/V1/SubscriberClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is {@see SubscriberClient::testIamPermissionsAsync()} . - * - * @example samples/V1/SubscriberClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json b/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 3c57bdf7d8e..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,256 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.pubsub.v1", - "libraryPackage": "Google\\Cloud\\PubSub\\V1", - "services": { - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "SchemaServiceGapicClient", - "rpcs": { - "CommitSchema": { - "methods": [ - "commitSchema" - ] - }, - "CreateSchema": { - "methods": [ - "createSchema" - ] - }, - "DeleteSchema": { - "methods": [ - "deleteSchema" - ] - }, - "DeleteSchemaRevision": { - "methods": [ - "deleteSchemaRevision" - ] - }, - "GetSchema": { - "methods": [ - "getSchema" - ] - }, - "ListSchemaRevisions": { - "methods": [ - "listSchemaRevisions" - ] - }, - "ListSchemas": { - "methods": [ - "listSchemas" - ] - }, - "RollbackSchema": { - "methods": [ - "rollbackSchema" - ] - }, - "ValidateMessage": { - "methods": [ - "validateMessage" - ] - }, - "ValidateSchema": { - "methods": [ - "validateSchema" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "Publisher": { - "clients": { - "grpc": { - "libraryClient": "PublisherGapicClient", - "rpcs": { - "CreateTopic": { - "methods": [ - "createTopic" - ] - }, - "DeleteTopic": { - "methods": [ - "deleteTopic" - ] - }, - "DetachSubscription": { - "methods": [ - "detachSubscription" - ] - }, - "GetTopic": { - "methods": [ - "getTopic" - ] - }, - "ListTopicSnapshots": { - "methods": [ - "listTopicSnapshots" - ] - }, - "ListTopicSubscriptions": { - "methods": [ - "listTopicSubscriptions" - ] - }, - "ListTopics": { - "methods": [ - "listTopics" - ] - }, - "Publish": { - "methods": [ - "publish" - ] - }, - "UpdateTopic": { - "methods": [ - "updateTopic" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "Subscriber": { - "clients": { - "grpc": { - "libraryClient": "SubscriberGapicClient", - "rpcs": { - "Acknowledge": { - "methods": [ - "acknowledge" - ] - }, - "CreateSnapshot": { - "methods": [ - "createSnapshot" - ] - }, - "CreateSubscription": { - "methods": [ - "createSubscription" - ] - }, - "DeleteSnapshot": { - "methods": [ - "deleteSnapshot" - ] - }, - "DeleteSubscription": { - "methods": [ - "deleteSubscription" - ] - }, - "GetSnapshot": { - "methods": [ - "getSnapshot" - ] - }, - "GetSubscription": { - "methods": [ - "getSubscription" - ] - }, - "ListSnapshots": { - "methods": [ - "listSnapshots" - ] - }, - "ListSubscriptions": { - "methods": [ - "listSubscriptions" - ] - }, - "ModifyAckDeadline": { - "methods": [ - "modifyAckDeadline" - ] - }, - "ModifyPushConfig": { - "methods": [ - "modifyPushConfig" - ] - }, - "Pull": { - "methods": [ - "pull" - ] - }, - "Seek": { - "methods": [ - "seek" - ] - }, - "StreamingPull": { - "methods": [ - "streamingPull" - ] - }, - "UpdateSnapshot": { - "methods": [ - "updateSnapshot" - ] - }, - "UpdateSubscription": { - "methods": [ - "updateSubscription" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json deleted file mode 100644 index 8c794fca07d..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_client_config.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.Publisher": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "retry_policy_2_codes": [ - "ABORTED", - "CANCELLED", - "INTERNAL", - "RESOURCE_EXHAUSTED", - "UNKNOWN", - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "retry_policy_3_codes": [ - "UNKNOWN", - "ABORTED", - "UNAVAILABLE" - ] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_2_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 4.0, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_3_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteTopic": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DetachSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTopic": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "ListTopicSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "ListTopicSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "ListTopics": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "Publish": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params", - "bundling": { - "delay_threshold_millis": 10, - "element_count_threshold": 100, - "request_byte_limit": 10485760, - "request_byte_threshold": 1048576 - } - }, - "UpdateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php deleted file mode 100644 index d39d0d038d3..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_descriptor_config.php +++ /dev/null @@ -1,208 +0,0 @@ - [ - 'google.pubsub.v1.Publisher' => [ - 'CreateTopic' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Topic', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTopic' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'topic', - 'fieldAccessors' => [ - 'getTopic', - ], - ], - ], - ], - 'DetachSubscription' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\DetachSubscriptionResponse', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'GetTopic' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Topic', - 'headerParams' => [ - [ - 'keyName' => 'topic', - 'fieldAccessors' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopicSnapshots' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSnapshots', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicSnapshotsResponse', - 'headerParams' => [ - [ - 'keyName' => 'topic', - 'fieldAccessors' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopicSubscriptions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSubscriptions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicSubscriptionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'topic', - 'fieldAccessors' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopics' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTopics', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListTopicsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project', - 'fieldAccessors' => [ - 'getProject', - ], - ], - ], - ], - 'Publish' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\PublishResponse', - 'headerParams' => [ - [ - 'keyName' => 'topic', - 'fieldAccessors' => [ - 'getTopic', - ], - ], - ], - ], - 'UpdateTopic' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Topic', - 'headerParams' => [ - [ - 'keyName' => 'topic.name', - 'fieldAccessors' => [ - 'getTopic', - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'deletedTopic' => '_deleted-topic_', - 'project' => 'projects/{project}', - 'projectTopic' => 'projects/{project}/topics/{topic}', - 'schema' => 'projects/{project}/schemas/{schema}', - 'subscription' => 'projects/{project}/subscriptions/{subscription}', - 'topic' => 'projects/{project}/topics/{topic}', - ], - ], - ], -]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php deleted file mode 100644 index a62253330e6..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/publisher_rest_client_config.php +++ /dev/null @@ -1,217 +0,0 @@ - [ - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.pubsub.v1.Publisher' => [ - 'CreateTopic' => [ - 'method' => 'put', - 'uriTemplate' => '/v1/{name=projects/*/topics/*}', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTopic' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{topic=projects/*/topics/*}', - 'placeholders' => [ - 'topic' => [ - 'getters' => [ - 'getTopic', - ], - ], - ], - ], - 'DetachSubscription' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:detach', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'GetTopic' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{topic=projects/*/topics/*}', - 'placeholders' => [ - 'topic' => [ - 'getters' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopicSnapshots' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{topic=projects/*/topics/*}/snapshots', - 'placeholders' => [ - 'topic' => [ - 'getters' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopicSubscriptions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{topic=projects/*/topics/*}/subscriptions', - 'placeholders' => [ - 'topic' => [ - 'getters' => [ - 'getTopic', - ], - ], - ], - ], - 'ListTopics' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{project=projects/*}/topics', - 'placeholders' => [ - 'project' => [ - 'getters' => [ - 'getProject', - ], - ], - ], - ], - 'Publish' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{topic=projects/*/topics/*}:publish', - 'body' => '*', - 'placeholders' => [ - 'topic' => [ - 'getters' => [ - 'getTopic', - ], - ], - ], - ], - 'UpdateTopic' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{topic.name=projects/*/topics/*}', - 'body' => '*', - 'placeholders' => [ - 'topic.name' => [ - 'getters' => [ - 'getTopic', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json deleted file mode 100644 index 2773e2ae2d5..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_client_config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.SchemaService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_8_codes": [ - "UNAVAILABLE" - ] - }, - "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_8_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CommitSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "CreateSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "DeleteSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "DeleteSchemaRevision": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "GetSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "ListSchemaRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "ListSchemas": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "RollbackSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "ValidateMessage": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "ValidateSchema": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_8_codes", - "retry_params_name": "retry_policy_8_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php deleted file mode 100644 index f11afb7e2cf..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_descriptor_config.php +++ /dev/null @@ -1,207 +0,0 @@ - [ - 'google.pubsub.v1.SchemaService' => [ - 'CommitSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Schema', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Schema', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteSchemaRevision' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Schema', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Schema', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListSchemaRevisions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSchemas', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListSchemaRevisionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListSchemas' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSchemas', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListSchemasResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RollbackSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Schema', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ValidateMessage' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ValidateMessageResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ValidateSchema' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ValidateSchemaResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'project' => 'projects/{project}', - 'schema' => 'projects/{project}/schemas/{schema}', - ], - ], - ], -]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php deleted file mode 100644 index db359582076..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/schema_service_rest_client_config.php +++ /dev/null @@ -1,229 +0,0 @@ - [ - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.pubsub.v1.SchemaService' => [ - 'CommitSchema' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:commit', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateSchema' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/schemas', - 'body' => 'schema', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteSchema' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteSchemaRevision' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:deleteRevision', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetSchema' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListSchemaRevisions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:listRevisions', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListSchemas' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/schemas', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RollbackSchema' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/schemas/*}:rollback', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ValidateMessage' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/schemas:validateMessage', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ValidateSchema' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/schemas:validate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json deleted file mode 100644 index c4812e9de3f..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_client_config.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.Subscriber": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_4_codes": [ - "DEADLINE_EXCEEDED", - "RESOURCE_EXHAUSTED", - "ABORTED", - "INTERNAL", - "UNAVAILABLE" - ], - "retry_policy_5_codes": [ - "UNKNOWN", - "ABORTED", - "UNAVAILABLE", - "INTERNAL" - ], - "retry_policy_6_codes": [ - "UNKNOWN", - "ABORTED", - "UNAVAILABLE" - ], - "retry_policy_7_codes": [ - "UNAVAILABLE" - ] - }, - "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_4_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 4.0, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 900000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 900000, - "total_timeout_millis": 900000 - }, - "retry_policy_5_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_6_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_7_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "Acknowledge": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "CreateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "CreateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "DeleteSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "DeleteSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "GetSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "GetSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "ListSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "ListSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "ModifyAckDeadline": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "ModifyPushConfig": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "Pull": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_5_codes", - "retry_params_name": "retry_policy_5_params" - }, - "Seek": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "StreamingPull": { - "timeout_millis": 900000 - }, - "UpdateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "UpdateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_7_codes", - "retry_params_name": "retry_policy_7_params" - } - } - } - } -} diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php deleted file mode 100644 index 4b0fead5900..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_descriptor_config.php +++ /dev/null @@ -1,280 +0,0 @@ - [ - 'google.pubsub.v1.Subscriber' => [ - 'Acknowledge' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'CreateSnapshot' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateSubscription' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteSnapshot' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'snapshot', - 'fieldAccessors' => [ - 'getSnapshot', - ], - ], - ], - ], - 'DeleteSubscription' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'GetSnapshot' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', - 'headerParams' => [ - [ - 'keyName' => 'snapshot', - 'fieldAccessors' => [ - 'getSnapshot', - ], - ], - ], - ], - 'GetSubscription' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'ListSnapshots' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSnapshots', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListSnapshotsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project', - 'fieldAccessors' => [ - 'getProject', - ], - ], - ], - ], - 'ListSubscriptions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSubscriptions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\ListSubscriptionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project', - 'fieldAccessors' => [ - 'getProject', - ], - ], - ], - ], - 'ModifyAckDeadline' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'ModifyPushConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'Pull' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\PullResponse', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'Seek' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\SeekResponse', - 'headerParams' => [ - [ - 'keyName' => 'subscription', - 'fieldAccessors' => [ - 'getSubscription', - ], - ], - ], - ], - 'StreamingPull' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\StreamingPullResponse', - ], - 'UpdateSnapshot' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Snapshot', - 'headerParams' => [ - [ - 'keyName' => 'snapshot.name', - 'fieldAccessors' => [ - 'getSnapshot', - 'getName', - ], - ], - ], - ], - 'UpdateSubscription' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\PubSub\V1\Subscription', - 'headerParams' => [ - [ - 'keyName' => 'subscription.name', - 'fieldAccessors' => [ - 'getSubscription', - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'deletedTopic' => '_deleted-topic_', - 'project' => 'projects/{project}', - 'projectTopic' => 'projects/{project}/topics/{topic}', - 'snapshot' => 'projects/{project}/snapshots/{snapshot}', - 'subscription' => 'projects/{project}/subscriptions/{subscription}', - 'topic' => 'projects/{project}/topics/{topic}', - ], - ], - ], -]; diff --git a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php b/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php deleted file mode 100644 index e39849a4274..00000000000 --- a/owl-bot-staging/PubSub/v1/src/V1/resources/subscriber_rest_client_config.php +++ /dev/null @@ -1,290 +0,0 @@ - [ - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/topics/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/snapshots/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/schemas/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.pubsub.v1.Subscriber' => [ - 'Acknowledge' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:acknowledge', - 'body' => '*', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'CreateSnapshot' => [ - 'method' => 'put', - 'uriTemplate' => '/v1/{name=projects/*/snapshots/*}', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateSubscription' => [ - 'method' => 'put', - 'uriTemplate' => '/v1/{name=projects/*/subscriptions/*}', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteSnapshot' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{snapshot=projects/*/snapshots/*}', - 'placeholders' => [ - 'snapshot' => [ - 'getters' => [ - 'getSnapshot', - ], - ], - ], - ], - 'DeleteSubscription' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'GetSnapshot' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{snapshot=projects/*/snapshots/*}', - 'placeholders' => [ - 'snapshot' => [ - 'getters' => [ - 'getSnapshot', - ], - ], - ], - ], - 'GetSubscription' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'ListSnapshots' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{project=projects/*}/snapshots', - 'placeholders' => [ - 'project' => [ - 'getters' => [ - 'getProject', - ], - ], - ], - ], - 'ListSubscriptions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{project=projects/*}/subscriptions', - 'placeholders' => [ - 'project' => [ - 'getters' => [ - 'getProject', - ], - ], - ], - ], - 'ModifyAckDeadline' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline', - 'body' => '*', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'ModifyPushConfig' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig', - 'body' => '*', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'Pull' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:pull', - 'body' => '*', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'Seek' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{subscription=projects/*/subscriptions/*}:seek', - 'body' => '*', - 'placeholders' => [ - 'subscription' => [ - 'getters' => [ - 'getSubscription', - ], - ], - ], - ], - 'UpdateSnapshot' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{snapshot.name=projects/*/snapshots/*}', - 'body' => '*', - 'placeholders' => [ - 'snapshot.name' => [ - 'getters' => [ - 'getSnapshot', - 'getName', - ], - ], - ], - ], - 'UpdateSubscription' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{subscription.name=projects/*/subscriptions/*}', - 'body' => '*', - 'placeholders' => [ - 'subscription.name' => [ - 'getters' => [ - 'getSubscription', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php deleted file mode 100644 index a14d598012b..00000000000 --- a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/PublisherClientTest.php +++ /dev/null @@ -1,941 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PublisherClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PublisherClient($options); - } - - /** @test */ - public function createTopicTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName2 = 'kmsKeyName2-1057489140'; - $satisfiesPzs2 = true; - $expectedResponse = new Topic(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName2); - $expectedResponse->setSatisfiesPzs($satisfiesPzs2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new Topic()) - ->setName($name); - $response = $gapicClient->createTopic($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/CreateTopic', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTopicExceptionTest() - { - $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 - $name = 'name3373707'; - $request = (new Topic()) - ->setName($name); - try { - $gapicClient->createTopic($request); - // 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 deleteTopicTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new DeleteTopicRequest()) - ->setTopic($formattedTopic); - $gapicClient->deleteTopic($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/DeleteTopic', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTopicExceptionTest() - { - $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 - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new DeleteTopicRequest()) - ->setTopic($formattedTopic); - try { - $gapicClient->deleteTopic($request); - // 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 detachSubscriptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new DetachSubscriptionResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new DetachSubscriptionRequest()) - ->setSubscription($formattedSubscription); - $response = $gapicClient->detachSubscription($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/DetachSubscription', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function detachSubscriptionExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new DetachSubscriptionRequest()) - ->setSubscription($formattedSubscription); - try { - $gapicClient->detachSubscription($request); - // 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 getTopicTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $expectedResponse = new Topic(); - $expectedResponse->setName($name); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new GetTopicRequest()) - ->setTopic($formattedTopic); - $response = $gapicClient->getTopic($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/GetTopic', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTopicExceptionTest() - { - $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 - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new GetTopicRequest()) - ->setTopic($formattedTopic); - try { - $gapicClient->getTopic($request); - // 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 listTopicSnapshotsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snapshotsElement = 'snapshotsElement1339034092'; - $snapshots = [ - $snapshotsElement, - ]; - $expectedResponse = new ListTopicSnapshotsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnapshots($snapshots); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new ListTopicSnapshotsRequest()) - ->setTopic($formattedTopic); - $response = $gapicClient->listTopicSnapshots($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/ListTopicSnapshots', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTopicSnapshotsExceptionTest() - { - $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 - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new ListTopicSnapshotsRequest()) - ->setTopic($formattedTopic); - try { - $gapicClient->listTopicSnapshots($request); - // 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 listTopicSubscriptionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $subscriptionsElement = 'subscriptionsElement1698708147'; - $subscriptions = [ - $subscriptionsElement, - ]; - $expectedResponse = new ListTopicSubscriptionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSubscriptions($subscriptions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new ListTopicSubscriptionsRequest()) - ->setTopic($formattedTopic); - $response = $gapicClient->listTopicSubscriptions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSubscriptions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/ListTopicSubscriptions', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTopicSubscriptionsExceptionTest() - { - $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 - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new ListTopicSubscriptionsRequest()) - ->setTopic($formattedTopic); - try { - $gapicClient->listTopicSubscriptions($request); - // 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 listTopicsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $topicsElement = new Topic(); - $topics = [ - $topicsElement, - ]; - $expectedResponse = new ListTopicsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTopics($topics); - $transport->addResponse($expectedResponse); - // Mock request - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListTopicsRequest()) - ->setProject($formattedProject); - $response = $gapicClient->listTopics($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTopics()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/ListTopics', $actualFuncCall); - $actualValue = $actualRequestObject->getProject(); - $this->assertProtobufEquals($formattedProject, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTopicsExceptionTest() - { - $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 - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListTopicsRequest()) - ->setProject($formattedProject); - try { - $gapicClient->listTopics($request); - // 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 publishTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new PublishResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $messages = []; - $request = (new PublishRequest()) - ->setTopic($formattedTopic) - ->setMessages($messages); - $response = $gapicClient->publish($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/Publish', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $actualValue = $actualRequestObject->getMessages(); - $this->assertProtobufEquals($messages, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function publishExceptionTest() - { - $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 - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $messages = []; - $request = (new PublishRequest()) - ->setTopic($formattedTopic) - ->setMessages($messages); - try { - $gapicClient->publish($request); - // 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 updateTopicTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $expectedResponse = new Topic(); - $expectedResponse->setName($name); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $topic = new Topic(); - $topicName = 'topicName388205658'; - $topic->setName($topicName); - $updateMask = new FieldMask(); - $request = (new UpdateTopicRequest()) - ->setTopic($topic) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateTopic($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/UpdateTopic', $actualFuncCall); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($topic, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTopicExceptionTest() - { - $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 - $topic = new Topic(); - $topicName = 'topicName388205658'; - $topic->setName($topicName); - $updateMask = new FieldMask(); - $request = (new UpdateTopicRequest()) - ->setTopic($topic) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateTopic($request); - // 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 createTopicAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName2 = 'kmsKeyName2-1057489140'; - $satisfiesPzs2 = true; - $expectedResponse = new Topic(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName2); - $expectedResponse->setSatisfiesPzs($satisfiesPzs2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new Topic()) - ->setName($name); - $response = $gapicClient->createTopicAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Publisher/CreateTopic', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php deleted file mode 100644 index cb6a7fbd721..00000000000 --- a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SchemaServiceClientTest.php +++ /dev/null @@ -1,1037 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SchemaServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SchemaServiceClient($options); - } - - /** @test */ - public function commitSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $definition = 'definition-1014418093'; - $revisionId = 'revisionId513861631'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name2); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new CommitSchemaRequest()) - ->setName($formattedName) - ->setSchema($schema); - $response = $gapicClient->commitSchema($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/CommitSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getSchema(); - $this->assertProtobufEquals($schema, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitSchemaExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new CommitSchemaRequest()) - ->setName($formattedName) - ->setSchema($schema); - try { - $gapicClient->commitSchema($request); - // 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 createSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $definition = 'definition-1014418093'; - $revisionId = 'revisionId513861631'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new CreateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - $response = $gapicClient->createSchema($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/CreateSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSchema(); - $this->assertProtobufEquals($schema, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSchemaExceptionTest() - { - $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->projectName('[PROJECT]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new CreateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - try { - $gapicClient->createSchema($request); - // 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 deleteSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new DeleteSchemaRequest()) - ->setName($formattedName); - $gapicClient->deleteSchema($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/DeleteSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSchemaExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new DeleteSchemaRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteSchema($request); - // 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 deleteSchemaRevisionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $definition = 'definition-1014418093'; - $revisionId2 = 'revisionId2-100208654'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name2); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = 'revisionId513861631'; - $request = (new DeleteSchemaRevisionRequest()) - ->setName($formattedName) - ->setRevisionId($revisionId); - $response = $gapicClient->deleteSchemaRevision($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/DeleteSchemaRevision', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getRevisionId(); - $this->assertProtobufEquals($revisionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSchemaRevisionExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = 'revisionId513861631'; - $request = (new DeleteSchemaRevisionRequest()) - ->setName($formattedName) - ->setRevisionId($revisionId); - try { - $gapicClient->deleteSchemaRevision($request); - // 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 getSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $definition = 'definition-1014418093'; - $revisionId = 'revisionId513861631'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name2); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new GetSchemaRequest()) - ->setName($formattedName); - $response = $gapicClient->getSchema($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/GetSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSchemaExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new GetSchemaRequest()) - ->setName($formattedName); - try { - $gapicClient->getSchema($request); - // 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 listSchemaRevisionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $schemasElement = new Schema(); - $schemas = [ - $schemasElement, - ]; - $expectedResponse = new ListSchemaRevisionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSchemas($schemas); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new ListSchemaRevisionsRequest()) - ->setName($formattedName); - $response = $gapicClient->listSchemaRevisions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSchemas()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/ListSchemaRevisions', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSchemaRevisionsExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $request = (new ListSchemaRevisionsRequest()) - ->setName($formattedName); - try { - $gapicClient->listSchemaRevisions($request); - // 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 listSchemasTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $schemasElement = new Schema(); - $schemas = [ - $schemasElement, - ]; - $expectedResponse = new ListSchemasResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSchemas($schemas); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListSchemasRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listSchemas($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSchemas()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/ListSchemas', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSchemasExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ListSchemasRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listSchemas($request); - // 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 rollbackSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $definition = 'definition-1014418093'; - $revisionId2 = 'revisionId2-100208654'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name2); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = 'revisionId513861631'; - $request = (new RollbackSchemaRequest()) - ->setName($formattedName) - ->setRevisionId($revisionId); - $response = $gapicClient->rollbackSchema($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/RollbackSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getRevisionId(); - $this->assertProtobufEquals($revisionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackSchemaExceptionTest() - { - $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->schemaName('[PROJECT]', '[SCHEMA]'); - $revisionId = 'revisionId513861631'; - $request = (new RollbackSchemaRequest()) - ->setName($formattedName) - ->setRevisionId($revisionId); - try { - $gapicClient->rollbackSchema($request); - // 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 validateMessageTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ValidateMessageResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ValidateMessageRequest()) - ->setParent($formattedParent); - $response = $gapicClient->validateMessage($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/ValidateMessage', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function validateMessageExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ValidateMessageRequest()) - ->setParent($formattedParent); - try { - $gapicClient->validateMessage($request); - // 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 validateSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ValidateSchemaResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new ValidateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - $response = $gapicClient->validateSchema($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/ValidateSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSchema(); - $this->assertProtobufEquals($schema, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function validateSchemaExceptionTest() - { - $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->projectName('[PROJECT]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new ValidateSchemaRequest()) - ->setParent($formattedParent) - ->setSchema($schema); - try { - $gapicClient->validateSchema($request); - // 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 commitSchemaAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $definition = 'definition-1014418093'; - $revisionId = 'revisionId513861631'; - $expectedResponse = new Schema(); - $expectedResponse->setName($name2); - $expectedResponse->setDefinition($definition); - $expectedResponse->setRevisionId($revisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->schemaName('[PROJECT]', '[SCHEMA]'); - $schema = new Schema(); - $schemaName = 'schemaName-448762932'; - $schema->setName($schemaName); - $request = (new CommitSchemaRequest()) - ->setName($formattedName) - ->setSchema($schema); - $response = $gapicClient->commitSchemaAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.SchemaService/CommitSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getSchema(); - $this->assertProtobufEquals($schema, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php b/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php deleted file mode 100644 index cb8d2dee95a..00000000000 --- a/owl-bot-staging/PubSub/v1/tests/Unit/V1/Client/SubscriberClientTest.php +++ /dev/null @@ -1,1494 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SubscriberClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SubscriberClient($options); - } - - /** @test */ - public function acknowledgeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIds = []; - $request = (new AcknowledgeRequest()) - ->setSubscription($formattedSubscription) - ->setAckIds($ackIds); - $gapicClient->acknowledge($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/Acknowledge', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $actualValue = $actualRequestObject->getAckIds(); - $this->assertProtobufEquals($ackIds, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function acknowledgeExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIds = []; - $request = (new AcknowledgeRequest()) - ->setSubscription($formattedSubscription) - ->setAckIds($ackIds); - try { - $gapicClient->acknowledge($request); - // 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 createSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $topic = 'topic110546223'; - $expectedResponse = new Snapshot(); - $expectedResponse->setName($name2); - $expectedResponse->setTopic($topic); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new CreateSnapshotRequest()) - ->setName($formattedName) - ->setSubscription($formattedSubscription); - $response = $gapicClient->createSnapshot($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/CreateSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSnapshotExceptionTest() - { - $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->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new CreateSnapshotRequest()) - ->setName($formattedName) - ->setSubscription($formattedSubscription); - try { - $gapicClient->createSnapshot($request); - // 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 createSubscriptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $topic2 = 'topic2-1139259102'; - $ackDeadlineSeconds2 = 921632575; - $retainAckedMessages2 = true; - $enableMessageOrdering2 = false; - $filter2 = 'filter2-721168085'; - $detached2 = false; - $enableExactlyOnceDelivery2 = true; - $expectedResponse = new Subscription(); - $expectedResponse->setName($name2); - $expectedResponse->setTopic($topic2); - $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds2); - $expectedResponse->setRetainAckedMessages($retainAckedMessages2); - $expectedResponse->setEnableMessageOrdering($enableMessageOrdering2); - $expectedResponse->setFilter($filter2); - $expectedResponse->setDetached($detached2); - $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new Subscription()) - ->setName($name) - ->setTopic($formattedTopic); - $response = $gapicClient->createSubscription($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/CreateSubscription', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getTopic(); - $this->assertProtobufEquals($formattedTopic, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSubscriptionExceptionTest() - { - $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 - $name = 'name3373707'; - $formattedTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $request = (new Subscription()) - ->setName($name) - ->setTopic($formattedTopic); - try { - $gapicClient->createSubscription($request); - // 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 deleteSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest()) - ->setSnapshot($formattedSnapshot); - $gapicClient->deleteSnapshot($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/DeleteSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getSnapshot(); - $this->assertProtobufEquals($formattedSnapshot, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSnapshotExceptionTest() - { - $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 - $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest()) - ->setSnapshot($formattedSnapshot); - try { - $gapicClient->deleteSnapshot($request); - // 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 deleteSubscriptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new DeleteSubscriptionRequest()) - ->setSubscription($formattedSubscription); - $gapicClient->deleteSubscription($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/DeleteSubscription', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSubscriptionExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new DeleteSubscriptionRequest()) - ->setSubscription($formattedSubscription); - try { - $gapicClient->deleteSubscription($request); - // 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 getSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $topic = 'topic110546223'; - $expectedResponse = new Snapshot(); - $expectedResponse->setName($name); - $expectedResponse->setTopic($topic); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest()) - ->setSnapshot($formattedSnapshot); - $response = $gapicClient->getSnapshot($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/GetSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getSnapshot(); - $this->assertProtobufEquals($formattedSnapshot, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnapshotExceptionTest() - { - $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 - $formattedSnapshot = $gapicClient->snapshotName('[PROJECT]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest()) - ->setSnapshot($formattedSnapshot); - try { - $gapicClient->getSnapshot($request); - // 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 getSubscriptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $topic = 'topic110546223'; - $ackDeadlineSeconds = 2135351438; - $retainAckedMessages = false; - $enableMessageOrdering = true; - $filter = 'filter-1274492040'; - $detached = true; - $enableExactlyOnceDelivery = false; - $expectedResponse = new Subscription(); - $expectedResponse->setName($name); - $expectedResponse->setTopic($topic); - $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds); - $expectedResponse->setRetainAckedMessages($retainAckedMessages); - $expectedResponse->setEnableMessageOrdering($enableMessageOrdering); - $expectedResponse->setFilter($filter); - $expectedResponse->setDetached($detached); - $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new GetSubscriptionRequest()) - ->setSubscription($formattedSubscription); - $response = $gapicClient->getSubscription($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/GetSubscription', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSubscriptionExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new GetSubscriptionRequest()) - ->setSubscription($formattedSubscription); - try { - $gapicClient->getSubscription($request); - // 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 listSnapshotsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snapshotsElement = new Snapshot(); - $snapshots = [ - $snapshotsElement, - ]; - $expectedResponse = new ListSnapshotsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnapshots($snapshots); - $transport->addResponse($expectedResponse); - // Mock request - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListSnapshotsRequest()) - ->setProject($formattedProject); - $response = $gapicClient->listSnapshots($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/ListSnapshots', $actualFuncCall); - $actualValue = $actualRequestObject->getProject(); - $this->assertProtobufEquals($formattedProject, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnapshotsExceptionTest() - { - $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 - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListSnapshotsRequest()) - ->setProject($formattedProject); - try { - $gapicClient->listSnapshots($request); - // 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 listSubscriptionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $subscriptionsElement = new Subscription(); - $subscriptions = [ - $subscriptionsElement, - ]; - $expectedResponse = new ListSubscriptionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSubscriptions($subscriptions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListSubscriptionsRequest()) - ->setProject($formattedProject); - $response = $gapicClient->listSubscriptions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSubscriptions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/ListSubscriptions', $actualFuncCall); - $actualValue = $actualRequestObject->getProject(); - $this->assertProtobufEquals($formattedProject, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSubscriptionsExceptionTest() - { - $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 - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new ListSubscriptionsRequest()) - ->setProject($formattedProject); - try { - $gapicClient->listSubscriptions($request); - // 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 modifyAckDeadlineTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIds = []; - $ackDeadlineSeconds = 2135351438; - $request = (new ModifyAckDeadlineRequest()) - ->setSubscription($formattedSubscription) - ->setAckIds($ackIds) - ->setAckDeadlineSeconds($ackDeadlineSeconds); - $gapicClient->modifyAckDeadline($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/ModifyAckDeadline', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $actualValue = $actualRequestObject->getAckIds(); - $this->assertProtobufEquals($ackIds, $actualValue); - $actualValue = $actualRequestObject->getAckDeadlineSeconds(); - $this->assertProtobufEquals($ackDeadlineSeconds, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function modifyAckDeadlineExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIds = []; - $ackDeadlineSeconds = 2135351438; - $request = (new ModifyAckDeadlineRequest()) - ->setSubscription($formattedSubscription) - ->setAckIds($ackIds) - ->setAckDeadlineSeconds($ackDeadlineSeconds); - try { - $gapicClient->modifyAckDeadline($request); - // 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 modifyPushConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $pushConfig = new PushConfig(); - $request = (new ModifyPushConfigRequest()) - ->setSubscription($formattedSubscription) - ->setPushConfig($pushConfig); - $gapicClient->modifyPushConfig($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/ModifyPushConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $actualValue = $actualRequestObject->getPushConfig(); - $this->assertProtobufEquals($pushConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function modifyPushConfigExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $pushConfig = new PushConfig(); - $request = (new ModifyPushConfigRequest()) - ->setSubscription($formattedSubscription) - ->setPushConfig($pushConfig); - try { - $gapicClient->modifyPushConfig($request); - // 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 pullTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new PullResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $maxMessages = 496131527; - $request = (new PullRequest()) - ->setSubscription($formattedSubscription) - ->setMaxMessages($maxMessages); - $response = $gapicClient->pull($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/Pull', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $actualValue = $actualRequestObject->getMaxMessages(); - $this->assertProtobufEquals($maxMessages, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pullExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $maxMessages = 496131527; - $request = (new PullRequest()) - ->setSubscription($formattedSubscription) - ->setMaxMessages($maxMessages); - try { - $gapicClient->pull($request); - // 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 seekTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new SeekResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new SeekRequest()) - ->setSubscription($formattedSubscription); - $response = $gapicClient->seek($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/Seek', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function seekExceptionTest() - { - $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 - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $request = (new SeekRequest()) - ->setSubscription($formattedSubscription); - try { - $gapicClient->seek($request); - // 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 streamingPullTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new StreamingPullResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new StreamingPullResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new StreamingPullResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $streamAckDeadlineSeconds = 1875467245; - $request = new StreamingPullRequest(); - $request->setSubscription($formattedSubscription); - $request->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds); - $formattedSubscription2 = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $streamAckDeadlineSeconds2 = 1562238880; - $request2 = new StreamingPullRequest(); - $request2->setSubscription($formattedSubscription2); - $request2->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds2); - $formattedSubscription3 = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $streamAckDeadlineSeconds3 = 1562238879; - $request3 = new StreamingPullRequest(); - $request3->setSubscription($formattedSubscription3); - $request3->setStreamAckDeadlineSeconds($streamAckDeadlineSeconds3); - $bidi = $gapicClient->streamingPull(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/StreamingPull', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingPullExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $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->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingPull(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream 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 updateSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $topic = 'topic110546223'; - $expectedResponse = new Snapshot(); - $expectedResponse->setName($name); - $expectedResponse->setTopic($topic); - $transport->addResponse($expectedResponse); - // Mock request - $snapshot = new Snapshot(); - $updateMask = new FieldMask(); - $request = (new UpdateSnapshotRequest()) - ->setSnapshot($snapshot) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateSnapshot($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/UpdateSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getSnapshot(); - $this->assertProtobufEquals($snapshot, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSnapshotExceptionTest() - { - $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 - $snapshot = new Snapshot(); - $updateMask = new FieldMask(); - $request = (new UpdateSnapshotRequest()) - ->setSnapshot($snapshot) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateSnapshot($request); - // 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 updateSubscriptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $topic = 'topic110546223'; - $ackDeadlineSeconds = 2135351438; - $retainAckedMessages = false; - $enableMessageOrdering = true; - $filter = 'filter-1274492040'; - $detached = true; - $enableExactlyOnceDelivery = false; - $expectedResponse = new Subscription(); - $expectedResponse->setName($name); - $expectedResponse->setTopic($topic); - $expectedResponse->setAckDeadlineSeconds($ackDeadlineSeconds); - $expectedResponse->setRetainAckedMessages($retainAckedMessages); - $expectedResponse->setEnableMessageOrdering($enableMessageOrdering); - $expectedResponse->setFilter($filter); - $expectedResponse->setDetached($detached); - $expectedResponse->setEnableExactlyOnceDelivery($enableExactlyOnceDelivery); - $transport->addResponse($expectedResponse); - // Mock request - $subscription = new Subscription(); - $subscriptionName = 'subscriptionName-515935928'; - $subscription->setName($subscriptionName); - $subscriptionTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $subscription->setTopic($subscriptionTopic); - $updateMask = new FieldMask(); - $request = (new UpdateSubscriptionRequest()) - ->setSubscription($subscription) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateSubscription($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/UpdateSubscription', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($subscription, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSubscriptionExceptionTest() - { - $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 - $subscription = new Subscription(); - $subscriptionName = 'subscriptionName-515935928'; - $subscription->setName($subscriptionName); - $subscriptionTopic = $gapicClient->topicName('[PROJECT]', '[TOPIC]'); - $subscription->setTopic($subscriptionTopic); - $updateMask = new FieldMask(); - $request = (new UpdateSubscriptionRequest()) - ->setSubscription($subscription) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateSubscription($request); - // 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 acknowledgeAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSubscription = $gapicClient->subscriptionName('[PROJECT]', '[SUBSCRIPTION]'); - $ackIds = []; - $request = (new AcknowledgeRequest()) - ->setSubscription($formattedSubscription) - ->setAckIds($ackIds); - $gapicClient->acknowledgeAsync($request)->wait(); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.pubsub.v1.Subscriber/Acknowledge', $actualFuncCall); - $actualValue = $actualRequestObject->getSubscription(); - $this->assertProtobufEquals($formattedSubscription, $actualValue); - $actualValue = $actualRequestObject->getAckIds(); - $this->assertProtobufEquals($ackIds, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php b/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php deleted file mode 100644 index 42123bf06e8..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Cloudquotas.php +++ /dev/null @@ -1,78 +0,0 @@ -internalAddGeneratedFile( - ' -�" -+google/api/cloudquotas/v1/cloudquotas.protogoogle.api.cloudquotas.v1google/api/client.proto)google/api/cloudquotas/v1/resources.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/protobuf/field_mask.proto"� -ListQuotaInfosRequest< -parent ( B,�A�A&$cloudquotas.googleapis.com/QuotaInfo - page_size (B�A - -page_token ( B�A"l -ListQuotaInfosResponse9 - quota_infos ( 2$.google.api.cloudquotas.v1.QuotaInfo -next_page_token ( "Q -GetQuotaInfoRequest: -name ( B,�A�A& -$cloudquotas.googleapis.com/QuotaInfo"� -ListQuotaPreferencesRequestB -parent ( B2�A�A,*cloudquotas.googleapis.com/QuotaPreference - page_size (B�A - -page_token ( B�A -filter ( B�A -order_by ( B�A"� -ListQuotaPreferencesResponseE -quota_preferences ( 2*.google.api.cloudquotas.v1.QuotaPreference -next_page_token (  - unreachable ( "] -GetQuotaPreferenceRequest@ -name ( B2�A�A, -*cloudquotas.googleapis.com/QuotaPreference"� -CreateQuotaPreferenceRequestB -parent ( B2�A�A,*cloudquotas.googleapis.com/QuotaPreference -quota_preference_id ( B�AI -quota_preference ( 2*.google.api.cloudquotas.v1.QuotaPreferenceB�AI -ignore_safety_checks (2+.google.api.cloudquotas.v1.QuotaSafetyCheck"� -UpdateQuotaPreferenceRequest4 - update_mask ( 2.google.protobuf.FieldMaskB�AI -quota_preference ( 2*.google.api.cloudquotas.v1.QuotaPreferenceB�A - allow_missing (B�A - validate_only (B�AI -ignore_safety_checks (2+.google.api.cloudquotas.v1.QuotaSafetyCheck2� - CloudQuotas� -ListQuotaInfos0.google.api.cloudquotas.v1.ListQuotaInfosRequest1.google.api.cloudquotas.v1.ListQuotaInfosResponse"��Aparent����9/v1/{parent=projects/*/locations/*/services/*}/quotaInfosZ@>/v1/{parent=organizations/*/locations/*/services/*}/quotaInfosZ:8/v1/{parent=folders/*/locations/*/services/*}/quotaInfos� - GetQuotaInfo..google.api.cloudquotas.v1.GetQuotaInfoRequest$.google.api.cloudquotas.v1.QuotaInfo"��Aname����9/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}Z@>/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}Z:8/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}� -ListQuotaPreferences6.google.api.cloudquotas.v1.ListQuotaPreferencesRequest7.google.api.cloudquotas.v1.ListQuotaPreferencesResponse"��Aparent����4/v1/{parent=projects/*/locations/*}/quotaPreferencesZ53/v1/{parent=folders/*/locations/*}/quotaPreferencesZ;9/v1/{parent=organizations/*/locations/*}/quotaPreferences� -GetQuotaPreference4.google.api.cloudquotas.v1.GetQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��Aname����4/v1/{name=projects/*/locations/*/quotaPreferences/*}Z;9/v1/{name=organizations/*/locations/*/quotaPreferences/*}Z53/v1/{name=folders/*/locations/*/quotaPreferences/*}� -CreateQuotaPreference7.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��A+parent,quota_preference,quota_preference_id�Aparent,quota_preference����"4/v1/{parent=projects/*/locations/*}/quotaPreferences:quota_preferenceZG"3/v1/{parent=folders/*/locations/*}/quotaPreferences:quota_preferenceZM"9/v1/{parent=organizations/*/locations/*}/quotaPreferences:quota_preference� -UpdateQuotaPreference7.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest*.google.api.cloudquotas.v1.QuotaPreference"��Aquota_preference,update_mask����2E/v1/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}:quota_preferenceZX2D/v1/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}:quota_preferenceZ^2J/v1/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}:quota_preferenceN�Acloudquotas.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.api.cloudquotas.v1BCloudquotasProtoPZAcloud.google.com/go/cloudquotas/apiv1/cloudquotaspb;cloudquotaspb�Google.Cloud.CloudQuotas.V1�Google\\Cloud\\CloudQuotas\\V1�Google::Cloud::CloudQuotas::V1�A� -"cloudquotas.googleapis.com/Service:projects/{project}/locations/{location}/services/{service}8folders/{folder}/locations/{location}/services/{service}Dorganizations/{organization}/locations/{location}/services/{service}�A� -#cloudquotas.googleapis.com/Location\'projects/{project}/locations/{location}%folders/{folder}/locations/{location}1organizations/{organization}/locations/{location}bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php b/owl-bot-staging/Quotas/v1/proto/src/GPBMetadata/Google/Api/Cloudquotas/V1/Resources.php deleted file mode 100644 index 9f2589e17b500e7021afaf1b8516d5900e053203..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4114 zcmbtXUvt~W5idzuqL%u@z)lL&t&6Z8Th1iph{-f59k&CK5CumeXcCmiE@v=HMkG`m|1_X32`h@yG?cbsDq2%F-$&KRpM(yn zD`VduyQFFdwCcG2Wcba*kL{>>wp$H}kcleXDu8F7k|?kpqO>}DUy|4!+Oa)oaRUQ2 zpo7NDz~E^234r6;QKWQJL+~0D{0k<>E_IYBwqyKxKqHHKG^VyozeP`;DkIyC2x?!I z9ZftZroN{z1;ca5&SOQ`WU>zeA3cAnq(|zoU|=8yx)+nsv)w_HL{3P9*bh4>TCa~u zJPjdR*?F97%goV{vLnt|uU|RjQzZ^3WPW!=2}wK&y(j$K%)rI;X>d)z_9=0Pd*sAE zqkdSg&%Bx$xlT0=>hfCCaF`VH7~7}8&(M7l+Cf0V=%-bA20r=|P2#N%htu%xBMf(@ z0b${J1V7$|$4lc+x+_F02-V6QR4Zq@rQ{PwaSB_3+S2cm4LF7o4AnUGJ`uRTDDcwG&hnKlSUn|iNF6!H-?w2cBHY44zt6cgSY&pIc+Z5~Eiq8Wgui^Su ztyZ}<7?tT^D~(juL`?~I9-{AFgas7Ic_oJq+=JWVxYm$Hfoq>z+`DzYc?l%p-KB59 zzuksHqBy})lnZ?E1(cF-cuq*{h*-p>V|q+o8lTG>C{w6?eDleLt~OI;amJvH=-

!RF=Q-iK1dXq&3u*1DGYvZGo3cCVu~^nG1x7JnrbV6D?No@ouU zn88G>?i+_qty|2ZYa2$lrMC4~s;L|8Vy^x}_Ko^|79PxFTx1)OA61ajtJ4%qUBvZQ z#EGNo>*VR8>iP~cD<--6I(@vTCLZBh@^n$@Rfdb2VOe{w2oKg$5Qff5i{mQiKF|8canglq& zBwCDam(aR1qjN^Y>*7%F&b5L3Y*~f^(mb*Y@}D=B8FA*t=14qWO`@2NsHoJ0KTEKQ z;<4?-7CE)4%PEuZu~OQF?S+^kr{umS=SeHtgj?7)CPeh1diJwS{W~O*e`Vo=n}}qV zHtCCH>4fKTrZ{DgU<#-UNnegfmNC_zCk)(d{`DIESi)@i-#I8eXT4oO3=3#mI1rMd zCBn%XeNLqLE^M%QkXS>6AZCYme38&kVRIbX*t=6T*8K~$dsk41qv#(#Ibw-Qk&ur= z9I4p^!3PAf{2U6l=i$LPk0Yj8XZtj@c69<0O<#CXQD>Ud;>$=lN~GP)53wtIe8kwQ zeYB)igDdglm1<{YE%F^QTI0~@H!bX>J>yUlB&YUG!%~~i z`aP3#*P9G%%_@QS@h>ltRfY%ak8g47vic%dNuR-*$Z*6{T&N8my~P;EPm?1eLIB;t z`513E_OVN>wEITLbU1DOj2bTg1vV~iFfDVAOX+ji2z?i?T``}5mSEJb5NB~KKZL^E ztMqHw_Pw!>TxBIjIk)6L_&XH&A$s#H4e1K7Yhvx zhaw@<)EcbAY1W>0XuJ@e3A6hU$_w8+TDPI$7=?|?Gz@HBt%G8A@4p%NEsj0cCt+_Z zy$(ekcIoS6Ua6e*QWZ8djr~hETr48Igoogle.api.cloudquotas.v1.CreateQuotaPreferenceRequest - */ -class CreateQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * Example: - * `projects/123/locations/global` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Id of the requesting object, must be unique under its parent. - * If client does not set this field, the service will generate one. - * - * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $quota_preference_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $quota_preference = null; - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; - */ - private $ignore_safety_checks; - - /** - * @param string $parent Required. Value for parent. - * - * Example: - * `projects/123/locations/global` - * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. - * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being created - * @param string $quotaPreferenceId Optional. Id of the requesting object, must be unique under its parent. - * If client does not set this field, the service will generate one. - * - * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference, string $quotaPreferenceId): self - { - return (new self()) - ->setParent($parent) - ->setQuotaPreference($quotaPreference) - ->setQuotaPreferenceId($quotaPreferenceId); - } - - /** - * @param string $parent Required. Value for parent. - * - * Example: - * `projects/123/locations/global` - * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. - * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being created - * - * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest - * - * @experimental - */ - public static function buildFromParentQuotaPreference(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference): self - { - return (new self()) - ->setParent($parent) - ->setQuotaPreference($quotaPreference); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * Example: - * `projects/123/locations/global` - * @type string $quota_preference_id - * Optional. Id of the requesting object, must be unique under its parent. - * If client does not set this field, the service will generate one. - * @type \Google\Cloud\CloudQuotas\V1\QuotaPreference $quota_preference - * Required. The resource being created - * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_safety_checks - * The list of quota safety checks to be ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * Example: - * `projects/123/locations/global` - * - * 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. Value for parent. - * Example: - * `projects/123/locations/global` - * - * 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. Id of the requesting object, must be unique under its parent. - * If client does not set this field, the service will generate one. - * - * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuotaPreferenceId() - { - return $this->quota_preference_id; - } - - /** - * Optional. Id of the requesting object, must be unique under its parent. - * If client does not set this field, the service will generate one. - * - * Generated from protobuf field string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuotaPreferenceId($var) - { - GPBUtil::checkString($var, True); - $this->quota_preference_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\CloudQuotas\V1\QuotaPreference|null - */ - public function getQuotaPreference() - { - return $this->quota_preference; - } - - public function hasQuotaPreference() - { - return isset($this->quota_preference); - } - - public function clearQuotaPreference() - { - unset($this->quota_preference); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $var - * @return $this - */ - public function setQuotaPreference($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); - $this->quota_preference = $var; - - return $this; - } - - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoreSafetyChecks() - { - return $this->ignore_safety_checks; - } - - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoreSafetyChecks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\CloudQuotas\V1\QuotaSafetyCheck::class); - $this->ignore_safety_checks = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php deleted file mode 100644 index e762ea504de..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/DimensionsInfo.php +++ /dev/null @@ -1,186 +0,0 @@ -google.api.cloudquotas.v1.DimensionsInfo - */ -class DimensionsInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The map of dimensions for this dimensions info. The key of a map entry - * is "region", "zone" or the name of a service specific dimension, and the - * value of a map entry is the value of the dimension. If a dimension does - * not appear in the map of dimensions, the dimensions info applies to all - * the dimension values except for those that have another DimenisonInfo - * instance configured for the specific value. - * Example: {"provider" : "Foo Inc"} where "provider" is a service specific - * dimension of a quota. - * - * Generated from protobuf field map dimensions = 1; - */ - private $dimensions; - /** - * Quota details for the specified dimensions. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; - */ - protected $details = null; - /** - * The applicable regions or zones of this dimensions info. The field will be - * set to ['global'] for quotas that are not per region or per zone. - * Otherwise, it will be set to the list of locations this dimension info is - * applicable to. - * - * Generated from protobuf field repeated string applicable_locations = 3; - */ - private $applicable_locations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $dimensions - * The map of dimensions for this dimensions info. The key of a map entry - * is "region", "zone" or the name of a service specific dimension, and the - * value of a map entry is the value of the dimension. If a dimension does - * not appear in the map of dimensions, the dimensions info applies to all - * the dimension values except for those that have another DimenisonInfo - * instance configured for the specific value. - * Example: {"provider" : "Foo Inc"} where "provider" is a service specific - * dimension of a quota. - * @type \Google\Cloud\CloudQuotas\V1\QuotaDetails $details - * Quota details for the specified dimensions. - * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_locations - * The applicable regions or zones of this dimensions info. The field will be - * set to ['global'] for quotas that are not per region or per zone. - * Otherwise, it will be set to the list of locations this dimension info is - * applicable to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The map of dimensions for this dimensions info. The key of a map entry - * is "region", "zone" or the name of a service specific dimension, and the - * value of a map entry is the value of the dimension. If a dimension does - * not appear in the map of dimensions, the dimensions info applies to all - * the dimension values except for those that have another DimenisonInfo - * instance configured for the specific value. - * Example: {"provider" : "Foo Inc"} where "provider" is a service specific - * dimension of a quota. - * - * Generated from protobuf field map dimensions = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDimensions() - { - return $this->dimensions; - } - - /** - * The map of dimensions for this dimensions info. The key of a map entry - * is "region", "zone" or the name of a service specific dimension, and the - * value of a map entry is the value of the dimension. If a dimension does - * not appear in the map of dimensions, the dimensions info applies to all - * the dimension values except for those that have another DimenisonInfo - * instance configured for the specific value. - * Example: {"provider" : "Foo Inc"} where "provider" is a service specific - * dimension of a quota. - * - * Generated from protobuf field map dimensions = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDimensions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->dimensions = $arr; - - return $this; - } - - /** - * Quota details for the specified dimensions. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; - * @return \Google\Cloud\CloudQuotas\V1\QuotaDetails|null - */ - public function getDetails() - { - return $this->details; - } - - public function hasDetails() - { - return isset($this->details); - } - - public function clearDetails() - { - unset($this->details); - } - - /** - * Quota details for the specified dimensions. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaDetails details = 2; - * @param \Google\Cloud\CloudQuotas\V1\QuotaDetails $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaDetails::class); - $this->details = $var; - - return $this; - } - - /** - * The applicable regions or zones of this dimensions info. The field will be - * set to ['global'] for quotas that are not per region or per zone. - * Otherwise, it will be set to the list of locations this dimension info is - * applicable to. - * - * Generated from protobuf field repeated string applicable_locations = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getApplicableLocations() - { - return $this->applicable_locations; - } - - /** - * The applicable regions or zones of this dimensions info. The field will be - * set to ['global'] for quotas that are not per region or per zone. - * Otherwise, it will be set to the list of locations this dimension info is - * applicable to. - * - * Generated from protobuf field repeated string applicable_locations = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setApplicableLocations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->applicable_locations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php deleted file mode 100644 index d28953dfb23..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaInfoRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.api.cloudquotas.v1.GetQuotaInfoRequest - */ -class GetQuotaInfoRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the quota info. - * An example name: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the quota info. - * - * An example name: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * Please see {@see CloudQuotasClient::quotaInfoName()} for help formatting this field. - * - * @return \Google\Cloud\CloudQuotas\V1\GetQuotaInfoRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the quota info. - * An example name: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the quota info. - * An example name: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * 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 resource name of the quota info. - * An example name: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php deleted file mode 100644 index d4e3772f568..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/GetQuotaPreferenceRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.api.cloudquotas.v1.GetQuotaPreferenceRequest - */ -class GetQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource - * Example name: - * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the resource - * - * Example name: - * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` - * Please see {@see CloudQuotasClient::quotaPreferenceName()} for help formatting this field. - * - * @return \Google\Cloud\CloudQuotas\V1\GetQuotaPreferenceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * Example name: - * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource - * Example name: - * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` - * - * 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. Name of the resource - * Example name: - * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` - * - * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php deleted file mode 100644 index 1620a7795fd..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.api.cloudquotas.v1.ListQuotaInfosRequest - */ -class ListQuotaInfosRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value of QuotaInfo resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * Example names: - * `projects/123/locations/global/services/compute.googleapis.com` - * `folders/234/locations/global/services/compute.googleapis.com` - * `organizations/345/locations/global/services/compute.googleapis.com` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. Parent value of QuotaInfo resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * - * Example names: - * `projects/123/locations/global/services/compute.googleapis.com` - * `folders/234/locations/global/services/compute.googleapis.com` - * `organizations/345/locations/global/services/compute.googleapis.com` - * Please see {@see CloudQuotasClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\CloudQuotas\V1\ListQuotaInfosRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value of QuotaInfo resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * Example names: - * `projects/123/locations/global/services/compute.googleapis.com` - * `folders/234/locations/global/services/compute.googleapis.com` - * `organizations/345/locations/global/services/compute.googleapis.com` - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value of QuotaInfo resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * Example names: - * `projects/123/locations/global/services/compute.googleapis.com` - * `folders/234/locations/global/services/compute.googleapis.com` - * `organizations/345/locations/global/services/compute.googleapis.com` - * - * 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. Parent value of QuotaInfo resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * Example names: - * `projects/123/locations/global/services/compute.googleapis.com` - * `folders/234/locations/global/services/compute.googleapis.com` - * `organizations/345/locations/global/services/compute.googleapis.com` - * - * 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. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php deleted file mode 100644 index 0eefa66e027..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaInfosResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.api.cloudquotas.v1.ListQuotaInfosResponse - */ -class ListQuotaInfosResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of QuotaInfo - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; - */ - private $quota_infos; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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\CloudQuotas\V1\QuotaInfo>|\Google\Protobuf\Internal\RepeatedField $quota_infos - * The list of QuotaInfo - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * The list of QuotaInfo - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQuotaInfos() - { - return $this->quota_infos; - } - - /** - * The list of QuotaInfo - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; - * @param array<\Google\Cloud\CloudQuotas\V1\QuotaInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQuotaInfos($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\QuotaInfo::class); - $this->quota_infos = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php deleted file mode 100644 index e657eb87622..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesRequest.php +++ /dev/null @@ -1,290 +0,0 @@ -google.api.cloudquotas.v1.ListQuotaPreferencesRequest - */ -class ListQuotaPreferencesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value of QuotaPreference resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * When the value starts with 'folders' or 'organizations', it lists the - * QuotaPreferences for org quotas in the container. It does not list the - * QuotaPreferences in the descendant projects of the container. - * Example parents: - * `projects/123/locations/global` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filter result QuotaPreferences by their state, type, - * create/update time range. - * Example filters: - * `reconciling=true AND request_type=CLOUD_CONSOLE`, - * `reconciling=true OR creation_time>2022-12-03T10:30:00` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. How to order of the results. By default, the results are ordered - * by create time. - * Example orders: - * `quota_id`, - * `service, create_time` - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Parent value of QuotaPreference resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * - * When the value starts with 'folders' or 'organizations', it lists the - * QuotaPreferences for org quotas in the container. It does not list the - * QuotaPreferences in the descendant projects of the container. - * - * Example parents: - * `projects/123/locations/global` - * Please see {@see CloudQuotasClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\CloudQuotas\V1\ListQuotaPreferencesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value of QuotaPreference resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * When the value starts with 'folders' or 'organizations', it lists the - * QuotaPreferences for org quotas in the container. It does not list the - * QuotaPreferences in the descendant projects of the container. - * Example parents: - * `projects/123/locations/global` - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filter result QuotaPreferences by their state, type, - * create/update time range. - * Example filters: - * `reconciling=true AND request_type=CLOUD_CONSOLE`, - * `reconciling=true OR creation_time>2022-12-03T10:30:00` - * @type string $order_by - * Optional. How to order of the results. By default, the results are ordered - * by create time. - * Example orders: - * `quota_id`, - * `service, create_time` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value of QuotaPreference resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * When the value starts with 'folders' or 'organizations', it lists the - * QuotaPreferences for org quotas in the container. It does not list the - * QuotaPreferences in the descendant projects of the container. - * Example parents: - * `projects/123/locations/global` - * - * 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. Parent value of QuotaPreference resources. - * Listing across different resource containers (such as 'projects/-') is not - * allowed. - * When the value starts with 'folders' or 'organizations', it lists the - * QuotaPreferences for org quotas in the container. It does not list the - * QuotaPreferences in the descendant projects of the container. - * Example parents: - * `projects/123/locations/global` - * - * 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. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate 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. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * 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. Filter result QuotaPreferences by their state, type, - * create/update time range. - * Example filters: - * `reconciling=true AND request_type=CLOUD_CONSOLE`, - * `reconciling=true OR creation_time>2022-12-03T10:30:00` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filter result QuotaPreferences by their state, type, - * create/update time range. - * Example filters: - * `reconciling=true AND request_type=CLOUD_CONSOLE`, - * `reconciling=true OR creation_time>2022-12-03T10:30:00` - * - * 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; - } - - /** - * Optional. How to order of the results. By default, the results are ordered - * by create time. - * Example orders: - * `quota_id`, - * `service, create_time` - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. How to order of the results. By default, the results are ordered - * by create time. - * Example orders: - * `quota_id`, - * `service, create_time` - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php deleted file mode 100644 index 123679124c1..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/ListQuotaPreferencesResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.api.cloudquotas.v1.ListQuotaPreferencesResponse - */ -class ListQuotaPreferencesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of QuotaPreference - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; - */ - private $quota_preferences; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\CloudQuotas\V1\QuotaPreference>|\Google\Protobuf\Internal\RepeatedField $quota_preferences - * The list of QuotaPreference - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * The list of QuotaPreference - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQuotaPreferences() - { - return $this->quota_preferences; - } - - /** - * The list of QuotaPreference - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; - * @param array<\Google\Cloud\CloudQuotas\V1\QuotaPreference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQuotaPreferences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); - $this->quota_preferences = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php deleted file mode 100644 index d1eadeec449..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig.php +++ /dev/null @@ -1,302 +0,0 @@ -google.api.cloudquotas.v1.QuotaConfig - */ -class QuotaConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The preferred value. Must be greater than or equal to -1. If set - * to -1, it means the value is "unlimited". - * - * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $preferred_value = 0; - /** - * Output only. Optional details about the state of this quota preference. - * - * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state_detail = ''; - /** - * Output only. Granted quota value. - * - * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $granted_value = null; - /** - * Output only. The trace id that the Google Cloud uses to provision the - * requested quota. This trace id may be used by the client to contact Cloud - * support to track the state of a quota preference request. The trace id is - * only produced for increase requests and is unique for each request. The - * quota decrease requests do not have a trace id. - * - * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $trace_id = ''; - /** - * Optional. The annotations map for clients to store small amounts of - * arbitrary data. Do not put PII or other sensitive information here. See - * https://google.aip.dev/128#annotations - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $annotations; - /** - * Output only. The origin of the quota preference request. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $request_origin = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $preferred_value - * Required. The preferred value. Must be greater than or equal to -1. If set - * to -1, it means the value is "unlimited". - * @type string $state_detail - * Output only. Optional details about the state of this quota preference. - * @type \Google\Protobuf\Int64Value $granted_value - * Output only. Granted quota value. - * @type string $trace_id - * Output only. The trace id that the Google Cloud uses to provision the - * requested quota. This trace id may be used by the client to contact Cloud - * support to track the state of a quota preference request. The trace id is - * only produced for increase requests and is unique for each request. The - * quota decrease requests do not have a trace id. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Optional. The annotations map for clients to store small amounts of - * arbitrary data. Do not put PII or other sensitive information here. See - * https://google.aip.dev/128#annotations - * @type int $request_origin - * Output only. The origin of the quota preference request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The preferred value. Must be greater than or equal to -1. If set - * to -1, it means the value is "unlimited". - * - * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getPreferredValue() - { - return $this->preferred_value; - } - - /** - * Required. The preferred value. Must be greater than or equal to -1. If set - * to -1, it means the value is "unlimited". - * - * Generated from protobuf field int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setPreferredValue($var) - { - GPBUtil::checkInt64($var); - $this->preferred_value = $var; - - return $this; - } - - /** - * Output only. Optional details about the state of this quota preference. - * - * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateDetail() - { - return $this->state_detail; - } - - /** - * Output only. Optional details about the state of this quota preference. - * - * Generated from protobuf field string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateDetail($var) - { - GPBUtil::checkString($var, True); - $this->state_detail = $var; - - return $this; - } - - /** - * Output only. Granted quota value. - * - * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getGrantedValue() - { - return $this->granted_value; - } - - public function hasGrantedValue() - { - return isset($this->granted_value); - } - - public function clearGrantedValue() - { - unset($this->granted_value); - } - - /** - * Returns the unboxed value from getGrantedValue() - - * Output only. Granted quota value. - * - * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string|null - */ - public function getGrantedValueUnwrapped() - { - return $this->readWrapperValue("granted_value"); - } - - /** - * Output only. Granted quota value. - * - * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setGrantedValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->granted_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Output only. Granted quota value. - * - * Generated from protobuf field .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string|null $var - * @return $this - */ - public function setGrantedValueUnwrapped($var) - { - $this->writeWrapperValue("granted_value", $var); - return $this;} - - /** - * Output only. The trace id that the Google Cloud uses to provision the - * requested quota. This trace id may be used by the client to contact Cloud - * support to track the state of a quota preference request. The trace id is - * only produced for increase requests and is unique for each request. The - * quota decrease requests do not have a trace id. - * - * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTraceId() - { - return $this->trace_id; - } - - /** - * Output only. The trace id that the Google Cloud uses to provision the - * requested quota. This trace id may be used by the client to contact Cloud - * support to track the state of a quota preference request. The trace id is - * only produced for increase requests and is unique for each request. The - * quota decrease requests do not have a trace id. - * - * Generated from protobuf field string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTraceId($var) - { - GPBUtil::checkString($var, True); - $this->trace_id = $var; - - return $this; - } - - /** - * Optional. The annotations map for clients to store small amounts of - * arbitrary data. Do not put PII or other sensitive information here. See - * https://google.aip.dev/128#annotations - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Optional. The annotations map for clients to store small amounts of - * arbitrary data. Do not put PII or other sensitive information here. See - * https://google.aip.dev/128#annotations - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The origin of the quota preference request. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRequestOrigin() - { - return $this->request_origin; - } - - /** - * Output only. The origin of the quota preference request. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRequestOrigin($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaConfig\Origin::class); - $this->request_origin = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php deleted file mode 100644 index e4945a8aba1..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaConfig/Origin.php +++ /dev/null @@ -1,64 +0,0 @@ -google.api.cloudquotas.v1.QuotaConfig.Origin - */ -class Origin -{ - /** - * The unspecified value. - * - * Generated from protobuf enum ORIGIN_UNSPECIFIED = 0; - */ - const ORIGIN_UNSPECIFIED = 0; - /** - * Created through Cloud Console. - * - * Generated from protobuf enum CLOUD_CONSOLE = 1; - */ - const CLOUD_CONSOLE = 1; - /** - * Generated by automatic quota adjustment. - * - * Generated from protobuf enum AUTO_ADJUSTER = 2; - */ - const AUTO_ADJUSTER = 2; - - private static $valueToName = [ - self::ORIGIN_UNSPECIFIED => 'ORIGIN_UNSPECIFIED', - self::CLOUD_CONSOLE => 'CLOUD_CONSOLE', - self::AUTO_ADJUSTER => 'AUTO_ADJUSTER', - ]; - - 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(Origin::class, \Google\Cloud\CloudQuotas\V1\QuotaConfig_Origin::class); - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php deleted file mode 100644 index 989b3f46d03..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaDetails.php +++ /dev/null @@ -1,119 +0,0 @@ -google.api.cloudquotas.v1.QuotaDetails - */ -class QuotaDetails extends \Google\Protobuf\Internal\Message -{ - /** - * The value currently in effect and being enforced. - * - * Generated from protobuf field int64 value = 1; - */ - protected $value = 0; - /** - * Rollout information of this quota. - * This field is present only if the effective limit will change due to the - * ongoing rollout of the service config. - * - * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; - */ - protected $rollout_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $value - * The value currently in effect and being enforced. - * @type \Google\Cloud\CloudQuotas\V1\RolloutInfo $rollout_info - * Rollout information of this quota. - * This field is present only if the effective limit will change due to the - * ongoing rollout of the service config. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The value currently in effect and being enforced. - * - * Generated from protobuf field int64 value = 1; - * @return int|string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value currently in effect and being enforced. - * - * Generated from protobuf field int64 value = 1; - * @param int|string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkInt64($var); - $this->value = $var; - - return $this; - } - - /** - * Rollout information of this quota. - * This field is present only if the effective limit will change due to the - * ongoing rollout of the service config. - * - * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; - * @return \Google\Cloud\CloudQuotas\V1\RolloutInfo|null - */ - public function getRolloutInfo() - { - return $this->rollout_info; - } - - public function hasRolloutInfo() - { - return isset($this->rollout_info); - } - - public function clearRolloutInfo() - { - unset($this->rollout_info); - } - - /** - * Rollout information of this quota. - * This field is present only if the effective limit will change due to the - * ongoing rollout of the service config. - * - * Generated from protobuf field .google.api.cloudquotas.v1.RolloutInfo rollout_info = 3; - * @param \Google\Cloud\CloudQuotas\V1\RolloutInfo $var - * @return $this - */ - public function setRolloutInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\RolloutInfo::class); - $this->rollout_info = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php deleted file mode 100644 index daf06c473eb..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility.php +++ /dev/null @@ -1,109 +0,0 @@ -google.api.cloudquotas.v1.QuotaIncreaseEligibility - */ -class QuotaIncreaseEligibility extends \Google\Protobuf\Internal\Message -{ - /** - * Whether a higher quota value can be requested for the quota. - * - * Generated from protobuf field bool is_eligible = 1; - */ - protected $is_eligible = false; - /** - * The reason of why it is ineligible to request increased value of the quota. - * If the is_eligible field is true, it defaults to - * INELIGIBILITY_REASON_UNSPECIFIED. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; - */ - protected $ineligibility_reason = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $is_eligible - * Whether a higher quota value can be requested for the quota. - * @type int $ineligibility_reason - * The reason of why it is ineligible to request increased value of the quota. - * If the is_eligible field is true, it defaults to - * INELIGIBILITY_REASON_UNSPECIFIED. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Whether a higher quota value can be requested for the quota. - * - * Generated from protobuf field bool is_eligible = 1; - * @return bool - */ - public function getIsEligible() - { - return $this->is_eligible; - } - - /** - * Whether a higher quota value can be requested for the quota. - * - * Generated from protobuf field bool is_eligible = 1; - * @param bool $var - * @return $this - */ - public function setIsEligible($var) - { - GPBUtil::checkBool($var); - $this->is_eligible = $var; - - return $this; - } - - /** - * The reason of why it is ineligible to request increased value of the quota. - * If the is_eligible field is true, it defaults to - * INELIGIBILITY_REASON_UNSPECIFIED. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; - * @return int - */ - public function getIneligibilityReason() - { - return $this->ineligibility_reason; - } - - /** - * The reason of why it is ineligible to request increased value of the quota. - * If the is_eligible field is true, it defaults to - * INELIGIBILITY_REASON_UNSPECIFIED. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; - * @param int $var - * @return $this - */ - public function setIneligibilityReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility\IneligibilityReason::class); - $this->ineligibility_reason = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php deleted file mode 100644 index e4861a1587d..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaIncreaseEligibility/IneligibilityReason.php +++ /dev/null @@ -1,79 +0,0 @@ -google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason - */ -class IneligibilityReason -{ - /** - * Default value when is_eligible is true. - * - * Generated from protobuf enum INELIGIBILITY_REASON_UNSPECIFIED = 0; - */ - const INELIGIBILITY_REASON_UNSPECIFIED = 0; - /** - * The container is not linked with a valid billing account. - * - * Generated from protobuf enum NO_VALID_BILLING_ACCOUNT = 1; - */ - const NO_VALID_BILLING_ACCOUNT = 1; - /** - * Quota increase is not supported for the quota. - * - * Generated from protobuf enum NOT_SUPPORTED = 3; - */ - const NOT_SUPPORTED = 3; - /** - * There is not enough usage history to determine the eligibility. - * - * Generated from protobuf enum NOT_ENOUGH_USAGE_HISTORY = 4; - */ - const NOT_ENOUGH_USAGE_HISTORY = 4; - /** - * Other reasons. - * - * Generated from protobuf enum OTHER = 2; - */ - const OTHER = 2; - - private static $valueToName = [ - self::INELIGIBILITY_REASON_UNSPECIFIED => 'INELIGIBILITY_REASON_UNSPECIFIED', - self::NO_VALID_BILLING_ACCOUNT => 'NO_VALID_BILLING_ACCOUNT', - self::NOT_SUPPORTED => 'NOT_SUPPORTED', - self::NOT_ENOUGH_USAGE_HISTORY => 'NOT_ENOUGH_USAGE_HISTORY', - self::OTHER => 'OTHER', - ]; - - 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(IneligibilityReason::class, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility_IneligibilityReason::class); - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php deleted file mode 100644 index 6de76fb1156..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo.php +++ /dev/null @@ -1,648 +0,0 @@ -google.api.cloudquotas.v1.QuotaInfo - */ -class QuotaInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name of this QuotaInfo. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The id of the quota, which is unquie within the service. - * Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 2; - */ - protected $quota_id = ''; - /** - * The metric of the quota. It specifies the resources consumption the quota - * is defined for. - * Example: `compute.googleapis.com/cpus` - * - * Generated from protobuf field string metric = 3; - */ - protected $metric = ''; - /** - * The name of the service in which the quota is defined. - * Example: `compute.googleapis.com` - * - * Generated from protobuf field string service = 4; - */ - protected $service = ''; - /** - * Whether this is a precise quota. A precise quota is tracked with absolute - * precision. In contrast, an imprecise quota is not tracked with precision. - * - * Generated from protobuf field bool is_precise = 5; - */ - protected $is_precise = false; - /** - * The reset time interval for the quota. Refresh interval applies to rate - * quota only. - * Example: "minute" for per minute, "day" for per day, or "10 seconds" for - * every 10 seconds. - * - * Generated from protobuf field string refresh_interval = 6; - */ - protected $refresh_interval = ''; - /** - * The container type of the QuotaInfo. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; - */ - protected $container_type = 0; - /** - * The dimensions the quota is defined on. - * - * Generated from protobuf field repeated string dimensions = 8; - */ - private $dimensions; - /** - * The display name of the quota metric - * - * Generated from protobuf field string metric_display_name = 9; - */ - protected $metric_display_name = ''; - /** - * The display name of the quota. - * - * Generated from protobuf field string quota_display_name = 10; - */ - protected $quota_display_name = ''; - /** - * The unit in which the metric value is reported, e.g., "MByte". - * - * Generated from protobuf field string metric_unit = 11; - */ - protected $metric_unit = ''; - /** - * Whether it is eligible to request a higher quota value for this quota. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; - */ - protected $quota_increase_eligibility = null; - /** - * Whether the quota value is fixed or adjustable - * - * Generated from protobuf field bool is_fixed = 13; - */ - protected $is_fixed = false; - /** - * The collection of dimensions info ordered by their dimensions from more - * specific ones to less specific ones. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; - */ - private $dimensions_infos; - /** - * Whether the quota is a concurrent quota. Concurrent quotas are enforced - * on the total number of concurrent operations in flight at any given time. - * - * Generated from protobuf field bool is_concurrent = 15; - */ - protected $is_concurrent = false; - /** - * URI to the page where users can request more quota for the cloud - * service—for example, - * https://console.cloud.google.com/iam-admin/quotas. - * - * Generated from protobuf field string service_request_quota_uri = 17; - */ - protected $service_request_quota_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Resource name of this QuotaInfo. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * @type string $quota_id - * The id of the quota, which is unquie within the service. - * Example: `CpusPerProjectPerRegion` - * @type string $metric - * The metric of the quota. It specifies the resources consumption the quota - * is defined for. - * Example: `compute.googleapis.com/cpus` - * @type string $service - * The name of the service in which the quota is defined. - * Example: `compute.googleapis.com` - * @type bool $is_precise - * Whether this is a precise quota. A precise quota is tracked with absolute - * precision. In contrast, an imprecise quota is not tracked with precision. - * @type string $refresh_interval - * The reset time interval for the quota. Refresh interval applies to rate - * quota only. - * Example: "minute" for per minute, "day" for per day, or "10 seconds" for - * every 10 seconds. - * @type int $container_type - * The container type of the QuotaInfo. - * @type array|\Google\Protobuf\Internal\RepeatedField $dimensions - * The dimensions the quota is defined on. - * @type string $metric_display_name - * The display name of the quota metric - * @type string $quota_display_name - * The display name of the quota. - * @type string $metric_unit - * The unit in which the metric value is reported, e.g., "MByte". - * @type \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility $quota_increase_eligibility - * Whether it is eligible to request a higher quota value for this quota. - * @type bool $is_fixed - * Whether the quota value is fixed or adjustable - * @type array<\Google\Cloud\CloudQuotas\V1\DimensionsInfo>|\Google\Protobuf\Internal\RepeatedField $dimensions_infos - * The collection of dimensions info ordered by their dimensions from more - * specific ones to less specific ones. - * @type bool $is_concurrent - * Whether the quota is a concurrent quota. Concurrent quotas are enforced - * on the total number of concurrent operations in flight at any given time. - * @type string $service_request_quota_uri - * URI to the page where users can request more quota for the cloud - * service—for example, - * https://console.cloud.google.com/iam-admin/quotas. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Resource name of this QuotaInfo. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Resource name of this QuotaInfo. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The id of the quota, which is unquie within the service. - * Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 2; - * @return string - */ - public function getQuotaId() - { - return $this->quota_id; - } - - /** - * The id of the quota, which is unquie within the service. - * Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 2; - * @param string $var - * @return $this - */ - public function setQuotaId($var) - { - GPBUtil::checkString($var, True); - $this->quota_id = $var; - - return $this; - } - - /** - * The metric of the quota. It specifies the resources consumption the quota - * is defined for. - * Example: `compute.googleapis.com/cpus` - * - * Generated from protobuf field string metric = 3; - * @return string - */ - public function getMetric() - { - return $this->metric; - } - - /** - * The metric of the quota. It specifies the resources consumption the quota - * is defined for. - * Example: `compute.googleapis.com/cpus` - * - * Generated from protobuf field string metric = 3; - * @param string $var - * @return $this - */ - public function setMetric($var) - { - GPBUtil::checkString($var, True); - $this->metric = $var; - - return $this; - } - - /** - * The name of the service in which the quota is defined. - * Example: `compute.googleapis.com` - * - * Generated from protobuf field string service = 4; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * The name of the service in which the quota is defined. - * Example: `compute.googleapis.com` - * - * Generated from protobuf field string service = 4; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Whether this is a precise quota. A precise quota is tracked with absolute - * precision. In contrast, an imprecise quota is not tracked with precision. - * - * Generated from protobuf field bool is_precise = 5; - * @return bool - */ - public function getIsPrecise() - { - return $this->is_precise; - } - - /** - * Whether this is a precise quota. A precise quota is tracked with absolute - * precision. In contrast, an imprecise quota is not tracked with precision. - * - * Generated from protobuf field bool is_precise = 5; - * @param bool $var - * @return $this - */ - public function setIsPrecise($var) - { - GPBUtil::checkBool($var); - $this->is_precise = $var; - - return $this; - } - - /** - * The reset time interval for the quota. Refresh interval applies to rate - * quota only. - * Example: "minute" for per minute, "day" for per day, or "10 seconds" for - * every 10 seconds. - * - * Generated from protobuf field string refresh_interval = 6; - * @return string - */ - public function getRefreshInterval() - { - return $this->refresh_interval; - } - - /** - * The reset time interval for the quota. Refresh interval applies to rate - * quota only. - * Example: "minute" for per minute, "day" for per day, or "10 seconds" for - * every 10 seconds. - * - * Generated from protobuf field string refresh_interval = 6; - * @param string $var - * @return $this - */ - public function setRefreshInterval($var) - { - GPBUtil::checkString($var, True); - $this->refresh_interval = $var; - - return $this; - } - - /** - * The container type of the QuotaInfo. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; - * @return int - */ - public function getContainerType() - { - return $this->container_type; - } - - /** - * The container type of the QuotaInfo. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; - * @param int $var - * @return $this - */ - public function setContainerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\CloudQuotas\V1\QuotaInfo\ContainerType::class); - $this->container_type = $var; - - return $this; - } - - /** - * The dimensions the quota is defined on. - * - * Generated from protobuf field repeated string dimensions = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDimensions() - { - return $this->dimensions; - } - - /** - * The dimensions the quota is defined on. - * - * Generated from protobuf field repeated string dimensions = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDimensions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->dimensions = $arr; - - return $this; - } - - /** - * The display name of the quota metric - * - * Generated from protobuf field string metric_display_name = 9; - * @return string - */ - public function getMetricDisplayName() - { - return $this->metric_display_name; - } - - /** - * The display name of the quota metric - * - * Generated from protobuf field string metric_display_name = 9; - * @param string $var - * @return $this - */ - public function setMetricDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->metric_display_name = $var; - - return $this; - } - - /** - * The display name of the quota. - * - * Generated from protobuf field string quota_display_name = 10; - * @return string - */ - public function getQuotaDisplayName() - { - return $this->quota_display_name; - } - - /** - * The display name of the quota. - * - * Generated from protobuf field string quota_display_name = 10; - * @param string $var - * @return $this - */ - public function setQuotaDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->quota_display_name = $var; - - return $this; - } - - /** - * The unit in which the metric value is reported, e.g., "MByte". - * - * Generated from protobuf field string metric_unit = 11; - * @return string - */ - public function getMetricUnit() - { - return $this->metric_unit; - } - - /** - * The unit in which the metric value is reported, e.g., "MByte". - * - * Generated from protobuf field string metric_unit = 11; - * @param string $var - * @return $this - */ - public function setMetricUnit($var) - { - GPBUtil::checkString($var, True); - $this->metric_unit = $var; - - return $this; - } - - /** - * Whether it is eligible to request a higher quota value for this quota. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; - * @return \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility|null - */ - public function getQuotaIncreaseEligibility() - { - return $this->quota_increase_eligibility; - } - - public function hasQuotaIncreaseEligibility() - { - return isset($this->quota_increase_eligibility); - } - - public function clearQuotaIncreaseEligibility() - { - unset($this->quota_increase_eligibility); - } - - /** - * Whether it is eligible to request a higher quota value for this quota. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; - * @param \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility $var - * @return $this - */ - public function setQuotaIncreaseEligibility($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaIncreaseEligibility::class); - $this->quota_increase_eligibility = $var; - - return $this; - } - - /** - * Whether the quota value is fixed or adjustable - * - * Generated from protobuf field bool is_fixed = 13; - * @return bool - */ - public function getIsFixed() - { - return $this->is_fixed; - } - - /** - * Whether the quota value is fixed or adjustable - * - * Generated from protobuf field bool is_fixed = 13; - * @param bool $var - * @return $this - */ - public function setIsFixed($var) - { - GPBUtil::checkBool($var); - $this->is_fixed = $var; - - return $this; - } - - /** - * The collection of dimensions info ordered by their dimensions from more - * specific ones to less specific ones. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDimensionsInfos() - { - return $this->dimensions_infos; - } - - /** - * The collection of dimensions info ordered by their dimensions from more - * specific ones to less specific ones. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; - * @param array<\Google\Cloud\CloudQuotas\V1\DimensionsInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDimensionsInfos($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudQuotas\V1\DimensionsInfo::class); - $this->dimensions_infos = $arr; - - return $this; - } - - /** - * Whether the quota is a concurrent quota. Concurrent quotas are enforced - * on the total number of concurrent operations in flight at any given time. - * - * Generated from protobuf field bool is_concurrent = 15; - * @return bool - */ - public function getIsConcurrent() - { - return $this->is_concurrent; - } - - /** - * Whether the quota is a concurrent quota. Concurrent quotas are enforced - * on the total number of concurrent operations in flight at any given time. - * - * Generated from protobuf field bool is_concurrent = 15; - * @param bool $var - * @return $this - */ - public function setIsConcurrent($var) - { - GPBUtil::checkBool($var); - $this->is_concurrent = $var; - - return $this; - } - - /** - * URI to the page where users can request more quota for the cloud - * service—for example, - * https://console.cloud.google.com/iam-admin/quotas. - * - * Generated from protobuf field string service_request_quota_uri = 17; - * @return string - */ - public function getServiceRequestQuotaUri() - { - return $this->service_request_quota_uri; - } - - /** - * URI to the page where users can request more quota for the cloud - * service—for example, - * https://console.cloud.google.com/iam-admin/quotas. - * - * Generated from protobuf field string service_request_quota_uri = 17; - * @param string $var - * @return $this - */ - public function setServiceRequestQuotaUri($var) - { - GPBUtil::checkString($var, True); - $this->service_request_quota_uri = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php deleted file mode 100644 index d571476865a..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaInfo/ContainerType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.api.cloudquotas.v1.QuotaInfo.ContainerType - */ -class ContainerType -{ - /** - * Unspecified container type. - * - * Generated from protobuf enum CONTAINER_TYPE_UNSPECIFIED = 0; - */ - const CONTAINER_TYPE_UNSPECIFIED = 0; - /** - * consumer project - * - * Generated from protobuf enum PROJECT = 1; - */ - const PROJECT = 1; - /** - * folder - * - * Generated from protobuf enum FOLDER = 2; - */ - const FOLDER = 2; - /** - * organization - * - * Generated from protobuf enum ORGANIZATION = 3; - */ - const ORGANIZATION = 3; - - private static $valueToName = [ - self::CONTAINER_TYPE_UNSPECIFIED => 'CONTAINER_TYPE_UNSPECIFIED', - self::PROJECT => 'PROJECT', - self::FOLDER => 'FOLDER', - self::ORGANIZATION => 'ORGANIZATION', - ]; - - 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(ContainerType::class, \Google\Cloud\CloudQuotas\V1\QuotaInfo_ContainerType::class); - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php deleted file mode 100644 index fde3b44c65a..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaPreference.php +++ /dev/null @@ -1,543 +0,0 @@ -google.api.cloudquotas.v1.QuotaPreference - */ -class QuotaPreference extends \Google\Protobuf\Internal\Message -{ - /** - * Required except in the CREATE requests. - * The resource name of the quota preference. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Immutable. The dimensions that this quota preference applies to. The key of - * the map entry is the name of a dimension, such as "region", "zone", - * "network_id", and the value of the map entry is the dimension value. - * If a dimension is missing from the map of dimensions, the quota preference - * applies to all the dimension values except for those that have other quota - * preferences configured for the specific value. - * NOTE: QuotaPreferences can only be applied across all values of "user" and - * "resource" dimension. Do not set values for "user" or "resource" in the - * dimension map. - * Example: {"provider", "Foo Inc"} where "provider" is a service specific - * dimension. - * - * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $dimensions; - /** - * Required. Preferred quota configuration. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $quota_config = null; - /** - * Optional. The current etag of the quota preference. If an etag is provided - * on update and does not match the current server's etag of the quota - * preference, the request will be blocked and an ABORTED error will be - * returned. See https://google.aip.dev/134#etags for more details on etags. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Required. The name of the service to which the quota preference is applied. - * - * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = ''; - /** - * Required. The id of the quota to which the quota preference is applied. A - * quota name is unique in the service. Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $quota_id = ''; - /** - * Output only. Is the quota preference pending Google Cloud approval and - * fulfillment. - * - * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * The reason / justification for this quota preference. - * - * Generated from protobuf field string justification = 11; - */ - protected $justification = ''; - /** - * Input only. An email address that can be used to contact the the user, in - * case Google Cloud needs more information to make a decision before - * additional quota can be granted. - * When requesting a quota increase, the email address is required. - * When requesting a quota decrease, the email address is optional. - * For example, the email address is optional when the - * `QuotaConfig.preferred_value` is smaller than the - * `QuotaDetails.reset_value`. - * - * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $contact_email = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required except in the CREATE requests. - * The resource name of the quota preference. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` - * @type array|\Google\Protobuf\Internal\MapField $dimensions - * Immutable. The dimensions that this quota preference applies to. The key of - * the map entry is the name of a dimension, such as "region", "zone", - * "network_id", and the value of the map entry is the dimension value. - * If a dimension is missing from the map of dimensions, the quota preference - * applies to all the dimension values except for those that have other quota - * preferences configured for the specific value. - * NOTE: QuotaPreferences can only be applied across all values of "user" and - * "resource" dimension. Do not set values for "user" or "resource" in the - * dimension map. - * Example: {"provider", "Foo Inc"} where "provider" is a service specific - * dimension. - * @type \Google\Cloud\CloudQuotas\V1\QuotaConfig $quota_config - * Required. Preferred quota configuration. - * @type string $etag - * Optional. The current etag of the quota preference. If an etag is provided - * on update and does not match the current server's etag of the quota - * preference, the request will be blocked and an ABORTED error will be - * returned. See https://google.aip.dev/134#etags for more details on etags. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type string $service - * Required. The name of the service to which the quota preference is applied. - * @type string $quota_id - * Required. The id of the quota to which the quota preference is applied. A - * quota name is unique in the service. Example: `CpusPerProjectPerRegion` - * @type bool $reconciling - * Output only. Is the quota preference pending Google Cloud approval and - * fulfillment. - * @type string $justification - * The reason / justification for this quota preference. - * @type string $contact_email - * Input only. An email address that can be used to contact the the user, in - * case Google Cloud needs more information to make a decision before - * additional quota can be granted. - * When requesting a quota increase, the email address is required. - * When requesting a quota decrease, the email address is optional. - * For example, the email address is optional when the - * `QuotaConfig.preferred_value` is smaller than the - * `QuotaDetails.reset_value`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required except in the CREATE requests. - * The resource name of the quota preference. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required except in the CREATE requests. - * The resource name of the quota preference. - * The ID component following "locations/" must be "global". - * Example: - * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Immutable. The dimensions that this quota preference applies to. The key of - * the map entry is the name of a dimension, such as "region", "zone", - * "network_id", and the value of the map entry is the dimension value. - * If a dimension is missing from the map of dimensions, the quota preference - * applies to all the dimension values except for those that have other quota - * preferences configured for the specific value. - * NOTE: QuotaPreferences can only be applied across all values of "user" and - * "resource" dimension. Do not set values for "user" or "resource" in the - * dimension map. - * Example: {"provider", "Foo Inc"} where "provider" is a service specific - * dimension. - * - * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDimensions() - { - return $this->dimensions; - } - - /** - * Immutable. The dimensions that this quota preference applies to. The key of - * the map entry is the name of a dimension, such as "region", "zone", - * "network_id", and the value of the map entry is the dimension value. - * If a dimension is missing from the map of dimensions, the quota preference - * applies to all the dimension values except for those that have other quota - * preferences configured for the specific value. - * NOTE: QuotaPreferences can only be applied across all values of "user" and - * "resource" dimension. Do not set values for "user" or "resource" in the - * dimension map. - * Example: {"provider", "Foo Inc"} where "provider" is a service specific - * dimension. - * - * Generated from protobuf field map dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDimensions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->dimensions = $arr; - - return $this; - } - - /** - * Required. Preferred quota configuration. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\CloudQuotas\V1\QuotaConfig|null - */ - public function getQuotaConfig() - { - return $this->quota_config; - } - - public function hasQuotaConfig() - { - return isset($this->quota_config); - } - - public function clearQuotaConfig() - { - unset($this->quota_config); - } - - /** - * Required. Preferred quota configuration. - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\CloudQuotas\V1\QuotaConfig $var - * @return $this - */ - public function setQuotaConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaConfig::class); - $this->quota_config = $var; - - return $this; - } - - /** - * Optional. The current etag of the quota preference. If an etag is provided - * on update and does not match the current server's etag of the quota - * preference, the request will be blocked and an ABORTED error will be - * returned. See https://google.aip.dev/134#etags for more details on etags. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the quota preference. If an etag is provided - * on update and does not match the current server's etag of the quota - * preference, the request will be blocked and an ABORTED error will be - * returned. See https://google.aip.dev/134#etags for more details on etags. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Required. The name of the service to which the quota preference is applied. - * - * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The name of the service to which the quota preference is applied. - * - * Generated from protobuf field string service = 7 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The id of the quota to which the quota preference is applied. A - * quota name is unique in the service. Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuotaId() - { - return $this->quota_id; - } - - /** - * Required. The id of the quota to which the quota preference is applied. A - * quota name is unique in the service. Example: `CpusPerProjectPerRegion` - * - * Generated from protobuf field string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuotaId($var) - { - GPBUtil::checkString($var, True); - $this->quota_id = $var; - - return $this; - } - - /** - * Output only. Is the quota preference pending Google Cloud approval and - * fulfillment. - * - * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Is the quota preference pending Google Cloud approval and - * fulfillment. - * - * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * The reason / justification for this quota preference. - * - * Generated from protobuf field string justification = 11; - * @return string - */ - public function getJustification() - { - return $this->justification; - } - - /** - * The reason / justification for this quota preference. - * - * Generated from protobuf field string justification = 11; - * @param string $var - * @return $this - */ - public function setJustification($var) - { - GPBUtil::checkString($var, True); - $this->justification = $var; - - return $this; - } - - /** - * Input only. An email address that can be used to contact the the user, in - * case Google Cloud needs more information to make a decision before - * additional quota can be granted. - * When requesting a quota increase, the email address is required. - * When requesting a quota decrease, the email address is optional. - * For example, the email address is optional when the - * `QuotaConfig.preferred_value` is smaller than the - * `QuotaDetails.reset_value`. - * - * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getContactEmail() - { - return $this->contact_email; - } - - /** - * Input only. An email address that can be used to contact the the user, in - * case Google Cloud needs more information to make a decision before - * additional quota can be granted. - * When requesting a quota increase, the email address is required. - * When requesting a quota decrease, the email address is optional. - * For example, the email address is optional when the - * `QuotaConfig.preferred_value` is smaller than the - * `QuotaDetails.reset_value`. - * - * Generated from protobuf field string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setContactEmail($var) - { - GPBUtil::checkString($var, True); - $this->contact_email = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php deleted file mode 100644 index 659dd6869ac..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/QuotaSafetyCheck.php +++ /dev/null @@ -1,63 +0,0 @@ -google.api.cloudquotas.v1.QuotaSafetyCheck - */ -class QuotaSafetyCheck -{ - /** - * Unspecified quota safety check. - * - * Generated from protobuf enum QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; - */ - const QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; - /** - * Validates that a quota mutation would not cause the consumer's effective - * limit to be lower than the consumer's quota usage. - * - * Generated from protobuf enum QUOTA_DECREASE_BELOW_USAGE = 1; - */ - const QUOTA_DECREASE_BELOW_USAGE = 1; - /** - * Validates that a quota mutation would not cause the consumer's effective - * limit to decrease by more than 10 percent. - * - * Generated from protobuf enum QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; - */ - const QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; - - private static $valueToName = [ - self::QUOTA_SAFETY_CHECK_UNSPECIFIED => 'QUOTA_SAFETY_CHECK_UNSPECIFIED', - self::QUOTA_DECREASE_BELOW_USAGE => 'QUOTA_DECREASE_BELOW_USAGE', - self::QUOTA_DECREASE_PERCENTAGE_TOO_HIGH => 'QUOTA_DECREASE_PERCENTAGE_TOO_HIGH', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php deleted file mode 100644 index 1d0c7e5fec5..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/RolloutInfo.php +++ /dev/null @@ -1,67 +0,0 @@ -google.api.cloudquotas.v1.RolloutInfo - */ -class RolloutInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Whether there is an ongoing rollout for a quota or not. - * - * Generated from protobuf field bool ongoing_rollout = 1; - */ - protected $ongoing_rollout = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $ongoing_rollout - * Whether there is an ongoing rollout for a quota or not. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Whether there is an ongoing rollout for a quota or not. - * - * Generated from protobuf field bool ongoing_rollout = 1; - * @return bool - */ - public function getOngoingRollout() - { - return $this->ongoing_rollout; - } - - /** - * Whether there is an ongoing rollout for a quota or not. - * - * Generated from protobuf field bool ongoing_rollout = 1; - * @param bool $var - * @return $this - */ - public function setOngoingRollout($var) - { - GPBUtil::checkBool($var); - $this->ongoing_rollout = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php b/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php deleted file mode 100644 index adb2aaf264f..00000000000 --- a/owl-bot-staging/Quotas/v1/proto/src/Google/Cloud/CloudQuotas/V1/UpdateQuotaPreferenceRequest.php +++ /dev/null @@ -1,270 +0,0 @@ -google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest - */ -class UpdateQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * QuotaPreference resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $quota_preference = null; - /** - * Optional. If set to true, and the quota preference is not found, a new one - * will be created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - /** - * Optional. If set to true, validate the request, but do not actually update. - * Note that a request being valid does not mean that the request is - * guaranteed to be fulfilled. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; - */ - private $ignore_safety_checks; - - /** - * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being updated - * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the - * QuotaPreference resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\CloudQuotas\V1\UpdateQuotaPreferenceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setQuotaPreference($quotaPreference) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * QuotaPreference resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\CloudQuotas\V1\QuotaPreference $quota_preference - * Required. The resource being updated - * @type bool $allow_missing - * Optional. If set to true, and the quota preference is not found, a new one - * will be created. In this situation, `update_mask` is ignored. - * @type bool $validate_only - * Optional. If set to true, validate the request, but do not actually update. - * Note that a request being valid does not mean that the request is - * guaranteed to be fulfilled. - * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_safety_checks - * The list of quota safety checks to be ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * QuotaPreference resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @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. Field mask is used to specify the fields to be overwritten in the - * QuotaPreference resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\CloudQuotas\V1\QuotaPreference|null - */ - public function getQuotaPreference() - { - return $this->quota_preference; - } - - public function hasQuotaPreference() - { - return isset($this->quota_preference); - } - - public function clearQuotaPreference() - { - unset($this->quota_preference); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $var - * @return $this - */ - public function setQuotaPreference($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class); - $this->quota_preference = $var; - - return $this; - } - - /** - * Optional. If set to true, and the quota preference is not found, a new one - * will be created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, and the quota preference is not found, a new one - * will be created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - - /** - * Optional. If set to true, validate the request, but do not actually update. - * Note that a request being valid does not mean that the request is - * guaranteed to be fulfilled. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set to true, validate the request, but do not actually update. - * Note that a request being valid does not mean that the request is - * guaranteed to be fulfilled. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoreSafetyChecks() - { - return $this->ignore_safety_checks; - } - - /** - * The list of quota safety checks to be ignored. - * - * Generated from protobuf field repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoreSafetyChecks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\CloudQuotas\V1\QuotaSafetyCheck::class); - $this->ignore_safety_checks = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php deleted file mode 100644 index 0ce0e304421..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/create_quota_preference.php +++ /dev/null @@ -1,99 +0,0 @@ -setPreferredValue($quotaPreferenceQuotaConfigPreferredValue); - $quotaPreference = (new QuotaPreference()) - ->setQuotaConfig($quotaPreferenceQuotaConfig) - ->setService($quotaPreferenceService) - ->setQuotaId($quotaPreferenceQuotaId); - $request = (new CreateQuotaPreferenceRequest()) - ->setParent($formattedParent) - ->setQuotaPreference($quotaPreference); - - // Call the API and handle any network failures. - try { - /** @var QuotaPreference $response */ - $response = $cloudQuotasClient->createQuotaPreference($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudQuotasClient::locationName('[PROJECT]', '[LOCATION]'); - $quotaPreferenceQuotaConfigPreferredValue = 0; - $quotaPreferenceService = '[SERVICE]'; - $quotaPreferenceQuotaId = '[QUOTA_ID]'; - - create_quota_preference_sample( - $formattedParent, - $quotaPreferenceQuotaConfigPreferredValue, - $quotaPreferenceService, - $quotaPreferenceQuotaId - ); -} -// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php deleted file mode 100644 index 4a0cea6ac5a..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_info.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var QuotaInfo $response */ - $response = $cloudQuotasClient->getQuotaInfo($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudQuotasClient::quotaInfoName( - '[PROJECT]', - '[LOCATION]', - '[SERVICE]', - '[QUOTA_INFO]' - ); - - get_quota_info_sample($formattedName); -} -// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php deleted file mode 100644 index 9ef87f2cde1..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/get_quota_preference.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var QuotaPreference $response */ - $response = $cloudQuotasClient->getQuotaPreference($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudQuotasClient::quotaPreferenceName( - '[PROJECT]', - '[LOCATION]', - '[QUOTA_PREFERENCE]' - ); - - get_quota_preference_sample($formattedName); -} -// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php deleted file mode 100644 index 6b69cee4cc7..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_infos.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudQuotasClient->listQuotaInfos($request); - - /** @var QuotaInfo $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudQuotasClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - - list_quota_infos_sample($formattedParent); -} -// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php deleted file mode 100644 index 54fa1a273da..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/list_quota_preferences.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudQuotasClient->listQuotaPreferences($request); - - /** @var QuotaPreference $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudQuotasClient::locationName('[PROJECT]', '[LOCATION]'); - - list_quota_preferences_sample($formattedParent); -} -// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_sync] diff --git a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php b/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php deleted file mode 100644 index b8e6bc6b5af..00000000000 --- a/owl-bot-staging/Quotas/v1/samples/V1/CloudQuotasClient/update_quota_preference.php +++ /dev/null @@ -1,91 +0,0 @@ -setPreferredValue($quotaPreferenceQuotaConfigPreferredValue); - $quotaPreference = (new QuotaPreference()) - ->setQuotaConfig($quotaPreferenceQuotaConfig) - ->setService($quotaPreferenceService) - ->setQuotaId($quotaPreferenceQuotaId); - $request = (new UpdateQuotaPreferenceRequest()) - ->setQuotaPreference($quotaPreference); - - // Call the API and handle any network failures. - try { - /** @var QuotaPreference $response */ - $response = $cloudQuotasClient->updateQuotaPreference($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $quotaPreferenceQuotaConfigPreferredValue = 0; - $quotaPreferenceService = '[SERVICE]'; - $quotaPreferenceQuotaId = '[QUOTA_ID]'; - - update_quota_preference_sample( - $quotaPreferenceQuotaConfigPreferredValue, - $quotaPreferenceService, - $quotaPreferenceQuotaId - ); -} -// [END cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_sync] diff --git a/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php b/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php deleted file mode 100644 index 5eda6b6500b..00000000000 --- a/owl-bot-staging/Quotas/v1/src/V1/Client/CloudQuotasClient.php +++ /dev/null @@ -1,692 +0,0 @@ - createQuotaPreferenceAsync(CreateQuotaPreferenceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getQuotaInfoAsync(GetQuotaInfoRequest $request, array $optionalArgs = []) - * @method PromiseInterface getQuotaPreferenceAsync(GetQuotaPreferenceRequest $request, array $optionalArgs = []) - * @method PromiseInterface listQuotaInfosAsync(ListQuotaInfosRequest $request, array $optionalArgs = []) - * @method PromiseInterface listQuotaPreferencesAsync(ListQuotaPreferencesRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateQuotaPreferenceAsync(UpdateQuotaPreferenceRequest $request, array $optionalArgs = []) - */ -final class CloudQuotasClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.api.cloudquotas.v1.CloudQuotas'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudquotas.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudquotas.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_quotas_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_quotas_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_quotas_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_quotas_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location resource. - * - * @param string $folder - * @param string $location - * - * @return string The formatted folder_location resource. - */ - public static function folderLocationName(string $folder, string $location): string - { - return self::getPathTemplate('folderLocation')->render([ - 'folder' => $folder, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_quota_preference resource. - * - * @param string $folder - * @param string $location - * @param string $quotaPreference - * - * @return string The formatted folder_location_quota_preference resource. - */ - public static function folderLocationQuotaPreferenceName(string $folder, string $location, string $quotaPreference): string - { - return self::getPathTemplate('folderLocationQuotaPreference')->render([ - 'folder' => $folder, - 'location' => $location, - 'quota_preference' => $quotaPreference, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_service resource. - * - * @param string $folder - * @param string $location - * @param string $service - * - * @return string The formatted folder_location_service resource. - */ - public static function folderLocationServiceName(string $folder, string $location, string $service): string - { - return self::getPathTemplate('folderLocationService')->render([ - 'folder' => $folder, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_service_quota_info resource. - * - * @param string $folder - * @param string $location - * @param string $service - * @param string $quotaInfo - * - * @return string The formatted folder_location_service_quota_info resource. - */ - public static function folderLocationServiceQuotaInfoName(string $folder, string $location, string $service, string $quotaInfo): string - { - return self::getPathTemplate('folderLocationServiceQuotaInfo')->render([ - 'folder' => $folder, - 'location' => $location, - 'service' => $service, - 'quota_info' => $quotaInfo, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location resource. - * - * @param string $organization - * @param string $location - * - * @return string The formatted organization_location resource. - */ - public static function organizationLocationName(string $organization, string $location): string - { - return self::getPathTemplate('organizationLocation')->render([ - 'organization' => $organization, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_quota_preference resource. - * - * @param string $organization - * @param string $location - * @param string $quotaPreference - * - * @return string The formatted organization_location_quota_preference resource. - */ - public static function organizationLocationQuotaPreferenceName(string $organization, string $location, string $quotaPreference): string - { - return self::getPathTemplate('organizationLocationQuotaPreference')->render([ - 'organization' => $organization, - 'location' => $location, - 'quota_preference' => $quotaPreference, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_service resource. - * - * @param string $organization - * @param string $location - * @param string $service - * - * @return string The formatted organization_location_service resource. - */ - public static function organizationLocationServiceName(string $organization, string $location, string $service): string - { - return self::getPathTemplate('organizationLocationService')->render([ - 'organization' => $organization, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_service_quota_info resource. - * - * @param string $organization - * @param string $location - * @param string $service - * @param string $quotaInfo - * - * @return string The formatted organization_location_service_quota_info resource. - */ - public static function organizationLocationServiceQuotaInfoName(string $organization, string $location, string $service, string $quotaInfo): string - { - return self::getPathTemplate('organizationLocationServiceQuotaInfo')->render([ - 'organization' => $organization, - 'location' => $location, - 'service' => $service, - 'quota_info' => $quotaInfo, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted project_location resource. - */ - public static function projectLocationName(string $project, string $location): string - { - return self::getPathTemplate('projectLocation')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_quota_preference resource. - * - * @param string $project - * @param string $location - * @param string $quotaPreference - * - * @return string The formatted project_location_quota_preference resource. - */ - public static function projectLocationQuotaPreferenceName(string $project, string $location, string $quotaPreference): string - { - return self::getPathTemplate('projectLocationQuotaPreference')->render([ - 'project' => $project, - 'location' => $location, - 'quota_preference' => $quotaPreference, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_service resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted project_location_service resource. - */ - public static function projectLocationServiceName(string $project, string $location, string $service): string - { - return self::getPathTemplate('projectLocationService')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_service_quota_info resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $quotaInfo - * - * @return string The formatted project_location_service_quota_info resource. - */ - public static function projectLocationServiceQuotaInfoName(string $project, string $location, string $service, string $quotaInfo): string - { - return self::getPathTemplate('projectLocationServiceQuotaInfo')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'quota_info' => $quotaInfo, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a quota_info - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $quotaInfo - * - * @return string The formatted quota_info resource. - */ - public static function quotaInfoName(string $project, string $location, string $service, string $quotaInfo): string - { - return self::getPathTemplate('quotaInfo')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'quota_info' => $quotaInfo, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * quota_preference resource. - * - * @param string $project - * @param string $location - * @param string $quotaPreference - * - * @return string The formatted quota_preference resource. - */ - public static function quotaPreferenceName(string $project, string $location, string $quotaPreference): string - { - return self::getPathTemplate('quotaPreference')->render([ - 'project' => $project, - 'location' => $location, - 'quota_preference' => $quotaPreference, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderLocation: folders/{folder}/locations/{location} - * - folderLocationQuotaPreference: folders/{folder}/locations/{location}/quotaPreferences/{quota_preference} - * - folderLocationService: folders/{folder}/locations/{location}/services/{service} - * - folderLocationServiceQuotaInfo: folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info} - * - location: projects/{project}/locations/{location} - * - organizationLocation: organizations/{organization}/locations/{location} - * - organizationLocationQuotaPreference: organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference} - * - organizationLocationService: organizations/{organization}/locations/{location}/services/{service} - * - organizationLocationServiceQuotaInfo: organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info} - * - projectLocation: projects/{project}/locations/{location} - * - projectLocationQuotaPreference: projects/{project}/locations/{location}/quotaPreferences/{quota_preference} - * - projectLocationService: projects/{project}/locations/{location}/services/{service} - * - projectLocationServiceQuotaInfo: projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info} - * - quotaInfo: projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info} - * - quotaPreference: projects/{project}/locations/{location}/quotaPreferences/{quota_preference} - * - service: projects/{project}/locations/{location}/services/{service} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudquotas.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new QuotaPreference that declares the desired value for a quota. - * - * The async variant is {@see CloudQuotasClient::createQuotaPreferenceAsync()} . - * - * @example samples/V1/CloudQuotasClient/create_quota_preference.php - * - * @param CreateQuotaPreferenceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 QuotaPreference - * - * @throws ApiException Thrown if the API call fails. - */ - public function createQuotaPreference(CreateQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference - { - return $this->startApiCall('CreateQuotaPreference', $request, $callOptions)->wait(); - } - - /** - * Retrieve the QuotaInfo of a quota for a project, folder or organization. - * - * The async variant is {@see CloudQuotasClient::getQuotaInfoAsync()} . - * - * @example samples/V1/CloudQuotasClient/get_quota_info.php - * - * @param GetQuotaInfoRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 QuotaInfo - * - * @throws ApiException Thrown if the API call fails. - */ - public function getQuotaInfo(GetQuotaInfoRequest $request, array $callOptions = []): QuotaInfo - { - return $this->startApiCall('GetQuotaInfo', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single QuotaPreference. - * - * The async variant is {@see CloudQuotasClient::getQuotaPreferenceAsync()} . - * - * @example samples/V1/CloudQuotasClient/get_quota_preference.php - * - * @param GetQuotaPreferenceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 QuotaPreference - * - * @throws ApiException Thrown if the API call fails. - */ - public function getQuotaPreference(GetQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference - { - return $this->startApiCall('GetQuotaPreference', $request, $callOptions)->wait(); - } - - /** - * Lists QuotaInfos of all quotas for a given project, folder or organization. - * - * The async variant is {@see CloudQuotasClient::listQuotaInfosAsync()} . - * - * @example samples/V1/CloudQuotasClient/list_quota_infos.php - * - * @param ListQuotaInfosRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listQuotaInfos(ListQuotaInfosRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListQuotaInfos', $request, $callOptions); - } - - /** - * Lists QuotaPreferences in a given project, folder or organization. - * - * The async variant is {@see CloudQuotasClient::listQuotaPreferencesAsync()} . - * - * @example samples/V1/CloudQuotasClient/list_quota_preferences.php - * - * @param ListQuotaPreferencesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listQuotaPreferences(ListQuotaPreferencesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListQuotaPreferences', $request, $callOptions); - } - - /** - * Updates the parameters of a single QuotaPreference. It can updates the - * config in any states, not just the ones pending approval. - * - * The async variant is {@see CloudQuotasClient::updateQuotaPreferenceAsync()} . - * - * @example samples/V1/CloudQuotasClient/update_quota_preference.php - * - * @param UpdateQuotaPreferenceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 QuotaPreference - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateQuotaPreference(UpdateQuotaPreferenceRequest $request, array $callOptions = []): QuotaPreference - { - return $this->startApiCall('UpdateQuotaPreference', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 79ee8e757db..00000000000 --- a/owl-bot-staging/Quotas/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.api.cloudquotas.v1", - "libraryPackage": "Google\\Cloud\\CloudQuotas\\V1", - "services": { - "CloudQuotas": { - "clients": { - "grpc": { - "libraryClient": "CloudQuotasGapicClient", - "rpcs": { - "CreateQuotaPreference": { - "methods": [ - "createQuotaPreference" - ] - }, - "GetQuotaInfo": { - "methods": [ - "getQuotaInfo" - ] - }, - "GetQuotaPreference": { - "methods": [ - "getQuotaPreference" - ] - }, - "ListQuotaInfos": { - "methods": [ - "listQuotaInfos" - ] - }, - "ListQuotaPreferences": { - "methods": [ - "listQuotaPreferences" - ] - }, - "UpdateQuotaPreference": { - "methods": [ - "updateQuotaPreference" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json deleted file mode 100644 index ae40b97f70f..00000000000 --- a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_client_config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "interfaces": { - "google.api.cloudquotas.v1.CloudQuotas": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateQuotaPreference": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQuotaInfo": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQuotaPreference": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListQuotaInfos": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListQuotaPreferences": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateQuotaPreference": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php deleted file mode 100644 index 41d398d899d..00000000000 --- a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_descriptor_config.php +++ /dev/null @@ -1,135 +0,0 @@ - [ - 'google.api.cloudquotas.v1.CloudQuotas' => [ - 'CreateQuotaPreference' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetQuotaInfo' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaInfo', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetQuotaPreference' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListQuotaInfos' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getQuotaInfos', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\ListQuotaInfosResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListQuotaPreferences' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getQuotaPreferences', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\ListQuotaPreferencesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateQuotaPreference' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\CloudQuotas\V1\QuotaPreference', - 'headerParams' => [ - [ - 'keyName' => 'quota_preference.name', - 'fieldAccessors' => [ - 'getQuotaPreference', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'folderLocation' => 'folders/{folder}/locations/{location}', - 'folderLocationQuotaPreference' => 'folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}', - 'folderLocationService' => 'folders/{folder}/locations/{location}/services/{service}', - 'folderLocationServiceQuotaInfo' => 'folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}', - 'location' => 'projects/{project}/locations/{location}', - 'organizationLocation' => 'organizations/{organization}/locations/{location}', - 'organizationLocationQuotaPreference' => 'organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}', - 'organizationLocationService' => 'organizations/{organization}/locations/{location}/services/{service}', - 'organizationLocationServiceQuotaInfo' => 'organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}', - 'projectLocation' => 'projects/{project}/locations/{location}', - 'projectLocationQuotaPreference' => 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}', - 'projectLocationService' => 'projects/{project}/locations/{location}/services/{service}', - 'projectLocationServiceQuotaInfo' => 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}', - 'quotaInfo' => 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}', - 'quotaPreference' => 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}', - 'service' => 'projects/{project}/locations/{location}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php b/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php deleted file mode 100644 index b9078725af7..00000000000 --- a/owl-bot-staging/Quotas/v1/src/V1/resources/cloud_quotas_rest_client_config.php +++ /dev/null @@ -1,162 +0,0 @@ - [ - 'google.api.cloudquotas.v1.CloudQuotas' => [ - 'CreateQuotaPreference' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/quotaPreferences', - 'body' => 'quota_preference', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/quotaPreferences', - 'body' => 'quota_preference', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/quotaPreferences', - 'body' => 'quota_preference', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetQuotaInfo' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetQuotaPreference' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/quotaPreferences/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/quotaPreferences/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/quotaPreferences/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListQuotaInfos' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/services/*}/quotaInfos', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/services/*}/quotaInfos', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/services/*}/quotaInfos', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListQuotaPreferences' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/quotaPreferences', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/quotaPreferences', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/quotaPreferences', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateQuotaPreference' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}', - 'body' => 'quota_preference', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}', - 'body' => 'quota_preference', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}', - 'body' => 'quota_preference', - ], - ], - 'placeholders' => [ - 'quota_preference.name' => [ - 'getters' => [ - 'getQuotaPreference', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php b/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php deleted file mode 100644 index 136af5b7439..00000000000 --- a/owl-bot-staging/Quotas/v1/tests/Unit/V1/Client/CloudQuotasClientTest.php +++ /dev/null @@ -1,620 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudQuotasClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudQuotasClient($options); - } - - /** @test */ - public function createQuotaPreferenceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $service = 'service1984153269'; - $quotaId = 'quotaId-879230910'; - $reconciling = false; - $justification = 'justification1864993522'; - $contactEmail = 'contactEmail947010237'; - $expectedResponse = new QuotaPreference(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setService($service); - $expectedResponse->setQuotaId($quotaId); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setJustification($justification); - $expectedResponse->setContactEmail($contactEmail); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $quotaPreference = new QuotaPreference(); - $quotaPreferenceQuotaConfig = new QuotaConfig(); - $quotaConfigPreferredValue = 557434902; - $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); - $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); - $quotaPreferenceService = 'quotaPreferenceService-1057995326'; - $quotaPreference->setService($quotaPreferenceService); - $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; - $quotaPreference->setQuotaId($quotaPreferenceQuotaId); - $request = (new CreateQuotaPreferenceRequest()) - ->setParent($formattedParent) - ->setQuotaPreference($quotaPreference); - $response = $gapicClient->createQuotaPreference($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQuotaPreference(); - $this->assertProtobufEquals($quotaPreference, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQuotaPreferenceExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $quotaPreference = new QuotaPreference(); - $quotaPreferenceQuotaConfig = new QuotaConfig(); - $quotaConfigPreferredValue = 557434902; - $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); - $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); - $quotaPreferenceService = 'quotaPreferenceService-1057995326'; - $quotaPreference->setService($quotaPreferenceService); - $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; - $quotaPreference->setQuotaId($quotaPreferenceQuotaId); - $request = (new CreateQuotaPreferenceRequest()) - ->setParent($formattedParent) - ->setQuotaPreference($quotaPreference); - try { - $gapicClient->createQuotaPreference($request); - // 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 getQuotaInfoTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $quotaId = 'quotaId-879230910'; - $metric = 'metric-1077545552'; - $service = 'service1984153269'; - $isPrecise = true; - $refreshInterval = 'refreshInterval1816824233'; - $metricDisplayName = 'metricDisplayName900625943'; - $quotaDisplayName = 'quotaDisplayName-1616924081'; - $metricUnit = 'metricUnit-1737381197'; - $isFixed = false; - $isConcurrent = true; - $serviceRequestQuotaUri = 'serviceRequestQuotaUri-773207445'; - $expectedResponse = new QuotaInfo(); - $expectedResponse->setName($name2); - $expectedResponse->setQuotaId($quotaId); - $expectedResponse->setMetric($metric); - $expectedResponse->setService($service); - $expectedResponse->setIsPrecise($isPrecise); - $expectedResponse->setRefreshInterval($refreshInterval); - $expectedResponse->setMetricDisplayName($metricDisplayName); - $expectedResponse->setQuotaDisplayName($quotaDisplayName); - $expectedResponse->setMetricUnit($metricUnit); - $expectedResponse->setIsFixed($isFixed); - $expectedResponse->setIsConcurrent($isConcurrent); - $expectedResponse->setServiceRequestQuotaUri($serviceRequestQuotaUri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->quotaInfoName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[QUOTA_INFO]'); - $request = (new GetQuotaInfoRequest()) - ->setName($formattedName); - $response = $gapicClient->getQuotaInfo($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/GetQuotaInfo', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQuotaInfoExceptionTest() - { - $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->quotaInfoName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[QUOTA_INFO]'); - $request = (new GetQuotaInfoRequest()) - ->setName($formattedName); - try { - $gapicClient->getQuotaInfo($request); - // 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 getQuotaPreferenceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $service = 'service1984153269'; - $quotaId = 'quotaId-879230910'; - $reconciling = false; - $justification = 'justification1864993522'; - $contactEmail = 'contactEmail947010237'; - $expectedResponse = new QuotaPreference(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setService($service); - $expectedResponse->setQuotaId($quotaId); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setJustification($justification); - $expectedResponse->setContactEmail($contactEmail); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->quotaPreferenceName('[PROJECT]', '[LOCATION]', '[QUOTA_PREFERENCE]'); - $request = (new GetQuotaPreferenceRequest()) - ->setName($formattedName); - $response = $gapicClient->getQuotaPreference($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/GetQuotaPreference', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQuotaPreferenceExceptionTest() - { - $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->quotaPreferenceName('[PROJECT]', '[LOCATION]', '[QUOTA_PREFERENCE]'); - $request = (new GetQuotaPreferenceRequest()) - ->setName($formattedName); - try { - $gapicClient->getQuotaPreference($request); - // 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 listQuotaInfosTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $quotaInfosElement = new QuotaInfo(); - $quotaInfos = [ - $quotaInfosElement, - ]; - $expectedResponse = new ListQuotaInfosResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQuotaInfos($quotaInfos); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListQuotaInfosRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listQuotaInfos($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQuotaInfos()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/ListQuotaInfos', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQuotaInfosExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListQuotaInfosRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listQuotaInfos($request); - // 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 listQuotaPreferencesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $quotaPreferencesElement = new QuotaPreference(); - $quotaPreferences = [ - $quotaPreferencesElement, - ]; - $expectedResponse = new ListQuotaPreferencesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQuotaPreferences($quotaPreferences); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListQuotaPreferencesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listQuotaPreferences($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQuotaPreferences()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/ListQuotaPreferences', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQuotaPreferencesExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListQuotaPreferencesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listQuotaPreferences($request); - // 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 updateQuotaPreferenceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $service = 'service1984153269'; - $quotaId = 'quotaId-879230910'; - $reconciling = false; - $justification = 'justification1864993522'; - $contactEmail = 'contactEmail947010237'; - $expectedResponse = new QuotaPreference(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setService($service); - $expectedResponse->setQuotaId($quotaId); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setJustification($justification); - $expectedResponse->setContactEmail($contactEmail); - $transport->addResponse($expectedResponse); - // Mock request - $quotaPreference = new QuotaPreference(); - $quotaPreferenceQuotaConfig = new QuotaConfig(); - $quotaConfigPreferredValue = 557434902; - $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); - $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); - $quotaPreferenceService = 'quotaPreferenceService-1057995326'; - $quotaPreference->setService($quotaPreferenceService); - $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; - $quotaPreference->setQuotaId($quotaPreferenceQuotaId); - $request = (new UpdateQuotaPreferenceRequest()) - ->setQuotaPreference($quotaPreference); - $response = $gapicClient->updateQuotaPreference($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/UpdateQuotaPreference', $actualFuncCall); - $actualValue = $actualRequestObject->getQuotaPreference(); - $this->assertProtobufEquals($quotaPreference, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQuotaPreferenceExceptionTest() - { - $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 - $quotaPreference = new QuotaPreference(); - $quotaPreferenceQuotaConfig = new QuotaConfig(); - $quotaConfigPreferredValue = 557434902; - $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); - $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); - $quotaPreferenceService = 'quotaPreferenceService-1057995326'; - $quotaPreference->setService($quotaPreferenceService); - $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; - $quotaPreference->setQuotaId($quotaPreferenceQuotaId); - $request = (new UpdateQuotaPreferenceRequest()) - ->setQuotaPreference($quotaPreference); - try { - $gapicClient->updateQuotaPreference($request); - // 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 createQuotaPreferenceAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $service = 'service1984153269'; - $quotaId = 'quotaId-879230910'; - $reconciling = false; - $justification = 'justification1864993522'; - $contactEmail = 'contactEmail947010237'; - $expectedResponse = new QuotaPreference(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setService($service); - $expectedResponse->setQuotaId($quotaId); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setJustification($justification); - $expectedResponse->setContactEmail($contactEmail); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $quotaPreference = new QuotaPreference(); - $quotaPreferenceQuotaConfig = new QuotaConfig(); - $quotaConfigPreferredValue = 557434902; - $quotaPreferenceQuotaConfig->setPreferredValue($quotaConfigPreferredValue); - $quotaPreference->setQuotaConfig($quotaPreferenceQuotaConfig); - $quotaPreferenceService = 'quotaPreferenceService-1057995326'; - $quotaPreference->setService($quotaPreferenceService); - $quotaPreferenceQuotaId = 'quotaPreferenceQuotaId1917192384'; - $quotaPreference->setQuotaId($quotaPreferenceQuotaId); - $request = (new CreateQuotaPreferenceRequest()) - ->setParent($formattedParent) - ->setQuotaPreference($quotaPreference); - $response = $gapicClient->createQuotaPreferenceAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQuotaPreference(); - $this->assertProtobufEquals($quotaPreference, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/ApiEntities.php deleted file mode 100644 index 60d444872fd1ae6ba2a52434d861b373fb792d28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2874 zcmc&$-EQMV6efTDnY7(t3YdamC@XDN>^e#T30%6nPU1!uZJbTKg{~r5jy+Ayy0+z? zh_K3&@CID*3S1%a6kPWaxZ;e*al&pRQn(;j&dfRAIp>@2%$%y0JB*3P3<=YMk1dLlM?x-4;TZ;BExQ1RFm_)=Q&l@?UW;$MM z)dIt}tt)#3n6~E{VMxO8invj2T(7~F4xe^plTb+FAmkcXB=ilF;C8ohN+QEDB4f}_ zAO}qfIp{5c9Guk;5i%VJf+gRUQ)KiKVfgv+(6LP%Mv#b!@7kemyAauM>>r`nBYa^v zAp!r_Z7*Wiq{(CIpt>fh-p34++TQg&Am<3ra_myRfUAMxMkH_zXV4;{8Q6a01zj)| z#Sw`zmg!3Mej1j-*%!FVaumhal03pu5R=8|7zZSZ1NSh=n*vO;ufYur0xyGOn>bd3 zTpDBB3q)~V)f{A*YmcOdys}qDhi1dUM#hzYbHs$khmY)(G|93uj*dZY)vPL7<303i z1s(neopDv>EF>ZomWfmt*Z1B_!+_{&L0Uc&>)uD{Rw7+E@>(>jks0joqjEcjs@1S> z8ZP%1Dw|$FbjBf{!@24vwK?nimn0y|ZT?(Gn@!JghzTO%wos9F3G?SZ2he~($LcgX zp9j$L!Jd%TH%m>(=x-GMkP6f*_Mx>>ufl3xDq3@lA#p;!hzk(r@hr?g(kNu<3nvKz zbZ0Q(cF~q)hrVM>^rWN`rG)Zir9A^}$FC)e@1i>)3C6Zbbi*{g*p2x0)Ou|gn=eSj zZ_xj&z7NnY`N0Rih^5m@C(@bACYThsQ&gfoMtB5&cMiV#H)ZrG01Ng$+A$p)ZZdsL zf{>KR*$(LAr`NTw#H#18HTuhTf_yyF+?C2u6U|1 z$X>UMNyzU2Xo;(!4H7$s9tSpmhZeQ>5S15Cu#5^X$RyR`HY$w`CuS<#6!Tx^_J7Nv zQbHB?HhQzKNt&!b>-4*FQ#n@TR^<)u9mKI^rK4zybfP?0I_*kszTT6i*14{!`m?@V z$%AAn%)TeLmA)qT0HpwVZn0IVsVQf2r8r;dO5oV4lsFFUFq@WqB5O3t8posE*;-RQ zJyrUBMeTs~I(G+^*^b=nslCdEIKGxbR9|{ku!e(MA{5|>tYv!V9zhR&56p(Om+9BE z=6GiE9>Ut}b6QJJzzbkC`=0LqR76N}U5`Fop8G#`fA^K{f3muS=lTDw{oAM*O?<-B zw!c*yF5qbZa9dG!P?5S(EotZ7R~7jo+DleX$tRc#oV06-k`Khwr9dGrAEw(?OlDhs1gm(D8P-1AFz zf2VH-mG8(~KDmL$VR&0stv@_mzV&my+D=9}AsOX_9$;Cgv*}RErbFSZ{`<^ykdA$9 z?z_Qw0E6Fk{!<1liV3nPE`t`uv-)ric#pi#?qyTO12$PL3}WemN F=r3eSq*(v} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php deleted file mode 100644 index 72bb8c1dc62..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/GPBMetadata/Google/Cloud/Rapidmigrationassessment/V1/Rapidmigrationassessment.php +++ /dev/null @@ -1,121 +0,0 @@ -internalAddGeneratedFile( - ' -�& -Ggoogle/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto(google.cloud.rapidmigrationassessment.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto;google/cloud/rapidmigrationassessment/v1/api_entities.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� -CreateAnnotationRequest9 -parent ( B)�A�A# -!locations.googleapis.com/LocationM - -annotation ( 24.google.cloud.rapidmigrationassessment.v1.AnnotationB�A - -request_id ( B�A"` -GetAnnotationRequestH -name ( B:�A�A4 -2rapidmigrationassessment.googleapis.com/Annotation"� -CreateCollectorRequest9 -parent ( B)�A�A# -!locations.googleapis.com/Location - collector_id ( B�AK - collector ( 23.google.cloud.rapidmigrationassessment.v1.CollectorB�A - -request_id ( B�A"� -ListCollectorsRequest9 -parent ( B)�A�A# -!locations.googleapis.com/Location - page_size ( - -page_token (  -filter (  -order_by ( "� -ListCollectorsResponseG - -collectors ( 23.google.cloud.rapidmigrationassessment.v1.Collector -next_page_token (  - unreachable ( "^ -GetCollectorRequestG -name ( B9�A�A3 -1rapidmigrationassessment.googleapis.com/Collector"z -DeleteCollectorRequestG -name ( B9�A�A3 -1rapidmigrationassessment.googleapis.com/Collector - -request_id ( B�A"� -UpdateCollectorRequest4 - update_mask ( 2.google.protobuf.FieldMaskB�AK - collector ( 23.google.cloud.rapidmigrationassessment.v1.CollectorB�A - -request_id ( B�A"z -ResumeCollectorRequestG -name ( B9�A�A3 -1rapidmigrationassessment.googleapis.com/Collector - -request_id ( B�A"| -RegisterCollectorRequestG -name ( B9�A�A3 -1rapidmigrationassessment.googleapis.com/Collector - -request_id ( B�A"y -PauseCollectorRequestG -name ( B9�A�A3 -1rapidmigrationassessment.googleapis.com/Collector - -request_id ( B�A"� -OperationMetadata4 - create_time ( 2.google.protobuf.TimestampB�A1 -end_time ( 2.google.protobuf.TimestampB�A -target ( B�A -verb ( B�A -status_message ( B�A# -requested_cancellation (B�A - api_version ( B�A2� -RapidMigrationAssessment� -CreateCollector@.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.google.longrunning.Operation"��A - CollectorOperationMetadata�Aparent,collector,collector_id���;"./v1/{parent=projects/*/locations/*}/collectors: collector� -CreateAnnotationA.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.google.longrunning.Operation"y�A - -AnnotationOperationMetadata�Aparent,annotation���="//v1/{parent=projects/*/locations/*}/annotations: -annotation� - GetAnnotation>.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest4.google.cloud.rapidmigrationassessment.v1.Annotation">�Aname���1//v1/{name=projects/*/locations/*/annotations/*}� -ListCollectors?.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest@.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse"?�Aparent���0./v1/{parent=projects/*/locations/*}/collectors� - GetCollector=.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest3.google.cloud.rapidmigrationassessment.v1.Collector"=�Aname���0./v1/{name=projects/*/locations/*/collectors/*}� -UpdateCollector@.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.google.longrunning.Operation"��A - CollectorOperationMetadata�Acollector,update_mask���E28/v1/{collector.name=projects/*/locations/*/collectors/*}: collector� -DeleteCollector@.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.google.longrunning.Operation"^�A - CollectorOperationMetadata�Aname���0*./v1/{name=projects/*/locations/*/collectors/*}� -ResumeCollector@.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.google.longrunning.Operation"h�A - CollectorOperationMetadata�Aname���:"5/v1/{name=projects/*/locations/*/collectors/*}:resume:*� -RegisterCollectorB.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.google.longrunning.Operation"j�A - CollectorOperationMetadata�Aname���<"7/v1/{name=projects/*/locations/*/collectors/*}:register:*� -PauseCollector?.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.google.longrunning.Operation"g�A - CollectorOperationMetadata�Aname���9"4/v1/{name=projects/*/locations/*/collectors/*}:pause:*[�A\'rapidmigrationassessment.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -,com.google.cloud.rapidmigrationassessment.v1BRapidMigrationAssessmentProtoPZhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb�(Google.Cloud.RapidMigrationAssessment.V1�(Google\\Cloud\\RapidMigrationAssessment\\V1�+Google::Cloud::RapidMigrationAssessment::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php deleted file mode 100644 index c4f66f0d672..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.Annotation - */ -class Annotation extends \Google\Protobuf\Internal\Message -{ - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Type of an annotation. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * name of resource. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs. - * @type int $type - * Type of an annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); - parent::__construct($data); - } - - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - * @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; - } - - /** - * Type of an annotation. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Type of an annotation. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RapidMigrationAssessment\V1\Annotation\Type::class); - $this->type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php deleted file mode 100644 index c5f5dabc798..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Annotation/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.Annotation.Type - */ -class Type -{ - /** - * Unknown type - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Indicates that this project has opted into StratoZone export. - * - * Generated from protobuf enum TYPE_LEGACY_EXPORT_CONSENT = 1; - */ - const TYPE_LEGACY_EXPORT_CONSENT = 1; - /** - * Indicates that this project is created by Qwiklab. - * - * Generated from protobuf enum TYPE_QWIKLAB = 2; - */ - const TYPE_QWIKLAB = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::TYPE_LEGACY_EXPORT_CONSENT => 'TYPE_LEGACY_EXPORT_CONSENT', - self::TYPE_QWIKLAB => 'TYPE_QWIKLAB', - ]; - - 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(Type::class, \Google\Cloud\RapidMigrationAssessment\V1\Annotation_Type::class); - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php deleted file mode 100644 index bee99c1a431..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector.php +++ /dev/null @@ -1,587 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.Collector - */ -class Collector extends \Google\Protobuf\Internal\Message -{ - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * User specified name of the Collector. - * - * Generated from protobuf field string display_name = 5; - */ - protected $display_name = ''; - /** - * User specified description of the Collector. - * - * Generated from protobuf field string description = 6; - */ - protected $description = ''; - /** - * Service Account email used to ingest data to this Collector. - * - * Generated from protobuf field string service_account = 7; - */ - protected $service_account = ''; - /** - * Output only. Store cloud storage bucket name (which is a guid) created with - * this Collector. - * - * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $bucket = ''; - /** - * User specified expected asset count. - * - * Generated from protobuf field int64 expected_asset_count = 9; - */ - protected $expected_asset_count = 0; - /** - * Output only. State of the Collector. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Client version. - * - * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $client_version = ''; - /** - * Output only. Reference to MC Source Guest Os Scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $guest_os_scan = null; - /** - * Output only. Reference to MC Source vsphere_scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $vsphere_scan = null; - /** - * How many days to collect data. - * - * Generated from protobuf field int32 collection_days = 14; - */ - protected $collection_days = 0; - /** - * Uri for EULA (End User License Agreement) from customer. - * - * Generated from protobuf field string eula_uri = 15; - */ - protected $eula_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * name of resource. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs. - * @type string $display_name - * User specified name of the Collector. - * @type string $description - * User specified description of the Collector. - * @type string $service_account - * Service Account email used to ingest data to this Collector. - * @type string $bucket - * Output only. Store cloud storage bucket name (which is a guid) created with - * this Collector. - * @type int|string $expected_asset_count - * User specified expected asset count. - * @type int $state - * Output only. State of the Collector. - * @type string $client_version - * Output only. Client version. - * @type \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan $guest_os_scan - * Output only. Reference to MC Source Guest Os Scan. - * @type \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan $vsphere_scan - * Output only. Reference to MC Source vsphere_scan. - * @type int $collection_days - * How many days to collect data. - * @type string $eula_uri - * Uri for EULA (End User License Agreement) from customer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); - parent::__construct($data); - } - - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * name of resource. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Create time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time stamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs. - * - * Generated from protobuf field map labels = 4; - * @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; - } - - /** - * User specified name of the Collector. - * - * Generated from protobuf field string display_name = 5; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User specified name of the Collector. - * - * Generated from protobuf field string display_name = 5; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * User specified description of the Collector. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User specified description of the Collector. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Service Account email used to ingest data to this Collector. - * - * Generated from protobuf field string service_account = 7; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Service Account email used to ingest data to this Collector. - * - * Generated from protobuf field string service_account = 7; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Output only. Store cloud storage bucket name (which is a guid) created with - * this Collector. - * - * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Output only. Store cloud storage bucket name (which is a guid) created with - * this Collector. - * - * Generated from protobuf field string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * User specified expected asset count. - * - * Generated from protobuf field int64 expected_asset_count = 9; - * @return int|string - */ - public function getExpectedAssetCount() - { - return $this->expected_asset_count; - } - - /** - * User specified expected asset count. - * - * Generated from protobuf field int64 expected_asset_count = 9; - * @param int|string $var - * @return $this - */ - public function setExpectedAssetCount($var) - { - GPBUtil::checkInt64($var); - $this->expected_asset_count = $var; - - return $this; - } - - /** - * Output only. State of the Collector. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. State of the Collector. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Client version. - * - * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getClientVersion() - { - return $this->client_version; - } - - /** - * Output only. Client version. - * - * Generated from protobuf field string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setClientVersion($var) - { - GPBUtil::checkString($var, True); - $this->client_version = $var; - - return $this; - } - - /** - * Output only. Reference to MC Source Guest Os Scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan|null - */ - public function getGuestOsScan() - { - return $this->guest_os_scan; - } - - public function hasGuestOsScan() - { - return isset($this->guest_os_scan); - } - - public function clearGuestOsScan() - { - unset($this->guest_os_scan); - } - - /** - * Output only. Reference to MC Source Guest Os Scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan $var - * @return $this - */ - public function setGuestOsScan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\GuestOsScan::class); - $this->guest_os_scan = $var; - - return $this; - } - - /** - * Output only. Reference to MC Source vsphere_scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan|null - */ - public function getVsphereScan() - { - return $this->vsphere_scan; - } - - public function hasVsphereScan() - { - return isset($this->vsphere_scan); - } - - public function clearVsphereScan() - { - unset($this->vsphere_scan); - } - - /** - * Output only. Reference to MC Source vsphere_scan. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan $var - * @return $this - */ - public function setVsphereScan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\VSphereScan::class); - $this->vsphere_scan = $var; - - return $this; - } - - /** - * How many days to collect data. - * - * Generated from protobuf field int32 collection_days = 14; - * @return int - */ - public function getCollectionDays() - { - return $this->collection_days; - } - - /** - * How many days to collect data. - * - * Generated from protobuf field int32 collection_days = 14; - * @param int $var - * @return $this - */ - public function setCollectionDays($var) - { - GPBUtil::checkInt32($var); - $this->collection_days = $var; - - return $this; - } - - /** - * Uri for EULA (End User License Agreement) from customer. - * - * Generated from protobuf field string eula_uri = 15; - * @return string - */ - public function getEulaUri() - { - return $this->eula_uri; - } - - /** - * Uri for EULA (End User License Agreement) from customer. - * - * Generated from protobuf field string eula_uri = 15; - * @param string $var - * @return $this - */ - public function setEulaUri($var) - { - GPBUtil::checkString($var, True); - $this->eula_uri = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php deleted file mode 100644 index 80e3ca98246..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/Collector/State.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.Collector.State - */ -class State -{ - /** - * Collector state is not recognized. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Collector started to create, but hasn't been completed MC source creation - * and db object creation. - * - * Generated from protobuf enum STATE_INITIALIZING = 1; - */ - const STATE_INITIALIZING = 1; - /** - * Collector has been created, MC source creation and db object creation - * completed. - * - * Generated from protobuf enum STATE_READY_TO_USE = 2; - */ - const STATE_READY_TO_USE = 2; - /** - * Collector client has been registered with client. - * - * Generated from protobuf enum STATE_REGISTERED = 3; - */ - const STATE_REGISTERED = 3; - /** - * Collector client is actively scanning. - * - * Generated from protobuf enum STATE_ACTIVE = 4; - */ - const STATE_ACTIVE = 4; - /** - * Collector is not actively scanning. - * - * Generated from protobuf enum STATE_PAUSED = 5; - */ - const STATE_PAUSED = 5; - /** - * Collector is starting background job for deletion. - * - * Generated from protobuf enum STATE_DELETING = 6; - */ - const STATE_DELETING = 6; - /** - * Collector completed all tasks for deletion. - * - * Generated from protobuf enum STATE_DECOMMISSIONED = 7; - */ - const STATE_DECOMMISSIONED = 7; - /** - * Collector is in error state. - * - * Generated from protobuf enum STATE_ERROR = 8; - */ - const STATE_ERROR = 8; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::STATE_INITIALIZING => 'STATE_INITIALIZING', - self::STATE_READY_TO_USE => 'STATE_READY_TO_USE', - self::STATE_REGISTERED => 'STATE_REGISTERED', - self::STATE_ACTIVE => 'STATE_ACTIVE', - self::STATE_PAUSED => 'STATE_PAUSED', - self::STATE_DELETING => 'STATE_DELETING', - self::STATE_DECOMMISSIONED => 'STATE_DECOMMISSIONED', - self::STATE_ERROR => 'STATE_ERROR', - ]; - - 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(State::class, \Google\Cloud\RapidMigrationAssessment\V1\Collector_State::class); - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php deleted file mode 100644 index 87efb5b2232..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateAnnotationRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest - */ -class CreateAnnotationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the parent (project+location). - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $annotation = null; - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. Name of the parent (project+location). Please see - * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. - * @param \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation Required. The resource being created. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\CreateAnnotationRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation): self - { - return (new self()) - ->setParent($parent) - ->setAnnotation($annotation); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the parent (project+location). - * @type \Google\Cloud\RapidMigrationAssessment\V1\Annotation $annotation - * Required. The resource being created. - * @type string $request_id - * Optional. An optional request ID to identify requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the parent (project+location). - * - * 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. Name of the parent (project+location). - * - * 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 resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RapidMigrationAssessment\V1\Annotation|null - */ - public function getAnnotation() - { - return $this->annotation; - } - - public function hasAnnotation() - { - return isset($this->annotation); - } - - public function clearAnnotation() - { - unset($this->annotation); - } - - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RapidMigrationAssessment\V1\Annotation $var - * @return $this - */ - public function setAnnotation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Annotation::class); - $this->annotation = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php deleted file mode 100644 index c309fb5898b..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/CreateCollectorRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest - */ -class CreateCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the parent (project+location). - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Id of the requesting object. - * - * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $collector_id = ''; - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $collector = null; - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. Name of the parent (project+location). Please see - * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. - * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector Required. The resource being created. - * @param string $collectorId Required. Id of the requesting object. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\CreateCollectorRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector, string $collectorId): self - { - return (new self()) - ->setParent($parent) - ->setCollector($collector) - ->setCollectorId($collectorId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the parent (project+location). - * @type string $collector_id - * Required. Id of the requesting object. - * @type \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector - * Required. The resource being created. - * @type string $request_id - * Optional. An optional request ID to identify requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the parent (project+location). - * - * 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. Name of the parent (project+location). - * - * 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. Id of the requesting object. - * - * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCollectorId() - { - return $this->collector_id; - } - - /** - * Required. Id of the requesting object. - * - * Generated from protobuf field string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCollectorId($var) - { - GPBUtil::checkString($var, True); - $this->collector_id = $var; - - return $this; - } - - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RapidMigrationAssessment\V1\Collector|null - */ - public function getCollector() - { - return $this->collector; - } - - public function hasCollector() - { - return isset($this->collector); - } - - public function clearCollector() - { - unset($this->collector); - } - - /** - * Required. The resource being created. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $var - * @return $this - */ - public function setCollector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); - $this->collector = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php deleted file mode 100644 index 1afa5dd029b..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/DeleteCollectorRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest - */ -class DeleteCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\DeleteCollectorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php deleted file mode 100644 index 00e49e06416..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetAnnotationRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest - */ -class GetAnnotationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::annotationName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\GetAnnotationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php deleted file mode 100644 index f70f9965ac4..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GetCollectorRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.GetCollectorRequest - */ -class GetCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\GetCollectorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php deleted file mode 100644 index f93d7fb6a1b..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/GuestOsScan.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.GuestOsScan - */ -class GuestOsScan extends \Google\Protobuf\Internal\Message -{ - /** - * reference to the corresponding Guest OS Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - */ - protected $core_source = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $core_source - * reference to the corresponding Guest OS Scan in MC Source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); - parent::__construct($data); - } - - /** - * reference to the corresponding Guest OS Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - * @return string - */ - public function getCoreSource() - { - return $this->core_source; - } - - /** - * reference to the corresponding Guest OS Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - * @param string $var - * @return $this - */ - public function setCoreSource($var) - { - GPBUtil::checkString($var, True); - $this->core_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php deleted file mode 100644 index cc6aaa40547..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest - */ -class ListCollectorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListCollectorsRequest. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filtering results. - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Parent value for ListCollectorsRequest. Please see - * {@see RapidMigrationAssessmentClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\ListCollectorsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value for ListCollectorsRequest. - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * @type string $filter - * Filtering results. - * @type string $order_by - * Hint for how to order the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListCollectorsRequest. - * - * 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. Parent value for ListCollectorsRequest. - * - * 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; - } - - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filtering results. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filtering results. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Hint for how to order the results. - * - * Generated from protobuf field string order_by = 5; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php deleted file mode 100644 index 855e4171f23..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ListCollectorsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse - */ -class ListCollectorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Collectors. - * - * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; - */ - private $collectors; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RapidMigrationAssessment\V1\Collector>|\Google\Protobuf\Internal\RepeatedField $collectors - * The list of Collectors. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * The list of Collectors. - * - * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectors() - { - return $this->collectors; - } - - /** - * The list of Collectors. - * - * Generated from protobuf field repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; - * @param array<\Google\Cloud\RapidMigrationAssessment\V1\Collector>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); - $this->collectors = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php deleted file mode 100644 index 25fc6047fd7..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php deleted file mode 100644 index 5b121be3f81..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/PauseCollectorRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest - */ -class PauseCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\PauseCollectorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php deleted file mode 100644 index f012e81aed8..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/RegisterCollectorRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest - */ -class RegisterCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\RegisterCollectorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php deleted file mode 100644 index 77e3fad9004..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/ResumeCollectorRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest - */ -class ResumeCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource. Please see - * {@see RapidMigrationAssessmentClient::collectorName()} for help formatting this field. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\ResumeCollectorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. - * - * 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. Name of the resource. - * - * 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; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * 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; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php deleted file mode 100644 index 602d2ef1154..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/UpdateCollectorRequest.php +++ /dev/null @@ -1,230 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest - */ -class UpdateCollectorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Field mask is used to specify the fields to be overwritten in the - * Collector resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $collector = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector Required. The resource being updated. - * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * Collector resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\RapidMigrationAssessment\V1\UpdateCollectorRequest - * - * @experimental - */ - public static function build(\Google\Cloud\RapidMigrationAssessment\V1\Collector $collector, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCollector($collector) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Field mask is used to specify the fields to be overwritten in the - * Collector resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\RapidMigrationAssessment\V1\Collector $collector - * Required. The resource being updated. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\Rapidmigrationassessment::initOnce(); - parent::__construct($data); - } - - /** - * Required. Field mask is used to specify the fields to be overwritten in the - * Collector resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Field mask is used to specify the fields to be overwritten in the - * Collector resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RapidMigrationAssessment\V1\Collector|null - */ - public function getCollector() - { - return $this->collector; - } - - public function hasCollector() - { - return isset($this->collector); - } - - public function clearCollector() - { - unset($this->collector); - } - - /** - * Required. The resource being updated. - * - * Generated from protobuf field .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RapidMigrationAssessment\V1\Collector $var - * @return $this - */ - public function setCollector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RapidMigrationAssessment\V1\Collector::class); - $this->collector = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php b/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php deleted file mode 100644 index a143f6bc875..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/proto/src/Google/Cloud/RapidMigrationAssessment/V1/VSphereScan.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.rapidmigrationassessment.v1.VSphereScan - */ -class VSphereScan extends \Google\Protobuf\Internal\Message -{ - /** - * reference to the corresponding VSphere Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - */ - protected $core_source = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $core_source - * reference to the corresponding VSphere Scan in MC Source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Rapidmigrationassessment\V1\ApiEntities::initOnce(); - parent::__construct($data); - } - - /** - * reference to the corresponding VSphere Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - * @return string - */ - public function getCoreSource() - { - return $this->core_source; - } - - /** - * reference to the corresponding VSphere Scan in MC Source. - * - * Generated from protobuf field string core_source = 1; - * @param string $var - * @return $this - */ - public function setCoreSource($var) - { - GPBUtil::checkString($var, True); - $this->core_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php deleted file mode 100644 index 21ae280ef3a..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_annotation.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($formattedParent) - ->setAnnotation($annotation); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->createAnnotation($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Annotation $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); - - create_annotation_sample($formattedParent); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php deleted file mode 100644 index 85046037f46..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/create_collector.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($formattedParent) - ->setCollectorId($collectorId) - ->setCollector($collector); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->createCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); - $collectorId = '[COLLECTOR_ID]'; - - create_collector_sample($formattedParent, $collectorId); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php deleted file mode 100644 index 054bbffd29a..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/delete_collector.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->deleteCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::collectorName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTOR]' - ); - - delete_collector_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php deleted file mode 100644 index 91134e80889..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_annotation.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Annotation $response */ - $response = $rapidMigrationAssessmentClient->getAnnotation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::annotationName( - '[PROJECT]', - '[LOCATION]', - '[ANNOTATION]' - ); - - get_annotation_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php deleted file mode 100644 index 652fc907540..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_collector.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Collector $response */ - $response = $rapidMigrationAssessmentClient->getCollector($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::collectorName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTOR]' - ); - - get_collector_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php deleted file mode 100644 index 632bf3f8855..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php deleted file mode 100644 index 839bfe97aca..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_collectors.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $rapidMigrationAssessmentClient->listCollectors($request); - - /** @var Collector $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RapidMigrationAssessmentClient::locationName('[PROJECT]', '[LOCATION]'); - - list_collectors_sample($formattedParent); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php deleted file mode 100644 index 55b1227945c..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php deleted file mode 100644 index b7075c547e6..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/pause_collector.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->pauseCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::collectorName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTOR]' - ); - - pause_collector_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php deleted file mode 100644 index 539268cf039..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/register_collector.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->registerCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::collectorName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTOR]' - ); - - register_collector_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php deleted file mode 100644 index d3f055621b0..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/resume_collector.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->resumeCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RapidMigrationAssessmentClient::collectorName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTOR]' - ); - - resume_collector_sample($formattedName); -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php b/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php deleted file mode 100644 index 649482bbc89..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/samples/V1/RapidMigrationAssessmentClient/update_collector.php +++ /dev/null @@ -1,74 +0,0 @@ -setUpdateMask($updateMask) - ->setCollector($collector); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $rapidMigrationAssessmentClient->updateCollector($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Collector $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php deleted file mode 100644 index 97985d92384..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/Client/RapidMigrationAssessmentClient.php +++ /dev/null @@ -1,659 +0,0 @@ - createAnnotationAsync(CreateAnnotationRequest $request, array $optionalArgs = []) - * @method PromiseInterface createCollectorAsync(CreateCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteCollectorAsync(DeleteCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface getAnnotationAsync(GetAnnotationRequest $request, array $optionalArgs = []) - * @method PromiseInterface getCollectorAsync(GetCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface listCollectorsAsync(ListCollectorsRequest $request, array $optionalArgs = []) - * @method PromiseInterface pauseCollectorAsync(PauseCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface registerCollectorAsync(RegisterCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface resumeCollectorAsync(ResumeCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateCollectorAsync(UpdateCollectorRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class RapidMigrationAssessmentClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'rapidmigrationassessment.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'rapidmigrationassessment.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/rapid_migration_assessment_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/rapid_migration_assessment_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a annotation - * resource. - * - * @param string $project - * @param string $location - * @param string $annotation - * - * @return string The formatted annotation resource. - */ - public static function annotationName(string $project, string $location, string $annotation): string - { - return self::getPathTemplate('annotation')->render([ - 'project' => $project, - 'location' => $location, - 'annotation' => $annotation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a collector - * resource. - * - * @param string $project - * @param string $location - * @param string $collector - * - * @return string The formatted collector resource. - */ - public static function collectorName(string $project, string $location, string $collector): string - { - return self::getPathTemplate('collector')->render([ - 'project' => $project, - 'location' => $location, - 'collector' => $collector, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - annotation: projects/{project}/locations/{location}/annotations/{annotation} - * - collector: projects/{project}/locations/{location}/collectors/{collector} - * - location: projects/{project}/locations/{location} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'rapidmigrationassessment.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates an Annotation - * - * The async variant is - * {@see RapidMigrationAssessmentClient::createAnnotationAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/create_annotation.php - * - * @param CreateAnnotationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createAnnotation(CreateAnnotationRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateAnnotation', $request, $callOptions)->wait(); - } - - /** - * Create a Collector to manage the on-prem appliance which collects - * information about Customer assets. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::createCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/create_collector.php - * - * @param CreateCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createCollector(CreateCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateCollector', $request, $callOptions)->wait(); - } - - /** - * Deletes a single Collector - changes state of collector to "Deleting". - * Background jobs does final deletion thorugh producer api. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::deleteCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/delete_collector.php - * - * @param DeleteCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteCollector(DeleteCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteCollector', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single Annotation. - * - * The async variant is {@see RapidMigrationAssessmentClient::getAnnotationAsync()} - * . - * - * @example samples/V1/RapidMigrationAssessmentClient/get_annotation.php - * - * @param GetAnnotationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Annotation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getAnnotation(GetAnnotationRequest $request, array $callOptions = []): Annotation - { - return $this->startApiCall('GetAnnotation', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single Collector. - * - * The async variant is {@see RapidMigrationAssessmentClient::getCollectorAsync()} - * . - * - * @example samples/V1/RapidMigrationAssessmentClient/get_collector.php - * - * @param GetCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Collector - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCollector(GetCollectorRequest $request, array $callOptions = []): Collector - { - return $this->startApiCall('GetCollector', $request, $callOptions)->wait(); - } - - /** - * Lists Collectors in a given project and location. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::listCollectorsAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/list_collectors.php - * - * @param ListCollectorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listCollectors(ListCollectorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCollectors', $request, $callOptions); - } - - /** - * Pauses the given collector. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::pauseCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/pause_collector.php - * - * @param PauseCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function pauseCollector(PauseCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('PauseCollector', $request, $callOptions)->wait(); - } - - /** - * Registers the given collector. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::registerCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/register_collector.php - * - * @param RegisterCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function registerCollector(RegisterCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RegisterCollector', $request, $callOptions)->wait(); - } - - /** - * Resumes the given collector. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::resumeCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/resume_collector.php - * - * @param ResumeCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function resumeCollector(ResumeCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ResumeCollector', $request, $callOptions)->wait(); - } - - /** - * Updates the parameters of a single Collector. - * - * The async variant is - * {@see RapidMigrationAssessmentClient::updateCollectorAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/update_collector.php - * - * @param UpdateCollectorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCollector(UpdateCollectorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateCollector', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see RapidMigrationAssessmentClient::getLocationAsync()} . - * - * @example samples/V1/RapidMigrationAssessmentClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see RapidMigrationAssessmentClient::listLocationsAsync()} - * . - * - * @example samples/V1/RapidMigrationAssessmentClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json deleted file mode 100644 index c2befd3145f..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.rapidmigrationassessment.v1", - "libraryPackage": "Google\\Cloud\\RapidMigrationAssessment\\V1", - "services": { - "RapidMigrationAssessment": { - "clients": { - "grpc": { - "libraryClient": "RapidMigrationAssessmentGapicClient", - "rpcs": { - "CreateAnnotation": { - "methods": [ - "createAnnotation" - ] - }, - "CreateCollector": { - "methods": [ - "createCollector" - ] - }, - "DeleteCollector": { - "methods": [ - "deleteCollector" - ] - }, - "GetAnnotation": { - "methods": [ - "getAnnotation" - ] - }, - "GetCollector": { - "methods": [ - "getCollector" - ] - }, - "ListCollectors": { - "methods": [ - "listCollectors" - ] - }, - "PauseCollector": { - "methods": [ - "pauseCollector" - ] - }, - "RegisterCollector": { - "methods": [ - "registerCollector" - ] - }, - "ResumeCollector": { - "methods": [ - "resumeCollector" - ] - }, - "UpdateCollector": { - "methods": [ - "updateCollector" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json deleted file mode 100644 index 66abca8631c..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_client_config.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "interfaces": { - "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateAnnotation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetAnnotation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetCollector": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListCollectors": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RegisterCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCollector": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php deleted file mode 100644 index 186a1712b14..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_descriptor_config.php +++ /dev/null @@ -1,245 +0,0 @@ - [ - 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' => [ - 'CreateAnnotation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Annotation', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'PauseCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RegisterCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ResumeCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCollector' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'metadataReturnType' => '\Google\Cloud\RapidMigrationAssessment\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'collector.name', - 'fieldAccessors' => [ - 'getCollector', - 'getName', - ], - ], - ], - ], - 'GetAnnotation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\Annotation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetCollector' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\Collector', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListCollectors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCollectors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RapidMigrationAssessment\V1\ListCollectorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'annotation' => 'projects/{project}/locations/{location}/annotations/{annotation}', - 'collector' => 'projects/{project}/locations/{location}/collectors/{collector}', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php b/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php deleted file mode 100644 index d2d9306a498..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/src/V1/resources/rapid_migration_assessment_rest_client_config.php +++ /dev/null @@ -1,223 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' => [ - 'CreateAnnotation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/annotations', - 'body' => 'annotation', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateCollector' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/collectors', - 'body' => 'collector', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'collector_id', - ], - ], - 'DeleteCollector' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetAnnotation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/annotations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCollector' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListCollectors' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/collectors', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseCollector' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RegisterCollector' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:register', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeCollector' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/collectors/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCollector' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{collector.name=projects/*/locations/*/collectors/*}', - 'body' => 'collector', - 'placeholders' => [ - 'collector.name' => [ - 'getters' => [ - 'getCollector', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php b/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php deleted file mode 100644 index 723ff2b6097..00000000000 --- a/owl-bot-staging/RapidMigrationAssessment/v1/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php +++ /dev/null @@ -1,1473 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RapidMigrationAssessmentClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RapidMigrationAssessmentClient($options); - } - - /** @test */ - public function createAnnotationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createAnnotationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Annotation(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAnnotationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $annotation = new Annotation(); - $request = (new CreateAnnotationRequest()) - ->setParent($formattedParent) - ->setAnnotation($annotation); - $response = $gapicClient->createAnnotation($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAnnotation(); - $this->assertProtobufEquals($annotation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); - $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 createAnnotationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createAnnotationTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $annotation = new Annotation(); - $request = (new CreateAnnotationRequest()) - ->setParent($formattedParent) - ->setAnnotation($annotation); - $response = $gapicClient->createAnnotation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); - 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 createCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $collectorId = 'collectorId1641692685'; - $collector = new Collector(); - $request = (new CreateCollectorRequest()) - ->setParent($formattedParent) - ->setCollectorId($collectorId) - ->setCollector($collector); - $response = $gapicClient->createCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getCollectorId(); - $this->assertProtobufEquals($collectorId, $actualValue); - $actualValue = $actualApiRequestObject->getCollector(); - $this->assertProtobufEquals($collector, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCollectorTest'); - $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 createCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createCollectorTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $collectorId = 'collectorId1641692685'; - $collector = new Collector(); - $request = (new CreateCollectorRequest()) - ->setParent($formattedParent) - ->setCollectorId($collectorId) - ->setCollector($collector); - $response = $gapicClient->createCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCollectorTest'); - 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 deleteCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new DeleteCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/DeleteCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCollectorTest'); - $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 deleteCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteCollectorTest'); - $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 - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new DeleteCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCollectorTest'); - 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 getAnnotationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Annotation(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->annotationName('[PROJECT]', '[LOCATION]', '[ANNOTATION]'); - $request = (new GetAnnotationRequest()) - ->setName($formattedName); - $response = $gapicClient->getAnnotation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetAnnotation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAnnotationExceptionTest() - { - $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->annotationName('[PROJECT]', '[LOCATION]', '[ANNOTATION]'); - $request = (new GetAnnotationRequest()) - ->setName($formattedName); - try { - $gapicClient->getAnnotation($request); - // 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 getCollectorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new GetCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->getCollector($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetCollector', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCollectorExceptionTest() - { - $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->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new GetCollectorRequest()) - ->setName($formattedName); - try { - $gapicClient->getCollector($request); - // 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 listCollectorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $collectorsElement = new Collector(); - $collectors = [ - $collectorsElement, - ]; - $expectedResponse = new ListCollectorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCollectors($collectors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCollectorsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listCollectors($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCollectors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ListCollectors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCollectorsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCollectorsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listCollectors($request); - // 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 pauseCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/pauseCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/pauseCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new PauseCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->pauseCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/PauseCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/pauseCollectorTest'); - $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 pauseCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/pauseCollectorTest'); - $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 - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new PauseCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->pauseCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/pauseCollectorTest'); - 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 registerCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/registerCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/registerCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new RegisterCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->registerCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/RegisterCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/registerCollectorTest'); - $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 registerCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/registerCollectorTest'); - $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 - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new RegisterCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->registerCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/registerCollectorTest'); - 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 resumeCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/resumeCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/resumeCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new ResumeCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->resumeCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/ResumeCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resumeCollectorTest'); - $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 resumeCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/resumeCollectorTest'); - $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 - $formattedName = $gapicClient->collectorName('[PROJECT]', '[LOCATION]', '[COLLECTOR]'); - $request = (new ResumeCollectorRequest()) - ->setName($formattedName); - $response = $gapicClient->resumeCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resumeCollectorTest'); - 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 updateCollectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateCollectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $bucket = 'bucket-1378203158'; - $expectedAssetCount = 290454521; - $clientVersion = 'clientVersion-1506231196'; - $collectionDays = 1060007256; - $eulaUri = 'eulaUri-421590958'; - $expectedResponse = new Collector(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setBucket($bucket); - $expectedResponse->setExpectedAssetCount($expectedAssetCount); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setCollectionDays($collectionDays); - $expectedResponse->setEulaUri($eulaUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateCollectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $collector = new Collector(); - $request = (new UpdateCollectorRequest()) - ->setUpdateMask($updateMask) - ->setCollector($collector); - $response = $gapicClient->updateCollector($request); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/UpdateCollector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getCollector(); - $this->assertProtobufEquals($collector, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateCollectorTest'); - $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 updateCollectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateCollectorTest'); - $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 - $updateMask = new FieldMask(); - $collector = new Collector(); - $request = (new UpdateCollectorRequest()) - ->setUpdateMask($updateMask) - ->setCollector($collector); - $response = $gapicClient->updateCollector($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateCollectorTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createAnnotationAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createAnnotationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Annotation(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAnnotationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $annotation = new Annotation(); - $request = (new CreateAnnotationRequest()) - ->setParent($formattedParent) - ->setAnnotation($annotation); - $response = $gapicClient->createAnnotationAsync($request)->wait(); - $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.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAnnotation(); - $this->assertProtobufEquals($annotation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAnnotationTest'); - $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()); - } -} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/GPBMetadata/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.php deleted file mode 100644 index 0577623efb24959f2671829c3bfaea1d19557ea5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24700 zcmd5^TWllOc{WK&D;;Vj?pWT{YJH){YkMv4Qdw^7IP@(;ijtV6NSYU|*H$v6$dSY> zMKT;xYt`L8qy^HV1&StUfxfgwkS1-@qCnFdnwR#WKoPVJ&^9f)MNv1sp?)g**oUIu zf6kd3Ig)3!euy8|;+Z-B`Okm;`~RPL?akhPk3AD#H#$bYJ}{c`oul|*--!46-9fj} zZO32ro9~fq@-Z0|prSzsTs5k3_`t~{px}71Q+vRbf z+gsOPWvtPzn`YeSF?*lI@n3Ja({455=Ab^n|1P&oz13+ATJ?78N3rAAif|Uyl#^L&Lp#Jl;13!+z&gjyD0gXaBYBLqx6D z+SWRqE>WS|F;gjLPY#IVCT7|#9OZ+}S!)^XX4=@VAGW&vQ%ucucDoNYt!zkc47@k{ z$Uv~{L2qyrd_j9E-{)rCymN}V)fU)(P(SDepIh!VwktTq;W0;~>?eF=KXG_{>4IFN-fKZg5H|_YUwX>*V3$}% z-;q2cU$`{(LJOQBA6|4l?91aHna4E@#B#-;1C|dhePursOCR7E z?HYTL6VKYgLA_JogSHi$1If$;H1G;o?h8g^plmP(jVB>5h5;y=T#+xIcnS#zp>zZ* zt6!O9v1-5GG3#8KlH&-&)|5@B|jSo{3xiz=s*<^Y2}deD4PO_%x;I{ zKO+VeHhEZY4~@kL_7oChH*9P`|HTQu*(D1b>u?gbAn{4+A4k}N-`dJ^Os$r+LPg6| zbH#$5-O3iKdi8cGtJeyZQZ|!Y%Vk$%k0=W)wwWzwHZ(leN~LmfD;o#&YBrP46|%8O5MsWh-QFZT zGFquxD`#U<$|ZJTWYC^*Mqz9!qZKmQd~8}d&lDh8UeBhr%uPL4c&nBx-;T`?{;qK? zpDkBojNV==YqeD!792ax2=t=L9AnPgv03GDw&?uE#!BUE1qc$7v9lvwnDJIETdBt8U1QdcV}!qWFLuuL+=8R1KXHa#l$Od@f+omWkn-~qm!B1O z%}?!&h>yek$_^yRwuPJn=aM;#sZP>kiDMD7p1`;Y#(kHa5gcxUog-J~lG%q`pv>h( z0Kb3@G#cF@q_ovsJi~Pfm#Zh)x&6AiZ!~q+bCQ}_F|o$Z4IF{jxu7pja;bVL5PqX# zB?Rur8FQQqWr>~F3g9u$Un7zQUdw0KbJg6YRwbFjZ_bmoJaJc8S!A)2R;k=7mRI#m zv0Tn(sPRuo7txYdf5$z)4aD3aOHCsGPlg&0{fzLBk!bCqf?Q{ek5%KHJ;xb_~5UJlHY%LiJ;OiJk2W1E~+XcZ?3#|J)`-lsDOV`1b?-(6x$A zwm6tAh@=^tHYBF%KTfadXF%Uz^J|+NFt7-gAh3EtzGZz4PnsrMz<+! zo3wXrw$z53FuFU?Y}g)fsh&$_0^xAXrV?ciiZF?QA*P2W1ty>!ISn)E@M1{)b1pfw zppcwOEngjx99XYP4J=)$=(S3=tV7`oI~gKFl`WTxW$^$a?>r1EmswmqtmLX$y;w*W zweo7Nuns$wDQ=eXSx8nyd5T>UZ$Z>^r5qVTf}`d0#aj@e3FQU$?C1+x8i?rm+-9z- zXW!n?Y88^UNe7)w84{EMH|Gk~Y`LK2VN_N2q=1vb>qQuH{jC~wlncNa2N|(PVIlSO zZ6SBi4^V9a2wqstWvcpSt^!S#*@(@ke-UC&mHMqi9BBy-+TCuynK$Zp+?<95ly?|*o5e}%sVYQyn8=K|}t_E80BN$$6aF;FZw))21db_Rny2!>Hx%bET za>11CngmngP)4^0LhknK!zS@Rg)nf&+zUk?fRJkhr(}Z}T?u?ERx(?A;6QWnEQcM8 zZ#nFWm?+NW^X$B^i~=Z*#yb324)@c+&Vr092R@3f&dxh9b)$3G>UTR7m@dw7_^Ckf z9jI9c0zcu@dmn1U2lc{Vgpg7|Yp%R6|GKy0V2M%Z$GzpK^TSNK;$QWbC)p%dCTaJRlI+#@$j&p6X#Eb@i=jYX0sISI?`8+B+Cb1@2sMviVjKQ4_1#ogS4 zTO@{)2$42*1q+mum3$shn>v$MF<0y|%Vq?H;VLf9W3g!RS|IML!5ET%DZt!jF(E6C zs4t!aw7Fz3Ugj*5;KJfaIR~v4*!;-25@(N#$Qhw9`bkHD)!EZUMuxaT zK75zO?1z?zFHBT0Q#eA31X7eF3F27aVe>n!cAFNqU{iD(O@0ip^K61RkBe0_8BC>) zB1=ptFnx>792k8RIXVN<{uD1fEXYkZ30-wyLMfjfTn-QfhVQc3Jy`m?^&?a~AZ)_U zekPExjqZD00J7z8>FXhOMxGo3hZ*EwT0KhZx>*(a$2!EYqko{1+ua7rFM}gDkH*=f z_2vPp5+(#=&^k19BueYtdy|T5kwyE)9@%ux!^E%7lU^4|*tU2=+$f$beJ#W$=*$q5 zx-%xu8;H=O@UXe=(?NQ&9T7o4NCuB%-G&2_A!1wMFd0q01*tDDj>NYvDI<~Qp|3rU z&=>QTcG(1-8Zw7&7uzeHzM!dy7&%VJG1U)E-TT~SL-D+EcsTOhp+))}o7Zv1R@NCAEcMqyY}(TA%4_UV zej?xind9Q|KAlW7`BAywk%M-jofh#gmJ?x7H2Gp6QQ&wrIZLQN!luMem~hD)j@cHRRQpjc#9LJi~-WMA_bUl8Yo+ zbIG+pTX6$UWT=aQdYzFGD-8MRV zA{#T8eDxG)SRnY;)c*>x1wYJy)YF+f(qDGs8fj+#G#^s!Ma1NkdZ(=6`C1|SHgfxv zPsB&G6^h^y47ia;x6M6M$?MH5`ZcD6otM%`pH8Ef}cBS6wUk2EOO z^ZFKN*-W8G)d9SKEg^v}^ATbCTO|Kt5%oI}_!-^+mbeE79PS0NDOWcUMQ3xZ4j+}L z$`#yPG9BpfMpj7V1SmKEd{U}ZLnP`%NdFOnOL@%ceJF9BpR%<@M1kj9?=<^eNC+AP z?ob|$zhXPb5y~I7x~9G}>@?d3CB(@qmQ0F5lPGRE9(qLm`4Btn!CQHfE#(SZT0TeB z3m>-PY;?0wyj4I-$^9PA1IM$e<=2YkO*nsHg*?HxOSv+BM3iYZv05u-!8aI2uBd|i z7gz-~qI9`t!t%qDX1An(FAbVE* zF}7$Gi(&e)ZIMYOeI>I#wTE2U>R+h0s|4M>`qEW);TW2bVI4W4B}84y_&)sJyvok| zFUtd5Lc?|P>c2+VEI%}vPf*@wvqLyMx|Ns^W;0-Rg_0f;P=XAdCrJUw{E#ikWZZ%# z$=xU>hz@SZOC=U{t%k($1(I2~fX(`mskgg#v7a4OyM!8>6g)>k%25aHN@(lRIk^cT zArMQ*#YSDrD0QeLikjN>9Rt}K%J0u5*MoD1MHClIzKuM=6PD{8Xmc#VN674u1<>(qr68so9CrS`LrU>OW(+?Z^S0luZGZS z0OxRE+%%3p);5~w?{6BiRM9WSh+F^ zQPjc5MFP_C?$rj1If#gWN_m-0U}sj9G4R%~$b1KmIs71CAXef5hWa`7WZ4+>TS$86 zjlFu~sA3?3qTO4Ye^n4u1S<*NHF1SK7ockbFyN=2UH3qH%@e3TC^&?nv04w=L^sRG z(-smPm?ZqP75JM&4iD8Y_(j4ljr*H+ryk7;sU;R$HQI&;i-+6T?}ykWAq(Czg>?uY zOZV4XY<{GcA~$>^kcfCO6Vd`1zC=vwd4|&2$BOp@OAciCaeu6&7!}w#FD0njCo1=+ zp~dmy)nJR@e-CwR!CLo-!l$`p-C)-PNR}6#`VAa{kP7bu>kxd-T?or*_WCe#v&$|C zx$(#IVbFBiiddZpohlRvpm&BRS&|IpGeSVfC?qa zEPP5xL0Xv=8(IYC8%+jlbF=d@5@KrqL(O;)@+i;xR5!`$ue^_c@2$u!E}xNqB&|Qx z*NBUbG3HY9U1aCl+|KJJH}t%`$!)v(?I{)kYf)st(y?^YK^FwJty*ujDoITd+Mlnt$njSY|(BbxkFAQPpDbdMJ(Fr*xh z4N&wf2E#B{tayO|Ls@@y0E*^-U>Iga@zx78XGaQCoY8{SNC6|kg8(zz8T7gP8X|{A zX27}Rhzi&Vl0%0WQD7mg{7bjTZ+Y-USTq@oN;1Pz6jKRgNFlyJ+1aMLC?S0!&@tYs z?^;a3fh}EQQP)lp`EviBGbnOsvh|xYWh(qiC{_DVD+hH^l_yS=wq@>bCuzO(qwE|+ zV6fZmAK3d+|0l%ey!)r5qD9S-{Ch}gqKj5$x@JS_%2nRyv$s>gSQ3 z7OU6~kPUsJiq>lCq6?TUM!bz|axuR}eQ*z?4pa4 zr~Iu-6*WHa=O_$VPs!mD^(EKrgC13QcF`8f$s+4xJ1mBNQG?7MRq^=!0#Xb?yBxj9 zBJ*s+vMv^cmG{{b_L1OxQT9fejQ7JCRR1=38h9>Q493D9)t0c20pS&gi_QUDk0Y?+ z#NK7|BS=vMO+AR~Wzh`nbJt*oO^ONv?;FT$WHUF@#kUciBd?51Nv@K^!6ChWh~UDq zY2yee*VqdVM^v&Iv=mow>qs=MWy`!wF;-JRX(OG>Qzn3?q0(BOt`%Tmv@ciyu~`TZp!Oz258T$Z7YH1f-I1 zYiG#&Y$&vre$8(|XuYZ(;<4cHuU!xDU<7x`!pQZ43!N>z(CeX)&_p=hrdB{IDTpFQ zFy}#|>8sZ4oU9!#FlF3ssPC}Y=bJsdmV>ffxFVbHBF~4jvK=_#LB4!CM5$;xCrUv!K=Syb0admeIb`vO z86~P>*KJ72*r#Za3@nPBr?#Ozux!1Fnmz7@aL$SFxE2i; z{6?;PK&(R@;j_Ew(}yw_uM>~+QR)q~M@d6R)L%fyzb6bka#g3ELovMH@AhR&tYV!I z?#7{RM0evzKXMOc*V_jwn{k49DBkrsNcBroY|a`N^jAu3l1sRZINr3dIq_nT7e+!O z)h6JV3sYA6@LHN zUUiF2qnR8hfC8Ctpo7(XM~G9FFl@N*AkZ7`p!7Ew4#W+Ipi(sgxne`HVc!O9W1x#h zMp@Pib}3>MwlUb?-H;aOrL!#RI%oRnI;5p1VYyEr=TZ#!-8_U?dX~jTH$ZV%uRhq9 zN}QbPrBAVWIL2;VaHYucg}Eys3-`DSX>0jV`T~1w*AkyP*EOlE*hW%>@7(i8x~|dfG;vYh+uWK%PZwX>1fP=jd@#`!wC7t){aoln?Po%# z$dxId^zrsB%JBYjtUZ9j?*`RwlO<9du?{|m2 zO@pp1QRAbXLV0`SGVcaYqNJ72*bNSV{bc%k-8JKlgO< ziU}r~BhZge6b`C{9ek{I{ICj}GJ>g~rTQ&=#-MB*U^Qpj5AQaX*y1>{awk6>V&_SK zoqgEK<&6>L@_?nx2UjNd*o84vB=hEw;dD;dQXIj|tFtwJyWm)bi`$-0oTx4AOuon) zi%fnP-iW(_&%eQXtzz; z%KOfbd&^JC*N?IC$tO;HuKq1ra?0a=fwvas|wg}qh>jIPDe{&Gz`-LsAyJ#F4qPLmY=9FO91PBgR?J|ay zG7j9{5`Wo6<@Li3OE-ZYm!pWDF(Bz9O7&>SwxaLf^d#c5o*#dH5xa==K79vI> z)Uk#BPJ9xh5}Q;Joj6;w7DQX;Rt}B9-i+H63uk2e?wVGq=5M1tls-z3FVGusWIt_ydR0TQ3kaRn7%yECv0rq{7o|CCZ>wiS}PA>8W8nYh#z zwlB3IKXTT#Ej%|%HhL}@?81n5m4s#Z?8L143Y&EgQfm^vs!}eaiQ4ZAEXa!TE8wwE z^4~ABB|D-;vPHVo6@&AW@>g~Tl0z;f*mWV%tl>LnPFP=JbyzIH_m~!1{R6gJdSN^Fk*9TCPfER$pcTHRqtxW~XTAc9F zhunQ_o(hLo>-M)(+EG#p4QkGN#E~14&Z}R?o9uw~!3BH)odgS+3pJ zp2wofW2VypZoch-E1#!9ec$+0D8{^6>nU}ddifyiBH_cfv`-_lFU4SoRl?PePM zG*`eaXkYW|XH(FtG$oqRlw_a`nWuAYDLBu(cwgfcbPxSUSzKbP{5JU6ZfOh1&-VKk zs|3gGO-Le^zUu0F<7jR_pNv~XO&o)(;A}Kk&Dh;<0TH&}w-7#W9RR!&{^`R6|A?OI zCEc=M-DA*EekH`1(-NZuONu)aEL?&UZ-tZU1@*G8(z5vPKy>Mlvid%5i+ExrCD=tz z&m0TSltr@>v(Y0{rTA>#*B&D>UUkI@JPPDHT2Yrz+)>>fkkY>X1%`7pXbNaJN2gi4 z3wF(5e74+R>BJ2t)oUkius;&5(jNa(HUc~DiKzs;q&60&2}Kypu^5{yHweLXtMyMP z3BIE-=U~NR!?rhWRlW&nahkaTN{chWI;X3FxKI|B)EjP9_?&W*;8=Z4_Y{7Sk2i*| z$(*&!Ob7EPg|+uiwXhEs6MN^X@7&kUOCP|>`pR#SaOrtfz2biq_g1Xet;}+2v;kN7 zJLG%l$URFU!K?(^tKU>>uUep!@`oUq?$chTTUG+^RQVHBkik8keH|&mq2L>Xl-HCri`8x90}$Ba5jE@wE@q@Z|XyBq^BdTY^_^{D9Mq3J28fiX z&)(N&r7odenOuXsq<$i>2I-5wX0lNKfx*S&fq zp@^_=%y`{fk%=WwdQSODn5oCC;i^_Bg}@5Whhi>3*5-qCdVMrvW%)S-iuK(#{52)z zf9$?gfP}g;lFILf+2tT54kcJSKoC$CVS?St4F*wih;d)LC^MB;$38>Kg(RcCA*dxj z{p5=Le7VNS*P1Dl*Sa7wOIzR7)Q_(I{k4|Z9}IeCYGvi_-Mf;j>;i0kIM^4TtG{No zgQkBe%$~-FmMsSKTjKC~8ifYgu;JvQN)!Nm@%J5xN)yYamJ4e_huv-Ga7*rSmj*KvKmV9(zaUz)$i?lJcN Db9MLR diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php deleted file mode 100644 index a9ab1644bb8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment - */ -class AccountDefenderAssessment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Labels for this request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $labels - * Output only. Labels for this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Labels for this request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Output only. Labels for this request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment\AccountDefenderLabel::class); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php deleted file mode 100644 index 1b83b9790b3..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountDefenderAssessment/AccountDefenderLabel.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel - */ -class AccountDefenderLabel -{ - /** - * Default unspecified type. - * - * Generated from protobuf enum ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; - */ - const ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; - /** - * The request matches a known good profile for the user. - * - * Generated from protobuf enum PROFILE_MATCH = 1; - */ - const PROFILE_MATCH = 1; - /** - * The request is potentially a suspicious login event and must be further - * verified either through multi-factor authentication or another system. - * - * Generated from protobuf enum SUSPICIOUS_LOGIN_ACTIVITY = 2; - */ - const SUSPICIOUS_LOGIN_ACTIVITY = 2; - /** - * The request matched a profile that previously had suspicious account - * creation behavior. This can mean that this is a fake account. - * - * Generated from protobuf enum SUSPICIOUS_ACCOUNT_CREATION = 3; - */ - const SUSPICIOUS_ACCOUNT_CREATION = 3; - /** - * The account in the request has a high number of related accounts. It does - * not necessarily imply that the account is bad but can require further - * investigation. - * - * Generated from protobuf enum RELATED_ACCOUNTS_NUMBER_HIGH = 4; - */ - const RELATED_ACCOUNTS_NUMBER_HIGH = 4; - - private static $valueToName = [ - self::ACCOUNT_DEFENDER_LABEL_UNSPECIFIED => 'ACCOUNT_DEFENDER_LABEL_UNSPECIFIED', - self::PROFILE_MATCH => 'PROFILE_MATCH', - self::SUSPICIOUS_LOGIN_ACTIVITY => 'SUSPICIOUS_LOGIN_ACTIVITY', - self::SUSPICIOUS_ACCOUNT_CREATION => 'SUSPICIOUS_ACCOUNT_CREATION', - self::RELATED_ACCOUNTS_NUMBER_HIGH => 'RELATED_ACCOUNTS_NUMBER_HIGH', - ]; - - 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(AccountDefenderLabel::class, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment_AccountDefenderLabel::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php deleted file mode 100644 index 5e8e0f49030..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo.php +++ /dev/null @@ -1,182 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AccountVerificationInfo - */ -class AccountVerificationInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Endpoints that can be used for identity verification. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $endpoints; - /** - * Optional. Language code preference for the verification message, set as a - * IETF BCP 47 language code. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - /** - * Output only. Result of the latest account verification challenge. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $latest_verification_result = 0; - /** - * Username of the account that is being verified. Deprecated. Customers - * should now provide the `account_id` field in `event.user_info`. - * - * Generated from protobuf field string username = 2 [deprecated = true]; - * @deprecated - */ - protected $username = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo>|\Google\Protobuf\Internal\RepeatedField $endpoints - * Optional. Endpoints that can be used for identity verification. - * @type string $language_code - * Optional. Language code preference for the verification message, set as a - * IETF BCP 47 language code. - * @type int $latest_verification_result - * Output only. Result of the latest account verification challenge. - * @type string $username - * Username of the account that is being verified. Deprecated. Customers - * should now provide the `account_id` field in `event.user_info`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Endpoints that can be used for identity verification. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEndpoints() - { - return $this->endpoints; - } - - /** - * Optional. Endpoints that can be used for identity verification. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo endpoints = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\EndpointVerificationInfo::class); - $this->endpoints = $arr; - - return $this; - } - - /** - * Optional. Language code preference for the verification message, set as a - * IETF BCP 47 language code. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. Language code preference for the verification message, set as a - * IETF BCP 47 language code. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * Output only. Result of the latest account verification challenge. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getLatestVerificationResult() - { - return $this->latest_verification_result; - } - - /** - * Output only. Result of the latest account verification challenge. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result latest_verification_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setLatestVerificationResult($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo\Result::class); - $this->latest_verification_result = $var; - - return $this; - } - - /** - * Username of the account that is being verified. Deprecated. Customers - * should now provide the `account_id` field in `event.user_info`. - * - * Generated from protobuf field string username = 2 [deprecated = true]; - * @return string - * @deprecated - */ - public function getUsername() - { - @trigger_error('username is deprecated.', E_USER_DEPRECATED); - return $this->username; - } - - /** - * Username of the account that is being verified. Deprecated. Customers - * should now provide the `account_id` field in `event.user_info`. - * - * Generated from protobuf field string username = 2 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setUsername($var) - { - @trigger_error('username is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php deleted file mode 100644 index 2b334806016..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AccountVerificationInfo/Result.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result - */ -class Result -{ - /** - * No information about the latest account verification. - * - * Generated from protobuf enum RESULT_UNSPECIFIED = 0; - */ - const RESULT_UNSPECIFIED = 0; - /** - * The user was successfully verified. This means the account verification - * challenge was successfully completed. - * - * Generated from protobuf enum SUCCESS_USER_VERIFIED = 1; - */ - const SUCCESS_USER_VERIFIED = 1; - /** - * The user failed the verification challenge. - * - * Generated from protobuf enum ERROR_USER_NOT_VERIFIED = 2; - */ - const ERROR_USER_NOT_VERIFIED = 2; - /** - * The site is not properly onboarded to use the account verification - * feature. - * - * Generated from protobuf enum ERROR_SITE_ONBOARDING_INCOMPLETE = 3; - */ - const ERROR_SITE_ONBOARDING_INCOMPLETE = 3; - /** - * The recipient is not allowed for account verification. This can occur - * during integration but should not occur in production. - * - * Generated from protobuf enum ERROR_RECIPIENT_NOT_ALLOWED = 4; - */ - const ERROR_RECIPIENT_NOT_ALLOWED = 4; - /** - * The recipient has already been sent too many verification codes in a - * short amount of time. - * - * Generated from protobuf enum ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5; - */ - const ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5; - /** - * The verification flow could not be completed due to a critical internal - * error. - * - * Generated from protobuf enum ERROR_CRITICAL_INTERNAL = 6; - */ - const ERROR_CRITICAL_INTERNAL = 6; - /** - * The client has exceeded their two factor request quota for this period of - * time. - * - * Generated from protobuf enum ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7; - */ - const ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7; - /** - * The request cannot be processed at the time because of an incident. This - * bypass can be restricted to a problematic destination email domain, a - * customer, or could affect the entire service. - * - * Generated from protobuf enum ERROR_VERIFICATION_BYPASSED = 8; - */ - const ERROR_VERIFICATION_BYPASSED = 8; - /** - * The request parameters do not match with the token provided and cannot be - * processed. - * - * Generated from protobuf enum ERROR_VERDICT_MISMATCH = 9; - */ - const ERROR_VERDICT_MISMATCH = 9; - - private static $valueToName = [ - self::RESULT_UNSPECIFIED => 'RESULT_UNSPECIFIED', - self::SUCCESS_USER_VERIFIED => 'SUCCESS_USER_VERIFIED', - self::ERROR_USER_NOT_VERIFIED => 'ERROR_USER_NOT_VERIFIED', - self::ERROR_SITE_ONBOARDING_INCOMPLETE => 'ERROR_SITE_ONBOARDING_INCOMPLETE', - self::ERROR_RECIPIENT_NOT_ALLOWED => 'ERROR_RECIPIENT_NOT_ALLOWED', - self::ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED => 'ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED', - self::ERROR_CRITICAL_INTERNAL => 'ERROR_CRITICAL_INTERNAL', - self::ERROR_CUSTOMER_QUOTA_EXHAUSTED => 'ERROR_CUSTOMER_QUOTA_EXHAUSTED', - self::ERROR_VERIFICATION_BYPASSED => 'ERROR_VERIFICATION_BYPASSED', - self::ERROR_VERDICT_MISMATCH => 'ERROR_VERDICT_MISMATCH', - ]; - - 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(Result::class, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo_Result::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php deleted file mode 100644 index 7c007dfb749..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest - */ -class AddIpOverrideRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. IP override added to the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ip_override_data = null; - - /** - * @param string $name Required. The name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData Required. IP override added to the key. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\AddIpOverrideRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData): self - { - return (new self()) - ->setName($name) - ->setIpOverrideData($ipOverrideData); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ip_override_data - * Required. IP override added to the key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. - * - * 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 name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. - * - * 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. IP override added to the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData|null - */ - public function getIpOverrideData() - { - return $this->ip_override_data; - } - - public function hasIpOverrideData() - { - return isset($this->ip_override_data); - } - - public function clearIpOverrideData() - { - unset($this->ip_override_data); - } - - /** - * Required. IP override added to the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $var - * @return $this - */ - public function setIpOverrideData($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); - $this->ip_override_data = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php deleted file mode 100644 index cfbc2dff2ac..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AddIpOverrideResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse - */ -class AddIpOverrideResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php deleted file mode 100644 index 48395cbf6a8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AndroidKeySettings.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AndroidKeySettings - */ -class AndroidKeySettings extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. If set to true, allowed_package_names are not enforced. - * - * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_all_package_names = false; - /** - * Optional. Android package names of apps allowed to use the key. - * Example: 'com.companyname.appname' - * - * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $allowed_package_names; - /** - * Optional. Set to true for keys that are used in an Android application that - * is available for download in app stores in addition to the Google Play - * Store. - * - * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $support_non_google_app_store_distribution = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $allow_all_package_names - * Optional. If set to true, allowed_package_names are not enforced. - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_package_names - * Optional. Android package names of apps allowed to use the key. - * Example: 'com.companyname.appname' - * @type bool $support_non_google_app_store_distribution - * Optional. Set to true for keys that are used in an Android application that - * is available for download in app stores in addition to the Google Play - * Store. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. If set to true, allowed_package_names are not enforced. - * - * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowAllPackageNames() - { - return $this->allow_all_package_names; - } - - /** - * Optional. If set to true, allowed_package_names are not enforced. - * - * Generated from protobuf field bool allow_all_package_names = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowAllPackageNames($var) - { - GPBUtil::checkBool($var); - $this->allow_all_package_names = $var; - - return $this; - } - - /** - * Optional. Android package names of apps allowed to use the key. - * Example: 'com.companyname.appname' - * - * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedPackageNames() - { - return $this->allowed_package_names; - } - - /** - * Optional. Android package names of apps allowed to use the key. - * Example: 'com.companyname.appname' - * - * Generated from protobuf field repeated string allowed_package_names = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedPackageNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_package_names = $arr; - - return $this; - } - - /** - * Optional. Set to true for keys that are used in an Android application that - * is available for download in app stores in addition to the Google Play - * Store. - * - * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getSupportNonGoogleAppStoreDistribution() - { - return $this->support_non_google_app_store_distribution; - } - - /** - * Optional. Set to true for keys that are used in an Android application that - * is available for download in app stores in addition to the Google Play - * Store. - * - * Generated from protobuf field bool support_non_google_app_store_distribution = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setSupportNonGoogleAppStoreDistribution($var) - { - GPBUtil::checkBool($var); - $this->support_non_google_app_store_distribution = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php deleted file mode 100644 index e2a10ba13c8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest.php +++ /dev/null @@ -1,303 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest - */ -class AnnotateAssessmentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $annotation = 0; - /** - * Optional. Reasons for the annotation that are assigned to the event. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $reasons; - /** - * Optional. A stable account identifier to apply to the assessment. This is - * an alternative to setting `account_id` in `CreateAssessment`, for example - * when a stable account identifier is not yet known in the initial request. - * - * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $account_id = ''; - /** - * Optional. A stable hashed account identifier to apply to the assessment. - * This is an alternative to setting `hashed_account_id` in - * `CreateAssessment`, for example when a stable account identifier is not yet - * known in the initial request. - * - * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $hashed_account_id = ''; - /** - * Optional. If the assessment is part of a payment transaction, provide - * details on payment lifecycle events that occur in the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transaction_event = null; - - /** - * @param string $name Required. The resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. Please see - * {@see RecaptchaEnterpriseServiceClient::assessmentName()} for help formatting this field. - * @param int $annotation Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation} - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest - * - * @experimental - */ - public static function build(string $name, int $annotation): self - { - return (new self()) - ->setName($name) - ->setAnnotation($annotation); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. - * @type int $annotation - * Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * @type array|\Google\Protobuf\Internal\RepeatedField $reasons - * Optional. Reasons for the annotation that are assigned to the event. - * @type string $account_id - * Optional. A stable account identifier to apply to the assessment. This is - * an alternative to setting `account_id` in `CreateAssessment`, for example - * when a stable account identifier is not yet known in the initial request. - * @type string $hashed_account_id - * Optional. A stable hashed account identifier to apply to the assessment. - * This is an alternative to setting `hashed_account_id` in - * `CreateAssessment`, for example when a stable account identifier is not yet - * known in the initial request. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $transaction_event - * Optional. If the assessment is part of a payment transaction, provide - * details on payment lifecycle events that occur in the transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. - * - * 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 resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. - * - * 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; - } - - /** - * Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAnnotation() - { - return $this->annotation; - } - - /** - * Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAnnotation($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation::class); - $this->annotation = $var; - - return $this; - } - - /** - * Optional. Reasons for the annotation that are assigned to the event. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReasons() - { - return $this->reasons; - } - - /** - * Optional. Reasons for the annotation that are assigned to the event. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReasons($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Reason::class); - $this->reasons = $arr; - - return $this; - } - - /** - * Optional. A stable account identifier to apply to the assessment. This is - * an alternative to setting `account_id` in `CreateAssessment`, for example - * when a stable account identifier is not yet known in the initial request. - * - * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAccountId() - { - return $this->account_id; - } - - /** - * Optional. A stable account identifier to apply to the assessment. This is - * an alternative to setting `account_id` in `CreateAssessment`, for example - * when a stable account identifier is not yet known in the initial request. - * - * Generated from protobuf field string account_id = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAccountId($var) - { - GPBUtil::checkString($var, True); - $this->account_id = $var; - - return $this; - } - - /** - * Optional. A stable hashed account identifier to apply to the assessment. - * This is an alternative to setting `hashed_account_id` in - * `CreateAssessment`, for example when a stable account identifier is not yet - * known in the initial request. - * - * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getHashedAccountId() - { - return $this->hashed_account_id; - } - - /** - * Optional. A stable hashed account identifier to apply to the assessment. - * This is an alternative to setting `hashed_account_id` in - * `CreateAssessment`, for example when a stable account identifier is not yet - * known in the initial request. - * - * Generated from protobuf field bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setHashedAccountId($var) - { - GPBUtil::checkString($var, False); - $this->hashed_account_id = $var; - - return $this; - } - - /** - * Optional. If the assessment is part of a payment transaction, provide - * details on payment lifecycle events that occur in the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent|null - */ - public function getTransactionEvent() - { - return $this->transaction_event; - } - - public function hasTransactionEvent() - { - return isset($this->transaction_event); - } - - public function clearTransactionEvent() - { - unset($this->transaction_event); - } - - /** - * Optional. If the assessment is part of a payment transaction, provide - * details on payment lifecycle events that occur in the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $var - * @return $this - */ - public function setTransactionEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent::class); - $this->transaction_event = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php deleted file mode 100644 index d46aa93d147..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Annotation.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation - */ -class Annotation -{ - /** - * Default unspecified type. - * - * Generated from protobuf enum ANNOTATION_UNSPECIFIED = 0; - */ - const ANNOTATION_UNSPECIFIED = 0; - /** - * Provides information that the event turned out to be legitimate. - * - * Generated from protobuf enum LEGITIMATE = 1; - */ - const LEGITIMATE = 1; - /** - * Provides information that the event turned out to be fraudulent. - * - * Generated from protobuf enum FRAUDULENT = 2; - */ - const FRAUDULENT = 2; - /** - * Provides information that the event was related to a login event in which - * the user typed the correct password. Deprecated, prefer indicating - * CORRECT_PASSWORD through the reasons field instead. - * - * Generated from protobuf enum PASSWORD_CORRECT = 3 [deprecated = true]; - */ - const PASSWORD_CORRECT = 3; - /** - * Provides information that the event was related to a login event in which - * the user typed the incorrect password. Deprecated, prefer indicating - * INCORRECT_PASSWORD through the reasons field instead. - * - * Generated from protobuf enum PASSWORD_INCORRECT = 4 [deprecated = true]; - */ - const PASSWORD_INCORRECT = 4; - - private static $valueToName = [ - self::ANNOTATION_UNSPECIFIED => 'ANNOTATION_UNSPECIFIED', - self::LEGITIMATE => 'LEGITIMATE', - self::FRAUDULENT => 'FRAUDULENT', - self::PASSWORD_CORRECT => 'PASSWORD_CORRECT', - self::PASSWORD_INCORRECT => 'PASSWORD_INCORRECT', - ]; - - 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(Annotation::class, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest_Annotation::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php deleted file mode 100644 index 4b0d90d7be1..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentRequest/Reason.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason - */ -class Reason -{ - /** - * Default unspecified reason. - * - * Generated from protobuf enum REASON_UNSPECIFIED = 0; - */ - const REASON_UNSPECIFIED = 0; - /** - * Indicates that the transaction had a chargeback issued with no other - * details. When possible, specify the type by using CHARGEBACK_FRAUD or - * CHARGEBACK_DISPUTE instead. - * - * Generated from protobuf enum CHARGEBACK = 1; - */ - const CHARGEBACK = 1; - /** - * Indicates that the transaction had a chargeback issued related to an - * alleged unauthorized transaction from the cardholder's perspective (for - * example, the card number was stolen). - * - * Generated from protobuf enum CHARGEBACK_FRAUD = 8; - */ - const CHARGEBACK_FRAUD = 8; - /** - * Indicates that the transaction had a chargeback issued related to the - * cardholder having provided their card details but allegedly not being - * satisfied with the purchase (for example, misrepresentation, attempted - * cancellation). - * - * Generated from protobuf enum CHARGEBACK_DISPUTE = 9; - */ - const CHARGEBACK_DISPUTE = 9; - /** - * Indicates that the completed payment transaction was refunded by the - * seller. - * - * Generated from protobuf enum REFUND = 10; - */ - const REFUND = 10; - /** - * Indicates that the completed payment transaction was determined to be - * fraudulent by the seller, and was cancelled and refunded as a result. - * - * Generated from protobuf enum REFUND_FRAUD = 11; - */ - const REFUND_FRAUD = 11; - /** - * Indicates that the payment transaction was accepted, and the user was - * charged. - * - * Generated from protobuf enum TRANSACTION_ACCEPTED = 12; - */ - const TRANSACTION_ACCEPTED = 12; - /** - * Indicates that the payment transaction was declined, for example due to - * invalid card details. - * - * Generated from protobuf enum TRANSACTION_DECLINED = 13; - */ - const TRANSACTION_DECLINED = 13; - /** - * Indicates the transaction associated with the assessment is suspected of - * being fraudulent based on the payment method, billing details, shipping - * address or other transaction information. - * - * Generated from protobuf enum PAYMENT_HEURISTICS = 2; - */ - const PAYMENT_HEURISTICS = 2; - /** - * Indicates that the user was served a 2FA challenge. An old assessment - * with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been - * overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. - * This is equivalent to `FAILED_TWO_FACTOR`. - * - * Generated from protobuf enum INITIATED_TWO_FACTOR = 7; - */ - const INITIATED_TWO_FACTOR = 7; - /** - * Indicates that the user passed a 2FA challenge. - * - * Generated from protobuf enum PASSED_TWO_FACTOR = 3; - */ - const PASSED_TWO_FACTOR = 3; - /** - * Indicates that the user failed a 2FA challenge. - * - * Generated from protobuf enum FAILED_TWO_FACTOR = 4; - */ - const FAILED_TWO_FACTOR = 4; - /** - * Indicates the user provided the correct password. - * - * Generated from protobuf enum CORRECT_PASSWORD = 5; - */ - const CORRECT_PASSWORD = 5; - /** - * Indicates the user provided an incorrect password. - * - * Generated from protobuf enum INCORRECT_PASSWORD = 6; - */ - const INCORRECT_PASSWORD = 6; - /** - * Indicates that the user sent unwanted and abusive messages to other users - * of the platform, such as spam, scams, phishing, or social engineering. - * - * Generated from protobuf enum SOCIAL_SPAM = 14; - */ - const SOCIAL_SPAM = 14; - - private static $valueToName = [ - self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED', - self::CHARGEBACK => 'CHARGEBACK', - self::CHARGEBACK_FRAUD => 'CHARGEBACK_FRAUD', - self::CHARGEBACK_DISPUTE => 'CHARGEBACK_DISPUTE', - self::REFUND => 'REFUND', - self::REFUND_FRAUD => 'REFUND_FRAUD', - self::TRANSACTION_ACCEPTED => 'TRANSACTION_ACCEPTED', - self::TRANSACTION_DECLINED => 'TRANSACTION_DECLINED', - self::PAYMENT_HEURISTICS => 'PAYMENT_HEURISTICS', - self::INITIATED_TWO_FACTOR => 'INITIATED_TWO_FACTOR', - self::PASSED_TWO_FACTOR => 'PASSED_TWO_FACTOR', - self::FAILED_TWO_FACTOR => 'FAILED_TWO_FACTOR', - self::CORRECT_PASSWORD => 'CORRECT_PASSWORD', - self::INCORRECT_PASSWORD => 'INCORRECT_PASSWORD', - self::SOCIAL_SPAM => 'SOCIAL_SPAM', - ]; - - 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(Reason::class, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest_Reason::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php deleted file mode 100644 index f38a573bcb4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AnnotateAssessmentResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse - */ -class AnnotateAssessmentResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php deleted file mode 100644 index 3e68e2c4d4a..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AppleDeveloperId.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AppleDeveloperId - */ -class AppleDeveloperId extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Input only. A private key (downloaded as a text file with a .p8 - * file extension) generated for your Apple Developer account. Ensure that - * Apple DeviceCheck is enabled for the private key. - * - * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $private_key = ''; - /** - * Required. The Apple developer key ID (10-character string). - * - * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key_id = ''; - /** - * Required. The Apple team ID (10-character string) owning the provisioning - * profile used to build your application. - * - * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $team_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $private_key - * Required. Input only. A private key (downloaded as a text file with a .p8 - * file extension) generated for your Apple Developer account. Ensure that - * Apple DeviceCheck is enabled for the private key. - * @type string $key_id - * Required. The Apple developer key ID (10-character string). - * @type string $team_id - * Required. The Apple team ID (10-character string) owning the provisioning - * profile used to build your application. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. Input only. A private key (downloaded as a text file with a .p8 - * file extension) generated for your Apple Developer account. Ensure that - * Apple DeviceCheck is enabled for the private key. - * - * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPrivateKey() - { - return $this->private_key; - } - - /** - * Required. Input only. A private key (downloaded as a text file with a .p8 - * file extension) generated for your Apple Developer account. Ensure that - * Apple DeviceCheck is enabled for the private key. - * - * Generated from protobuf field string private_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPrivateKey($var) - { - GPBUtil::checkString($var, True); - $this->private_key = $var; - - return $this; - } - - /** - * Required. The Apple developer key ID (10-character string). - * - * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKeyId() - { - return $this->key_id; - } - - /** - * Required. The Apple developer key ID (10-character string). - * - * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKeyId($var) - { - GPBUtil::checkString($var, True); - $this->key_id = $var; - - return $this; - } - - /** - * Required. The Apple team ID (10-character string) owning the provisioning - * profile used to build your application. - * - * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTeamId() - { - return $this->team_id; - } - - /** - * Required. The Apple team ID (10-character string) owning the provisioning - * profile used to build your application. - * - * Generated from protobuf field string team_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTeamId($var) - { - GPBUtil::checkString($var, True); - $this->team_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php deleted file mode 100644 index 841569a1b29..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Assessment.php +++ /dev/null @@ -1,599 +0,0 @@ -google.cloud.recaptchaenterprise.v1.Assessment - */ -class Assessment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Identifier. The resource name for the Assessment in the format - * `projects/{project}/assessments/{assessment}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Optional. The event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event = null; - /** - * Output only. The risk analysis result for the event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $risk_analysis = null; - /** - * Output only. Properties of the provided event token. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $token_properties = null; - /** - * Optional. Account verification information for identity verification. The - * assessment event must include a token and site key to use this feature. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $account_verification = null; - /** - * Output only. Assessment returned by account defender when an account - * identifier is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $account_defender_assessment = null; - /** - * Optional. The private password leak verification field contains the - * parameters that are used to to check for leaks privately without sharing - * user credentials. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $private_password_leak_verification = null; - /** - * Output only. Assessment returned when firewall policies belonging to the - * project are evaluated using the field firewall_policy_evaluation. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $firewall_policy_assessment = null; - /** - * Output only. Assessment returned by Fraud Prevention when TransactionData - * is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $fraud_prevention_assessment = null; - /** - * Output only. Fraud Signals specific to the users involved in a payment - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $fraud_signals = null; - /** - * Output only. Assessment returned when a site key, a token, and a phone - * number as `user_id` are provided. Account defender and SMS toll fraud - * protection need to be enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $phone_fraud_assessment = null; - /** - * Optional. The environment creating the assessment. This describes your - * environment (the system invoking CreateAssessment), NOT the environment of - * your user. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $assessment_environment = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Identifier. The resource name for the Assessment in the format - * `projects/{project}/assessments/{assessment}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\Event $event - * Optional. The event being assessed. - * @type \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $risk_analysis - * Output only. The risk analysis result for the event being assessed. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $token_properties - * Output only. Properties of the provided event token. - * @type \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo $account_verification - * Optional. Account verification information for identity verification. The - * assessment event must include a token and site key to use this feature. - * @type \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $account_defender_assessment - * Output only. Assessment returned by account defender when an account - * identifier is provided. - * @type \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification $private_password_leak_verification - * Optional. The private password leak verification field contains the - * parameters that are used to to check for leaks privately without sharing - * user credentials. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment $firewall_policy_assessment - * Output only. Assessment returned when firewall policies belonging to the - * project are evaluated using the field firewall_policy_evaluation. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment $fraud_prevention_assessment - * Output only. Assessment returned by Fraud Prevention when TransactionData - * is provided. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals $fraud_signals - * Output only. Fraud Signals specific to the users involved in a payment - * transaction. - * @type \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment $phone_fraud_assessment - * Output only. Assessment returned when a site key, a token, and a phone - * number as `user_id` are provided. Account defender and SMS toll fraud - * protection need to be enabled. - * @type \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment $assessment_environment - * Optional. The environment creating the assessment. This describes your - * environment (the system invoking CreateAssessment), NOT the environment of - * your user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Identifier. The resource name for the Assessment in the format - * `projects/{project}/assessments/{assessment}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Identifier. The resource name for the Assessment in the format - * `projects/{project}/assessments/{assessment}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\Event|null - */ - public function getEvent() - { - return $this->event; - } - - public function hasEvent() - { - return isset($this->event); - } - - public function clearEvent() - { - unset($this->event); - } - - /** - * Optional. The event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event event = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\Event $var - * @return $this - */ - public function setEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Event::class); - $this->event = $var; - - return $this; - } - - /** - * Output only. The risk analysis result for the event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis|null - */ - public function getRiskAnalysis() - { - return $this->risk_analysis; - } - - public function hasRiskAnalysis() - { - return isset($this->risk_analysis); - } - - public function clearRiskAnalysis() - { - unset($this->risk_analysis); - } - - /** - * Output only. The risk analysis result for the event being assessed. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $var - * @return $this - */ - public function setRiskAnalysis($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis::class); - $this->risk_analysis = $var; - - return $this; - } - - /** - * Output only. Properties of the provided event token. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties|null - */ - public function getTokenProperties() - { - return $this->token_properties; - } - - public function hasTokenProperties() - { - return isset($this->token_properties); - } - - public function clearTokenProperties() - { - unset($this->token_properties); - } - - /** - * Output only. Properties of the provided event token. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $var - * @return $this - */ - public function setTokenProperties($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties::class); - $this->token_properties = $var; - - return $this; - } - - /** - * Optional. Account verification information for identity verification. The - * assessment event must include a token and site key to use this feature. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo|null - */ - public function getAccountVerification() - { - return $this->account_verification; - } - - public function hasAccountVerification() - { - return isset($this->account_verification); - } - - public function clearAccountVerification() - { - unset($this->account_verification); - } - - /** - * Optional. Account verification information for identity verification. The - * assessment event must include a token and site key to use this feature. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountVerificationInfo account_verification = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo $var - * @return $this - */ - public function setAccountVerification($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo::class); - $this->account_verification = $var; - - return $this; - } - - /** - * Output only. Assessment returned by account defender when an account - * identifier is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment|null - */ - public function getAccountDefenderAssessment() - { - return $this->account_defender_assessment; - } - - public function hasAccountDefenderAssessment() - { - return isset($this->account_defender_assessment); - } - - public function clearAccountDefenderAssessment() - { - unset($this->account_defender_assessment); - } - - /** - * Output only. Assessment returned by account defender when an account - * identifier is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $var - * @return $this - */ - public function setAccountDefenderAssessment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment::class); - $this->account_defender_assessment = $var; - - return $this; - } - - /** - * Optional. The private password leak verification field contains the - * parameters that are used to to check for leaks privately without sharing - * user credentials. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification|null - */ - public function getPrivatePasswordLeakVerification() - { - return $this->private_password_leak_verification; - } - - public function hasPrivatePasswordLeakVerification() - { - return isset($this->private_password_leak_verification); - } - - public function clearPrivatePasswordLeakVerification() - { - unset($this->private_password_leak_verification); - } - - /** - * Optional. The private password leak verification field contains the - * parameters that are used to to check for leaks privately without sharing - * user credentials. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification private_password_leak_verification = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification $var - * @return $this - */ - public function setPrivatePasswordLeakVerification($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\PrivatePasswordLeakVerification::class); - $this->private_password_leak_verification = $var; - - return $this; - } - - /** - * Output only. Assessment returned when firewall policies belonging to the - * project are evaluated using the field firewall_policy_evaluation. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment|null - */ - public function getFirewallPolicyAssessment() - { - return $this->firewall_policy_assessment; - } - - public function hasFirewallPolicyAssessment() - { - return isset($this->firewall_policy_assessment); - } - - public function clearFirewallPolicyAssessment() - { - unset($this->firewall_policy_assessment); - } - - /** - * Output only. Assessment returned when firewall policies belonging to the - * project are evaluated using the field firewall_policy_evaluation. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment firewall_policy_assessment = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment $var - * @return $this - */ - public function setFirewallPolicyAssessment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicyAssessment::class); - $this->firewall_policy_assessment = $var; - - return $this; - } - - /** - * Output only. Assessment returned by Fraud Prevention when TransactionData - * is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment|null - */ - public function getFraudPreventionAssessment() - { - return $this->fraud_prevention_assessment; - } - - public function hasFraudPreventionAssessment() - { - return isset($this->fraud_prevention_assessment); - } - - public function clearFraudPreventionAssessment() - { - unset($this->fraud_prevention_assessment); - } - - /** - * Output only. Assessment returned by Fraud Prevention when TransactionData - * is provided. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment fraud_prevention_assessment = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment $var - * @return $this - */ - public function setFraudPreventionAssessment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment::class); - $this->fraud_prevention_assessment = $var; - - return $this; - } - - /** - * Output only. Fraud Signals specific to the users involved in a payment - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals|null - */ - public function getFraudSignals() - { - return $this->fraud_signals; - } - - public function hasFraudSignals() - { - return isset($this->fraud_signals); - } - - public function clearFraudSignals() - { - unset($this->fraud_signals); - } - - /** - * Output only. Fraud Signals specific to the users involved in a payment - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals fraud_signals = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals $var - * @return $this - */ - public function setFraudSignals($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals::class); - $this->fraud_signals = $var; - - return $this; - } - - /** - * Output only. Assessment returned when a site key, a token, and a phone - * number as `user_id` are provided. Account defender and SMS toll fraud - * protection need to be enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment|null - */ - public function getPhoneFraudAssessment() - { - return $this->phone_fraud_assessment; - } - - public function hasPhoneFraudAssessment() - { - return isset($this->phone_fraud_assessment); - } - - public function clearPhoneFraudAssessment() - { - unset($this->phone_fraud_assessment); - } - - /** - * Output only. Assessment returned when a site key, a token, and a phone - * number as `user_id` are provided. Account defender and SMS toll fraud - * protection need to be enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment phone_fraud_assessment = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment $var - * @return $this - */ - public function setPhoneFraudAssessment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\PhoneFraudAssessment::class); - $this->phone_fraud_assessment = $var; - - return $this; - } - - /** - * Optional. The environment creating the assessment. This describes your - * environment (the system invoking CreateAssessment), NOT the environment of - * your user. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment|null - */ - public function getAssessmentEnvironment() - { - return $this->assessment_environment; - } - - public function hasAssessmentEnvironment() - { - return isset($this->assessment_environment); - } - - public function clearAssessmentEnvironment() - { - unset($this->assessment_environment); - } - - /** - * Optional. The environment creating the assessment. This describes your - * environment (the system invoking CreateAssessment), NOT the environment of - * your user. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AssessmentEnvironment assessment_environment = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment $var - * @return $this - */ - public function setAssessmentEnvironment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AssessmentEnvironment::class); - $this->assessment_environment = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php deleted file mode 100644 index 049d27d4354..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/AssessmentEnvironment.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.recaptchaenterprise.v1.AssessmentEnvironment - */ -class AssessmentEnvironment extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Identifies the client module initiating the CreateAssessment - * request. This can be the link to the client module's project. Examples - * include: - * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" - * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" - * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" - * - "wordpress.org/plugins/recaptcha-something" - * - * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $client = ''; - /** - * Optional. The version of the client module. For example, "1.0.0". - * - * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $client - * Optional. Identifies the client module initiating the CreateAssessment - * request. This can be the link to the client module's project. Examples - * include: - * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" - * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" - * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" - * - "wordpress.org/plugins/recaptcha-something" - * @type string $version - * Optional. The version of the client module. For example, "1.0.0". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Identifies the client module initiating the CreateAssessment - * request. This can be the link to the client module's project. Examples - * include: - * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" - * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" - * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" - * - "wordpress.org/plugins/recaptcha-something" - * - * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getClient() - { - return $this->client; - } - - /** - * Optional. Identifies the client module initiating the CreateAssessment - * request. This can be the link to the client module's project. Examples - * include: - * - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" - * - "cloud.google.com/recaptcha/docs/implement-waf-akamai" - * - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" - * - "wordpress.org/plugins/recaptcha-something" - * - * Generated from protobuf field string client = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setClient($var) - { - GPBUtil::checkString($var, True); - $this->client = $var; - - return $this; - } - - /** - * Optional. The version of the client module. For example, "1.0.0". - * - * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Optional. The version of the client module. For example, "1.0.0". - * - * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php deleted file mode 100644 index a1ce9c36cfc..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ChallengeMetrics.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ChallengeMetrics - */ -class ChallengeMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent - * to a count of pageloads for pages that include reCAPTCHA. - * - * Generated from protobuf field int64 pageload_count = 1; - */ - protected $pageload_count = 0; - /** - * Count of nocaptchas (successful verification without a challenge) issued. - * - * Generated from protobuf field int64 nocaptcha_count = 2; - */ - protected $nocaptcha_count = 0; - /** - * Count of submitted challenge solutions that were incorrect or otherwise - * deemed suspicious such that a subsequent challenge was triggered. - * - * Generated from protobuf field int64 failed_count = 3; - */ - protected $failed_count = 0; - /** - * Count of nocaptchas (successful verification without a challenge) plus - * submitted challenge solutions that were correct and resulted in - * verification. - * - * Generated from protobuf field int64 passed_count = 4; - */ - protected $passed_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $pageload_count - * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent - * to a count of pageloads for pages that include reCAPTCHA. - * @type int|string $nocaptcha_count - * Count of nocaptchas (successful verification without a challenge) issued. - * @type int|string $failed_count - * Count of submitted challenge solutions that were incorrect or otherwise - * deemed suspicious such that a subsequent challenge was triggered. - * @type int|string $passed_count - * Count of nocaptchas (successful verification without a challenge) plus - * submitted challenge solutions that were correct and resulted in - * verification. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent - * to a count of pageloads for pages that include reCAPTCHA. - * - * Generated from protobuf field int64 pageload_count = 1; - * @return int|string - */ - public function getPageloadCount() - { - return $this->pageload_count; - } - - /** - * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent - * to a count of pageloads for pages that include reCAPTCHA. - * - * Generated from protobuf field int64 pageload_count = 1; - * @param int|string $var - * @return $this - */ - public function setPageloadCount($var) - { - GPBUtil::checkInt64($var); - $this->pageload_count = $var; - - return $this; - } - - /** - * Count of nocaptchas (successful verification without a challenge) issued. - * - * Generated from protobuf field int64 nocaptcha_count = 2; - * @return int|string - */ - public function getNocaptchaCount() - { - return $this->nocaptcha_count; - } - - /** - * Count of nocaptchas (successful verification without a challenge) issued. - * - * Generated from protobuf field int64 nocaptcha_count = 2; - * @param int|string $var - * @return $this - */ - public function setNocaptchaCount($var) - { - GPBUtil::checkInt64($var); - $this->nocaptcha_count = $var; - - return $this; - } - - /** - * Count of submitted challenge solutions that were incorrect or otherwise - * deemed suspicious such that a subsequent challenge was triggered. - * - * Generated from protobuf field int64 failed_count = 3; - * @return int|string - */ - public function getFailedCount() - { - return $this->failed_count; - } - - /** - * Count of submitted challenge solutions that were incorrect or otherwise - * deemed suspicious such that a subsequent challenge was triggered. - * - * Generated from protobuf field int64 failed_count = 3; - * @param int|string $var - * @return $this - */ - public function setFailedCount($var) - { - GPBUtil::checkInt64($var); - $this->failed_count = $var; - - return $this; - } - - /** - * Count of nocaptchas (successful verification without a challenge) plus - * submitted challenge solutions that were correct and resulted in - * verification. - * - * Generated from protobuf field int64 passed_count = 4; - * @return int|string - */ - public function getPassedCount() - { - return $this->passed_count; - } - - /** - * Count of nocaptchas (successful verification without a challenge) plus - * submitted challenge solutions that were correct and resulted in - * verification. - * - * Generated from protobuf field int64 passed_count = 4; - * @param int|string $var - * @return $this - */ - public function setPassedCount($var) - { - GPBUtil::checkInt64($var); - $this->passed_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php deleted file mode 100644 index 942b225a585..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateAssessmentRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest - */ -class CreateAssessmentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which the assessment is created, - * in the format `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The assessment details. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $assessment = null; - - /** - * @param string $parent Required. The name of the project in which the assessment is created, - * in the format `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment Required. The assessment details. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateAssessmentRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment): self - { - return (new self()) - ->setParent($parent) - ->setAssessment($assessment); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which the assessment is created, - * in the format `projects/{project}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\Assessment $assessment - * Required. The assessment details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which the assessment is created, - * in the format `projects/{project}`. - * - * 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 name of the project in which the assessment is created, - * in the format `projects/{project}`. - * - * 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 assessment details. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\Assessment|null - */ - public function getAssessment() - { - return $this->assessment; - } - - public function hasAssessment() - { - return isset($this->assessment); - } - - public function clearAssessment() - { - unset($this->assessment); - } - - /** - * Required. The assessment details. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Assessment assessment = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\Assessment $var - * @return $this - */ - public function setAssessment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Assessment::class); - $this->assessment = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php deleted file mode 100644 index 0ffdf73d76d..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateFirewallPolicyRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest - */ -class CreateFirewallPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project this policy applies to, in the format - * `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Information to create the policy. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $firewall_policy = null; - - /** - * @param string $parent Required. The name of the project this policy applies to, in the format - * `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy Required. Information to create the policy. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateFirewallPolicyRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy): self - { - return (new self()) - ->setParent($parent) - ->setFirewallPolicy($firewallPolicy); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project this policy applies to, in the format - * `projects/{project}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy - * Required. Information to create the policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project this policy applies to, in the format - * `projects/{project}`. - * - * 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 name of the project this policy applies to, in the format - * `projects/{project}`. - * - * 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. Information to create the policy. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null - */ - public function getFirewallPolicy() - { - return $this->firewall_policy; - } - - public function hasFirewallPolicy() - { - return isset($this->firewall_policy); - } - - public function clearFirewallPolicy() - { - unset($this->firewall_policy); - } - - /** - * Required. Information to create the policy. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var - * @return $this - */ - public function setFirewallPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); - $this->firewall_policy = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php deleted file mode 100644 index 24d4ef5c928..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/CreateKeyRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.recaptchaenterprise.v1.CreateKeyRequest - */ -class CreateKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project in which the key is created, in the - * format `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Information to create a reCAPTCHA Enterprise key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key = null; - - /** - * @param string $parent Required. The name of the project in which the key is created, in the - * format `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $key Required. Information to create a reCAPTCHA Enterprise key. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\CreateKeyRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\Key $key): self - { - return (new self()) - ->setParent($parent) - ->setKey($key); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project in which the key is created, in the - * format `projects/{project}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\Key $key - * Required. Information to create a reCAPTCHA Enterprise key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project in which the key is created, in the - * format `projects/{project}`. - * - * 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 name of the project in which the key is created, in the - * format `projects/{project}`. - * - * 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. Information to create a reCAPTCHA Enterprise key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\Key|null - */ - public function getKey() - { - return $this->key; - } - - public function hasKey() - { - return isset($this->key); - } - - public function clearKey() - { - unset($this->key); - } - - /** - * Required. Information to create a reCAPTCHA Enterprise key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); - $this->key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php deleted file mode 100644 index 8d57bd78b9b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteFirewallPolicyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest - */ -class DeleteFirewallPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see - * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\DeleteFirewallPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * 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 name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php deleted file mode 100644 index f949c7b62a3..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/DeleteKeyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.DeleteKeyRequest - */ -class DeleteKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\DeleteKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. - * - * 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 name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php deleted file mode 100644 index 44cd0299f8f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/EndpointVerificationInfo.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo - */ -class EndpointVerificationInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Token to provide to the client to trigger endpoint - * verification. It must be used within 15 minutes. - * - * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $request_token = ''; - /** - * Output only. Timestamp of the last successful verification for the - * endpoint, if any. - * - * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_verification_time = null; - protected $endpoint; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $email_address - * Email address for which to trigger a verification request. - * @type string $phone_number - * Phone number for which to trigger a verification request. Should be given - * in E.164 format. - * @type string $request_token - * Output only. Token to provide to the client to trigger endpoint - * verification. It must be used within 15 minutes. - * @type \Google\Protobuf\Timestamp $last_verification_time - * Output only. Timestamp of the last successful verification for the - * endpoint, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Email address for which to trigger a verification request. - * - * Generated from protobuf field string email_address = 1; - * @return string - */ - public function getEmailAddress() - { - return $this->readOneof(1); - } - - public function hasEmailAddress() - { - return $this->hasOneof(1); - } - - /** - * Email address for which to trigger a verification request. - * - * Generated from protobuf field string email_address = 1; - * @param string $var - * @return $this - */ - public function setEmailAddress($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Phone number for which to trigger a verification request. Should be given - * in E.164 format. - * - * Generated from protobuf field string phone_number = 2; - * @return string - */ - public function getPhoneNumber() - { - return $this->readOneof(2); - } - - public function hasPhoneNumber() - { - return $this->hasOneof(2); - } - - /** - * Phone number for which to trigger a verification request. Should be given - * in E.164 format. - * - * Generated from protobuf field string phone_number = 2; - * @param string $var - * @return $this - */ - public function setPhoneNumber($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Output only. Token to provide to the client to trigger endpoint - * verification. It must be used within 15 minutes. - * - * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRequestToken() - { - return $this->request_token; - } - - /** - * Output only. Token to provide to the client to trigger endpoint - * verification. It must be used within 15 minutes. - * - * Generated from protobuf field string request_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRequestToken($var) - { - GPBUtil::checkString($var, True); - $this->request_token = $var; - - return $this; - } - - /** - * Output only. Timestamp of the last successful verification for the - * endpoint, if any. - * - * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastVerificationTime() - { - return $this->last_verification_time; - } - - public function hasLastVerificationTime() - { - return isset($this->last_verification_time); - } - - public function clearLastVerificationTime() - { - unset($this->last_verification_time); - } - - /** - * Output only. Timestamp of the last successful verification for the - * endpoint, if any. - * - * Generated from protobuf field .google.protobuf.Timestamp last_verification_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastVerificationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_verification_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getEndpoint() - { - return $this->whichOneof("endpoint"); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php deleted file mode 100644 index bffdd6b4135..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event.php +++ /dev/null @@ -1,640 +0,0 @@ -google.cloud.recaptchaenterprise.v1.Event - */ -class Event extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The user response token provided by the reCAPTCHA Enterprise - * client-side integration on your site. - * - * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $token = ''; - /** - * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your - * site and generate the token. - * - * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $site_key = ''; - /** - * Optional. The user agent present in the request from the user's device - * related to this event. - * - * Generated from protobuf field string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_agent = ''; - /** - * Optional. The IP address in the request from the user's device related to - * this event. - * - * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - */ - protected $user_ip_address = ''; - /** - * Optional. The expected action for this type of event. This should be the - * same action provided at token generation time on client-side platforms - * already integrated with recaptcha enterprise. - * - * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $expected_action = ''; - /** - * Optional. Deprecated: use `user_info.account_id` instead. - * Unique stable hashed user identifier for the request. The identifier must - * be hashed using hmac-sha256 with stable secret. - * - * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $hashed_account_id = ''; - /** - * Optional. Flag for a reCAPTCHA express request for an assessment without a - * token. If enabled, `site_key` must reference an Express site key. - * - * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $express = false; - /** - * Optional. The URI resource the user requested that triggered an assessment. - * - * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $requested_uri = ''; - /** - * Optional. Flag for running WAF token assessment. - * If enabled, the token must be specified, and have been created by a - * WAF-enabled key. - * - * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $waf_token_assessment = false; - /** - * Optional. JA3 fingerprint for SSL clients. - * - * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ja3 = ''; - /** - * Optional. HTTP header information about the request. - * - * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $headers; - /** - * Optional. Flag for enabling firewall policy config assessment. - * If this flag is enabled, the firewall policy is evaluated and a - * suggested firewall action is returned in the response. - * - * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $firewall_policy_evaluation = false; - /** - * Optional. Data describing a payment transaction to be assessed. Sending - * this data enables reCAPTCHA Enterprise Fraud Prevention and the - * FraudPreventionAssessment component in the response. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transaction_data = null; - /** - * Optional. Information about the user that generates this event, when they - * can be identified. They are often identified through the use of an account - * for logged-in requests or login/registration requests, or by providing user - * identifiers for guest actions like checkout. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_info = null; - /** - * Optional. The Fraud Prevention setting for this assessment. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $fraud_prevention = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $token - * Optional. The user response token provided by the reCAPTCHA Enterprise - * client-side integration on your site. - * @type string $site_key - * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your - * site and generate the token. - * @type string $user_agent - * Optional. The user agent present in the request from the user's device - * related to this event. - * @type string $user_ip_address - * Optional. The IP address in the request from the user's device related to - * this event. - * @type string $expected_action - * Optional. The expected action for this type of event. This should be the - * same action provided at token generation time on client-side platforms - * already integrated with recaptcha enterprise. - * @type string $hashed_account_id - * Optional. Deprecated: use `user_info.account_id` instead. - * Unique stable hashed user identifier for the request. The identifier must - * be hashed using hmac-sha256 with stable secret. - * @type bool $express - * Optional. Flag for a reCAPTCHA express request for an assessment without a - * token. If enabled, `site_key` must reference an Express site key. - * @type string $requested_uri - * Optional. The URI resource the user requested that triggered an assessment. - * @type bool $waf_token_assessment - * Optional. Flag for running WAF token assessment. - * If enabled, the token must be specified, and have been created by a - * WAF-enabled key. - * @type string $ja3 - * Optional. JA3 fingerprint for SSL clients. - * @type array|\Google\Protobuf\Internal\RepeatedField $headers - * Optional. HTTP header information about the request. - * @type bool $firewall_policy_evaluation - * Optional. Flag for enabling firewall policy config assessment. - * If this flag is enabled, the firewall policy is evaluated and a - * suggested firewall action is returned in the response. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData $transaction_data - * Optional. Data describing a payment transaction to be assessed. Sending - * this data enables reCAPTCHA Enterprise Fraud Prevention and the - * FraudPreventionAssessment component in the response. - * @type \Google\Cloud\RecaptchaEnterprise\V1\UserInfo $user_info - * Optional. Information about the user that generates this event, when they - * can be identified. They are often identified through the use of an account - * for logged-in requests or login/registration requests, or by providing user - * identifiers for guest actions like checkout. - * @type int $fraud_prevention - * Optional. The Fraud Prevention setting for this assessment. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The user response token provided by the reCAPTCHA Enterprise - * client-side integration on your site. - * - * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getToken() - { - return $this->token; - } - - /** - * Optional. The user response token provided by the reCAPTCHA Enterprise - * client-side integration on your site. - * - * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setToken($var) - { - GPBUtil::checkString($var, True); - $this->token = $var; - - return $this; - } - - /** - * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your - * site and generate the token. - * - * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSiteKey() - { - return $this->site_key; - } - - /** - * Optional. The site key that was used to invoke reCAPTCHA Enterprise on your - * site and generate the token. - * - * Generated from protobuf field string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSiteKey($var) - { - GPBUtil::checkString($var, True); - $this->site_key = $var; - - return $this; - } - - /** - * Optional. The user agent present in the request from the user's device - * related to this event. - * - * Generated from protobuf field string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUserAgent() - { - return $this->user_agent; - } - - /** - * Optional. The user agent present in the request from the user's device - * related to this event. - * - * Generated from protobuf field string user_agent = 3 [(.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. The IP address in the request from the user's device related to - * this event. - * - * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @return string - */ - public function getUserIpAddress() - { - return $this->user_ip_address; - } - - /** - * Optional. The IP address in the request from the user's device related to - * this event. - * - * Generated from protobuf field string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setUserIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->user_ip_address = $var; - - return $this; - } - - /** - * Optional. The expected action for this type of event. This should be the - * same action provided at token generation time on client-side platforms - * already integrated with recaptcha enterprise. - * - * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getExpectedAction() - { - return $this->expected_action; - } - - /** - * Optional. The expected action for this type of event. This should be the - * same action provided at token generation time on client-side platforms - * already integrated with recaptcha enterprise. - * - * Generated from protobuf field string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setExpectedAction($var) - { - GPBUtil::checkString($var, True); - $this->expected_action = $var; - - return $this; - } - - /** - * Optional. Deprecated: use `user_info.account_id` instead. - * Unique stable hashed user identifier for the request. The identifier must - * be hashed using hmac-sha256 with stable secret. - * - * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getHashedAccountId() - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - return $this->hashed_account_id; - } - - /** - * Optional. Deprecated: use `user_info.account_id` instead. - * Unique stable hashed user identifier for the request. The identifier must - * be hashed using hmac-sha256 with stable secret. - * - * Generated from protobuf field bytes hashed_account_id = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setHashedAccountId($var) - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, False); - $this->hashed_account_id = $var; - - return $this; - } - - /** - * Optional. Flag for a reCAPTCHA express request for an assessment without a - * token. If enabled, `site_key` must reference an Express site key. - * - * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getExpress() - { - return $this->express; - } - - /** - * Optional. Flag for a reCAPTCHA express request for an assessment without a - * token. If enabled, `site_key` must reference an Express site key. - * - * Generated from protobuf field bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setExpress($var) - { - GPBUtil::checkBool($var); - $this->express = $var; - - return $this; - } - - /** - * Optional. The URI resource the user requested that triggered an assessment. - * - * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestedUri() - { - return $this->requested_uri; - } - - /** - * Optional. The URI resource the user requested that triggered an assessment. - * - * Generated from protobuf field string requested_uri = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestedUri($var) - { - GPBUtil::checkString($var, True); - $this->requested_uri = $var; - - return $this; - } - - /** - * Optional. Flag for running WAF token assessment. - * If enabled, the token must be specified, and have been created by a - * WAF-enabled key. - * - * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getWafTokenAssessment() - { - return $this->waf_token_assessment; - } - - /** - * Optional. Flag for running WAF token assessment. - * If enabled, the token must be specified, and have been created by a - * WAF-enabled key. - * - * Generated from protobuf field bool waf_token_assessment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setWafTokenAssessment($var) - { - GPBUtil::checkBool($var); - $this->waf_token_assessment = $var; - - return $this; - } - - /** - * Optional. JA3 fingerprint for SSL clients. - * - * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getJa3() - { - return $this->ja3; - } - - /** - * Optional. JA3 fingerprint for SSL clients. - * - * Generated from protobuf field string ja3 = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setJa3($var) - { - GPBUtil::checkString($var, True); - $this->ja3 = $var; - - return $this; - } - - /** - * Optional. HTTP header information about the request. - * - * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Optional. HTTP header information about the request. - * - * Generated from protobuf field repeated string headers = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * Optional. Flag for enabling firewall policy config assessment. - * If this flag is enabled, the firewall policy is evaluated and a - * suggested firewall action is returned in the response. - * - * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getFirewallPolicyEvaluation() - { - return $this->firewall_policy_evaluation; - } - - /** - * Optional. Flag for enabling firewall policy config assessment. - * If this flag is enabled, the firewall policy is evaluated and a - * suggested firewall action is returned in the response. - * - * Generated from protobuf field bool firewall_policy_evaluation = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setFirewallPolicyEvaluation($var) - { - GPBUtil::checkBool($var); - $this->firewall_policy_evaluation = $var; - - return $this; - } - - /** - * Optional. Data describing a payment transaction to be assessed. Sending - * this data enables reCAPTCHA Enterprise Fraud Prevention and the - * FraudPreventionAssessment component in the response. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData|null - */ - public function getTransactionData() - { - return $this->transaction_data; - } - - public function hasTransactionData() - { - return isset($this->transaction_data); - } - - public function clearTransactionData() - { - unset($this->transaction_data); - } - - /** - * Optional. Data describing a payment transaction to be assessed. Sending - * this data enables reCAPTCHA Enterprise Fraud Prevention and the - * FraudPreventionAssessment component in the response. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData transaction_data = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData $var - * @return $this - */ - public function setTransactionData($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData::class); - $this->transaction_data = $var; - - return $this; - } - - /** - * Optional. Information about the user that generates this event, when they - * can be identified. They are often identified through the use of an account - * for logged-in requests or login/registration requests, or by providing user - * identifiers for guest actions like checkout. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\UserInfo|null - */ - public function getUserInfo() - { - return $this->user_info; - } - - public function hasUserInfo() - { - return isset($this->user_info); - } - - public function clearUserInfo() - { - unset($this->user_info); - } - - /** - * Optional. Information about the user that generates this event, when they - * can be identified. They are often identified through the use of an account - * for logged-in requests or login/registration requests, or by providing user - * identifiers for guest actions like checkout. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\UserInfo $var - * @return $this - */ - public function setUserInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\UserInfo::class); - $this->user_info = $var; - - return $this; - } - - /** - * Optional. The Fraud Prevention setting for this assessment. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getFraudPrevention() - { - return $this->fraud_prevention; - } - - /** - * Optional. The Fraud Prevention setting for this assessment. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setFraudPrevention($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\Event\FraudPrevention::class); - $this->fraud_prevention = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php deleted file mode 100644 index 5650681f23e..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Event/FraudPrevention.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.recaptchaenterprise.v1.Event.FraudPrevention - */ -class FraudPrevention -{ - /** - * Default, unspecified setting. If opted in for automatic detection, - * `fraud_prevention_assessment` is returned based on the request. - * Otherwise, `fraud_prevention_assessment` is returned if - * `transaction_data` is present in the `Event` and Fraud Prevention is - * enabled in the Google Cloud console. - * - * Generated from protobuf enum FRAUD_PREVENTION_UNSPECIFIED = 0; - */ - const FRAUD_PREVENTION_UNSPECIFIED = 0; - /** - * Enable Fraud Prevention for this assessment, if Fraud Prevention is - * enabled in the Google Cloud console. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * Disable Fraud Prevention for this assessment, regardless of opt-in - * status or Google Cloud console settings. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::FRAUD_PREVENTION_UNSPECIFIED => 'FRAUD_PREVENTION_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - ]; - - 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(FraudPrevention::class, \Google\Cloud\RecaptchaEnterprise\V1\Event_FraudPrevention::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php deleted file mode 100644 index 6fcd12db202..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ExpressKeySettings.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ExpressKeySettings - */ -class ExpressKeySettings extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php deleted file mode 100644 index b5be30f5734..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction.php +++ /dev/null @@ -1,259 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction - */ -class FirewallAction extends \Google\Protobuf\Internal\Message -{ - protected $firewall_action_oneof; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction $allow - * The user request did not match any policy and should be allowed - * access to the requested resource. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction $block - * This action denies access to a given page. The user gets an HTTP - * error code. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction $include_recaptcha_script - * This action injects reCAPTCHA JavaScript code into the HTML page - * returned by the site backend. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction $redirect - * This action redirects the request to a reCAPTCHA interstitial to - * attach a token. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction $substitute - * This action transparently serves a different page to an offending - * user. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction $set_header - * This action sets a custom header but allow the request to continue - * to the customer backend. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * The user request did not match any policy and should be allowed - * access to the requested resource. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction allow = 1; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction|null - */ - public function getAllow() - { - return $this->readOneof(1); - } - - public function hasAllow() - { - return $this->hasOneof(1); - } - - /** - * The user request did not match any policy and should be allowed - * access to the requested resource. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction allow = 1; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction $var - * @return $this - */ - public function setAllow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\AllowAction::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * This action denies access to a given page. The user gets an HTTP - * error code. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction block = 2; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction|null - */ - public function getBlock() - { - return $this->readOneof(2); - } - - public function hasBlock() - { - return $this->hasOneof(2); - } - - /** - * This action denies access to a given page. The user gets an HTTP - * error code. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction block = 2; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction $var - * @return $this - */ - public function setBlock($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\BlockAction::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * This action injects reCAPTCHA JavaScript code into the HTML page - * returned by the site backend. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction include_recaptcha_script = 6; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction|null - */ - public function getIncludeRecaptchaScript() - { - return $this->readOneof(6); - } - - public function hasIncludeRecaptchaScript() - { - return $this->hasOneof(6); - } - - /** - * This action injects reCAPTCHA JavaScript code into the HTML page - * returned by the site backend. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction include_recaptcha_script = 6; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction $var - * @return $this - */ - public function setIncludeRecaptchaScript($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\IncludeRecaptchaScriptAction::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * This action redirects the request to a reCAPTCHA interstitial to - * attach a token. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction redirect = 5; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction|null - */ - public function getRedirect() - { - return $this->readOneof(5); - } - - public function hasRedirect() - { - return $this->hasOneof(5); - } - - /** - * This action redirects the request to a reCAPTCHA interstitial to - * attach a token. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction redirect = 5; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction $var - * @return $this - */ - public function setRedirect($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\RedirectAction::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * This action transparently serves a different page to an offending - * user. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction substitute = 3; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction|null - */ - public function getSubstitute() - { - return $this->readOneof(3); - } - - public function hasSubstitute() - { - return $this->hasOneof(3); - } - - /** - * This action transparently serves a different page to an offending - * user. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction substitute = 3; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction $var - * @return $this - */ - public function setSubstitute($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SubstituteAction::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * This action sets a custom header but allow the request to continue - * to the customer backend. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction set_header = 4; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction|null - */ - public function getSetHeader() - { - return $this->readOneof(4); - } - - public function hasSetHeader() - { - return $this->hasOneof(4); - } - - /** - * This action sets a custom header but allow the request to continue - * to the customer backend. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction set_header = 4; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction $var - * @return $this - */ - public function setSetHeader($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction\SetHeaderAction::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getFirewallActionOneof() - { - return $this->whichOneof("firewall_action_oneof"); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php deleted file mode 100644 index 20547eb88cf..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/AllowAction.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction - */ -class AllowAction extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AllowAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_AllowAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php deleted file mode 100644 index a8793c63387..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/BlockAction.php +++ /dev/null @@ -1,37 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction - */ -class BlockAction extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BlockAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_BlockAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php deleted file mode 100644 index 9c2df380e9b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/IncludeRecaptchaScriptAction.php +++ /dev/null @@ -1,40 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction - */ -class IncludeRecaptchaScriptAction extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IncludeRecaptchaScriptAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_IncludeRecaptchaScriptAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php deleted file mode 100644 index 308c3b4c9f5..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/RedirectAction.php +++ /dev/null @@ -1,37 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction - */ -class RedirectAction extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_RedirectAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php deleted file mode 100644 index 65d715f16ef..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SetHeaderAction.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction - */ -class SetHeaderAction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The header key to set in the request to the backend server. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $key = ''; - /** - * Optional. The header value to set in the request to the backend server. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Optional. The header key to set in the request to the backend server. - * @type string $value - * Optional. The header value to set in the request to the backend server. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The header key to set in the request to the backend server. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Optional. The header key to set in the request to the backend server. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Optional. The header value to set in the request to the backend server. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Optional. The header value to set in the request to the backend server. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetHeaderAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_SetHeaderAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php deleted file mode 100644 index ed45d8090c8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallAction/SubstituteAction.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction - */ -class SubstituteAction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The address to redirect to. The target is a relative path in - * the current host. Example: "/blog/404.html". - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. The address to redirect to. The target is a relative path in - * the current host. Example: "/blog/404.html". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The address to redirect to. The target is a relative path in - * the current host. Example: "/blog/404.html". - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. The address to redirect to. The target is a relative path in - * the current host. Example: "/blog/404.html". - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SubstituteAction::class, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction_SubstituteAction::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php deleted file mode 100644 index a034eab2792..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicy.php +++ /dev/null @@ -1,280 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallPolicy - */ -class FirewallPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. The resource name for the FirewallPolicy in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Optional. A description of what this policy aims to achieve, for - * convenience purposes. The description can at most include 256 UTF-8 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Optional. The path for which this policy applies, specified as a glob - * pattern. For more information on glob, see the [manual - * page](https://man7.org/linux/man-pages/man7/glob.7.html). - * A path has a max length of 200 characters. - * - * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - /** - * Optional. A CEL (Common Expression Language) conditional expression that - * specifies if this policy applies to an incoming user request. If this - * condition evaluates to true and the requested path matched the path - * pattern, the associated actions should be executed by the caller. The - * condition string is checked for CEL syntax correctness on creation. For - * more information, see the [CEL spec](https://github.com/google/cel-spec) - * and its [language - * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). - * A condition has a max length of 500 characters. - * - * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $condition = ''; - /** - * Optional. The actions that the caller should take regarding user access. - * There should be at most one terminal action. A terminal action is any - * action that forces a response, such as `AllowAction`, - * `BlockAction` or `SubstituteAction`. - * Zero or more non-terminal actions such as `SetHeader` might be - * specified. A single policy can contain up to 16 actions. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $actions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. The resource name for the FirewallPolicy in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * @type string $description - * Optional. A description of what this policy aims to achieve, for - * convenience purposes. The description can at most include 256 UTF-8 - * characters. - * @type string $path - * Optional. The path for which this policy applies, specified as a glob - * pattern. For more information on glob, see the [manual - * page](https://man7.org/linux/man-pages/man7/glob.7.html). - * A path has a max length of 200 characters. - * @type string $condition - * Optional. A CEL (Common Expression Language) conditional expression that - * specifies if this policy applies to an incoming user request. If this - * condition evaluates to true and the requested path matched the path - * pattern, the associated actions should be executed by the caller. The - * condition string is checked for CEL syntax correctness on creation. For - * more information, see the [CEL spec](https://github.com/google/cel-spec) - * and its [language - * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). - * A condition has a max length of 500 characters. - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $actions - * Optional. The actions that the caller should take regarding user access. - * There should be at most one terminal action. A terminal action is any - * action that forces a response, such as `AllowAction`, - * `BlockAction` or `SubstituteAction`. - * Zero or more non-terminal actions such as `SetHeader` might be - * specified. A single policy can contain up to 16 actions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. The resource name for the FirewallPolicy in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. The resource name for the FirewallPolicy in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A description of what this policy aims to achieve, for - * convenience purposes. The description can at most include 256 UTF-8 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A description of what this policy aims to achieve, for - * convenience purposes. The description can at most include 256 UTF-8 - * characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. The path for which this policy applies, specified as a glob - * pattern. For more information on glob, see the [manual - * page](https://man7.org/linux/man-pages/man7/glob.7.html). - * A path has a max length of 200 characters. - * - * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. The path for which this policy applies, specified as a glob - * pattern. For more information on glob, see the [manual - * page](https://man7.org/linux/man-pages/man7/glob.7.html). - * A path has a max length of 200 characters. - * - * Generated from protobuf field string path = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Optional. A CEL (Common Expression Language) conditional expression that - * specifies if this policy applies to an incoming user request. If this - * condition evaluates to true and the requested path matched the path - * pattern, the associated actions should be executed by the caller. The - * condition string is checked for CEL syntax correctness on creation. For - * more information, see the [CEL spec](https://github.com/google/cel-spec) - * and its [language - * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). - * A condition has a max length of 500 characters. - * - * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCondition() - { - return $this->condition; - } - - /** - * Optional. A CEL (Common Expression Language) conditional expression that - * specifies if this policy applies to an incoming user request. If this - * condition evaluates to true and the requested path matched the path - * pattern, the associated actions should be executed by the caller. The - * condition string is checked for CEL syntax correctness on creation. For - * more information, see the [CEL spec](https://github.com/google/cel-spec) - * and its [language - * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). - * A condition has a max length of 500 characters. - * - * Generated from protobuf field string condition = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkString($var, True); - $this->condition = $var; - - return $this; - } - - /** - * Optional. The actions that the caller should take regarding user access. - * There should be at most one terminal action. A terminal action is any - * action that forces a response, such as `AllowAction`, - * `BlockAction` or `SubstituteAction`. - * Zero or more non-terminal actions such as `SetHeader` might be - * specified. A single policy can contain up to 16 actions. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getActions() - { - return $this->actions; - } - - /** - * Optional. The actions that the caller should take regarding user access. - * There should be at most one terminal action. A terminal action is any - * action that forces a response, such as `AllowAction`, - * `BlockAction` or `SubstituteAction`. - * Zero or more non-terminal actions such as `SetHeader` might be - * specified. A single policy can contain up to 16 actions. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setActions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction::class); - $this->actions = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php deleted file mode 100644 index 628b81b9959..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FirewallPolicyAssessment.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment - */ -class FirewallPolicyAssessment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. If the processing of a policy config fails, an error is - * populated and the firewall_policy is left empty. - * - * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $error = null; - /** - * Output only. The policy that matched the request. If more than one policy - * may match, this is the first match. If no policy matches the incoming - * request, the policy field is left empty. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $firewall_policy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Rpc\Status $error - * Output only. If the processing of a policy config fails, an error is - * populated and the firewall_policy is left empty. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy - * Output only. The policy that matched the request. If more than one policy - * may match, this is the first match. If no policy matches the incoming - * request, the policy field is left empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. If the processing of a policy config fails, an error is - * populated and the firewall_policy is left empty. - * - * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * Output only. If the processing of a policy config fails, an error is - * populated and the firewall_policy is left empty. - * - * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * Output only. The policy that matched the request. If more than one policy - * may match, this is the first match. If no policy matches the incoming - * request, the policy field is left empty. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null - */ - public function getFirewallPolicy() - { - return $this->firewall_policy; - } - - public function hasFirewallPolicy() - { - return isset($this->firewall_policy); - } - - public function clearFirewallPolicy() - { - unset($this->firewall_policy); - } - - /** - * Output only. The policy that matched the request. If more than one policy - * may match, this is the first match. If no policy matches the incoming - * request, the policy field is left empty. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var - * @return $this - */ - public function setFirewallPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); - $this->firewall_policy = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php deleted file mode 100644 index 616799349e7..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment.php +++ /dev/null @@ -1,215 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment - */ -class FraudPreventionAssessment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Probability of this transaction being fraudulent. Summarizes - * the combined risk of attack vectors below. Values are from 0.0 (lowest) - * to 1.0 (highest). - * - * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $transaction_risk = 0.0; - /** - * Output only. Assessment of this transaction for risk of a stolen - * instrument. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $stolen_instrument_verdict = null; - /** - * Output only. Assessment of this transaction for risk of being part of a - * card testing attack. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $card_testing_verdict = null; - /** - * Output only. Assessment of this transaction for behavioral trust. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $behavioral_trust_verdict = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $transaction_risk - * Output only. Probability of this transaction being fraudulent. Summarizes - * the combined risk of attack vectors below. Values are from 0.0 (lowest) - * to 1.0 (highest). - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict $stolen_instrument_verdict - * Output only. Assessment of this transaction for risk of a stolen - * instrument. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict $card_testing_verdict - * Output only. Assessment of this transaction for risk of being part of a - * card testing attack. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict $behavioral_trust_verdict - * Output only. Assessment of this transaction for behavioral trust. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Probability of this transaction being fraudulent. Summarizes - * the combined risk of attack vectors below. Values are from 0.0 (lowest) - * to 1.0 (highest). - * - * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getTransactionRisk() - { - return $this->transaction_risk; - } - - /** - * Output only. Probability of this transaction being fraudulent. Summarizes - * the combined risk of attack vectors below. Values are from 0.0 (lowest) - * to 1.0 (highest). - * - * Generated from protobuf field float transaction_risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setTransactionRisk($var) - { - GPBUtil::checkFloat($var); - $this->transaction_risk = $var; - - return $this; - } - - /** - * Output only. Assessment of this transaction for risk of a stolen - * instrument. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict|null - */ - public function getStolenInstrumentVerdict() - { - return $this->stolen_instrument_verdict; - } - - public function hasStolenInstrumentVerdict() - { - return isset($this->stolen_instrument_verdict); - } - - public function clearStolenInstrumentVerdict() - { - unset($this->stolen_instrument_verdict); - } - - /** - * Output only. Assessment of this transaction for risk of a stolen - * instrument. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict stolen_instrument_verdict = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict $var - * @return $this - */ - public function setStolenInstrumentVerdict($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\StolenInstrumentVerdict::class); - $this->stolen_instrument_verdict = $var; - - return $this; - } - - /** - * Output only. Assessment of this transaction for risk of being part of a - * card testing attack. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict|null - */ - public function getCardTestingVerdict() - { - return $this->card_testing_verdict; - } - - public function hasCardTestingVerdict() - { - return isset($this->card_testing_verdict); - } - - public function clearCardTestingVerdict() - { - unset($this->card_testing_verdict); - } - - /** - * Output only. Assessment of this transaction for risk of being part of a - * card testing attack. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict card_testing_verdict = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict $var - * @return $this - */ - public function setCardTestingVerdict($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\CardTestingVerdict::class); - $this->card_testing_verdict = $var; - - return $this; - } - - /** - * Output only. Assessment of this transaction for behavioral trust. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict|null - */ - public function getBehavioralTrustVerdict() - { - return $this->behavioral_trust_verdict; - } - - public function hasBehavioralTrustVerdict() - { - return isset($this->behavioral_trust_verdict); - } - - public function clearBehavioralTrustVerdict() - { - unset($this->behavioral_trust_verdict); - } - - /** - * Output only. Assessment of this transaction for behavioral trust. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict behavioral_trust_verdict = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict $var - * @return $this - */ - public function setBehavioralTrustVerdict($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment\BehavioralTrustVerdict::class); - $this->behavioral_trust_verdict = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php deleted file mode 100644 index 46e30e6ef74..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/BehavioralTrustVerdict.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict - */ -class BehavioralTrustVerdict extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Probability of this transaction attempt being executed in a - * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 - * (highest). - * - * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $trust = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $trust - * Output only. Probability of this transaction attempt being executed in a - * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 - * (highest). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Probability of this transaction attempt being executed in a - * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 - * (highest). - * - * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getTrust() - { - return $this->trust; - } - - /** - * Output only. Probability of this transaction attempt being executed in a - * behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 - * (highest). - * - * Generated from protobuf field float trust = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setTrust($var) - { - GPBUtil::checkFloat($var); - $this->trust = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BehavioralTrustVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_BehavioralTrustVerdict::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php deleted file mode 100644 index 1673fe7932b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/CardTestingVerdict.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict - */ -class CardTestingVerdict extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Probability of this transaction attempt being part of a card - * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $risk = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $risk - * Output only. Probability of this transaction attempt being part of a card - * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Probability of this transaction attempt being part of a card - * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getRisk() - { - return $this->risk; - } - - /** - * Output only. Probability of this transaction attempt being part of a card - * testing attack. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setRisk($var) - { - GPBUtil::checkFloat($var); - $this->risk = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CardTestingVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_CardTestingVerdict::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php deleted file mode 100644 index b8774e74ca6..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudPreventionAssessment/StolenInstrumentVerdict.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict - */ -class StolenInstrumentVerdict extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Probability of this transaction being executed with a stolen - * instrument. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $risk = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $risk - * Output only. Probability of this transaction being executed with a stolen - * instrument. Values are from 0.0 (lowest) to 1.0 (highest). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Probability of this transaction being executed with a stolen - * instrument. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getRisk() - { - return $this->risk; - } - - /** - * Output only. Probability of this transaction being executed with a stolen - * instrument. Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setRisk($var) - { - GPBUtil::checkFloat($var); - $this->risk = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StolenInstrumentVerdict::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudPreventionAssessment_StolenInstrumentVerdict::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php deleted file mode 100644 index aba0ccfcd4b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudSignals - */ -class FraudSignals extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Signals describing the end user in this transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $user_signals = null; - /** - * Output only. Signals describing the payment card or cards used in this - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $card_signals = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals $user_signals - * Output only. Signals describing the end user in this transaction. - * @type \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals $card_signals - * Output only. Signals describing the payment card or cards used in this - * transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Signals describing the end user in this transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals|null - */ - public function getUserSignals() - { - return $this->user_signals; - } - - public function hasUserSignals() - { - return isset($this->user_signals); - } - - public function clearUserSignals() - { - unset($this->user_signals); - } - - /** - * Output only. Signals describing the end user in this transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals user_signals = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals $var - * @return $this - */ - public function setUserSignals($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\UserSignals::class); - $this->user_signals = $var; - - return $this; - } - - /** - * Output only. Signals describing the payment card or cards used in this - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals|null - */ - public function getCardSignals() - { - return $this->card_signals; - } - - public function hasCardSignals() - { - return isset($this->card_signals); - } - - public function clearCardSignals() - { - unset($this->card_signals); - } - - /** - * Output only. Signals describing the payment card or cards used in this - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals card_signals = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals $var - * @return $this - */ - public function setCardSignals($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals::class); - $this->card_signals = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php deleted file mode 100644 index 1c6e40b18d8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals - */ -class CardSignals extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The labels for the payment card in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $card_labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $card_labels - * Output only. The labels for the payment card in this transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The labels for the payment card in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCardLabels() - { - return $this->card_labels; - } - - /** - * Output only. The labels for the payment card in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel card_labels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCardLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals\CardSignals\CardLabel::class); - $this->card_labels = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CardSignals::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_CardSignals::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php deleted file mode 100644 index e3e8e94649f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/CardSignals/CardLabel.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel - */ -class CardLabel -{ - /** - * No label specified. - * - * Generated from protobuf enum CARD_LABEL_UNSPECIFIED = 0; - */ - const CARD_LABEL_UNSPECIFIED = 0; - /** - * This card has been detected as prepaid. - * - * Generated from protobuf enum PREPAID = 1; - */ - const PREPAID = 1; - /** - * This card has been detected as virtual, such as a card number generated - * for a single transaction or merchant. - * - * Generated from protobuf enum VIRTUAL = 2; - */ - const VIRTUAL = 2; - /** - * This card has been detected as being used in an unexpected geographic - * location. - * - * Generated from protobuf enum UNEXPECTED_LOCATION = 3; - */ - const UNEXPECTED_LOCATION = 3; - - private static $valueToName = [ - self::CARD_LABEL_UNSPECIFIED => 'CARD_LABEL_UNSPECIFIED', - self::PREPAID => 'PREPAID', - self::VIRTUAL => 'VIRTUAL', - self::UNEXPECTED_LOCATION => 'UNEXPECTED_LOCATION', - ]; - - 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(CardLabel::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_CardSignals_CardLabel::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php deleted file mode 100644 index 2d8305d3bd6..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/FraudSignals/UserSignals.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals - */ -class UserSignals extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. This user (based on email, phone, and other identifiers) has - * been seen on the internet for at least this number of days. - * - * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $active_days_lower_bound = 0; - /** - * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic - * components in their identity, such as a randomly generated email address, - * temporary phone number, or fake shipping address. - * - * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $synthetic_risk = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $active_days_lower_bound - * Output only. This user (based on email, phone, and other identifiers) has - * been seen on the internet for at least this number of days. - * @type float $synthetic_risk - * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic - * components in their identity, such as a randomly generated email address, - * temporary phone number, or fake shipping address. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. This user (based on email, phone, and other identifiers) has - * been seen on the internet for at least this number of days. - * - * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getActiveDaysLowerBound() - { - return $this->active_days_lower_bound; - } - - /** - * Output only. This user (based on email, phone, and other identifiers) has - * been seen on the internet for at least this number of days. - * - * Generated from protobuf field int32 active_days_lower_bound = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setActiveDaysLowerBound($var) - { - GPBUtil::checkInt32($var); - $this->active_days_lower_bound = $var; - - return $this; - } - - /** - * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic - * components in their identity, such as a randomly generated email address, - * temporary phone number, or fake shipping address. - * - * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getSyntheticRisk() - { - return $this->synthetic_risk; - } - - /** - * Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic - * components in their identity, such as a randomly generated email address, - * temporary phone number, or fake shipping address. - * - * Generated from protobuf field float synthetic_risk = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setSyntheticRisk($var) - { - GPBUtil::checkFloat($var); - $this->synthetic_risk = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UserSignals::class, \Google\Cloud\RecaptchaEnterprise\V1\FraudSignals_UserSignals::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php deleted file mode 100644 index e5a80411e06..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetFirewallPolicyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest - */ -class GetFirewallPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see - * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\GetFirewallPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * 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 name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php deleted file mode 100644 index 741076d9355..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetKeyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.GetKeyRequest - */ -class GetKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the requested key, in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the requested key, in the format - * `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\GetKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the requested key, in the format - * `projects/{project}/keys/{key}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the requested key, in the format - * `projects/{project}/keys/{key}`. - * - * 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 name of the requested key, in the format - * `projects/{project}/keys/{key}`. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php deleted file mode 100644 index 495178abf20..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/GetMetricsRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.GetMetricsRequest - */ -class GetMetricsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. Please see - * {@see RecaptchaEnterpriseServiceClient::metricsName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\GetMetricsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * 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 name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php deleted file mode 100644 index 85d11376701..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IOSKeySettings.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.recaptchaenterprise.v1.IOSKeySettings - */ -class IOSKeySettings extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. If set to true, allowed_bundle_ids are not enforced. - * - * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_all_bundle_ids = false; - /** - * Optional. iOS bundle ids of apps allowed to use the key. - * Example: 'com.companyname.productname.appname' - * - * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $allowed_bundle_ids; - /** - * Optional. Apple Developer account details for the app that is protected by - * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple - * App Attest and Apple DeviceCheck to protect your app from abuse. Providing - * these fields allows reCAPTCHA to get a better assessment of the integrity - * of your app. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $apple_developer_id = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $allow_all_bundle_ids - * Optional. If set to true, allowed_bundle_ids are not enforced. - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_bundle_ids - * Optional. iOS bundle ids of apps allowed to use the key. - * Example: 'com.companyname.productname.appname' - * @type \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId $apple_developer_id - * Optional. Apple Developer account details for the app that is protected by - * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple - * App Attest and Apple DeviceCheck to protect your app from abuse. Providing - * these fields allows reCAPTCHA to get a better assessment of the integrity - * of your app. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. If set to true, allowed_bundle_ids are not enforced. - * - * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowAllBundleIds() - { - return $this->allow_all_bundle_ids; - } - - /** - * Optional. If set to true, allowed_bundle_ids are not enforced. - * - * Generated from protobuf field bool allow_all_bundle_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowAllBundleIds($var) - { - GPBUtil::checkBool($var); - $this->allow_all_bundle_ids = $var; - - return $this; - } - - /** - * Optional. iOS bundle ids of apps allowed to use the key. - * Example: 'com.companyname.productname.appname' - * - * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedBundleIds() - { - return $this->allowed_bundle_ids; - } - - /** - * Optional. iOS bundle ids of apps allowed to use the key. - * Example: 'com.companyname.productname.appname' - * - * Generated from protobuf field repeated string allowed_bundle_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedBundleIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_bundle_ids = $arr; - - return $this; - } - - /** - * Optional. Apple Developer account details for the app that is protected by - * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple - * App Attest and Apple DeviceCheck to protect your app from abuse. Providing - * these fields allows reCAPTCHA to get a better assessment of the integrity - * of your app. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId|null - */ - public function getAppleDeveloperId() - { - return $this->apple_developer_id; - } - - public function hasAppleDeveloperId() - { - return isset($this->apple_developer_id); - } - - public function clearAppleDeveloperId() - { - unset($this->apple_developer_id); - } - - /** - * Optional. Apple Developer account details for the app that is protected by - * the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple - * App Attest and Apple DeviceCheck to protect your app from abuse. Providing - * these fields allows reCAPTCHA to get a better assessment of the integrity - * of your app. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AppleDeveloperId apple_developer_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId $var - * @return $this - */ - public function setAppleDeveloperId($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AppleDeveloperId::class); - $this->apple_developer_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php deleted file mode 100644 index 0a6c440ab29..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.recaptchaenterprise.v1.IpOverrideData - */ -class IpOverrideData extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The IP address to override (can be IPv4, IPv6 or CIDR). - * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. - * The IP override must be a public IP address. - * Example of IPv4: 168.192.5.6 - * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B - * Example of IPv4 with CIDR: 168.192.5.0/24 - * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 - * - * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { - */ - protected $ip = ''; - /** - * Required. Describes the type of IP override. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $override_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $ip - * Required. The IP address to override (can be IPv4, IPv6 or CIDR). - * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. - * The IP override must be a public IP address. - * Example of IPv4: 168.192.5.6 - * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B - * Example of IPv4 with CIDR: 168.192.5.0/24 - * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 - * @type int $override_type - * Required. Describes the type of IP override. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The IP address to override (can be IPv4, IPv6 or CIDR). - * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. - * The IP override must be a public IP address. - * Example of IPv4: 168.192.5.6 - * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B - * Example of IPv4 with CIDR: 168.192.5.0/24 - * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 - * - * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * Required. The IP address to override (can be IPv4, IPv6 or CIDR). - * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. - * The IP override must be a public IP address. - * Example of IPv4: 168.192.5.6 - * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B - * Example of IPv4 with CIDR: 168.192.5.0/24 - * Example of IPv6 with CIDR: 2001:0DB8:1234::/48 - * - * Generated from protobuf field string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { - * @param string $var - * @return $this - */ - public function setIp($var) - { - GPBUtil::checkString($var, True); - $this->ip = $var; - - return $this; - } - - /** - * Required. Describes the type of IP override. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getOverrideType() - { - return $this->override_type; - } - - /** - * Required. Describes the type of IP override. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setOverrideType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData\OverrideType::class); - $this->override_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php deleted file mode 100644 index f14e440d9c4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/IpOverrideData/OverrideType.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType - */ -class OverrideType -{ - /** - * Default override type that indicates this enum hasn't been specified. - * - * Generated from protobuf enum OVERRIDE_TYPE_UNSPECIFIED = 0; - */ - const OVERRIDE_TYPE_UNSPECIFIED = 0; - /** - * Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for - * all valid assessments. - * - * Generated from protobuf enum ALLOW = 1; - */ - const ALLOW = 1; - - private static $valueToName = [ - self::OVERRIDE_TYPE_UNSPECIFIED => 'OVERRIDE_TYPE_UNSPECIFIED', - self::ALLOW => 'ALLOW', - ]; - - 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(OverrideType::class, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData_OverrideType::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php deleted file mode 100644 index 0f900489ad4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Key.php +++ /dev/null @@ -1,417 +0,0 @@ -google.cloud.recaptchaenterprise.v1.Key - */ -class Key extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. The resource name for the Key in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Required. Human-readable display name of this key. Modifiable by user. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/recaptcha/docs/labels). - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Output only. The timestamp corresponding to the creation of this key. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Optional. Options for user acceptance testing. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $testing_options = null; - /** - * Optional. Settings for WAF - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $waf_settings = null; - protected $platform_settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. The resource name for the Key in the format - * `projects/{project}/keys/{key}`. - * @type string $display_name - * Required. Human-readable display name of this key. Modifiable by user. - * @type \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $web_settings - * Settings for keys that can be used by websites. - * @type \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $android_settings - * Settings for keys that can be used by Android apps. - * @type \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $ios_settings - * Settings for keys that can be used by iOS apps. - * @type \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $express_settings - * Settings for keys that can be used by reCAPTCHA Express. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/recaptcha/docs/labels). - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp corresponding to the creation of this key. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $testing_options - * Optional. Options for user acceptance testing. - * @type \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $waf_settings - * Optional. Settings for WAF - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. The resource name for the Key in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. The resource name for the Key in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Human-readable display name of this key. Modifiable by user. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. Human-readable display name of this key. Modifiable by user. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Settings for keys that can be used by websites. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3; - * @return \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings|null - */ - public function getWebSettings() - { - return $this->readOneof(3); - } - - public function hasWebSettings() - { - return $this->hasOneof(3); - } - - /** - * Settings for keys that can be used by websites. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3; - * @param \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $var - * @return $this - */ - public function setWebSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Settings for keys that can be used by Android apps. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4; - * @return \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings|null - */ - public function getAndroidSettings() - { - return $this->readOneof(4); - } - - public function hasAndroidSettings() - { - return $this->hasOneof(4); - } - - /** - * Settings for keys that can be used by Android apps. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4; - * @param \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $var - * @return $this - */ - public function setAndroidSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Settings for keys that can be used by iOS apps. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5; - * @return \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings|null - */ - public function getIosSettings() - { - return $this->readOneof(5); - } - - public function hasIosSettings() - { - return $this->hasOneof(5); - } - - /** - * Settings for keys that can be used by iOS apps. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5; - * @param \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $var - * @return $this - */ - public function setIosSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Settings for keys that can be used by reCAPTCHA Express. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; - * @return \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings|null - */ - public function getExpressSettings() - { - return $this->readOneof(11); - } - - public function hasExpressSettings() - { - return $this->hasOneof(11); - } - - /** - * Settings for keys that can be used by reCAPTCHA Express. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; - * @param \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $var - * @return $this - */ - public function setExpressSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/recaptcha/docs/labels). - * - * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/recaptcha/docs/labels). - * - * Generated from protobuf field map labels = 6 [(.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; - } - - /** - * Output only. The timestamp corresponding to the creation of this key. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The timestamp corresponding to the creation of this key. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Optional. Options for user acceptance testing. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions|null - */ - public function getTestingOptions() - { - return $this->testing_options; - } - - public function hasTestingOptions() - { - return isset($this->testing_options); - } - - public function clearTestingOptions() - { - unset($this->testing_options); - } - - /** - * Optional. Options for user acceptance testing. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $var - * @return $this - */ - public function setTestingOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions::class); - $this->testing_options = $var; - - return $this; - } - - /** - * Optional. Settings for WAF - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\WafSettings|null - */ - public function getWafSettings() - { - return $this->waf_settings; - } - - public function hasWafSettings() - { - return isset($this->waf_settings); - } - - public function clearWafSettings() - { - unset($this->waf_settings); - } - - /** - * Optional. Settings for WAF - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $var - * @return $this - */ - public function setWafSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings::class); - $this->waf_settings = $var; - - return $this; - } - - /** - * @return string - */ - public function getPlatformSettings() - { - return $this->whichOneof("platform_settings"); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php deleted file mode 100644 index 4fdc8e041b4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest - */ -class ListFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of policies to return. Default is 10. Max - * limit is 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous. - * ListFirewallPoliciesRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the project to list the policies for, in the format - * `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ListFirewallPoliciesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * @type int $page_size - * Optional. The maximum number of policies to return. Default is 10. Max - * limit is 1000. - * @type string $page_token - * Optional. The next_page_token value returned from a previous. - * ListFirewallPoliciesRequest, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * - * 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 name of the project to list the policies for, in the format - * `projects/{project}`. - * - * 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. The maximum number of policies to return. Default is 10. Max - * limit is 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of policies to return. Default is 10. Max - * limit is 1000. - * - * 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 next_page_token value returned from a previous. - * ListFirewallPoliciesRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous. - * ListFirewallPoliciesRequest, if any. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php deleted file mode 100644 index 0abe284f4f3..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListFirewallPoliciesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse - */ -class ListFirewallPoliciesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Policy details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; - */ - private $firewall_policies; - /** - * Token to retrieve the next page of results. It is set to empty if no - * policies remain in results. - * - * 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\RecaptchaEnterprise\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $firewall_policies - * Policy details. - * @type string $next_page_token - * Token to retrieve the next page of results. It is set to empty if no - * policies remain in results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Policy details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFirewallPolicies() - { - return $this->firewall_policies; - } - - /** - * Policy details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policies = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFirewallPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); - $this->firewall_policies = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results. It is set to empty if no - * policies remain in results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results. It is set to empty if no - * policies remain in results. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php deleted file mode 100644 index 52134e04752..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest - */ -class ListIpOverridesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of overrides to return. Default is 10. Max - * limit is 100. If the number of overrides is less than the page_size, all - * overrides are returned. If the page size is more than 100, it is coerced to - * 100. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous - * ListIpOverridesRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The parent key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ListIpOverridesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. - * @type int $page_size - * Optional. The maximum number of overrides to return. Default is 10. Max - * limit is 100. If the number of overrides is less than the page_size, all - * overrides are returned. If the page size is more than 100, it is coerced to - * 100. - * @type string $page_token - * Optional. The next_page_token value returned from a previous - * ListIpOverridesRequest, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. - * - * 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 key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. - * - * 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. The maximum number of overrides to return. Default is 10. Max - * limit is 100. If the number of overrides is less than the page_size, all - * overrides are returned. If the page size is more than 100, it is coerced to - * 100. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of overrides to return. Default is 10. Max - * limit is 100. If the number of overrides is less than the page_size, all - * overrides are returned. If the page size is more than 100, it is coerced to - * 100. - * - * 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 next_page_token value returned from a previous - * ListIpOverridesRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous - * ListIpOverridesRequest, if any. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php deleted file mode 100644 index 490069fb86c..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListIpOverridesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse - */ -class ListIpOverridesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * IP Overrides details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; - */ - private $ip_overrides; - /** - * Token to retrieve the next page of results. If this field is empty, no keys - * remain in the results. - * - * 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\RecaptchaEnterprise\V1\IpOverrideData>|\Google\Protobuf\Internal\RepeatedField $ip_overrides - * IP Overrides details. - * @type string $next_page_token - * Token to retrieve the next page of results. If this field is empty, no keys - * remain in the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * IP Overrides details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIpOverrides() - { - return $this->ip_overrides; - } - - /** - * IP Overrides details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_overrides = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIpOverrides($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); - $this->ip_overrides = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results. If this field is empty, no keys - * remain in the results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results. If this field is empty, no keys - * remain in the results. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php deleted file mode 100644 index f726c8ae2c4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListKeysRequest - */ -class ListKeysRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project that contains the keys that is - * listed, in the format `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the project that contains the keys that is - * listed, in the format `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ListKeysRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project that contains the keys that is - * listed, in the format `projects/{project}`. - * @type int $page_size - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @type string $page_token - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project that contains the keys that is - * listed, in the format `projects/{project}`. - * - * 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 name of the project that contains the keys that is - * listed, in the format `projects/{project}`. - * - * 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. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * - * 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 next_page_token value returned from a previous. - * ListKeysRequest, if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php deleted file mode 100644 index 1041b3d7ebd..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListKeysResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListKeysResponse - */ -class ListKeysResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Key details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; - */ - private $keys; - /** - * Token to retrieve the next page of results. It is set to empty if no keys - * remain in results. - * - * 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\RecaptchaEnterprise\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys - * Key details. - * @type string $next_page_token - * Token to retrieve the next page of results. It is set to empty if no keys - * remain in results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Key details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeys() - { - return $this->keys; - } - - /** - * Key details. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.Key keys = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); - $this->keys = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results. It is set to empty if no keys - * remain in results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results. It is set to empty if no keys - * remain in results. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php deleted file mode 100644 index 236874e5076..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest - */ -class ListRelatedAccountGroupMembershipsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of accounts to return. The service might - * return fewer than this value. If unspecified, at most 50 accounts are - * returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroupMemberships` must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. Please see - * {@see RecaptchaEnterpriseServiceClient::relatedAccountGroupName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupMembershipsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - * @type int $page_size - * Optional. The maximum number of accounts to return. The service might - * return fewer than this value. If unspecified, at most 50 accounts are - * returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroupMemberships` must match the call that provided the - * page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - * - * 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 for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - * - * 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. The maximum number of accounts to return. The service might - * return fewer than this value. If unspecified, at most 50 accounts are - * returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of accounts to return. The service might - * return fewer than this value. If unspecified, at most 50 accounts are - * returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * - * 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. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroupMemberships` must match the call that provided the - * 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. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroupMemberships` must match the call that provided the - * 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; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php deleted file mode 100644 index 893785ab465..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupMembershipsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse - */ -class ListRelatedAccountGroupMembershipsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The memberships listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - */ - private $related_account_group_memberships; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $related_account_group_memberships - * The memberships listed by the query. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * The memberships listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRelatedAccountGroupMemberships() - { - return $this->related_account_group_memberships; - } - - /** - * The memberships listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRelatedAccountGroupMemberships($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership::class); - $this->related_account_group_memberships = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php deleted file mode 100644 index b9bd3de3314..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest - */ -class ListRelatedAccountGroupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to list related account groups from, in - * the format `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroups` must match the call that provided the page - * token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the project to list related account groups from, in - * the format `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project to list related account groups from, in - * the format `projects/{project}`. - * @type int $page_size - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * @type string $page_token - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroups` must match the call that provided the page - * token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to list related account groups from, in - * the format `projects/{project}`. - * - * 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 name of the project to list related account groups from, in - * the format `projects/{project}`. - * - * 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. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * 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. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroups` must match the call that provided the 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. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListRelatedAccountGroups` must match the call that provided the 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; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php deleted file mode 100644 index eabc47329cd..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ListRelatedAccountGroupsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse - */ -class ListRelatedAccountGroupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The groups of related accounts listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; - */ - private $related_account_groups; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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\RecaptchaEnterprise\V1\RelatedAccountGroup>|\Google\Protobuf\Internal\RepeatedField $related_account_groups - * The groups of related accounts listed by the query. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * The groups of related accounts listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRelatedAccountGroups() - { - return $this->related_account_groups; - } - - /** - * The groups of related accounts listed by the query. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroup related_account_groups = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRelatedAccountGroups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroup::class); - $this->related_account_groups = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php deleted file mode 100644 index c0e9c3eb5ca..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/Metrics.php +++ /dev/null @@ -1,195 +0,0 @@ -google.cloud.recaptchaenterprise.v1.Metrics - */ -class Metrics extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Identifier. The name of the metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Inclusive start time aligned to a day (UTC). - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. All Key types should have score-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; - */ - private $score_metrics; - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have - * challenge-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; - */ - private $challenge_metrics; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Identifier. The name of the metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * @type \Google\Protobuf\Timestamp $start_time - * Inclusive start time aligned to a day (UTC). - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics>|\Google\Protobuf\Internal\RepeatedField $score_metrics - * Metrics are continuous and in order by dates, and in the granularity - * of day. All Key types should have score-based data. - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics>|\Google\Protobuf\Internal\RepeatedField $challenge_metrics - * Metrics are continuous and in order by dates, and in the granularity - * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have - * challenge-based data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Identifier. The name of the metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Identifier. The name of the metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * - * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Inclusive start time aligned to a day (UTC). - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Inclusive start time aligned to a day (UTC). - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. All Key types should have score-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScoreMetrics() - { - return $this->score_metrics; - } - - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. All Key types should have score-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScoreMetrics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ScoreMetrics::class); - $this->score_metrics = $arr; - - return $this; - } - - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have - * challenge-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChallengeMetrics() - { - return $this->challenge_metrics; - } - - /** - * Metrics are continuous and in order by dates, and in the granularity - * of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have - * challenge-based data. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChallengeMetrics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ChallengeMetrics::class); - $this->challenge_metrics = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php deleted file mode 100644 index 3f952ea02cc..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/MigrateKeyRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.recaptchaenterprise.v1.MigrateKeyRequest - */ -class MigrateKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the key to be migrated, in the format - * `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. If true, skips the billing check. - * A reCAPTCHA Enterprise key or migrated key behaves differently than a - * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid - * any disruption of your usage, we check that a billing account is present. - * If your usage of reCAPTCHA is under the free quota, you can safely skip the - * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha/docs/billing-information. - * - * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $skip_billing_check = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the key to be migrated, in the format - * `projects/{project}/keys/{key}`. - * @type bool $skip_billing_check - * Optional. If true, skips the billing check. - * A reCAPTCHA Enterprise key or migrated key behaves differently than a - * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid - * any disruption of your usage, we check that a billing account is present. - * If your usage of reCAPTCHA is under the free quota, you can safely skip the - * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha/docs/billing-information. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the key to be migrated, in the format - * `projects/{project}/keys/{key}`. - * - * 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 name of the key to be migrated, in the format - * `projects/{project}/keys/{key}`. - * - * 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; - } - - /** - * Optional. If true, skips the billing check. - * A reCAPTCHA Enterprise key or migrated key behaves differently than a - * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid - * any disruption of your usage, we check that a billing account is present. - * If your usage of reCAPTCHA is under the free quota, you can safely skip the - * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha/docs/billing-information. - * - * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getSkipBillingCheck() - { - return $this->skip_billing_check; - } - - /** - * Optional. If true, skips the billing check. - * A reCAPTCHA Enterprise key or migrated key behaves differently than a - * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid - * any disruption of your usage, we check that a billing account is present. - * If your usage of reCAPTCHA is under the free quota, you can safely skip the - * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha/docs/billing-information. - * - * Generated from protobuf field bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setSkipBillingCheck($var) - { - GPBUtil::checkBool($var); - $this->skip_billing_check = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php deleted file mode 100644 index 40d0697b61f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PhoneFraudAssessment.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment - */ -class PhoneFraudAssessment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Assessment of this phone event for risk of SMS toll fraud. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $sms_toll_fraud_verdict = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict $sms_toll_fraud_verdict - * Output only. Assessment of this phone event for risk of SMS toll fraud. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Assessment of this phone event for risk of SMS toll fraud. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict|null - */ - public function getSmsTollFraudVerdict() - { - return $this->sms_toll_fraud_verdict; - } - - public function hasSmsTollFraudVerdict() - { - return isset($this->sms_toll_fraud_verdict); - } - - public function clearSmsTollFraudVerdict() - { - unset($this->sms_toll_fraud_verdict); - } - - /** - * Output only. Assessment of this phone event for risk of SMS toll fraud. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict sms_toll_fraud_verdict = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict $var - * @return $this - */ - public function setSmsTollFraudVerdict($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict::class); - $this->sms_toll_fraud_verdict = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php deleted file mode 100644 index f753cd4aff2..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/PrivatePasswordLeakVerification.php +++ /dev/null @@ -1,201 +0,0 @@ -google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification - */ -class PrivatePasswordLeakVerification extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized - * username. It is used to look up password leaks associated with that hash - * prefix. - * - * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $lookup_hash_prefix = ''; - /** - * Optional. Encrypted Scrypt hash of the canonicalized username+password. It - * is re-encrypted by the server and returned through - * `reencrypted_user_credentials_hash`. - * - * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encrypted_user_credentials_hash = ''; - /** - * Output only. List of prefixes of the encrypted potential password leaks - * that matched the given parameters. They must be compared with the - * client-side decryption prefix of `reencrypted_user_credentials_hash` - * - * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $encrypted_leak_match_prefixes; - /** - * Output only. Corresponds to the re-encryption of the - * `encrypted_user_credentials_hash` field. It is used to match potential - * password leaks within `encrypted_leak_match_prefixes`. - * - * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reencrypted_user_credentials_hash = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $lookup_hash_prefix - * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized - * username. It is used to look up password leaks associated with that hash - * prefix. - * @type string $encrypted_user_credentials_hash - * Optional. Encrypted Scrypt hash of the canonicalized username+password. It - * is re-encrypted by the server and returned through - * `reencrypted_user_credentials_hash`. - * @type array|\Google\Protobuf\Internal\RepeatedField $encrypted_leak_match_prefixes - * Output only. List of prefixes of the encrypted potential password leaks - * that matched the given parameters. They must be compared with the - * client-side decryption prefix of `reencrypted_user_credentials_hash` - * @type string $reencrypted_user_credentials_hash - * Output only. Corresponds to the re-encryption of the - * `encrypted_user_credentials_hash` field. It is used to match potential - * password leaks within `encrypted_leak_match_prefixes`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized - * username. It is used to look up password leaks associated with that hash - * prefix. - * - * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLookupHashPrefix() - { - return $this->lookup_hash_prefix; - } - - /** - * Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized - * username. It is used to look up password leaks associated with that hash - * prefix. - * - * Generated from protobuf field bytes lookup_hash_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLookupHashPrefix($var) - { - GPBUtil::checkString($var, False); - $this->lookup_hash_prefix = $var; - - return $this; - } - - /** - * Optional. Encrypted Scrypt hash of the canonicalized username+password. It - * is re-encrypted by the server and returned through - * `reencrypted_user_credentials_hash`. - * - * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEncryptedUserCredentialsHash() - { - return $this->encrypted_user_credentials_hash; - } - - /** - * Optional. Encrypted Scrypt hash of the canonicalized username+password. It - * is re-encrypted by the server and returned through - * `reencrypted_user_credentials_hash`. - * - * Generated from protobuf field bytes encrypted_user_credentials_hash = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEncryptedUserCredentialsHash($var) - { - GPBUtil::checkString($var, False); - $this->encrypted_user_credentials_hash = $var; - - return $this; - } - - /** - * Output only. List of prefixes of the encrypted potential password leaks - * that matched the given parameters. They must be compared with the - * client-side decryption prefix of `reencrypted_user_credentials_hash` - * - * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEncryptedLeakMatchPrefixes() - { - return $this->encrypted_leak_match_prefixes; - } - - /** - * Output only. List of prefixes of the encrypted potential password leaks - * that matched the given parameters. They must be compared with the - * client-side decryption prefix of `reencrypted_user_credentials_hash` - * - * Generated from protobuf field repeated bytes encrypted_leak_match_prefixes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEncryptedLeakMatchPrefixes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); - $this->encrypted_leak_match_prefixes = $arr; - - return $this; - } - - /** - * Output only. Corresponds to the re-encryption of the - * `encrypted_user_credentials_hash` field. It is used to match potential - * password leaks within `encrypted_leak_match_prefixes`. - * - * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReencryptedUserCredentialsHash() - { - return $this->reencrypted_user_credentials_hash; - } - - /** - * Output only. Corresponds to the re-encryption of the - * `encrypted_user_credentials_hash` field. It is used to match potential - * password leaks within `encrypted_leak_match_prefixes`. - * - * Generated from protobuf field bytes reencrypted_user_credentials_hash = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReencryptedUserCredentialsHash($var) - { - GPBUtil::checkString($var, False); - $this->reencrypted_user_credentials_hash = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php deleted file mode 100644 index 29c2020bed6..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroup.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RelatedAccountGroup - */ -class RelatedAccountGroup extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Identifier. The resource name for the related account group in - * the format - * `projects/{project}/relatedaccountgroups/{related_account_group}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Identifier. The resource name for the related account group in - * the format - * `projects/{project}/relatedaccountgroups/{related_account_group}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. Identifier. The resource name for the related account group in - * the format - * `projects/{project}/relatedaccountgroups/{related_account_group}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Identifier. The resource name for the related account group in - * the format - * `projects/{project}/relatedaccountgroups/{related_account_group}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php deleted file mode 100644 index e766bb4b5ad..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RelatedAccountGroupMembership.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership - */ -class RelatedAccountGroupMembership extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Identifier. The resource name for this membership in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * The unique stable account identifier of the member. The identifier - * corresponds to an `account_id` provided in a previous `CreateAssessment` or - * `AnnotateAssessment` call. - * - * Generated from protobuf field string account_id = 4; - */ - protected $account_id = ''; - /** - * Deprecated: use `account_id` instead. - * The unique stable hashed account identifier of the member. The identifier - * corresponds to a `hashed_account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; - * @deprecated - */ - protected $hashed_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Identifier. The resource name for this membership in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. - * @type string $account_id - * The unique stable account identifier of the member. The identifier - * corresponds to an `account_id` provided in a previous `CreateAssessment` or - * `AnnotateAssessment` call. - * @type string $hashed_account_id - * Deprecated: use `account_id` instead. - * The unique stable hashed account identifier of the member. The identifier - * corresponds to a `hashed_account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. Identifier. The resource name for this membership in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Identifier. The resource name for this membership in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The unique stable account identifier of the member. The identifier - * corresponds to an `account_id` provided in a previous `CreateAssessment` or - * `AnnotateAssessment` call. - * - * Generated from protobuf field string account_id = 4; - * @return string - */ - public function getAccountId() - { - return $this->account_id; - } - - /** - * The unique stable account identifier of the member. The identifier - * corresponds to an `account_id` provided in a previous `CreateAssessment` or - * `AnnotateAssessment` call. - * - * Generated from protobuf field string account_id = 4; - * @param string $var - * @return $this - */ - public function setAccountId($var) - { - GPBUtil::checkString($var, True); - $this->account_id = $var; - - return $this; - } - - /** - * Deprecated: use `account_id` instead. - * The unique stable hashed account identifier of the member. The identifier - * corresponds to a `hashed_account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; - * @return string - * @deprecated - */ - public function getHashedAccountId() - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - return $this->hashed_account_id; - } - - /** - * Deprecated: use `account_id` instead. - * The unique stable hashed account identifier of the member. The identifier - * corresponds to a `hashed_account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setHashedAccountId($var) - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, False); - $this->hashed_account_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php deleted file mode 100644 index 4da23b7f131..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest - */ -class RemoveIpOverrideRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. IP override to be removed from the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ip_override_data = null; - - /** - * @param string $name Required. The name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData Required. IP override to be removed from the key. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\RemoveIpOverrideRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ipOverrideData): self - { - return (new self()) - ->setName($name) - ->setIpOverrideData($ipOverrideData); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. - * @type \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $ip_override_data - * Required. IP override to be removed from the key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. - * - * 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 name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. - * - * 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. IP override to be removed from the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData|null - */ - public function getIpOverrideData() - { - return $this->ip_override_data; - } - - public function hasIpOverrideData() - { - return isset($this->ip_override_data); - } - - public function clearIpOverrideData() - { - unset($this->ip_override_data); - } - - /** - * Required. IP override to be removed from the key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData $var - * @return $this - */ - public function setIpOverrideData($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData::class); - $this->ip_override_data = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php deleted file mode 100644 index c6cb317ffd7..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RemoveIpOverrideResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse - */ -class RemoveIpOverrideResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php deleted file mode 100644 index 2ac90f60a3e..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest - */ -class ReorderFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $names; - - /** - * @param string $parent Required. The name of the project to list the policies for, in the format - * `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * @param string[] $names Required. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. Please see - * {@see RecaptchaEnterpriseServiceClient::firewallPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\ReorderFirewallPoliciesRequest - * - * @experimental - */ - public static function build(string $parent, array $names): self - { - return (new self()) - ->setParent($parent) - ->setNames($names); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $names - * Required. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * - * 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 name of the project to list the policies for, in the format - * `projects/{project}`. - * - * 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. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNames() - { - return $this->names; - } - - /** - * Required. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - * - * Generated from protobuf field repeated string names = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->names = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php deleted file mode 100644 index a03f0e590b4..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ReorderFirewallPoliciesResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse - */ -class ReorderFirewallPoliciesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php deleted file mode 100644 index 5c242d9c65b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest - */ -class RetrieveLegacySecretKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $key = ''; - - /** - * @param string $key Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. Please see - * {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyRequest - * - * @experimental - */ - public static function build(string $key): self - { - return (new self()) - ->setKey($key); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php deleted file mode 100644 index 397a75127a0..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RetrieveLegacySecretKeyResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse - */ -class RetrieveLegacySecretKeyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The secret key (also known as shared secret) authorizes communication - * between your application backend and the reCAPTCHA Enterprise server to - * create an assessment. - * The secret key needs to be kept safe for security purposes. - * - * Generated from protobuf field string legacy_secret_key = 1; - */ - protected $legacy_secret_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $legacy_secret_key - * The secret key (also known as shared secret) authorizes communication - * between your application backend and the reCAPTCHA Enterprise server to - * create an assessment. - * The secret key needs to be kept safe for security purposes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * The secret key (also known as shared secret) authorizes communication - * between your application backend and the reCAPTCHA Enterprise server to - * create an assessment. - * The secret key needs to be kept safe for security purposes. - * - * Generated from protobuf field string legacy_secret_key = 1; - * @return string - */ - public function getLegacySecretKey() - { - return $this->legacy_secret_key; - } - - /** - * The secret key (also known as shared secret) authorizes communication - * between your application backend and the reCAPTCHA Enterprise server to - * create an assessment. - * The secret key needs to be kept safe for security purposes. - * - * Generated from protobuf field string legacy_secret_key = 1; - * @param string $var - * @return $this - */ - public function setLegacySecretKey($var) - { - GPBUtil::checkString($var, True); - $this->legacy_secret_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php deleted file mode 100644 index 6fa203ea294..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RiskAnalysis - */ -class RiskAnalysis extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Legitimate event score from 0.0 to 1.0. - * (1.0 means very likely legitimate traffic while 0.0 means very likely - * non-legitimate traffic). - * - * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $score = 0.0; - /** - * Output only. Reasons contributing to the risk analysis verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $reasons; - /** - * Output only. Extended verdict reasons to be used for experimentation only. - * The set of possible reasons is subject to change. - * - * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $extended_verdict_reasons; - /** - * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE - * keys - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $challenge = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $score - * Output only. Legitimate event score from 0.0 to 1.0. - * (1.0 means very likely legitimate traffic while 0.0 means very likely - * non-legitimate traffic). - * @type array|\Google\Protobuf\Internal\RepeatedField $reasons - * Output only. Reasons contributing to the risk analysis verdict. - * @type array|\Google\Protobuf\Internal\RepeatedField $extended_verdict_reasons - * Output only. Extended verdict reasons to be used for experimentation only. - * The set of possible reasons is subject to change. - * @type int $challenge - * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE - * keys - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Legitimate event score from 0.0 to 1.0. - * (1.0 means very likely legitimate traffic while 0.0 means very likely - * non-legitimate traffic). - * - * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getScore() - { - return $this->score; - } - - /** - * Output only. Legitimate event score from 0.0 to 1.0. - * (1.0 means very likely legitimate traffic while 0.0 means very likely - * non-legitimate traffic). - * - * Generated from protobuf field float score = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setScore($var) - { - GPBUtil::checkFloat($var); - $this->score = $var; - - return $this; - } - - /** - * Output only. Reasons contributing to the risk analysis verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReasons() - { - return $this->reasons; - } - - /** - * Output only. Reasons contributing to the risk analysis verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReasons($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis\ClassificationReason::class); - $this->reasons = $arr; - - return $this; - } - - /** - * Output only. Extended verdict reasons to be used for experimentation only. - * The set of possible reasons is subject to change. - * - * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExtendedVerdictReasons() - { - return $this->extended_verdict_reasons; - } - - /** - * Output only. Extended verdict reasons to be used for experimentation only. - * The set of possible reasons is subject to change. - * - * Generated from protobuf field repeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExtendedVerdictReasons($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->extended_verdict_reasons = $arr; - - return $this; - } - - /** - * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE - * keys - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getChallenge() - { - return $this->challenge; - } - - /** - * Output only. Challenge information for SCORE_AND_CHALLENGE and INVISIBLE - * keys - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setChallenge($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis\Challenge::class); - $this->challenge = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php deleted file mode 100644 index d61a1944dd0..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/Challenge.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge - */ -class Challenge -{ - /** - * Default unspecified type. - * - * Generated from protobuf enum CHALLENGE_UNSPECIFIED = 0; - */ - const CHALLENGE_UNSPECIFIED = 0; - /** - * No challenge was presented for solving. - * - * Generated from protobuf enum NOCAPTCHA = 1; - */ - const NOCAPTCHA = 1; - /** - * A solution was submitted that was correct. - * - * Generated from protobuf enum PASSED = 2; - */ - const PASSED = 2; - /** - * A solution was submitted that was incorrect or otherwise - * deemed suspicious. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - - private static $valueToName = [ - self::CHALLENGE_UNSPECIFIED => 'CHALLENGE_UNSPECIFIED', - self::NOCAPTCHA => 'NOCAPTCHA', - self::PASSED => 'PASSED', - self::FAILED => 'FAILED', - ]; - - 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(Challenge::class, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis_Challenge::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php deleted file mode 100644 index 159b1c8c8e3..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/RiskAnalysis/ClassificationReason.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - */ -class ClassificationReason -{ - /** - * Default unspecified type. - * - * Generated from protobuf enum CLASSIFICATION_REASON_UNSPECIFIED = 0; - */ - const CLASSIFICATION_REASON_UNSPECIFIED = 0; - /** - * Interactions matched the behavior of an automated agent. - * - * Generated from protobuf enum AUTOMATION = 1; - */ - const AUTOMATION = 1; - /** - * The event originated from an illegitimate environment. - * - * Generated from protobuf enum UNEXPECTED_ENVIRONMENT = 2; - */ - const UNEXPECTED_ENVIRONMENT = 2; - /** - * Traffic volume from the event source is higher than normal. - * - * Generated from protobuf enum TOO_MUCH_TRAFFIC = 3; - */ - const TOO_MUCH_TRAFFIC = 3; - /** - * Interactions with the site were significantly different than expected - * patterns. - * - * Generated from protobuf enum UNEXPECTED_USAGE_PATTERNS = 4; - */ - const UNEXPECTED_USAGE_PATTERNS = 4; - /** - * Too little traffic has been received from this site thus far to generate - * quality risk analysis. - * - * Generated from protobuf enum LOW_CONFIDENCE_SCORE = 5; - */ - const LOW_CONFIDENCE_SCORE = 5; - /** - * The request matches behavioral characteristics of a carding attack. - * - * Generated from protobuf enum SUSPECTED_CARDING = 6; - */ - const SUSPECTED_CARDING = 6; - /** - * The request matches behavioral characteristics of chargebacks for fraud. - * - * Generated from protobuf enum SUSPECTED_CHARGEBACK = 7; - */ - const SUSPECTED_CHARGEBACK = 7; - - private static $valueToName = [ - self::CLASSIFICATION_REASON_UNSPECIFIED => 'CLASSIFICATION_REASON_UNSPECIFIED', - self::AUTOMATION => 'AUTOMATION', - self::UNEXPECTED_ENVIRONMENT => 'UNEXPECTED_ENVIRONMENT', - self::TOO_MUCH_TRAFFIC => 'TOO_MUCH_TRAFFIC', - self::UNEXPECTED_USAGE_PATTERNS => 'UNEXPECTED_USAGE_PATTERNS', - self::LOW_CONFIDENCE_SCORE => 'LOW_CONFIDENCE_SCORE', - self::SUSPECTED_CARDING => 'SUSPECTED_CARDING', - self::SUSPECTED_CHARGEBACK => 'SUSPECTED_CHARGEBACK', - ]; - - 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(ClassificationReason::class, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis_ClassificationReason::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php deleted file mode 100644 index 0c0196f6624..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreDistribution.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ScoreDistribution - */ -class ScoreDistribution extends \Google\Protobuf\Internal\Message -{ - /** - * Map key is score value multiplied by 100. The scores are discrete values - * between [0, 1]. The maximum number of buckets is on order of a few dozen, - * but typically much lower (ie. 10). - * - * Generated from protobuf field map score_buckets = 1; - */ - private $score_buckets; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $score_buckets - * Map key is score value multiplied by 100. The scores are discrete values - * between [0, 1]. The maximum number of buckets is on order of a few dozen, - * but typically much lower (ie. 10). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Map key is score value multiplied by 100. The scores are discrete values - * between [0, 1]. The maximum number of buckets is on order of a few dozen, - * but typically much lower (ie. 10). - * - * Generated from protobuf field map score_buckets = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getScoreBuckets() - { - return $this->score_buckets; - } - - /** - * Map key is score value multiplied by 100. The scores are discrete values - * between [0, 1]. The maximum number of buckets is on order of a few dozen, - * but typically much lower (ie. 10). - * - * Generated from protobuf field map score_buckets = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setScoreBuckets($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::INT64); - $this->score_buckets = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php deleted file mode 100644 index 6b118c87689..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/ScoreMetrics.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.recaptchaenterprise.v1.ScoreMetrics - */ -class ScoreMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * Aggregated score metrics for all traffic. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; - */ - protected $overall_metrics = null; - /** - * Action-based metrics. The map key is the action name which specified by the - * site owners at time of the "execute" client-side call. - * - * Generated from protobuf field map action_metrics = 2; - */ - private $action_metrics; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution $overall_metrics - * Aggregated score metrics for all traffic. - * @type array|\Google\Protobuf\Internal\MapField $action_metrics - * Action-based metrics. The map key is the action name which specified by the - * site owners at time of the "execute" client-side call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Aggregated score metrics for all traffic. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; - * @return \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution|null - */ - public function getOverallMetrics() - { - return $this->overall_metrics; - } - - public function hasOverallMetrics() - { - return isset($this->overall_metrics); - } - - public function clearOverallMetrics() - { - unset($this->overall_metrics); - } - - /** - * Aggregated score metrics for all traffic. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; - * @param \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution $var - * @return $this - */ - public function setOverallMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution::class); - $this->overall_metrics = $var; - - return $this; - } - - /** - * Action-based metrics. The map key is the action name which specified by the - * site owners at time of the "execute" client-side call. - * - * Generated from protobuf field map action_metrics = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getActionMetrics() - { - return $this->action_metrics; - } - - /** - * Action-based metrics. The map key is the action name which specified by the - * site owners at time of the "execute" client-side call. - * - * Generated from protobuf field map action_metrics = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setActionMetrics($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\ScoreDistribution::class); - $this->action_metrics = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php deleted file mode 100644 index 0c6559fc52f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsRequest.php +++ /dev/null @@ -1,294 +0,0 @@ -google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest - */ -class SearchRelatedAccountGroupMembershipsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $project = ''; - /** - * Optional. The unique stable account identifier used to search connections. - * The identifier should correspond to an `account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - * or account_id must be set, but not both. - * - * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $account_id = ''; - /** - * Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $hashed_account_id = ''; - /** - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous - * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `SearchRelatedAccountGroupMemberships` must match the call that provided - * the page token. - * - * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $project Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. Please see - * {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field. - * @param string $hashedAccountId Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\SearchRelatedAccountGroupMembershipsRequest - * - * @experimental - */ - public static function build(string $project, string $hashedAccountId): self - { - return (new self()) - ->setProject($project) - ->setHashedAccountId($hashedAccountId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project - * Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. - * @type string $account_id - * Optional. The unique stable account identifier used to search connections. - * The identifier should correspond to an `account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - * or account_id must be set, but not both. - * @type string $hashed_account_id - * Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * @type int $page_size - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `SearchRelatedAccountGroupMemberships` must match the call that provided - * the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->project = $var; - - return $this; - } - - /** - * Optional. The unique stable account identifier used to search connections. - * The identifier should correspond to an `account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - * or account_id must be set, but not both. - * - * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAccountId() - { - return $this->account_id; - } - - /** - * Optional. The unique stable account identifier used to search connections. - * The identifier should correspond to an `account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - * or account_id must be set, but not both. - * - * Generated from protobuf field string account_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAccountId($var) - { - GPBUtil::checkString($var, True); - $this->account_id = $var; - - return $this; - } - - /** - * Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getHashedAccountId() - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - return $this->hashed_account_id; - } - - /** - * Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * - * Generated from protobuf field bytes hashed_account_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setHashedAccountId($var) - { - @trigger_error('hashed_account_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, False); - $this->hashed_account_id = $var; - - return $this; - } - - /** - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of groups to return. The service might return - * fewer than this value. If unspecified, at most 50 groups are returned. The - * maximum value is 1000; values above 1000 are coerced to 1000. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `SearchRelatedAccountGroupMemberships` must match the call that provided - * the page token. - * - * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `SearchRelatedAccountGroupMemberships` must match the call that provided - * the page token. - * - * Generated from protobuf field string page_token = 4 [(.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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php deleted file mode 100644 index 6099354ab5e..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SearchRelatedAccountGroupMembershipsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse - */ -class SearchRelatedAccountGroupMembershipsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The queried memberships. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - */ - private $related_account_group_memberships; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $related_account_group_memberships - * The queried memberships. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * The queried memberships. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRelatedAccountGroupMemberships() - { - return $this->related_account_group_memberships; - } - - /** - * The queried memberships. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership related_account_group_memberships = 1; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRelatedAccountGroupMemberships($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\RelatedAccountGroupMembership::class); - $this->related_account_group_memberships = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * 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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php deleted file mode 100644 index 8f411544313..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict - */ -class SmsTollFraudVerdict extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Probability of an SMS event being fraudulent. - * Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $risk = 0.0; - /** - * Output only. Reasons contributing to the SMS toll fraud verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $reasons; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $risk - * Output only. Probability of an SMS event being fraudulent. - * Values are from 0.0 (lowest) to 1.0 (highest). - * @type array|\Google\Protobuf\Internal\RepeatedField $reasons - * Output only. Reasons contributing to the SMS toll fraud verdict. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Probability of an SMS event being fraudulent. - * Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getRisk() - { - return $this->risk; - } - - /** - * Output only. Probability of an SMS event being fraudulent. - * Values are from 0.0 (lowest) to 1.0 (highest). - * - * Generated from protobuf field float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setRisk($var) - { - GPBUtil::checkFloat($var); - $this->risk = $var; - - return $this; - } - - /** - * Output only. Reasons contributing to the SMS toll fraud verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReasons() - { - return $this->reasons; - } - - /** - * Output only. Reasons contributing to the SMS toll fraud verdict. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReasons($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict\SmsTollFraudReason::class); - $this->reasons = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php deleted file mode 100644 index 6e67f9b1eec..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/SmsTollFraudVerdict/SmsTollFraudReason.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason - */ -class SmsTollFraudReason -{ - /** - * Default unspecified reason - * - * Generated from protobuf enum SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0; - */ - const SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0; - /** - * The provided phone number was invalid - * - * Generated from protobuf enum INVALID_PHONE_NUMBER = 1; - */ - const INVALID_PHONE_NUMBER = 1; - - private static $valueToName = [ - self::SMS_TOLL_FRAUD_REASON_UNSPECIFIED => 'SMS_TOLL_FRAUD_REASON_UNSPECIFIED', - self::INVALID_PHONE_NUMBER => 'INVALID_PHONE_NUMBER', - ]; - - 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(SmsTollFraudReason::class, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict_SmsTollFraudReason::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php deleted file mode 100644 index 310161e1b0e..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TestingOptions - */ -class TestingOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. All assessments for this Key return this score. Must be between 0 - * (likely not legitimate) and 1 (likely legitimate) inclusive. - * - * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $testing_score = 0.0; - /** - * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all - * challenge requests for this site return nocaptcha if NOCAPTCHA, or an - * unsolvable challenge if CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $testing_challenge = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $testing_score - * Optional. All assessments for this Key return this score. Must be between 0 - * (likely not legitimate) and 1 (likely legitimate) inclusive. - * @type int $testing_challenge - * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all - * challenge requests for this site return nocaptcha if NOCAPTCHA, or an - * unsolvable challenge if CHALLENGE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. All assessments for this Key return this score. Must be between 0 - * (likely not legitimate) and 1 (likely legitimate) inclusive. - * - * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getTestingScore() - { - return $this->testing_score; - } - - /** - * Optional. All assessments for this Key return this score. Must be between 0 - * (likely not legitimate) and 1 (likely legitimate) inclusive. - * - * Generated from protobuf field float testing_score = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setTestingScore($var) - { - GPBUtil::checkFloat($var); - $this->testing_score = $var; - - return $this; - } - - /** - * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all - * challenge requests for this site return nocaptcha if NOCAPTCHA, or an - * unsolvable challenge if CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTestingChallenge() - { - return $this->testing_challenge; - } - - /** - * Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all - * challenge requests for this site return nocaptcha if NOCAPTCHA, or an - * unsolvable challenge if CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTestingChallenge($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions\TestingChallenge::class); - $this->testing_challenge = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php deleted file mode 100644 index c139614f372..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TestingOptions/TestingChallenge.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge - */ -class TestingChallenge -{ - /** - * Perform the normal risk analysis and return either nocaptcha or a - * challenge depending on risk and trust factors. - * - * Generated from protobuf enum TESTING_CHALLENGE_UNSPECIFIED = 0; - */ - const TESTING_CHALLENGE_UNSPECIFIED = 0; - /** - * Challenge requests for this key always return a nocaptcha, which - * does not require a solution. - * - * Generated from protobuf enum NOCAPTCHA = 1; - */ - const NOCAPTCHA = 1; - /** - * Challenge requests for this key always return an unsolvable - * challenge. - * - * Generated from protobuf enum UNSOLVABLE_CHALLENGE = 2; - */ - const UNSOLVABLE_CHALLENGE = 2; - - private static $valueToName = [ - self::TESTING_CHALLENGE_UNSPECIFIED => 'TESTING_CHALLENGE_UNSPECIFIED', - self::NOCAPTCHA => 'NOCAPTCHA', - self::UNSOLVABLE_CHALLENGE => 'UNSOLVABLE_CHALLENGE', - ]; - - 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(TestingChallenge::class, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions_TestingChallenge::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php deleted file mode 100644 index 76d51f5b8d2..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties.php +++ /dev/null @@ -1,309 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TokenProperties - */ -class TokenProperties extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Whether the provided user response token is valid. When valid - * = false, the reason could be specified in invalid_reason or it could also - * be due to a user failing to solve a challenge or a sitekey mismatch (i.e - * the sitekey used to generate the token was different than the one specified - * in the assessment). - * - * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $valid = false; - /** - * Output only. Reason associated with the response when valid = false. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $invalid_reason = 0; - /** - * Output only. The timestamp corresponding to the generation of the token. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The hostname of the page on which the token was generated (Web - * keys only). - * - * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $hostname = ''; - /** - * Output only. The name of the Android package with which the token was - * generated (Android keys only). - * - * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $android_package_name = ''; - /** - * Output only. The ID of the iOS bundle with which the token was generated - * (iOS keys only). - * - * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ios_bundle_id = ''; - /** - * Output only. Action name provided at token generation. - * - * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $action = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $valid - * Output only. Whether the provided user response token is valid. When valid - * = false, the reason could be specified in invalid_reason or it could also - * be due to a user failing to solve a challenge or a sitekey mismatch (i.e - * the sitekey used to generate the token was different than the one specified - * in the assessment). - * @type int $invalid_reason - * Output only. Reason associated with the response when valid = false. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp corresponding to the generation of the token. - * @type string $hostname - * Output only. The hostname of the page on which the token was generated (Web - * keys only). - * @type string $android_package_name - * Output only. The name of the Android package with which the token was - * generated (Android keys only). - * @type string $ios_bundle_id - * Output only. The ID of the iOS bundle with which the token was generated - * (iOS keys only). - * @type string $action - * Output only. Action name provided at token generation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Whether the provided user response token is valid. When valid - * = false, the reason could be specified in invalid_reason or it could also - * be due to a user failing to solve a challenge or a sitekey mismatch (i.e - * the sitekey used to generate the token was different than the one specified - * in the assessment). - * - * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getValid() - { - return $this->valid; - } - - /** - * Output only. Whether the provided user response token is valid. When valid - * = false, the reason could be specified in invalid_reason or it could also - * be due to a user failing to solve a challenge or a sitekey mismatch (i.e - * the sitekey used to generate the token was different than the one specified - * in the assessment). - * - * Generated from protobuf field bool valid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setValid($var) - { - GPBUtil::checkBool($var); - $this->valid = $var; - - return $this; - } - - /** - * Output only. Reason associated with the response when valid = false. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getInvalidReason() - { - return $this->invalid_reason; - } - - /** - * Output only. Reason associated with the response when valid = false. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason invalid_reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setInvalidReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties\InvalidReason::class); - $this->invalid_reason = $var; - - return $this; - } - - /** - * Output only. The timestamp corresponding to the generation of the token. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The timestamp corresponding to the generation of the token. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The hostname of the page on which the token was generated (Web - * keys only). - * - * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getHostname() - { - return $this->hostname; - } - - /** - * Output only. The hostname of the page on which the token was generated (Web - * keys only). - * - * Generated from protobuf field string hostname = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setHostname($var) - { - GPBUtil::checkString($var, True); - $this->hostname = $var; - - return $this; - } - - /** - * Output only. The name of the Android package with which the token was - * generated (Android keys only). - * - * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAndroidPackageName() - { - return $this->android_package_name; - } - - /** - * Output only. The name of the Android package with which the token was - * generated (Android keys only). - * - * Generated from protobuf field string android_package_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAndroidPackageName($var) - { - GPBUtil::checkString($var, True); - $this->android_package_name = $var; - - return $this; - } - - /** - * Output only. The ID of the iOS bundle with which the token was generated - * (iOS keys only). - * - * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIosBundleId() - { - return $this->ios_bundle_id; - } - - /** - * Output only. The ID of the iOS bundle with which the token was generated - * (iOS keys only). - * - * Generated from protobuf field string ios_bundle_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIosBundleId($var) - { - GPBUtil::checkString($var, True); - $this->ios_bundle_id = $var; - - return $this; - } - - /** - * Output only. Action name provided at token generation. - * - * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Output only. Action name provided at token generation. - * - * Generated from protobuf field string action = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAction($var) - { - GPBUtil::checkString($var, True); - $this->action = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php deleted file mode 100644 index 94f9c48b329..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TokenProperties/InvalidReason.php +++ /dev/null @@ -1,93 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason - */ -class InvalidReason -{ - /** - * Default unspecified type. - * - * Generated from protobuf enum INVALID_REASON_UNSPECIFIED = 0; - */ - const INVALID_REASON_UNSPECIFIED = 0; - /** - * If the failure reason was not accounted for. - * - * Generated from protobuf enum UNKNOWN_INVALID_REASON = 1; - */ - const UNKNOWN_INVALID_REASON = 1; - /** - * The provided user verification token was malformed. - * - * Generated from protobuf enum MALFORMED = 2; - */ - const MALFORMED = 2; - /** - * The user verification token had expired. - * - * Generated from protobuf enum EXPIRED = 3; - */ - const EXPIRED = 3; - /** - * The user verification had already been seen. - * - * Generated from protobuf enum DUPE = 4; - */ - const DUPE = 4; - /** - * The user verification token was not present. - * - * Generated from protobuf enum MISSING = 5; - */ - const MISSING = 5; - /** - * A retriable error (such as network failure) occurred on the browser. - * Could easily be simulated by an attacker. - * - * Generated from protobuf enum BROWSER_ERROR = 6; - */ - const BROWSER_ERROR = 6; - - private static $valueToName = [ - self::INVALID_REASON_UNSPECIFIED => 'INVALID_REASON_UNSPECIFIED', - self::UNKNOWN_INVALID_REASON => 'UNKNOWN_INVALID_REASON', - self::MALFORMED => 'MALFORMED', - self::EXPIRED => 'EXPIRED', - self::DUPE => 'DUPE', - self::MISSING => 'MISSING', - self::BROWSER_ERROR => 'BROWSER_ERROR', - ]; - - 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(InvalidReason::class, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties_InvalidReason::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php deleted file mode 100644 index 4a838d95742..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData.php +++ /dev/null @@ -1,581 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionData - */ -class TransactionData extends \Google\Protobuf\Internal\Message -{ - /** - * Unique identifier for the transaction. This custom identifier can be used - * to reference this transaction in the future, for example, labeling a refund - * or chargeback event. Two attempts at the same transaction should use the - * same transaction id. - * - * Generated from protobuf field optional string transaction_id = 11; - */ - protected $transaction_id = null; - /** - * Optional. The payment method for the transaction. The allowed values are: - * * credit-card - * * debit-card - * * gift-card - * * processor-{name} (If a third-party is used, for example, - * processor-paypal) - * * custom-{name} (If an alternative method is used, for example, - * custom-crypto) - * - * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $payment_method = ''; - /** - * Optional. The Bank Identification Number - generally the first 6 or 8 - * digits of the card. - * - * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $card_bin = ''; - /** - * Optional. The last four digits of the card. - * - * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $card_last_four = ''; - /** - * Optional. The currency code in ISO-4217 format. - * - * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $currency_code = ''; - /** - * Optional. The decimal value of the transaction in the specified currency. - * - * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value = 0.0; - /** - * Optional. The value of shipping in the specified currency. 0 for free or no - * shipping. - * - * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $shipping_value = 0.0; - /** - * Optional. Destination address if this transaction involves shipping a - * physical item. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $shipping_address = null; - /** - * Optional. Address associated with the payment method when applicable. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $billing_address = null; - /** - * Optional. Information about the user paying/initiating the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user = null; - /** - * Optional. Information about the user or users fulfilling the transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $merchants; - /** - * Optional. Items purchased in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $items; - /** - * Optional. Information about the payment gateway's response to the - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $gateway_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $transaction_id - * Unique identifier for the transaction. This custom identifier can be used - * to reference this transaction in the future, for example, labeling a refund - * or chargeback event. Two attempts at the same transaction should use the - * same transaction id. - * @type string $payment_method - * Optional. The payment method for the transaction. The allowed values are: - * * credit-card - * * debit-card - * * gift-card - * * processor-{name} (If a third-party is used, for example, - * processor-paypal) - * * custom-{name} (If an alternative method is used, for example, - * custom-crypto) - * @type string $card_bin - * Optional. The Bank Identification Number - generally the first 6 or 8 - * digits of the card. - * @type string $card_last_four - * Optional. The last four digits of the card. - * @type string $currency_code - * Optional. The currency code in ISO-4217 format. - * @type float $value - * Optional. The decimal value of the transaction in the specified currency. - * @type float $shipping_value - * Optional. The value of shipping in the specified currency. 0 for free or no - * shipping. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $shipping_address - * Optional. Destination address if this transaction involves shipping a - * physical item. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $billing_address - * Optional. Address associated with the payment method when applicable. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User $user - * Optional. Information about the user paying/initiating the transaction. - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User>|\Google\Protobuf\Internal\RepeatedField $merchants - * Optional. Information about the user or users fulfilling the transaction. - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item>|\Google\Protobuf\Internal\RepeatedField $items - * Optional. Items purchased in this transaction. - * @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo $gateway_info - * Optional. Information about the payment gateway's response to the - * transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Unique identifier for the transaction. This custom identifier can be used - * to reference this transaction in the future, for example, labeling a refund - * or chargeback event. Two attempts at the same transaction should use the - * same transaction id. - * - * Generated from protobuf field optional string transaction_id = 11; - * @return string - */ - public function getTransactionId() - { - return isset($this->transaction_id) ? $this->transaction_id : ''; - } - - public function hasTransactionId() - { - return isset($this->transaction_id); - } - - public function clearTransactionId() - { - unset($this->transaction_id); - } - - /** - * Unique identifier for the transaction. This custom identifier can be used - * to reference this transaction in the future, for example, labeling a refund - * or chargeback event. Two attempts at the same transaction should use the - * same transaction id. - * - * Generated from protobuf field optional string transaction_id = 11; - * @param string $var - * @return $this - */ - public function setTransactionId($var) - { - GPBUtil::checkString($var, True); - $this->transaction_id = $var; - - return $this; - } - - /** - * Optional. The payment method for the transaction. The allowed values are: - * * credit-card - * * debit-card - * * gift-card - * * processor-{name} (If a third-party is used, for example, - * processor-paypal) - * * custom-{name} (If an alternative method is used, for example, - * custom-crypto) - * - * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPaymentMethod() - { - return $this->payment_method; - } - - /** - * Optional. The payment method for the transaction. The allowed values are: - * * credit-card - * * debit-card - * * gift-card - * * processor-{name} (If a third-party is used, for example, - * processor-paypal) - * * custom-{name} (If an alternative method is used, for example, - * custom-crypto) - * - * Generated from protobuf field string payment_method = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPaymentMethod($var) - { - GPBUtil::checkString($var, True); - $this->payment_method = $var; - - return $this; - } - - /** - * Optional. The Bank Identification Number - generally the first 6 or 8 - * digits of the card. - * - * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCardBin() - { - return $this->card_bin; - } - - /** - * Optional. The Bank Identification Number - generally the first 6 or 8 - * digits of the card. - * - * Generated from protobuf field string card_bin = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCardBin($var) - { - GPBUtil::checkString($var, True); - $this->card_bin = $var; - - return $this; - } - - /** - * Optional. The last four digits of the card. - * - * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCardLastFour() - { - return $this->card_last_four; - } - - /** - * Optional. The last four digits of the card. - * - * Generated from protobuf field string card_last_four = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCardLastFour($var) - { - GPBUtil::checkString($var, True); - $this->card_last_four = $var; - - return $this; - } - - /** - * Optional. The currency code in ISO-4217 format. - * - * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * Optional. The currency code in ISO-4217 format. - * - * 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. The decimal value of the transaction in the specified currency. - * - * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getValue() - { - return $this->value; - } - - /** - * Optional. The decimal value of the transaction in the specified currency. - * - * Generated from protobuf field double value = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkDouble($var); - $this->value = $var; - - return $this; - } - - /** - * Optional. The value of shipping in the specified currency. 0 for free or no - * shipping. - * - * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getShippingValue() - { - return $this->shipping_value; - } - - /** - * Optional. The value of shipping in the specified currency. 0 for free or no - * shipping. - * - * Generated from protobuf field double shipping_value = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setShippingValue($var) - { - GPBUtil::checkDouble($var); - $this->shipping_value = $var; - - return $this; - } - - /** - * Optional. Destination address if this transaction involves shipping a - * physical item. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address|null - */ - public function getShippingAddress() - { - return $this->shipping_address; - } - - public function hasShippingAddress() - { - return isset($this->shipping_address); - } - - public function clearShippingAddress() - { - unset($this->shipping_address); - } - - /** - * Optional. Destination address if this transaction involves shipping a - * physical item. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address shipping_address = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $var - * @return $this - */ - public function setShippingAddress($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address::class); - $this->shipping_address = $var; - - return $this; - } - - /** - * Optional. Address associated with the payment method when applicable. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address|null - */ - public function getBillingAddress() - { - return $this->billing_address; - } - - public function hasBillingAddress() - { - return isset($this->billing_address); - } - - public function clearBillingAddress() - { - unset($this->billing_address); - } - - /** - * Optional. Address associated with the payment method when applicable. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.Address billing_address = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address $var - * @return $this - */ - public function setBillingAddress($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Address::class); - $this->billing_address = $var; - - return $this; - } - - /** - * Optional. Information about the user paying/initiating the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Optional. Information about the user paying/initiating the transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.User user = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User::class); - $this->user = $var; - - return $this; - } - - /** - * Optional. Information about the user or users fulfilling the transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMerchants() - { - return $this->merchants; - } - - /** - * Optional. Information about the user or users fulfilling the transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.User merchants = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMerchants($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\User::class); - $this->merchants = $arr; - - return $this; - } - - /** - * Optional. Items purchased in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getItems() - { - return $this->items; - } - - /** - * Optional. Items purchased in this transaction. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.TransactionData.Item items = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setItems($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\Item::class); - $this->items = $arr; - - return $this; - } - - /** - * Optional. Information about the payment gateway's response to the - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo|null - */ - public function getGatewayInfo() - { - return $this->gateway_info; - } - - public function hasGatewayInfo() - { - return isset($this->gateway_info); - } - - public function clearGatewayInfo() - { - unset($this->gateway_info); - } - - /** - * Optional. Information about the payment gateway's response to the - * transaction. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo gateway_info = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo $var - * @return $this - */ - public function setGatewayInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData\GatewayInfo::class); - $this->gateway_info = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php deleted file mode 100644 index 53c471921b0..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Address.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionData.Address - */ -class Address extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The recipient name, potentially including information such as - * "care of". - * - * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $recipient = ''; - /** - * Optional. The first lines of the address. The first line generally - * contains the street name and number, and further lines may include - * information such as an apartment number. - * - * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $address; - /** - * Optional. The town/city of the address. - * - * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $locality = ''; - /** - * Optional. The state, province, or otherwise administrative area of the - * address. - * - * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $administrative_area = ''; - /** - * Optional. The CLDR country/region of the address. - * - * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $region_code = ''; - /** - * Optional. The postal or ZIP code of the address. - * - * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $postal_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $recipient - * Optional. The recipient name, potentially including information such as - * "care of". - * @type array|\Google\Protobuf\Internal\RepeatedField $address - * Optional. The first lines of the address. The first line generally - * contains the street name and number, and further lines may include - * information such as an apartment number. - * @type string $locality - * Optional. The town/city of the address. - * @type string $administrative_area - * Optional. The state, province, or otherwise administrative area of the - * address. - * @type string $region_code - * Optional. The CLDR country/region of the address. - * @type string $postal_code - * Optional. The postal or ZIP code of the address. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The recipient name, potentially including information such as - * "care of". - * - * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRecipient() - { - return $this->recipient; - } - - /** - * Optional. The recipient name, potentially including information such as - * "care of". - * - * Generated from protobuf field string recipient = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRecipient($var) - { - GPBUtil::checkString($var, True); - $this->recipient = $var; - - return $this; - } - - /** - * Optional. The first lines of the address. The first line generally - * contains the street name and number, and further lines may include - * information such as an apartment number. - * - * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAddress() - { - return $this->address; - } - - /** - * Optional. The first lines of the address. The first line generally - * contains the street name and number, and further lines may include - * information such as an apartment number. - * - * Generated from protobuf field repeated string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAddress($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->address = $arr; - - return $this; - } - - /** - * Optional. The town/city of the address. - * - * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLocality() - { - return $this->locality; - } - - /** - * Optional. The town/city of the address. - * - * Generated from protobuf field string locality = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLocality($var) - { - GPBUtil::checkString($var, True); - $this->locality = $var; - - return $this; - } - - /** - * Optional. The state, province, or otherwise administrative area of the - * address. - * - * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAdministrativeArea() - { - return $this->administrative_area; - } - - /** - * Optional. The state, province, or otherwise administrative area of the - * address. - * - * Generated from protobuf field string administrative_area = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAdministrativeArea($var) - { - GPBUtil::checkString($var, True); - $this->administrative_area = $var; - - return $this; - } - - /** - * Optional. The CLDR country/region of the address. - * - * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRegionCode() - { - return $this->region_code; - } - - /** - * Optional. The CLDR country/region of the address. - * - * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRegionCode($var) - { - GPBUtil::checkString($var, True); - $this->region_code = $var; - - return $this; - } - - /** - * Optional. The postal or ZIP code of the address. - * - * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPostalCode() - { - return $this->postal_code; - } - - /** - * Optional. The postal or ZIP code of the address. - * - * Generated from protobuf field string postal_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPostalCode($var) - { - GPBUtil::checkString($var, True); - $this->postal_code = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Address::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_Address::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php deleted file mode 100644 index c80b7df3a8b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/GatewayInfo.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo - */ -class GatewayInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Name of the gateway service (for example, stripe, square, - * paypal). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $name = ''; - /** - * Optional. Gateway response code describing the state of the transaction. - * - * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $gateway_response_code = ''; - /** - * Optional. AVS response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $avs_response_code = ''; - /** - * Optional. CVV response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cvv_response_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. Name of the gateway service (for example, stripe, square, - * paypal). - * @type string $gateway_response_code - * Optional. Gateway response code describing the state of the transaction. - * @type string $avs_response_code - * Optional. AVS response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * @type string $cvv_response_code - * Optional. CVV response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Name of the gateway service (for example, stripe, square, - * paypal). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. Name of the gateway service (for example, stripe, square, - * paypal). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Gateway response code describing the state of the transaction. - * - * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getGatewayResponseCode() - { - return $this->gateway_response_code; - } - - /** - * Optional. Gateway response code describing the state of the transaction. - * - * Generated from protobuf field string gateway_response_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setGatewayResponseCode($var) - { - GPBUtil::checkString($var, True); - $this->gateway_response_code = $var; - - return $this; - } - - /** - * Optional. AVS response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAvsResponseCode() - { - return $this->avs_response_code; - } - - /** - * Optional. AVS response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string avs_response_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAvsResponseCode($var) - { - GPBUtil::checkString($var, True); - $this->avs_response_code = $var; - - return $this; - } - - /** - * Optional. CVV response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCvvResponseCode() - { - return $this->cvv_response_code; - } - - /** - * Optional. CVV response code from the gateway - * (available only when reCAPTCHA Enterprise is called after authorization). - * - * Generated from protobuf field string cvv_response_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCvvResponseCode($var) - { - GPBUtil::checkString($var, True); - $this->cvv_response_code = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GatewayInfo::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_GatewayInfo::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php deleted file mode 100644 index e9cf18afba8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/Item.php +++ /dev/null @@ -1,180 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionData.Item - */ -class Item extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The full name of the item. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $name = ''; - /** - * Optional. The value per item that the user is paying, in the transaction - * currency, after discounts. - * - * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value = 0.0; - /** - * Optional. The quantity of this item that is being purchased. - * - * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $quantity = 0; - /** - * Optional. When a merchant is specified, its corresponding account_id. - * Necessary to populate marketplace-style transactions. - * - * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $merchant_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The full name of the item. - * @type float $value - * Optional. The value per item that the user is paying, in the transaction - * currency, after discounts. - * @type int|string $quantity - * Optional. The quantity of this item that is being purchased. - * @type string $merchant_account_id - * Optional. When a merchant is specified, its corresponding account_id. - * Necessary to populate marketplace-style transactions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The full name of the item. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The full name of the item. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The value per item that the user is paying, in the transaction - * currency, after discounts. - * - * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getValue() - { - return $this->value; - } - - /** - * Optional. The value per item that the user is paying, in the transaction - * currency, after discounts. - * - * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkDouble($var); - $this->value = $var; - - return $this; - } - - /** - * Optional. The quantity of this item that is being purchased. - * - * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getQuantity() - { - return $this->quantity; - } - - /** - * Optional. The quantity of this item that is being purchased. - * - * Generated from protobuf field int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setQuantity($var) - { - GPBUtil::checkInt64($var); - $this->quantity = $var; - - return $this; - } - - /** - * Optional. When a merchant is specified, its corresponding account_id. - * Necessary to populate marketplace-style transactions. - * - * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getMerchantAccountId() - { - return $this->merchant_account_id; - } - - /** - * Optional. When a merchant is specified, its corresponding account_id. - * Necessary to populate marketplace-style transactions. - * - * Generated from protobuf field string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setMerchantAccountId($var) - { - GPBUtil::checkString($var, True); - $this->merchant_account_id = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Item::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_Item::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php deleted file mode 100644 index f5aeaedf65c..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionData/User.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionData.User - */ -class User extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Unique account identifier for this user. If using account - * defender, this should match the hashed_account_id field. Otherwise, a - * unique and persistent identifier for this account. - * - * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $account_id = ''; - /** - * Optional. The epoch milliseconds of the user's account creation. - * - * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $creation_ms = 0; - /** - * Optional. The email address of the user. - * - * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $email = ''; - /** - * Optional. Whether the email has been verified to be accessible by the - * user (OTP or similar). - * - * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $email_verified = false; - /** - * Optional. The phone number of the user, with country code. - * - * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $phone_number = ''; - /** - * Optional. Whether the phone number has been verified to be accessible by - * the user (OTP or similar). - * - * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $phone_verified = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $account_id - * Optional. Unique account identifier for this user. If using account - * defender, this should match the hashed_account_id field. Otherwise, a - * unique and persistent identifier for this account. - * @type int|string $creation_ms - * Optional. The epoch milliseconds of the user's account creation. - * @type string $email - * Optional. The email address of the user. - * @type bool $email_verified - * Optional. Whether the email has been verified to be accessible by the - * user (OTP or similar). - * @type string $phone_number - * Optional. The phone number of the user, with country code. - * @type bool $phone_verified - * Optional. Whether the phone number has been verified to be accessible by - * the user (OTP or similar). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Unique account identifier for this user. If using account - * defender, this should match the hashed_account_id field. Otherwise, a - * unique and persistent identifier for this account. - * - * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAccountId() - { - return $this->account_id; - } - - /** - * Optional. Unique account identifier for this user. If using account - * defender, this should match the hashed_account_id field. Otherwise, a - * unique and persistent identifier for this account. - * - * Generated from protobuf field string account_id = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAccountId($var) - { - GPBUtil::checkString($var, True); - $this->account_id = $var; - - return $this; - } - - /** - * Optional. The epoch milliseconds of the user's account creation. - * - * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getCreationMs() - { - return $this->creation_ms; - } - - /** - * Optional. The epoch milliseconds of the user's account creation. - * - * Generated from protobuf field int64 creation_ms = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setCreationMs($var) - { - GPBUtil::checkInt64($var); - $this->creation_ms = $var; - - return $this; - } - - /** - * Optional. The email address of the user. - * - * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * Optional. The email address of the user. - * - * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEmail($var) - { - GPBUtil::checkString($var, True); - $this->email = $var; - - return $this; - } - - /** - * Optional. Whether the email has been verified to be accessible by the - * user (OTP or similar). - * - * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEmailVerified() - { - return $this->email_verified; - } - - /** - * Optional. Whether the email has been verified to be accessible by the - * user (OTP or similar). - * - * Generated from protobuf field bool email_verified = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEmailVerified($var) - { - GPBUtil::checkBool($var); - $this->email_verified = $var; - - return $this; - } - - /** - * Optional. The phone number of the user, with country code. - * - * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPhoneNumber() - { - return $this->phone_number; - } - - /** - * Optional. The phone number of the user, with country code. - * - * Generated from protobuf field string phone_number = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPhoneNumber($var) - { - GPBUtil::checkString($var, True); - $this->phone_number = $var; - - return $this; - } - - /** - * Optional. Whether the phone number has been verified to be accessible by - * the user (OTP or similar). - * - * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getPhoneVerified() - { - return $this->phone_verified; - } - - /** - * Optional. Whether the phone number has been verified to be accessible by - * the user (OTP or similar). - * - * Generated from protobuf field bool phone_verified = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setPhoneVerified($var) - { - GPBUtil::checkBool($var); - $this->phone_verified = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(User::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_User::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php deleted file mode 100644 index 982397f1d7b..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent.php +++ /dev/null @@ -1,199 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionEvent - */ -class TransactionEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The type of this transaction event. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_type = 0; - /** - * Optional. The reason or standardized code that corresponds with this - * transaction event, if one exists. For example, a CHARGEBACK event with code - * 6005. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reason = ''; - /** - * Optional. The value that corresponds with this transaction event, if one - * exists. For example, a refund event where $5.00 was refunded. Currency is - * obtained from the original transaction data. - * - * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value = 0.0; - /** - * Optional. Timestamp when this transaction event occurred; otherwise assumed - * to be the time of the API call. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $event_type - * Optional. The type of this transaction event. - * @type string $reason - * Optional. The reason or standardized code that corresponds with this - * transaction event, if one exists. For example, a CHARGEBACK event with code - * 6005. - * @type float $value - * Optional. The value that corresponds with this transaction event, if one - * exists. For example, a refund event where $5.00 was refunded. Currency is - * obtained from the original transaction data. - * @type \Google\Protobuf\Timestamp $event_time - * Optional. Timestamp when this transaction event occurred; otherwise assumed - * to be the time of the API call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The type of this transaction event. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getEventType() - { - return $this->event_type; - } - - /** - * Optional. The type of this transaction event. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType event_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setEventType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent\TransactionEventType::class); - $this->event_type = $var; - - return $this; - } - - /** - * Optional. The reason or standardized code that corresponds with this - * transaction event, if one exists. For example, a CHARGEBACK event with code - * 6005. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Optional. The reason or standardized code that corresponds with this - * transaction event, if one exists. For example, a CHARGEBACK event with code - * 6005. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - - /** - * Optional. The value that corresponds with this transaction event, if one - * exists. For example, a refund event where $5.00 was refunded. Currency is - * obtained from the original transaction data. - * - * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getValue() - { - return $this->value; - } - - /** - * Optional. The value that corresponds with this transaction event, if one - * exists. For example, a refund event where $5.00 was refunded. Currency is - * obtained from the original transaction data. - * - * Generated from protobuf field double value = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkDouble($var); - $this->value = $var; - - return $this; - } - - /** - * Optional. Timestamp when this transaction event occurred; otherwise assumed - * to be the time of the API call. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.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. Timestamp when this transaction event occurred; otherwise assumed - * to be the time of the API call. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 4 [(.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; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php deleted file mode 100644 index 04f38508e88..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/TransactionEvent/TransactionEventType.php +++ /dev/null @@ -1,214 +0,0 @@ -google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType - */ -class TransactionEventType -{ - /** - * Default, unspecified event type. - * - * Generated from protobuf enum TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; - */ - const TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; - /** - * Indicates that the transaction is approved by the merchant. The - * accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', - * 'CYBERSOURCE', or 'MANUAL_REVIEW'. - * - * Generated from protobuf enum MERCHANT_APPROVE = 1; - */ - const MERCHANT_APPROVE = 1; - /** - * Indicates that the transaction is denied and concluded due to risks - * detected by the merchant. The accompanying reasons can include terms such - * as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. - * - * Generated from protobuf enum MERCHANT_DENY = 2; - */ - const MERCHANT_DENY = 2; - /** - * Indicates that the transaction is being evaluated by a human, due to - * suspicion or risk. - * - * Generated from protobuf enum MANUAL_REVIEW = 3; - */ - const MANUAL_REVIEW = 3; - /** - * Indicates that the authorization attempt with the card issuer succeeded. - * - * Generated from protobuf enum AUTHORIZATION = 4; - */ - const AUTHORIZATION = 4; - /** - * Indicates that the authorization attempt with the card issuer failed. - * The accompanying reasons can include Visa's '54' indicating that the card - * is expired, or '82' indicating that the CVV is incorrect. - * - * Generated from protobuf enum AUTHORIZATION_DECLINE = 5; - */ - const AUTHORIZATION_DECLINE = 5; - /** - * Indicates that the transaction is completed because the funds were - * settled. - * - * Generated from protobuf enum PAYMENT_CAPTURE = 6; - */ - const PAYMENT_CAPTURE = 6; - /** - * Indicates that the transaction could not be completed because the funds - * were not settled. - * - * Generated from protobuf enum PAYMENT_CAPTURE_DECLINE = 7; - */ - const PAYMENT_CAPTURE_DECLINE = 7; - /** - * Indicates that the transaction has been canceled. Specify the reason - * for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. - * - * Generated from protobuf enum CANCEL = 8; - */ - const CANCEL = 8; - /** - * Indicates that the merchant has received a chargeback inquiry due to - * fraud for the transaction, requesting additional information before a - * fraud chargeback is officially issued and a formal chargeback - * notification is sent. - * - * Generated from protobuf enum CHARGEBACK_INQUIRY = 9; - */ - const CHARGEBACK_INQUIRY = 9; - /** - * Indicates that the merchant has received a chargeback alert due to fraud - * for the transaction. The process of resolving the dispute without - * involving the payment network is started. - * - * Generated from protobuf enum CHARGEBACK_ALERT = 10; - */ - const CHARGEBACK_ALERT = 10; - /** - * Indicates that a fraud notification is issued for the transaction, sent - * by the payment instrument's issuing bank because the transaction appears - * to be fraudulent. We recommend including TC40 or SAFE data in the - * `reason` field for this event type. For partial chargebacks, we recommend - * that you include an amount in the `value` field. - * - * Generated from protobuf enum FRAUD_NOTIFICATION = 11; - */ - const FRAUD_NOTIFICATION = 11; - /** - * Indicates that the merchant is informed by the payment network that the - * transaction has entered the chargeback process due to fraud. Reason code - * examples include Discover's '6005' and '6041'. For partial chargebacks, - * we recommend that you include an amount in the `value` field. - * - * Generated from protobuf enum CHARGEBACK = 12; - */ - const CHARGEBACK = 12; - /** - * Indicates that the transaction has entered the chargeback process due to - * fraud, and that the merchant has chosen to enter representment. Reason - * examples include Discover's '6005' and '6041'. For partial chargebacks, - * we recommend that you include an amount in the `value` field. - * - * Generated from protobuf enum CHARGEBACK_REPRESENTMENT = 13; - */ - const CHARGEBACK_REPRESENTMENT = 13; - /** - * Indicates that the transaction has had a fraud chargeback which was - * illegitimate and was reversed as a result. For partial chargebacks, we - * recommend that you include an amount in the `value` field. - * - * Generated from protobuf enum CHARGEBACK_REVERSE = 14; - */ - const CHARGEBACK_REVERSE = 14; - /** - * Indicates that the merchant has received a refund for a completed - * transaction. For partial refunds, we recommend that you include an amount - * in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of - * exempt tax) - * - * Generated from protobuf enum REFUND_REQUEST = 15; - */ - const REFUND_REQUEST = 15; - /** - * Indicates that the merchant has received a refund request for this - * transaction, but that they have declined it. For partial refunds, we - * recommend that you include an amount in the `value` field. Reason - * example: 'TAX_EXEMPT' (partial refund of exempt tax) - * - * Generated from protobuf enum REFUND_DECLINE = 16; - */ - const REFUND_DECLINE = 16; - /** - * Indicates that the completed transaction was refunded by the merchant. - * For partial refunds, we recommend that you include an amount in the - * `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt - * tax) - * - * Generated from protobuf enum REFUND = 17; - */ - const REFUND = 17; - /** - * Indicates that the completed transaction was refunded by the merchant, - * and that this refund was reversed. For partial refunds, we recommend that - * you include an amount in the `value` field. - * - * Generated from protobuf enum REFUND_REVERSE = 18; - */ - const REFUND_REVERSE = 18; - - private static $valueToName = [ - self::TRANSACTION_EVENT_TYPE_UNSPECIFIED => 'TRANSACTION_EVENT_TYPE_UNSPECIFIED', - self::MERCHANT_APPROVE => 'MERCHANT_APPROVE', - self::MERCHANT_DENY => 'MERCHANT_DENY', - self::MANUAL_REVIEW => 'MANUAL_REVIEW', - self::AUTHORIZATION => 'AUTHORIZATION', - self::AUTHORIZATION_DECLINE => 'AUTHORIZATION_DECLINE', - self::PAYMENT_CAPTURE => 'PAYMENT_CAPTURE', - self::PAYMENT_CAPTURE_DECLINE => 'PAYMENT_CAPTURE_DECLINE', - self::CANCEL => 'CANCEL', - self::CHARGEBACK_INQUIRY => 'CHARGEBACK_INQUIRY', - self::CHARGEBACK_ALERT => 'CHARGEBACK_ALERT', - self::FRAUD_NOTIFICATION => 'FRAUD_NOTIFICATION', - self::CHARGEBACK => 'CHARGEBACK', - self::CHARGEBACK_REPRESENTMENT => 'CHARGEBACK_REPRESENTMENT', - self::CHARGEBACK_REVERSE => 'CHARGEBACK_REVERSE', - self::REFUND_REQUEST => 'REFUND_REQUEST', - self::REFUND_DECLINE => 'REFUND_DECLINE', - self::REFUND => 'REFUND', - self::REFUND_REVERSE => 'REFUND_REVERSE', - ]; - - 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(TransactionEventType::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent_TransactionEventType::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php deleted file mode 100644 index 30296a309d6..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateFirewallPolicyRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest - */ -class UpdateFirewallPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The policy to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $firewall_policy = null; - /** - * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy Required. The policy to update. - * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\UpdateFirewallPolicyRequest - * - * @experimental - */ - public static function build(\Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setFirewallPolicy($firewallPolicy) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy - * Required. The policy to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The policy to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null - */ - public function getFirewallPolicy() - { - return $this->firewall_policy; - } - - public function hasFirewallPolicy() - { - return isset($this->firewall_policy); - } - - public function clearFirewallPolicy() - { - unset($this->firewall_policy); - } - - /** - * Required. The policy to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var - * @return $this - */ - public function setFirewallPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class); - $this->firewall_policy = $var; - - return $this; - } - - /** - * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php deleted file mode 100644 index 00a05f2d2d8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UpdateKeyRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.recaptchaenterprise.v1.UpdateKeyRequest - */ -class UpdateKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The key to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key = null; - /** - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $key Required. The key to update. - * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * - * @return \Google\Cloud\RecaptchaEnterprise\V1\UpdateKeyRequest - * - * @experimental - */ - public static function build(\Google\Cloud\RecaptchaEnterprise\V1\Key $key, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setKey($key) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecaptchaEnterprise\V1\Key $key - * Required. The key to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The key to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecaptchaEnterprise\V1\Key|null - */ - public function getKey() - { - return $this->key; - } - - public function hasKey() - { - return isset($this->key); - } - - public function clearKey() - { - unset($this->key); - } - - /** - * Required. The key to update. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Key key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecaptchaEnterprise\V1\Key $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Key::class); - $this->key = $var; - - return $this; - } - - /** - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php deleted file mode 100644 index 172fe5a75cc..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserId.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.recaptchaenterprise.v1.UserId - */ -class UserId extends \Google\Protobuf\Internal\Message -{ - protected $id_oneof; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $email - * Optional. An email address. - * @type string $phone_number - * Optional. A phone number. Should use the E.164 format. - * @type string $username - * Optional. A unique username, if different from all the other identifiers - * and `account_id` that are provided. Can be a unique login handle or - * display name for a user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. An email address. - * - * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEmail() - { - return $this->readOneof(1); - } - - public function hasEmail() - { - return $this->hasOneof(1); - } - - /** - * Optional. An email address. - * - * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEmail($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. A phone number. Should use the E.164 format. - * - * Generated from protobuf field string phone_number = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPhoneNumber() - { - return $this->readOneof(2); - } - - public function hasPhoneNumber() - { - return $this->hasOneof(2); - } - - /** - * Optional. A phone number. Should use the E.164 format. - * - * Generated from protobuf field string phone_number = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPhoneNumber($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Optional. A unique username, if different from all the other identifiers - * and `account_id` that are provided. Can be a unique login handle or - * display name for a user. - * - * Generated from protobuf field string username = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUsername() - { - return $this->readOneof(3); - } - - public function hasUsername() - { - return $this->hasOneof(3); - } - - /** - * Optional. A unique username, if different from all the other identifiers - * and `account_id` that are provided. Can be a unique login handle or - * display name for a user. - * - * Generated from protobuf field string username = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getIdOneof() - { - return $this->whichOneof("id_oneof"); - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php deleted file mode 100644 index 45d5c2715ce..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/UserInfo.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.recaptchaenterprise.v1.UserInfo - */ -class UserInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Creation time for this account associated with this user. Leave - * blank for non logged-in actions, guest checkout, or when there is no - * account associated with the current user. - * - * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $create_account_time = null; - /** - * Optional. For logged-in requests or login/registration requests, the unique - * account identifier associated with this user. You can use the username if - * it is stable (meaning it is the same for every request associated with the - * same user), or any stable user ID of your choice. Leave blank for non - * logged-in actions or guest checkout. - * - * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $account_id = ''; - /** - * Optional. Identifiers associated with this user or request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $user_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_account_time - * Optional. Creation time for this account associated with this user. Leave - * blank for non logged-in actions, guest checkout, or when there is no - * account associated with the current user. - * @type string $account_id - * Optional. For logged-in requests or login/registration requests, the unique - * account identifier associated with this user. You can use the username if - * it is stable (meaning it is the same for every request associated with the - * same user), or any stable user ID of your choice. Leave blank for non - * logged-in actions or guest checkout. - * @type array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $user_ids - * Optional. Identifiers associated with this user or request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Creation time for this account associated with this user. Leave - * blank for non logged-in actions, guest checkout, or when there is no - * account associated with the current user. - * - * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateAccountTime() - { - return $this->create_account_time; - } - - public function hasCreateAccountTime() - { - return isset($this->create_account_time); - } - - public function clearCreateAccountTime() - { - unset($this->create_account_time); - } - - /** - * Optional. Creation time for this account associated with this user. Leave - * blank for non logged-in actions, guest checkout, or when there is no - * account associated with the current user. - * - * Generated from protobuf field .google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateAccountTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_account_time = $var; - - return $this; - } - - /** - * Optional. For logged-in requests or login/registration requests, the unique - * account identifier associated with this user. You can use the username if - * it is stable (meaning it is the same for every request associated with the - * same user), or any stable user ID of your choice. Leave blank for non - * logged-in actions or guest checkout. - * - * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAccountId() - { - return $this->account_id; - } - - /** - * Optional. For logged-in requests or login/registration requests, the unique - * account identifier associated with this user. You can use the username if - * it is stable (meaning it is the same for every request associated with the - * same user), or any stable user ID of your choice. Leave blank for non - * logged-in actions or guest checkout. - * - * Generated from protobuf field string account_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAccountId($var) - { - GPBUtil::checkString($var, True); - $this->account_id = $var; - - return $this; - } - - /** - * Optional. Identifiers associated with this user or request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUserIds() - { - return $this->user_ids; - } - - /** - * Optional. Identifiers associated with this user or request. - * - * Generated from protobuf field repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUserIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\UserId::class); - $this->user_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php deleted file mode 100644 index 7eb59cf1472..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WafSettings - */ -class WafSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The WAF service that uses this key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $waf_service = 0; - /** - * Required. The WAF feature for which this key is enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $waf_feature = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $waf_service - * Required. The WAF service that uses this key. - * @type int $waf_feature - * Required. The WAF feature for which this key is enabled. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Required. The WAF service that uses this key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getWafService() - { - return $this->waf_service; - } - - /** - * Required. The WAF service that uses this key. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafService waf_service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setWafService($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings\WafService::class); - $this->waf_service = $var; - - return $this; - } - - /** - * Required. The WAF feature for which this key is enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getWafFeature() - { - return $this->waf_feature; - } - - /** - * Required. The WAF feature for which this key is enabled. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature waf_feature = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setWafFeature($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings\WafFeature::class); - $this->waf_feature = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php deleted file mode 100644 index 33d01002105..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafFeature.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature - */ -class WafFeature -{ - /** - * Undefined feature. - * - * Generated from protobuf enum WAF_FEATURE_UNSPECIFIED = 0; - */ - const WAF_FEATURE_UNSPECIFIED = 0; - /** - * Redirects suspicious traffic to reCAPTCHA. - * - * Generated from protobuf enum CHALLENGE_PAGE = 1; - */ - const CHALLENGE_PAGE = 1; - /** - * Use reCAPTCHA session-tokens to protect the whole user session on the - * site's domain. - * - * Generated from protobuf enum SESSION_TOKEN = 2; - */ - const SESSION_TOKEN = 2; - /** - * Use reCAPTCHA action-tokens to protect user actions. - * - * Generated from protobuf enum ACTION_TOKEN = 3; - */ - const ACTION_TOKEN = 3; - /** - * Use reCAPTCHA WAF express protection to protect any content other than - * web pages, like APIs and IoT devices. - * - * Generated from protobuf enum EXPRESS = 5; - */ - const EXPRESS = 5; - - private static $valueToName = [ - self::WAF_FEATURE_UNSPECIFIED => 'WAF_FEATURE_UNSPECIFIED', - self::CHALLENGE_PAGE => 'CHALLENGE_PAGE', - self::SESSION_TOKEN => 'SESSION_TOKEN', - self::ACTION_TOKEN => 'ACTION_TOKEN', - self::EXPRESS => 'EXPRESS', - ]; - - 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(WafFeature::class, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings_WafFeature::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php deleted file mode 100644 index e56c885cea5..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WafSettings/WafService.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WafSettings.WafService - */ -class WafService -{ - /** - * Undefined WAF - * - * Generated from protobuf enum WAF_SERVICE_UNSPECIFIED = 0; - */ - const WAF_SERVICE_UNSPECIFIED = 0; - /** - * Cloud Armor - * - * Generated from protobuf enum CA = 1; - */ - const CA = 1; - /** - * Fastly - * - * Generated from protobuf enum FASTLY = 3; - */ - const FASTLY = 3; - /** - * Cloudflare - * - * Generated from protobuf enum CLOUDFLARE = 4; - */ - const CLOUDFLARE = 4; - /** - * Akamai - * - * Generated from protobuf enum AKAMAI = 5; - */ - const AKAMAI = 5; - - private static $valueToName = [ - self::WAF_SERVICE_UNSPECIFIED => 'WAF_SERVICE_UNSPECIFIED', - self::CA => 'CA', - self::FASTLY => 'FASTLY', - self::CLOUDFLARE => 'CLOUDFLARE', - self::AKAMAI => 'AKAMAI', - ]; - - 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(WafService::class, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings_WafService::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php deleted file mode 100644 index deee451420f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings.php +++ /dev/null @@ -1,227 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WebKeySettings - */ -class WebKeySettings extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. If set to true, it means allowed_domains are not enforced. - * - * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_all_domains = false; - /** - * Optional. Domains or subdomains of websites allowed to use the key. All - * subdomains of an allowed domain are automatically allowed. A valid domain - * requires a host and must not include any path, port, query or fragment. - * Examples: 'example.com' or 'subdomain.example.com' - * - * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $allowed_domains; - /** - * Optional. If set to true, the key can be used on AMP (Accelerated Mobile - * Pages) websites. This is supported only for the SCORE integration type. - * - * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_amp_traffic = false; - /** - * Required. Describes how this key is integrated with the website. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $integration_type = 0; - /** - * Optional. Settings for the frequency and difficulty at which this key - * triggers captcha challenges. This should only be specified for - * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $challenge_security_preference = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $allow_all_domains - * Optional. If set to true, it means allowed_domains are not enforced. - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_domains - * Optional. Domains or subdomains of websites allowed to use the key. All - * subdomains of an allowed domain are automatically allowed. A valid domain - * requires a host and must not include any path, port, query or fragment. - * Examples: 'example.com' or 'subdomain.example.com' - * @type bool $allow_amp_traffic - * Optional. If set to true, the key can be used on AMP (Accelerated Mobile - * Pages) websites. This is supported only for the SCORE integration type. - * @type int $integration_type - * Required. Describes how this key is integrated with the website. - * @type int $challenge_security_preference - * Optional. Settings for the frequency and difficulty at which this key - * triggers captcha challenges. This should only be specified for - * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce(); - parent::__construct($data); - } - - /** - * Optional. If set to true, it means allowed_domains are not enforced. - * - * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowAllDomains() - { - return $this->allow_all_domains; - } - - /** - * Optional. If set to true, it means allowed_domains are not enforced. - * - * Generated from protobuf field bool allow_all_domains = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowAllDomains($var) - { - GPBUtil::checkBool($var); - $this->allow_all_domains = $var; - - return $this; - } - - /** - * Optional. Domains or subdomains of websites allowed to use the key. All - * subdomains of an allowed domain are automatically allowed. A valid domain - * requires a host and must not include any path, port, query or fragment. - * Examples: 'example.com' or 'subdomain.example.com' - * - * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedDomains() - { - return $this->allowed_domains; - } - - /** - * Optional. Domains or subdomains of websites allowed to use the key. All - * subdomains of an allowed domain are automatically allowed. A valid domain - * requires a host and must not include any path, port, query or fragment. - * Examples: 'example.com' or 'subdomain.example.com' - * - * Generated from protobuf field repeated string allowed_domains = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedDomains($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_domains = $arr; - - return $this; - } - - /** - * Optional. If set to true, the key can be used on AMP (Accelerated Mobile - * Pages) websites. This is supported only for the SCORE integration type. - * - * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowAmpTraffic() - { - return $this->allow_amp_traffic; - } - - /** - * Optional. If set to true, the key can be used on AMP (Accelerated Mobile - * Pages) websites. This is supported only for the SCORE integration type. - * - * Generated from protobuf field bool allow_amp_traffic = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowAmpTraffic($var) - { - GPBUtil::checkBool($var); - $this->allow_amp_traffic = $var; - - return $this; - } - - /** - * Required. Describes how this key is integrated with the website. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getIntegrationType() - { - return $this->integration_type; - } - - /** - * Required. Describes how this key is integrated with the website. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setIntegrationType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings\IntegrationType::class); - $this->integration_type = $var; - - return $this; - } - - /** - * Optional. Settings for the frequency and difficulty at which this key - * triggers captcha challenges. This should only be specified for - * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getChallengeSecurityPreference() - { - return $this->challenge_security_preference; - } - - /** - * Optional. Settings for the frequency and difficulty at which this key - * triggers captcha challenges. This should only be specified for - * IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE. - * - * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setChallengeSecurityPreference($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings\ChallengeSecurityPreference::class); - $this->challenge_security_preference = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php deleted file mode 100644 index d88becd7d59..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/ChallengeSecurityPreference.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference - */ -class ChallengeSecurityPreference -{ - /** - * Default type that indicates this enum hasn't been specified. - * - * Generated from protobuf enum CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; - */ - const CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; - /** - * Key tends to show fewer and easier challenges. - * - * Generated from protobuf enum USABILITY = 1; - */ - const USABILITY = 1; - /** - * Key tends to show balanced (in amount and difficulty) challenges. - * - * Generated from protobuf enum BALANCE = 2; - */ - const BALANCE = 2; - /** - * Key tends to show more and harder challenges. - * - * Generated from protobuf enum SECURITY = 3; - */ - const SECURITY = 3; - - private static $valueToName = [ - self::CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED => 'CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED', - self::USABILITY => 'USABILITY', - self::BALANCE => 'BALANCE', - self::SECURITY => 'SECURITY', - ]; - - 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(ChallengeSecurityPreference::class, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings_ChallengeSecurityPreference::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php b/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php deleted file mode 100644 index c254ac1621f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/proto/src/Google/Cloud/RecaptchaEnterprise/V1/WebKeySettings/IntegrationType.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType - */ -class IntegrationType -{ - /** - * Default type that indicates this enum hasn't been specified. This is not - * a valid IntegrationType, one of the other types must be specified - * instead. - * - * Generated from protobuf enum INTEGRATION_TYPE_UNSPECIFIED = 0; - */ - const INTEGRATION_TYPE_UNSPECIFIED = 0; - /** - * Only used to produce scores. It doesn't display the "I'm not a robot" - * checkbox and never shows captcha challenges. - * - * Generated from protobuf enum SCORE = 1; - */ - const SCORE = 1; - /** - * Displays the "I'm not a robot" checkbox and may show captcha challenges - * after it is checked. - * - * Generated from protobuf enum CHECKBOX = 2; - */ - const CHECKBOX = 2; - /** - * Doesn't display the "I'm not a robot" checkbox, but may show captcha - * challenges after risk analysis. - * - * Generated from protobuf enum INVISIBLE = 3; - */ - const INVISIBLE = 3; - - private static $valueToName = [ - self::INTEGRATION_TYPE_UNSPECIFIED => 'INTEGRATION_TYPE_UNSPECIFIED', - self::SCORE => 'SCORE', - self::CHECKBOX => 'CHECKBOX', - self::INVISIBLE => 'INVISIBLE', - ]; - - 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(IntegrationType::class, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings_IntegrationType::class); - diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php deleted file mode 100644 index 281f7b67c41..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php +++ /dev/null @@ -1,94 +0,0 @@ -setIp($ipOverrideDataIp) - ->setOverrideType($ipOverrideDataOverrideType); - $request = (new AddIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - - // Call the API and handle any network failures. - try { - /** @var AddIpOverrideResponse $response */ - $response = $recaptchaEnterpriseServiceClient->addIpOverride($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - $ipOverrideDataIp = '[IP]'; - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - - add_ip_override_sample($formattedName, $ipOverrideDataIp, $ipOverrideDataOverrideType); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php deleted file mode 100644 index 795285fdc61..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName) - ->setAnnotation($annotation); - - // Call the API and handle any network failures. - try { - /** @var AnnotateAssessmentResponse $response */ - $response = $recaptchaEnterpriseServiceClient->annotateAssessment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::assessmentName('[PROJECT]', '[ASSESSMENT]'); - $annotation = Annotation::ANNOTATION_UNSPECIFIED; - - annotate_assessment_sample($formattedName, $annotation); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php deleted file mode 100644 index 6f423277873..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php +++ /dev/null @@ -1,74 +0,0 @@ -setParent($formattedParent) - ->setAssessment($assessment); - - // Call the API and handle any network failures. - try { - /** @var Assessment $response */ - $response = $recaptchaEnterpriseServiceClient->createAssessment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - create_assessment_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php deleted file mode 100644 index 69aaafca3e9..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent) - ->setFirewallPolicy($firewallPolicy); - - // Call the API and handle any network failures. - try { - /** @var FirewallPolicy $response */ - $response = $recaptchaEnterpriseServiceClient->createFirewallPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - create_firewall_policy_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php deleted file mode 100644 index 21f9ac2c03f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/create_key.php +++ /dev/null @@ -1,77 +0,0 @@ -setDisplayName($keyDisplayName); - $request = (new CreateKeyRequest()) - ->setParent($formattedParent) - ->setKey($key); - - // Call the API and handle any network failures. - try { - /** @var Key $response */ - $response = $recaptchaEnterpriseServiceClient->createKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - $keyDisplayName = '[DISPLAY_NAME]'; - - create_key_sample($formattedParent, $keyDisplayName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php deleted file mode 100644 index 778dff633d9..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $recaptchaEnterpriseServiceClient->deleteFirewallPolicy($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::firewallPolicyName( - '[PROJECT]', - '[FIREWALLPOLICY]' - ); - - delete_firewall_policy_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php deleted file mode 100644 index 1c638b7a752..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php +++ /dev/null @@ -1,70 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $recaptchaEnterpriseServiceClient->deleteKey($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - - delete_key_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php deleted file mode 100644 index ee3cd695bcc..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var FirewallPolicy $response */ - $response = $recaptchaEnterpriseServiceClient->getFirewallPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::firewallPolicyName( - '[PROJECT]', - '[FIREWALLPOLICY]' - ); - - get_firewall_policy_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php deleted file mode 100644 index 31763afbd0a..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_key.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Key $response */ - $response = $recaptchaEnterpriseServiceClient->getKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - - get_key_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php deleted file mode 100644 index 47fd8ee6e6c..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Metrics $response */ - $response = $recaptchaEnterpriseServiceClient->getMetrics($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::metricsName('[PROJECT]', '[KEY]'); - - get_metrics_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php deleted file mode 100644 index 124b5973bd8..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->listFirewallPolicies($request); - - /** @var FirewallPolicy $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - list_firewall_policies_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php deleted file mode 100644 index ca998523c26..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->listIpOverrides($request); - - /** @var IpOverrideData $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - - list_ip_overrides_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php deleted file mode 100644 index 468c27c507f..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->listKeys($request); - - /** @var Key $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - list_keys_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php deleted file mode 100644 index 0234cee9450..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($request); - - /** @var RelatedAccountGroupMembership $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::relatedAccountGroupName( - '[PROJECT]', - '[RELATEDACCOUNTGROUP]' - ); - - list_related_account_group_memberships_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php deleted file mode 100644 index 1c3d589a0b3..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($request); - - /** @var RelatedAccountGroup $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - list_related_account_groups_sample($formattedParent); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php deleted file mode 100644 index 8d057ec1fd0..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Key $response */ - $response = $recaptchaEnterpriseServiceClient->migrateKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - - migrate_key_sample($formattedName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php deleted file mode 100644 index bcd40ed3b15..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php +++ /dev/null @@ -1,95 +0,0 @@ -setIp($ipOverrideDataIp) - ->setOverrideType($ipOverrideDataOverrideType); - $request = (new RemoveIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - - // Call the API and handle any network failures. - try { - /** @var RemoveIpOverrideResponse $response */ - $response = $recaptchaEnterpriseServiceClient->removeIpOverride($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - $ipOverrideDataIp = '[IP]'; - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - - remove_ip_override_sample($formattedName, $ipOverrideDataIp, $ipOverrideDataOverrideType); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php deleted file mode 100644 index 2107eda2075..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($formattedParent) - ->setNames($formattedNames); - - // Call the API and handle any network failures. - try { - /** @var ReorderFirewallPoliciesResponse $response */ - $response = $recaptchaEnterpriseServiceClient->reorderFirewallPolicies($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - $formattedNamesElement = RecaptchaEnterpriseServiceClient::firewallPolicyName( - '[PROJECT]', - '[FIREWALLPOLICY]' - ); - - reorder_firewall_policies_sample($formattedParent, $formattedNamesElement); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php deleted file mode 100644 index c74bb8267ef..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php +++ /dev/null @@ -1,74 +0,0 @@ -setKey($formattedKey); - - // Call the API and handle any network failures. - try { - /** @var RetrieveLegacySecretKeyResponse $response */ - $response = $recaptchaEnterpriseServiceClient->retrieveLegacySecretKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedKey = RecaptchaEnterpriseServiceClient::keyName('[PROJECT]', '[KEY]'); - - retrieve_legacy_secret_key_sample($formattedKey); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php deleted file mode 100644 index 3b9e0e41ae2..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php +++ /dev/null @@ -1,78 +0,0 @@ -setProject($formattedProject); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($request); - - /** @var RelatedAccountGroupMembership $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProject = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]'); - - search_related_account_group_memberships_sample($formattedProject); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php deleted file mode 100644 index 580ddd57fcf..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php +++ /dev/null @@ -1,59 +0,0 @@ -setFirewallPolicy($firewallPolicy); - - // Call the API and handle any network failures. - try { - /** @var FirewallPolicy $response */ - $response = $recaptchaEnterpriseServiceClient->updateFirewallPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php b/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php deleted file mode 100644 index 590dd3e700e..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/samples/V1/RecaptchaEnterpriseServiceClient/update_key.php +++ /dev/null @@ -1,72 +0,0 @@ -setDisplayName($keyDisplayName); - $request = (new UpdateKeyRequest()) - ->setKey($key); - - // Call the API and handle any network failures. - try { - /** @var Key $response */ - $response = $recaptchaEnterpriseServiceClient->updateKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $keyDisplayName = '[DISPLAY_NAME]'; - - update_key_sample($keyDisplayName); -} -// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php deleted file mode 100644 index b72fc96ab13..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Client/RecaptchaEnterpriseServiceClient.php +++ /dev/null @@ -1,959 +0,0 @@ - addIpOverrideAsync(AddIpOverrideRequest $request, array $optionalArgs = []) - * @method PromiseInterface annotateAssessmentAsync(AnnotateAssessmentRequest $request, array $optionalArgs = []) - * @method PromiseInterface createAssessmentAsync(CreateAssessmentRequest $request, array $optionalArgs = []) - * @method PromiseInterface createFirewallPolicyAsync(CreateFirewallPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface createKeyAsync(CreateKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteFirewallPolicyAsync(DeleteFirewallPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteKeyAsync(DeleteKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getFirewallPolicyAsync(GetFirewallPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getKeyAsync(GetKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getMetricsAsync(GetMetricsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listFirewallPoliciesAsync(ListFirewallPoliciesRequest $request, array $optionalArgs = []) - * @method PromiseInterface listIpOverridesAsync(ListIpOverridesRequest $request, array $optionalArgs = []) - * @method PromiseInterface listKeysAsync(ListKeysRequest $request, array $optionalArgs = []) - * @method PromiseInterface listRelatedAccountGroupMembershipsAsync(ListRelatedAccountGroupMembershipsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listRelatedAccountGroupsAsync(ListRelatedAccountGroupsRequest $request, array $optionalArgs = []) - * @method PromiseInterface migrateKeyAsync(MigrateKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface removeIpOverrideAsync(RemoveIpOverrideRequest $request, array $optionalArgs = []) - * @method PromiseInterface reorderFirewallPoliciesAsync(ReorderFirewallPoliciesRequest $request, array $optionalArgs = []) - * @method PromiseInterface retrieveLegacySecretKeyAsync(RetrieveLegacySecretKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchRelatedAccountGroupMembershipsAsync(SearchRelatedAccountGroupMembershipsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateFirewallPolicyAsync(UpdateFirewallPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateKeyAsync(UpdateKeyRequest $request, array $optionalArgs = []) - */ -final class RecaptchaEnterpriseServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recaptchaenterprise.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recaptchaenterprise.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/recaptcha_enterprise_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a assessment - * resource. - * - * @param string $project - * @param string $assessment - * - * @return string The formatted assessment resource. - */ - public static function assessmentName(string $project, string $assessment): string - { - return self::getPathTemplate('assessment')->render([ - 'project' => $project, - 'assessment' => $assessment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * firewall_policy resource. - * - * @param string $project - * @param string $firewallpolicy - * - * @return string The formatted firewall_policy resource. - */ - public static function firewallPolicyName(string $project, string $firewallpolicy): string - { - return self::getPathTemplate('firewallPolicy')->render([ - 'project' => $project, - 'firewallpolicy' => $firewallpolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a key - * resource. - * - * @param string $project - * @param string $key - * - * @return string The formatted key resource. - */ - public static function keyName(string $project, string $key): string - { - return self::getPathTemplate('key')->render([ - 'project' => $project, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a metrics - * resource. - * - * @param string $project - * @param string $key - * - * @return string The formatted metrics resource. - */ - public static function metricsName(string $project, string $key): string - { - return self::getPathTemplate('metrics')->render([ - 'project' => $project, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * related_account_group resource. - * - * @param string $project - * @param string $relatedaccountgroup - * - * @return string The formatted related_account_group resource. - */ - public static function relatedAccountGroupName(string $project, string $relatedaccountgroup): string - { - return self::getPathTemplate('relatedAccountGroup')->render([ - 'project' => $project, - 'relatedaccountgroup' => $relatedaccountgroup, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - assessment: projects/{project}/assessments/{assessment} - * - firewallPolicy: projects/{project}/firewallpolicies/{firewallpolicy} - * - key: projects/{project}/keys/{key} - * - metrics: projects/{project}/keys/{key}/metrics - * - project: projects/{project} - * - relatedAccountGroup: projects/{project}/relatedaccountgroups/{relatedaccountgroup} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recaptchaenterprise.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Adds an IP override to a key. The following restrictions hold: - * * The maximum number of IP overrides per key is 100. - * * For any conflict (such as IP already exists or IP part of an existing - * IP range), an error is returned. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::addIpOverrideAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/add_ip_override.php - * - * @param AddIpOverrideRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AddIpOverrideResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function addIpOverride(AddIpOverrideRequest $request, array $callOptions = []): AddIpOverrideResponse - { - return $this->startApiCall('AddIpOverride', $request, $callOptions)->wait(); - } - - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fraudulent. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::annotateAssessmentAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/annotate_assessment.php - * - * @param AnnotateAssessmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AnnotateAssessmentResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function annotateAssessment(AnnotateAssessmentRequest $request, array $callOptions = []): AnnotateAssessmentResponse - { - return $this->startApiCall('AnnotateAssessment', $request, $callOptions)->wait(); - } - - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::createAssessmentAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/create_assessment.php - * - * @param CreateAssessmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Assessment - * - * @throws ApiException Thrown if the API call fails. - */ - public function createAssessment(CreateAssessmentRequest $request, array $callOptions = []): Assessment - { - return $this->startApiCall('CreateAssessment', $request, $callOptions)->wait(); - } - - /** - * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA - * Enterprise actions can be executed. - * A project may have a maximum of 1000 policies. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::createFirewallPolicyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/create_firewall_policy.php - * - * @param CreateFirewallPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 FirewallPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function createFirewallPolicy(CreateFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy - { - return $this->startApiCall('CreateFirewallPolicy', $request, $callOptions)->wait(); - } - - /** - * Creates a new reCAPTCHA Enterprise key. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::createKeyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/create_key.php - * - * @param CreateKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Key - * - * @throws ApiException Thrown if the API call fails. - */ - public function createKey(CreateKeyRequest $request, array $callOptions = []): Key - { - return $this->startApiCall('CreateKey', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified firewall policy. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::deleteFirewallPolicyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/delete_firewall_policy.php - * - * @param DeleteFirewallPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteFirewallPolicy(DeleteFirewallPolicyRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteFirewallPolicy', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified key. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::deleteKeyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/delete_key.php - * - * @param DeleteKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteKey(DeleteKeyRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteKey', $request, $callOptions)->wait(); - } - - /** - * Returns the specified firewall policy. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::getFirewallPolicyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/get_firewall_policy.php - * - * @param GetFirewallPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 FirewallPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getFirewallPolicy(GetFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy - { - return $this->startApiCall('GetFirewallPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns the specified key. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::getKeyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/get_key.php - * - * @param GetKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Key - * - * @throws ApiException Thrown if the API call fails. - */ - public function getKey(GetKeyRequest $request, array $callOptions = []): Key - { - return $this->startApiCall('GetKey', $request, $callOptions)->wait(); - } - - /** - * Get some aggregated metrics for a Key. This data can be used to build - * dashboards. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::getMetricsAsync()} - * . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/get_metrics.php - * - * @param GetMetricsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Metrics - * - * @throws ApiException Thrown if the API call fails. - */ - public function getMetrics(GetMetricsRequest $request, array $callOptions = []): Metrics - { - return $this->startApiCall('GetMetrics', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all firewall policies that belong to a project. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::listFirewallPoliciesAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/list_firewall_policies.php - * - * @param ListFirewallPoliciesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listFirewallPolicies(ListFirewallPoliciesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListFirewallPolicies', $request, $callOptions); - } - - /** - * Lists all IP overrides for a key. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::listIpOverridesAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/list_ip_overrides.php - * - * @param ListIpOverridesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listIpOverrides(ListIpOverridesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListIpOverrides', $request, $callOptions); - } - - /** - * Returns the list of all keys that belong to a project. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::listKeysAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/list_keys.php - * - * @param ListKeysRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listKeys(ListKeysRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListKeys', $request, $callOptions); - } - - /** - * Get memberships in a group of related accounts. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::listRelatedAccountGroupMembershipsAsync()} - * . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_group_memberships.php - * - * @param ListRelatedAccountGroupMembershipsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRelatedAccountGroupMemberships', $request, $callOptions); - } - - /** - * List groups of related accounts. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::listRelatedAccountGroupsAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/list_related_account_groups.php - * - * @param ListRelatedAccountGroupsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRelatedAccountGroups(ListRelatedAccountGroupsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRelatedAccountGroups', $request, $callOptions); - } - - /** - * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. - * Once a key is migrated, it can be used from either product. SiteVerify - * requests are billed as CreateAssessment calls. You must be - * authenticated as one of the current owners of the reCAPTCHA Key, and - * your user must have the reCAPTCHA Enterprise Admin IAM role in the - * destination project. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::migrateKeyAsync()} - * . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/migrate_key.php - * - * @param MigrateKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Key - * - * @throws ApiException Thrown if the API call fails. - */ - public function migrateKey(MigrateKeyRequest $request, array $callOptions = []): Key - { - return $this->startApiCall('MigrateKey', $request, $callOptions)->wait(); - } - - /** - * Removes an IP override from a key. The following restrictions hold: - * * If the IP isn't found in an existing IP override, a `NOT_FOUND` error - * is returned. - * * If the IP is found in an existing IP override, but the - * override type does not match, a `NOT_FOUND` error is returned. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::removeIpOverrideAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/remove_ip_override.php - * - * @param RemoveIpOverrideRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RemoveIpOverrideResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function removeIpOverride(RemoveIpOverrideRequest $request, array $callOptions = []): RemoveIpOverrideResponse - { - return $this->startApiCall('RemoveIpOverride', $request, $callOptions)->wait(); - } - - /** - * Reorders all firewall policies. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::reorderFirewallPoliciesAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/reorder_firewall_policies.php - * - * @param ReorderFirewallPoliciesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ReorderFirewallPoliciesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function reorderFirewallPolicies(ReorderFirewallPoliciesRequest $request, array $callOptions = []): ReorderFirewallPoliciesResponse - { - return $this->startApiCall('ReorderFirewallPolicies', $request, $callOptions)->wait(); - } - - /** - * Returns the secret key related to the specified public key. - * You must use the legacy secret key only in a 3rd party integration with - * legacy reCAPTCHA. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::retrieveLegacySecretKeyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/retrieve_legacy_secret_key.php - * - * @param RetrieveLegacySecretKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RetrieveLegacySecretKeyResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function retrieveLegacySecretKey(RetrieveLegacySecretKeyRequest $request, array $callOptions = []): RetrieveLegacySecretKeyResponse - { - return $this->startApiCall('RetrieveLegacySecretKey', $request, $callOptions)->wait(); - } - - /** - * Search group memberships related to a given account. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::searchRelatedAccountGroupMembershipsAsync()} - * . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/search_related_account_group_memberships.php - * - * @param SearchRelatedAccountGroupMembershipsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchRelatedAccountGroupMemberships', $request, $callOptions); - } - - /** - * Updates the specified firewall policy. - * - * The async variant is - * {@see RecaptchaEnterpriseServiceClient::updateFirewallPolicyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/update_firewall_policy.php - * - * @param UpdateFirewallPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 FirewallPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateFirewallPolicy(UpdateFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy - { - return $this->startApiCall('UpdateFirewallPolicy', $request, $callOptions)->wait(); - } - - /** - * Updates the specified key. - * - * The async variant is {@see RecaptchaEnterpriseServiceClient::updateKeyAsync()} . - * - * @example samples/V1/RecaptchaEnterpriseServiceClient/update_key.php - * - * @param UpdateKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Key - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateKey(UpdateKeyRequest $request, array $callOptions = []): Key - { - return $this->startApiCall('UpdateKey', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php deleted file mode 100644 index b8e7e5dc016..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/Gapic/RecaptchaEnterpriseServiceGapicClient.php +++ /dev/null @@ -1,1610 +0,0 @@ -keyName('[PROJECT]', '[KEY]'); - * $ipOverrideData = new IpOverrideData(); - * $response = $recaptchaEnterpriseServiceClient->addIpOverride($formattedName, $ipOverrideData); - * } finally { - * $recaptchaEnterpriseServiceClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\RecaptchaEnterprise\V1\Client\RecaptchaEnterpriseServiceClient}. - */ -class RecaptchaEnterpriseServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'recaptchaenterprise.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recaptchaenterprise.UNIVERSE_DOMAIN'; - - /** 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 $assessmentNameTemplate; - - private static $firewallPolicyNameTemplate; - - private static $keyNameTemplate; - - private static $metricsNameTemplate; - - private static $projectNameTemplate; - - private static $relatedAccountGroupNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/recaptcha_enterprise_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/recaptcha_enterprise_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAssessmentNameTemplate() - { - if (self::$assessmentNameTemplate == null) { - self::$assessmentNameTemplate = new PathTemplate('projects/{project}/assessments/{assessment}'); - } - - return self::$assessmentNameTemplate; - } - - private static function getFirewallPolicyNameTemplate() - { - if (self::$firewallPolicyNameTemplate == null) { - self::$firewallPolicyNameTemplate = new PathTemplate('projects/{project}/firewallpolicies/{firewallpolicy}'); - } - - return self::$firewallPolicyNameTemplate; - } - - private static function getKeyNameTemplate() - { - if (self::$keyNameTemplate == null) { - self::$keyNameTemplate = new PathTemplate('projects/{project}/keys/{key}'); - } - - return self::$keyNameTemplate; - } - - private static function getMetricsNameTemplate() - { - if (self::$metricsNameTemplate == null) { - self::$metricsNameTemplate = new PathTemplate('projects/{project}/keys/{key}/metrics'); - } - - return self::$metricsNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getRelatedAccountGroupNameTemplate() - { - if (self::$relatedAccountGroupNameTemplate == null) { - self::$relatedAccountGroupNameTemplate = new PathTemplate('projects/{project}/relatedaccountgroups/{relatedaccountgroup}'); - } - - return self::$relatedAccountGroupNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'assessment' => self::getAssessmentNameTemplate(), - 'firewallPolicy' => self::getFirewallPolicyNameTemplate(), - 'key' => self::getKeyNameTemplate(), - 'metrics' => self::getMetricsNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'relatedAccountGroup' => self::getRelatedAccountGroupNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a assessment - * resource. - * - * @param string $project - * @param string $assessment - * - * @return string The formatted assessment resource. - */ - public static function assessmentName($project, $assessment) - { - return self::getAssessmentNameTemplate()->render([ - 'project' => $project, - 'assessment' => $assessment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * firewall_policy resource. - * - * @param string $project - * @param string $firewallpolicy - * - * @return string The formatted firewall_policy resource. - */ - public static function firewallPolicyName($project, $firewallpolicy) - { - return self::getFirewallPolicyNameTemplate()->render([ - 'project' => $project, - 'firewallpolicy' => $firewallpolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a key - * resource. - * - * @param string $project - * @param string $key - * - * @return string The formatted key resource. - */ - public static function keyName($project, $key) - { - return self::getKeyNameTemplate()->render([ - 'project' => $project, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a metrics - * resource. - * - * @param string $project - * @param string $key - * - * @return string The formatted metrics resource. - */ - public static function metricsName($project, $key) - { - return self::getMetricsNameTemplate()->render([ - 'project' => $project, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * related_account_group resource. - * - * @param string $project - * @param string $relatedaccountgroup - * - * @return string The formatted related_account_group resource. - */ - public static function relatedAccountGroupName($project, $relatedaccountgroup) - { - return self::getRelatedAccountGroupNameTemplate()->render([ - 'project' => $project, - 'relatedaccountgroup' => $relatedaccountgroup, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - assessment: projects/{project}/assessments/{assessment} - * - firewallPolicy: projects/{project}/firewallpolicies/{firewallpolicy} - * - key: projects/{project}/keys/{key} - * - metrics: projects/{project}/keys/{key}/metrics - * - project: projects/{project} - * - relatedAccountGroup: projects/{project}/relatedaccountgroups/{relatedaccountgroup} - * - * 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. - */ - 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 $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recaptchaenterprise.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 - * $apiEndpoint 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 - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Adds an IP override to a key. The following restrictions hold: - * * The maximum number of IP overrides per key is 100. - * * For any conflict (such as IP already exists or IP part of an existing - * IP range), an error is returned. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $ipOverrideData = new IpOverrideData(); - * $response = $recaptchaEnterpriseServiceClient->addIpOverride($formattedName, $ipOverrideData); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the key to which the IP override is added, in the - * format `projects/{project}/keys/{key}`. - * @param IpOverrideData $ipOverrideData Required. IP override added to the key. - * @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\RecaptchaEnterprise\V1\AddIpOverrideResponse - * - * @throws ApiException if the remote call fails - */ - public function addIpOverride($name, $ipOverrideData, array $optionalArgs = []) - { - $request = new AddIpOverrideRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setIpOverrideData($ipOverrideData); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AddIpOverride', AddIpOverrideResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fraudulent. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); - * $annotation = Annotation::ANNOTATION_UNSPECIFIED; - * $response = $recaptchaEnterpriseServiceClient->annotateAssessment($formattedName, $annotation); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Assessment, in the format - * `projects/{project}/assessments/{assessment}`. - * @param int $annotation Optional. The annotation that is assigned to the Event. This field can be - * left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. - * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation} - * @param array $optionalArgs { - * Optional. - * - * @type int[] $reasons - * Optional. Reasons for the annotation that are assigned to the event. - * For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Reason} - * @type string $accountId - * Optional. A stable account identifier to apply to the assessment. This is - * an alternative to setting `account_id` in `CreateAssessment`, for example - * when a stable account identifier is not yet known in the initial request. - * @type string $hashedAccountId - * Optional. A stable hashed account identifier to apply to the assessment. - * This is an alternative to setting `hashed_account_id` in - * `CreateAssessment`, for example when a stable account identifier is not yet - * known in the initial request. - * @type TransactionEvent $transactionEvent - * Optional. If the assessment is part of a payment transaction, provide - * details on payment lifecycle events that occur in the transaction. - * @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\RecaptchaEnterprise\V1\AnnotateAssessmentResponse - * - * @throws ApiException if the remote call fails - */ - public function annotateAssessment($name, $annotation, array $optionalArgs = []) - { - $request = new AnnotateAssessmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setAnnotation($annotation); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['reasons'])) { - $request->setReasons($optionalArgs['reasons']); - } - - if (isset($optionalArgs['accountId'])) { - $request->setAccountId($optionalArgs['accountId']); - } - - if (isset($optionalArgs['hashedAccountId'])) { - $request->setHashedAccountId($optionalArgs['hashedAccountId']); - } - - if (isset($optionalArgs['transactionEvent'])) { - $request->setTransactionEvent($optionalArgs['transactionEvent']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AnnotateAssessment', AnnotateAssessmentResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * $assessment = new Assessment(); - * $response = $recaptchaEnterpriseServiceClient->createAssessment($formattedParent, $assessment); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project in which the assessment is created, - * in the format `projects/{project}`. - * @param Assessment $assessment Required. The assessment details. - * @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\RecaptchaEnterprise\V1\Assessment - * - * @throws ApiException if the remote call fails - */ - public function createAssessment($parent, $assessment, array $optionalArgs = []) - { - $request = new CreateAssessmentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAssessment($assessment); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateAssessment', Assessment::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA - * Enterprise actions can be executed. - * A project may have a maximum of 1000 policies. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * $firewallPolicy = new FirewallPolicy(); - * $response = $recaptchaEnterpriseServiceClient->createFirewallPolicy($formattedParent, $firewallPolicy); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project this policy applies to, in the format - * `projects/{project}`. - * @param FirewallPolicy $firewallPolicy Required. Information to create the policy. - * @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\RecaptchaEnterprise\V1\FirewallPolicy - * - * @throws ApiException if the remote call fails - */ - public function createFirewallPolicy($parent, $firewallPolicy, array $optionalArgs = []) - { - $request = new CreateFirewallPolicyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFirewallPolicy($firewallPolicy); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new reCAPTCHA Enterprise key. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * $key = new Key(); - * $response = $recaptchaEnterpriseServiceClient->createKey($formattedParent, $key); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project in which the key is created, in the - * format `projects/{project}`. - * @param Key $key Required. Information to create a reCAPTCHA Enterprise key. - * @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\RecaptchaEnterprise\V1\Key - * - * @throws ApiException if the remote call fails - */ - public function createKey($parent, $key, array $optionalArgs = []) - { - $request = new CreateKeyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setKey($key); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateKey', Key::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified firewall policy. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - * $recaptchaEnterpriseServiceClient->deleteFirewallPolicy($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the policy to be deleted, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * @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 - */ - public function deleteFirewallPolicy($name, array $optionalArgs = []) - { - $request = new DeleteFirewallPolicyRequest(); - $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('DeleteFirewallPolicy', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified key. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $recaptchaEnterpriseServiceClient->deleteKey($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the key to be deleted, in the format - * `projects/{project}/keys/{key}`. - * @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 - */ - public function deleteKey($name, array $optionalArgs = []) - { - $request = new DeleteKeyRequest(); - $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('DeleteKey', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the specified firewall policy. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - * $response = $recaptchaEnterpriseServiceClient->getFirewallPolicy($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the requested policy, in the format - * `projects/{project}/firewallpolicies/{firewallpolicy}`. - * @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\RecaptchaEnterprise\V1\FirewallPolicy - * - * @throws ApiException if the remote call fails - */ - public function getFirewallPolicy($name, array $optionalArgs = []) - { - $request = new GetFirewallPolicyRequest(); - $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('GetFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the specified key. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $response = $recaptchaEnterpriseServiceClient->getKey($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the requested key, in the format - * `projects/{project}/keys/{key}`. - * @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\RecaptchaEnterprise\V1\Key - * - * @throws ApiException if the remote call fails - */ - public function getKey($name, array $optionalArgs = []) - { - $request = new GetKeyRequest(); - $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('GetKey', Key::class, $optionalArgs, $request)->wait(); - } - - /** - * Get some aggregated metrics for a Key. This data can be used to build - * dashboards. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->metricsName('[PROJECT]', '[KEY]'); - * $response = $recaptchaEnterpriseServiceClient->getMetrics($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the requested metrics, in the format - * `projects/{project}/keys/{key}/metrics`. - * @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\RecaptchaEnterprise\V1\Metrics - * - * @throws ApiException if the remote call fails - */ - public function getMetrics($name, array $optionalArgs = []) - { - $request = new GetMetricsRequest(); - $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('GetMetrics', Metrics::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all firewall policies that belong to a project. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listFirewallPolicies($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listFirewallPolicies($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * @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 - */ - public function listFirewallPolicies($parent, array $optionalArgs = []) - { - $request = new ListFirewallPoliciesRequest(); - $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('ListFirewallPolicies', $optionalArgs, ListFirewallPoliciesResponse::class, $request); - } - - /** - * Lists all IP overrides for a key. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listIpOverrides($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listIpOverrides($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent key for which the IP overrides are listed, in the - * format `projects/{project}/keys/{key}`. - * @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 - */ - public function listIpOverrides($parent, array $optionalArgs = []) - { - $request = new ListIpOverridesRequest(); - $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('ListIpOverrides', $optionalArgs, ListIpOverridesResponse::class, $request); - } - - /** - * Returns the list of all keys that belong to a project. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listKeys($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listKeys($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project that contains the keys that is - * listed, in the format `projects/{project}`. - * @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 - */ - public function listKeys($parent, array $optionalArgs = []) - { - $request = new ListKeysRequest(); - $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('ListKeys', $optionalArgs, ListKeysResponse::class, $request); - } - - /** - * Get memberships in a group of related accounts. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroupMemberships($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name for the related account group in the format - * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - * @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 - */ - public function listRelatedAccountGroupMemberships($parent, array $optionalArgs = []) - { - $request = new ListRelatedAccountGroupMembershipsRequest(); - $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('ListRelatedAccountGroupMemberships', $optionalArgs, ListRelatedAccountGroupMembershipsResponse::class, $request); - } - - /** - * List groups of related accounts. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->listRelatedAccountGroups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project to list related account groups from, in - * the format `projects/{project}`. - * @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 - */ - public function listRelatedAccountGroups($parent, array $optionalArgs = []) - { - $request = new ListRelatedAccountGroupsRequest(); - $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('ListRelatedAccountGroups', $optionalArgs, ListRelatedAccountGroupsResponse::class, $request); - } - - /** - * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. - * Once a key is migrated, it can be used from either product. SiteVerify - * requests are billed as CreateAssessment calls. You must be - * authenticated as one of the current owners of the reCAPTCHA Key, and - * your user must have the reCAPTCHA Enterprise Admin IAM role in the - * destination project. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $response = $recaptchaEnterpriseServiceClient->migrateKey($formattedName); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the key to be migrated, in the format - * `projects/{project}/keys/{key}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $skipBillingCheck - * Optional. If true, skips the billing check. - * A reCAPTCHA Enterprise key or migrated key behaves differently than a - * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid - * any disruption of your usage, we check that a billing account is present. - * If your usage of reCAPTCHA is under the free quota, you can safely skip the - * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha/docs/billing-information. - * @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\RecaptchaEnterprise\V1\Key - * - * @throws ApiException if the remote call fails - */ - public function migrateKey($name, array $optionalArgs = []) - { - $request = new MigrateKeyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['skipBillingCheck'])) { - $request->setSkipBillingCheck($optionalArgs['skipBillingCheck']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MigrateKey', Key::class, $optionalArgs, $request)->wait(); - } - - /** - * Removes an IP override from a key. The following restrictions hold: - * * If the IP isn't found in an existing IP override, a `NOT_FOUND` error - * is returned. - * * If the IP is found in an existing IP override, but the - * override type does not match, a `NOT_FOUND` error is returned. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedName = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $ipOverrideData = new IpOverrideData(); - * $response = $recaptchaEnterpriseServiceClient->removeIpOverride($formattedName, $ipOverrideData); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the key from which the IP override is removed, in the - * format `projects/{project}/keys/{key}`. - * @param IpOverrideData $ipOverrideData Required. IP override to be removed from the key. - * @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\RecaptchaEnterprise\V1\RemoveIpOverrideResponse - * - * @throws ApiException if the remote call fails - */ - public function removeIpOverride($name, $ipOverrideData, array $optionalArgs = []) - { - $request = new RemoveIpOverrideRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setIpOverrideData($ipOverrideData); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RemoveIpOverride', RemoveIpOverrideResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Reorders all firewall policies. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedParent = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * $formattedNames = [ - * $recaptchaEnterpriseServiceClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), - * ]; - * $response = $recaptchaEnterpriseServiceClient->reorderFirewallPolicies($formattedParent, $formattedNames); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project to list the policies for, in the format - * `projects/{project}`. - * @param string[] $names Required. A list containing all policy names, in the new order. Each name - * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - * @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\RecaptchaEnterprise\V1\ReorderFirewallPoliciesResponse - * - * @throws ApiException if the remote call fails - */ - public function reorderFirewallPolicies($parent, $names, array $optionalArgs = []) - { - $request = new ReorderFirewallPoliciesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNames($names); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReorderFirewallPolicies', ReorderFirewallPoliciesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the secret key related to the specified public key. - * You must use the legacy secret key only in a 3rd party integration with - * legacy reCAPTCHA. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedKey = $recaptchaEnterpriseServiceClient->keyName('[PROJECT]', '[KEY]'); - * $response = $recaptchaEnterpriseServiceClient->retrieveLegacySecretKey($formattedKey); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $key Required. The public key name linked to the requested secret key in the - * format `projects/{project}/keys/{key}`. - * @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\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyResponse - * - * @throws ApiException if the remote call fails - */ - public function retrieveLegacySecretKey($key, array $optionalArgs = []) - { - $request = new RetrieveLegacySecretKeyRequest(); - $requestParamHeaders = []; - $request->setKey($key); - $requestParamHeaders['key'] = $key; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RetrieveLegacySecretKey', RetrieveLegacySecretKeyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Search group memberships related to a given account. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $formattedProject = $recaptchaEnterpriseServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($formattedProject); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recaptchaEnterpriseServiceClient->searchRelatedAccountGroupMemberships($formattedProject); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param string $project Required. The name of the project to search related account group - * memberships from. Specify the project name in the following format: - * `projects/{project}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $accountId - * Optional. The unique stable account identifier used to search connections. - * The identifier should correspond to an `account_id` provided in a previous - * `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - * or account_id must be set, but not both. - * @type string $hashedAccountId - * Optional. Deprecated: use `account_id` instead. - * The unique stable hashed account identifier used to search connections. The - * identifier should correspond to a `hashed_account_id` provided in a - * previous `CreateAssessment` or `AnnotateAssessment` call. Either - * hashed_account_id or account_id must be set, but not both. - * @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 - */ - public function searchRelatedAccountGroupMemberships($project, array $optionalArgs = []) - { - $request = new SearchRelatedAccountGroupMembershipsRequest(); - $requestParamHeaders = []; - $request->setProject($project); - $requestParamHeaders['project'] = $project; - if (isset($optionalArgs['accountId'])) { - $request->setAccountId($optionalArgs['accountId']); - } - - if (isset($optionalArgs['hashedAccountId'])) { - $request->setHashedAccountId($optionalArgs['hashedAccountId']); - } - - 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('SearchRelatedAccountGroupMemberships', $optionalArgs, SearchRelatedAccountGroupMembershipsResponse::class, $request); - } - - /** - * Updates the specified firewall policy. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $firewallPolicy = new FirewallPolicy(); - * $response = $recaptchaEnterpriseServiceClient->updateFirewallPolicy($firewallPolicy); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param FirewallPolicy $firewallPolicy Required. The policy to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields are updated. - * @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\RecaptchaEnterprise\V1\FirewallPolicy - * - * @throws ApiException if the remote call fails - */ - public function updateFirewallPolicy($firewallPolicy, array $optionalArgs = []) - { - $request = new UpdateFirewallPolicyRequest(); - $requestParamHeaders = []; - $request->setFirewallPolicy($firewallPolicy); - $requestParamHeaders['firewall_policy.name'] = $firewallPolicy->getName(); - 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('UpdateFirewallPolicy', FirewallPolicy::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates the specified key. - * - * Sample code: - * ``` - * $recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); - * try { - * $key = new Key(); - * $response = $recaptchaEnterpriseServiceClient->updateKey($key); - * } finally { - * $recaptchaEnterpriseServiceClient->close(); - * } - * ``` - * - * @param Key $key Required. The key to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields are updated. - * @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\RecaptchaEnterprise\V1\Key - * - * @throws ApiException if the remote call fails - */ - public function updateKey($key, array $optionalArgs = []) - { - $request = new UpdateKeyRequest(); - $requestParamHeaders = []; - $request->setKey($key); - $requestParamHeaders['key.name'] = $key->getName(); - 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('UpdateKey', Key::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php deleted file mode 100644 index 062d8e69637..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/RecaptchaEnterpriseServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' => [ - 'AddIpOverride' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\AddIpOverrideResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'AnnotateAssessment' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateAssessment' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Assessment', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateFirewallPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteFirewallPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetFirewallPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetMetrics' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Metrics', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListFirewallPolicies' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFirewallPolicies', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListFirewallPoliciesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListIpOverrides' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getIpOverrides', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListIpOverridesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListKeys' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getKeys', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListKeysResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListRelatedAccountGroupMemberships' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRelatedAccountGroupMemberships', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupMembershipsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListRelatedAccountGroups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRelatedAccountGroups', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ListRelatedAccountGroupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'MigrateKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RemoveIpOverride' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\RemoveIpOverrideResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ReorderFirewallPolicies' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\ReorderFirewallPoliciesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RetrieveLegacySecretKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyResponse', - 'headerParams' => [ - [ - 'keyName' => 'key', - 'fieldAccessors' => [ - 'getKey', - ], - ], - ], - ], - 'SearchRelatedAccountGroupMemberships' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRelatedAccountGroupMemberships', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\SearchRelatedAccountGroupMembershipsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project', - 'fieldAccessors' => [ - 'getProject', - ], - ], - ], - ], - 'UpdateFirewallPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy', - 'headerParams' => [ - [ - 'keyName' => 'firewall_policy.name', - 'fieldAccessors' => [ - 'getFirewallPolicy', - 'getName', - ], - ], - ], - ], - 'UpdateKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecaptchaEnterprise\V1\Key', - 'headerParams' => [ - [ - 'keyName' => 'key.name', - 'fieldAccessors' => [ - 'getKey', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'assessment' => 'projects/{project}/assessments/{assessment}', - 'firewallPolicy' => 'projects/{project}/firewallpolicies/{firewallpolicy}', - 'key' => 'projects/{project}/keys/{key}', - 'metrics' => 'projects/{project}/keys/{key}/metrics', - 'project' => 'projects/{project}', - 'relatedAccountGroup' => 'projects/{project}/relatedaccountgroups/{relatedaccountgroup}', - ], - ], - ], -]; diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php b/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php deleted file mode 100644 index 43261e80848..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/src/V1/resources/recaptcha_enterprise_service_rest_client_config.php +++ /dev/null @@ -1,284 +0,0 @@ - [ - 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' => [ - 'AddIpOverride' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/keys/*}:addIpOverride', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'AnnotateAssessment' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/assessments/*}:annotate', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateAssessment' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/assessments', - 'body' => 'assessment', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateFirewallPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies', - 'body' => 'firewall_policy', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateKey' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/keys', - 'body' => 'key', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteFirewallPolicy' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/firewallpolicies/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteKey' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/keys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFirewallPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/firewallpolicies/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/keys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetMetrics' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/keys/*/metrics}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListFirewallPolicies' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListIpOverrides' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/keys/*}:listIpOverrides', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListKeys' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/keys', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRelatedAccountGroupMemberships' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/relatedaccountgroups/*}/memberships', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRelatedAccountGroups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/relatedaccountgroups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MigrateKey' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/keys/*}:migrate', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RemoveIpOverride' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/keys/*}:removeIpOverride', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ReorderFirewallPolicies' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/firewallpolicies:reorder', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RetrieveLegacySecretKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey', - 'placeholders' => [ - 'key' => [ - 'getters' => [ - 'getKey', - ], - ], - ], - ], - 'SearchRelatedAccountGroupMemberships' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{project=projects/*}/relatedaccountgroupmemberships:search', - 'body' => '*', - 'placeholders' => [ - 'project' => [ - 'getters' => [ - 'getProject', - ], - ], - ], - ], - 'UpdateFirewallPolicy' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{firewall_policy.name=projects/*/firewallpolicies/*}', - 'body' => 'firewall_policy', - 'placeholders' => [ - 'firewall_policy.name' => [ - 'getters' => [ - 'getFirewallPolicy', - 'getName', - ], - ], - ], - ], - 'UpdateKey' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{key.name=projects/*/keys/*}', - 'body' => 'key', - 'placeholders' => [ - 'key.name' => [ - 'getters' => [ - 'getKey', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php deleted file mode 100644 index b25fa206d90..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/Client/RecaptchaEnterpriseServiceClientTest.php +++ /dev/null @@ -1,1676 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RecaptchaEnterpriseServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RecaptchaEnterpriseServiceClient($options); - } - - /** @test */ - public function addIpOverrideTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddIpOverrideResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $request = (new AddIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - $response = $gapicClient->addIpOverride($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIpOverrideData(); - $this->assertProtobufEquals($ipOverrideData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addIpOverrideExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $request = (new AddIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - try { - $gapicClient->addIpOverride($request); - // 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 annotateAssessmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnnotateAssessmentResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); - $annotation = Annotation::ANNOTATION_UNSPECIFIED; - $request = (new AnnotateAssessmentRequest()) - ->setName($formattedName) - ->setAnnotation($annotation); - $response = $gapicClient->annotateAssessment($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AnnotateAssessment', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getAnnotation(); - $this->assertProtobufEquals($annotation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function annotateAssessmentExceptionTest() - { - $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->assessmentName('[PROJECT]', '[ASSESSMENT]'); - $annotation = Annotation::ANNOTATION_UNSPECIFIED; - $request = (new AnnotateAssessmentRequest()) - ->setName($formattedName) - ->setAnnotation($annotation); - try { - $gapicClient->annotateAssessment($request); - // 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 createAssessmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Assessment(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $assessment = new Assessment(); - $request = (new CreateAssessmentRequest()) - ->setParent($formattedParent) - ->setAssessment($assessment); - $response = $gapicClient->createAssessment($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateAssessment', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAssessment(); - $this->assertProtobufEquals($assessment, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAssessmentExceptionTest() - { - $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->projectName('[PROJECT]'); - $assessment = new Assessment(); - $request = (new CreateAssessmentRequest()) - ->setParent($formattedParent) - ->setAssessment($assessment); - try { - $gapicClient->createAssessment($request); - // 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 createFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $firewallPolicy = new FirewallPolicy(); - $request = (new CreateFirewallPolicyRequest()) - ->setParent($formattedParent) - ->setFirewallPolicy($firewallPolicy); - $response = $gapicClient->createFirewallPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getFirewallPolicy(); - $this->assertProtobufEquals($firewallPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createFirewallPolicyExceptionTest() - { - $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->projectName('[PROJECT]'); - $firewallPolicy = new FirewallPolicy(); - $request = (new CreateFirewallPolicyRequest()) - ->setParent($formattedParent) - ->setFirewallPolicy($firewallPolicy); - try { - $gapicClient->createFirewallPolicy($request); - // 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 createKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $request = (new CreateKeyRequest()) - ->setParent($formattedParent) - ->setKey($key); - $response = $gapicClient->createKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($key, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createKeyExceptionTest() - { - $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->projectName('[PROJECT]'); - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $request = (new CreateKeyRequest()) - ->setParent($formattedParent) - ->setKey($key); - try { - $gapicClient->createKey($request); - // 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 deleteFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $request = (new DeleteFirewallPolicyRequest()) - ->setName($formattedName); - $gapicClient->deleteFirewallPolicy($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteFirewallPolicyExceptionTest() - { - $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $request = (new DeleteFirewallPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteFirewallPolicy($request); - // 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 deleteKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new DeleteKeyRequest()) - ->setName($formattedName); - $gapicClient->deleteKey($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $request = (new DeleteKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteKey($request); - // 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 getFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $request = (new GetFirewallPolicyRequest()) - ->setName($formattedName); - $response = $gapicClient->getFirewallPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFirewallPolicyExceptionTest() - { - $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $request = (new GetFirewallPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->getFirewallPolicy($request); - // 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 getKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new GetKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->getKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $request = (new GetKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->getKey($request); - // 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 getMetricsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Metrics(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricsName('[PROJECT]', '[KEY]'); - $request = (new GetMetricsRequest()) - ->setName($formattedName); - $response = $gapicClient->getMetrics($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetMetrics', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetricsExceptionTest() - { - $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->metricsName('[PROJECT]', '[KEY]'); - $request = (new GetMetricsRequest()) - ->setName($formattedName); - try { - $gapicClient->getMetrics($request); - // 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 listFirewallPoliciesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $firewallPoliciesElement = new FirewallPolicy(); - $firewallPolicies = [ - $firewallPoliciesElement, - ]; - $expectedResponse = new ListFirewallPoliciesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFirewallPolicies($firewallPolicies); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListFirewallPoliciesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listFirewallPolicies($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFirewallPolicies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListFirewallPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFirewallPoliciesExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ListFirewallPoliciesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listFirewallPolicies($request); - // 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 listIpOverridesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $ipOverridesElement = new IpOverrideData(); - $ipOverrides = [ - $ipOverridesElement, - ]; - $expectedResponse = new ListIpOverridesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIpOverrides($ipOverrides); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new ListIpOverridesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listIpOverrides($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIpOverrides()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListIpOverrides', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIpOverridesExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $request = (new ListIpOverridesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listIpOverrides($request); - // 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 listKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $keysElement = new Key(); - $keys = [ - $keysElement, - ]; - $expectedResponse = new ListKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setKeys($keys); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListKeysRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listKeys($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listKeysExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ListKeysRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listKeys($request); - // 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 listRelatedAccountGroupMembershipsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); - $relatedAccountGroupMemberships = [ - $relatedAccountGroupMembershipsElement, - ]; - $expectedResponse = new ListRelatedAccountGroupMembershipsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); - $request = (new ListRelatedAccountGroupMembershipsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRelatedAccountGroupMemberships($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroupMemberships', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRelatedAccountGroupMembershipsExceptionTest() - { - $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->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); - $request = (new ListRelatedAccountGroupMembershipsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRelatedAccountGroupMemberships($request); - // 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 listRelatedAccountGroupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupsElement = new RelatedAccountGroup(); - $relatedAccountGroups = [ - $relatedAccountGroupsElement, - ]; - $expectedResponse = new ListRelatedAccountGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroups($relatedAccountGroups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListRelatedAccountGroupsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRelatedAccountGroups($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRelatedAccountGroupsExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new ListRelatedAccountGroupsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRelatedAccountGroups($request); - // 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 migrateKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new MigrateKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->migrateKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/MigrateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function migrateKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $request = (new MigrateKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->migrateKey($request); - // 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 removeIpOverrideTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RemoveIpOverrideResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $request = (new RemoveIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - $response = $gapicClient->removeIpOverride($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RemoveIpOverride', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIpOverrideData(); - $this->assertProtobufEquals($ipOverrideData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIpOverrideExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $request = (new RemoveIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - try { - $gapicClient->removeIpOverride($request); - // 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 reorderFirewallPoliciesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReorderFirewallPoliciesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $formattedNames = [ - $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), - ]; - $request = (new ReorderFirewallPoliciesRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); - $response = $gapicClient->reorderFirewallPolicies($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ReorderFirewallPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reorderFirewallPoliciesExceptionTest() - { - $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->projectName('[PROJECT]'); - $formattedNames = [ - $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), - ]; - $request = (new ReorderFirewallPoliciesRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); - try { - $gapicClient->reorderFirewallPolicies($request); - // 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 retrieveLegacySecretKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $legacySecretKey = 'legacySecretKey-1937138042'; - $expectedResponse = new RetrieveLegacySecretKeyResponse(); - $expectedResponse->setLegacySecretKey($legacySecretKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new RetrieveLegacySecretKeyRequest()) - ->setKey($formattedKey); - $response = $gapicClient->retrieveLegacySecretKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RetrieveLegacySecretKey', $actualFuncCall); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($formattedKey, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function retrieveLegacySecretKeyExceptionTest() - { - $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 - $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $request = (new RetrieveLegacySecretKeyRequest()) - ->setKey($formattedKey); - try { - $gapicClient->retrieveLegacySecretKey($request); - // 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 searchRelatedAccountGroupMembershipsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); - $relatedAccountGroupMemberships = [ - $relatedAccountGroupMembershipsElement, - ]; - $expectedResponse = new SearchRelatedAccountGroupMembershipsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); - $transport->addResponse($expectedResponse); - // Mock request - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new SearchRelatedAccountGroupMembershipsRequest()) - ->setProject($formattedProject); - $response = $gapicClient->searchRelatedAccountGroupMemberships($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/SearchRelatedAccountGroupMemberships', $actualFuncCall); - $actualValue = $actualRequestObject->getProject(); - $this->assertProtobufEquals($formattedProject, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchRelatedAccountGroupMembershipsExceptionTest() - { - $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 - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $request = (new SearchRelatedAccountGroupMembershipsRequest()) - ->setProject($formattedProject); - try { - $gapicClient->searchRelatedAccountGroupMemberships($request); - // 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 updateFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $firewallPolicy = new FirewallPolicy(); - $request = (new UpdateFirewallPolicyRequest()) - ->setFirewallPolicy($firewallPolicy); - $response = $gapicClient->updateFirewallPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getFirewallPolicy(); - $this->assertProtobufEquals($firewallPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFirewallPolicyExceptionTest() - { - $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 - $firewallPolicy = new FirewallPolicy(); - $request = (new UpdateFirewallPolicyRequest()) - ->setFirewallPolicy($firewallPolicy); - try { - $gapicClient->updateFirewallPolicy($request); - // 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 updateKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $request = (new UpdateKeyRequest()) - ->setKey($key); - $response = $gapicClient->updateKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($key, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateKeyExceptionTest() - { - $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 - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $request = (new UpdateKeyRequest()) - ->setKey($key); - try { - $gapicClient->updateKey($request); - // 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 addIpOverrideAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddIpOverrideResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $request = (new AddIpOverrideRequest()) - ->setName($formattedName) - ->setIpOverrideData($ipOverrideData); - $response = $gapicClient->addIpOverrideAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIpOverrideData(); - $this->assertProtobufEquals($ipOverrideData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php b/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php deleted file mode 100644 index 0d04fa39208..00000000000 --- a/owl-bot-staging/RecaptchaEnterprise/v1/tests/Unit/V1/RecaptchaEnterpriseServiceClientTest.php +++ /dev/null @@ -1,1517 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RecaptchaEnterpriseServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RecaptchaEnterpriseServiceClient($options); - } - - /** @test */ - public function addIpOverrideTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddIpOverrideResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $response = $gapicClient->addIpOverride($formattedName, $ipOverrideData); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIpOverrideData(); - $this->assertProtobufEquals($ipOverrideData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addIpOverrideExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - try { - $gapicClient->addIpOverride($formattedName, $ipOverrideData); - // 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 annotateAssessmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnnotateAssessmentResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->assessmentName('[PROJECT]', '[ASSESSMENT]'); - $annotation = Annotation::ANNOTATION_UNSPECIFIED; - $response = $gapicClient->annotateAssessment($formattedName, $annotation); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AnnotateAssessment', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getAnnotation(); - $this->assertProtobufEquals($annotation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function annotateAssessmentExceptionTest() - { - $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->assessmentName('[PROJECT]', '[ASSESSMENT]'); - $annotation = Annotation::ANNOTATION_UNSPECIFIED; - try { - $gapicClient->annotateAssessment($formattedName, $annotation); - // 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 createAssessmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Assessment(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $assessment = new Assessment(); - $response = $gapicClient->createAssessment($formattedParent, $assessment); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateAssessment', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAssessment(); - $this->assertProtobufEquals($assessment, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAssessmentExceptionTest() - { - $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->projectName('[PROJECT]'); - $assessment = new Assessment(); - try { - $gapicClient->createAssessment($formattedParent, $assessment); - // 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 createFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $firewallPolicy = new FirewallPolicy(); - $response = $gapicClient->createFirewallPolicy($formattedParent, $firewallPolicy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getFirewallPolicy(); - $this->assertProtobufEquals($firewallPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createFirewallPolicyExceptionTest() - { - $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->projectName('[PROJECT]'); - $firewallPolicy = new FirewallPolicy(); - try { - $gapicClient->createFirewallPolicy($formattedParent, $firewallPolicy); - // 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 createKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $response = $gapicClient->createKey($formattedParent, $key); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/CreateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($key, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createKeyExceptionTest() - { - $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->projectName('[PROJECT]'); - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - try { - $gapicClient->createKey($formattedParent, $key); - // 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 deleteFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $gapicClient->deleteFirewallPolicy($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteFirewallPolicyExceptionTest() - { - $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - try { - $gapicClient->deleteFirewallPolicy($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 deleteKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $gapicClient->deleteKey($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/DeleteKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - try { - $gapicClient->deleteKey($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 getFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - $response = $gapicClient->getFirewallPolicy($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFirewallPolicyExceptionTest() - { - $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->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'); - try { - $gapicClient->getFirewallPolicy($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 getKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $response = $gapicClient->getKey($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - try { - $gapicClient->getKey($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 getMetricsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Metrics(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricsName('[PROJECT]', '[KEY]'); - $response = $gapicClient->getMetrics($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetMetrics', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetricsExceptionTest() - { - $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->metricsName('[PROJECT]', '[KEY]'); - try { - $gapicClient->getMetrics($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 listFirewallPoliciesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $firewallPoliciesElement = new FirewallPolicy(); - $firewallPolicies = [ - $firewallPoliciesElement, - ]; - $expectedResponse = new ListFirewallPoliciesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFirewallPolicies($firewallPolicies); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listFirewallPolicies($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFirewallPolicies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListFirewallPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFirewallPoliciesExceptionTest() - { - $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->projectName('[PROJECT]'); - try { - $gapicClient->listFirewallPolicies($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 listIpOverridesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $ipOverridesElement = new IpOverrideData(); - $ipOverrides = [ - $ipOverridesElement, - ]; - $expectedResponse = new ListIpOverridesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIpOverrides($ipOverrides); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $response = $gapicClient->listIpOverrides($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIpOverrides()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListIpOverrides', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIpOverridesExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - try { - $gapicClient->listIpOverrides($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 listKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $keysElement = new Key(); - $keys = [ - $keysElement, - ]; - $expectedResponse = new ListKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setKeys($keys); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listKeys($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listKeysExceptionTest() - { - $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->projectName('[PROJECT]'); - try { - $gapicClient->listKeys($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 listRelatedAccountGroupMembershipsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); - $relatedAccountGroupMemberships = [ - $relatedAccountGroupMembershipsElement, - ]; - $expectedResponse = new ListRelatedAccountGroupMembershipsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); - $response = $gapicClient->listRelatedAccountGroupMemberships($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroupMemberships', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRelatedAccountGroupMembershipsExceptionTest() - { - $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->relatedAccountGroupName('[PROJECT]', '[RELATEDACCOUNTGROUP]'); - try { - $gapicClient->listRelatedAccountGroupMemberships($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 listRelatedAccountGroupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupsElement = new RelatedAccountGroup(); - $relatedAccountGroups = [ - $relatedAccountGroupsElement, - ]; - $expectedResponse = new ListRelatedAccountGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroups($relatedAccountGroups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listRelatedAccountGroups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ListRelatedAccountGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRelatedAccountGroupsExceptionTest() - { - $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->projectName('[PROJECT]'); - try { - $gapicClient->listRelatedAccountGroups($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 migrateKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $response = $gapicClient->migrateKey($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.recaptchaenterprise.v1.RecaptchaEnterpriseService/MigrateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function migrateKeyExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - try { - $gapicClient->migrateKey($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 removeIpOverrideTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RemoveIpOverrideResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - $response = $gapicClient->removeIpOverride($formattedName, $ipOverrideData); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RemoveIpOverride', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIpOverrideData(); - $this->assertProtobufEquals($ipOverrideData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIpOverrideExceptionTest() - { - $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->keyName('[PROJECT]', '[KEY]'); - $ipOverrideData = new IpOverrideData(); - $ipOverrideDataIp = 'ipOverrideDataIp1421737572'; - $ipOverrideData->setIp($ipOverrideDataIp); - $ipOverrideDataOverrideType = OverrideType::OVERRIDE_TYPE_UNSPECIFIED; - $ipOverrideData->setOverrideType($ipOverrideDataOverrideType); - try { - $gapicClient->removeIpOverride($formattedName, $ipOverrideData); - // 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 reorderFirewallPoliciesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReorderFirewallPoliciesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $formattedNames = [ - $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), - ]; - $response = $gapicClient->reorderFirewallPolicies($formattedParent, $formattedNames); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/ReorderFirewallPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reorderFirewallPoliciesExceptionTest() - { - $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->projectName('[PROJECT]'); - $formattedNames = [ - $gapicClient->firewallPolicyName('[PROJECT]', '[FIREWALLPOLICY]'), - ]; - try { - $gapicClient->reorderFirewallPolicies($formattedParent, $formattedNames); - // 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 retrieveLegacySecretKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $legacySecretKey = 'legacySecretKey-1937138042'; - $expectedResponse = new RetrieveLegacySecretKeyResponse(); - $expectedResponse->setLegacySecretKey($legacySecretKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); - $response = $gapicClient->retrieveLegacySecretKey($formattedKey); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RetrieveLegacySecretKey', $actualFuncCall); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($formattedKey, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function retrieveLegacySecretKeyExceptionTest() - { - $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 - $formattedKey = $gapicClient->keyName('[PROJECT]', '[KEY]'); - try { - $gapicClient->retrieveLegacySecretKey($formattedKey); - // 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 searchRelatedAccountGroupMembershipsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $relatedAccountGroupMembershipsElement = new RelatedAccountGroupMembership(); - $relatedAccountGroupMemberships = [ - $relatedAccountGroupMembershipsElement, - ]; - $expectedResponse = new SearchRelatedAccountGroupMembershipsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRelatedAccountGroupMemberships($relatedAccountGroupMemberships); - $transport->addResponse($expectedResponse); - // Mock request - $formattedProject = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->searchRelatedAccountGroupMemberships($formattedProject); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRelatedAccountGroupMemberships()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/SearchRelatedAccountGroupMemberships', $actualFuncCall); - $actualValue = $actualRequestObject->getProject(); - $this->assertProtobufEquals($formattedProject, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchRelatedAccountGroupMembershipsExceptionTest() - { - $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 - $formattedProject = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->searchRelatedAccountGroupMemberships($formattedProject); - // 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 updateFirewallPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $path = 'path3433509'; - $condition = 'condition-861311717'; - $expectedResponse = new FirewallPolicy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setPath($path); - $expectedResponse->setCondition($condition); - $transport->addResponse($expectedResponse); - // Mock request - $firewallPolicy = new FirewallPolicy(); - $response = $gapicClient->updateFirewallPolicy($firewallPolicy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateFirewallPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getFirewallPolicy(); - $this->assertProtobufEquals($firewallPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFirewallPolicyExceptionTest() - { - $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 - $firewallPolicy = new FirewallPolicy(); - try { - $gapicClient->updateFirewallPolicy($firewallPolicy); - // 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 updateKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Key(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - $response = $gapicClient->updateKey($key); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/UpdateKey', $actualFuncCall); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($key, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateKeyExceptionTest() - { - $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 - $key = new Key(); - $keyDisplayName = 'keyDisplayName-302940530'; - $key->setDisplayName($keyDisplayName); - try { - $gapicClient->updateKey($key); - // 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/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 e18d9a0478ce14bf0057abf5b2b737b3c7e15a97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2636 zcmbtWU2hvj6s^~F+FbX;-BQ(Z9~eTVI#TL1L40UKK(@0qB$>~I#un33F0ZBbZ6CSgk2(_$$@Jo5+ zNPRO;E8*xVs%wsxb&cdc;w&SJ*%4xdXDr%Nyd}WJGb>ynyb?E{Yw!Jg^}u)wB;tA!Jqfw)Borob5k#DDC;$r zS+9{>ulC6bIn?H~NjLr~LOJ(Whm(nU9}MbO3#d?EZxw%Q8s-_iCu~iEm`&X=6=#Wg z;w!Bhs8}!W9yi{ZVq+nV{H-95bHu4mWJ{6o@ z%sHc@j0;vJFloI?q*pq?Une51An53cEGJ{Grz z7FSlOFk@=89>K$_4s!W4AsfH1fq6ZJ=|h>k!Gd|hs7I6`R;%`P%!VxidlE0-fy|=t zT_z+a!c($(t9WWj7L}kc@n%^Z2TER?@>JMrRnsm>(3Vhk#F;X!vVfN{Mj~&j9kXE3 z5tLK$+?=`cDkRFD_x|q&2NG}~@w8*#2NR!T8sbq%-0w0Ri6b;swk_&_4S3|?D2}Ly zLs3ud$c)kIt+`iiSfdl+d2R0U?u!*1+K~%Ys+tWjud+N#K24JlPZw-tXi`t$Ud*U? zJ{2eFFHw)^^I(6if}!;XDWxnbUc+np0JBj&}w3f$?w9=hGb ze54@fdwsjxKd}21L*!a-HQO)s-(tgZA@q|=4wkN zt&q43zo$MQtIJT2wSG3>xoAM%y*RzX*H}Lvvx_>OYzOi3J_aXr*2-MHDs-QdjP{lf z|74WinternalAddGeneratedFile( - ' -� -?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 ( B3�A�A- -+recommendationengine.googleapis.com/CatalogQ - catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemB�A"b -GetCatalogItemRequestI -name ( B;�A�A5 -3recommendationengine.googleapis.com/CatalogItemPath"� -ListCatalogItemsRequestC -parent ( B3�A�A- -+recommendationengine.googleapis.com/Catalog - page_size (B�A - -page_token ( B�A -filter ( B�A"� -ListCatalogItemsResponseM - catalog_items ( 26.google.cloud.recommendationengine.v1beta1.CatalogItem -next_page_token ( "� -UpdateCatalogItemRequestI -name ( B;�A�A5 -3recommendationengine.googleapis.com/CatalogItemPathQ - catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemB�A/ - update_mask ( 2.google.protobuf.FieldMask"e -DeleteCatalogItemRequestI -name ( B;�A�A5 -3recommendationengine.googleapis.com/CatalogItemPath2� -CatalogService� -CreateCatalogItemC.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"l�Aparent,catalog_item���P"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems: catalog_item� -GetCatalogItem@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"P�Aname���CA/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}� -ListCatalogItemsB.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequestC.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse"X�A parent,filter���B@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems� -UpdateCatalogItemC.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"w�Aname,catalog_item,update_mask���Q2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}: catalog_item� -DeleteCatalogItemC.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.google.protobuf.Empty"P�Aname���C*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}� -ImportCatalogItemsD.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.google.longrunning.Operation"��A� -Dgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadata�A,parent,request_id,input_config,errors_config���L"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� --com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 ecbe94f045c..00000000000 --- 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.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 e84c970a097885785054eb136f352310d8f41b70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3672 zcmds4-EQMl5Zpxh>8=a3v6o{-(0_Q@M)Dx#G8)FHzt8V0oC z2T|H@aEb;a8uq<}MIjA`EToOIwH{5pwFVo-5l?L80wDB8RK%W7$^KF6BRqgMUUy%i zb+;v2w^M-D{dBD*(KZ46z!QSB6)JoK1b=bb3z$ztg8qGSj|rEBEMZ>2zQ%9dA_FfF z6iu(69i*WzVtm!(8Z?kT6p z2}7bM-YA~jwiEl^W8`r99Dj^5JT)7Y5-G+_7CsS)h+u2Iq zc9FboBk$$A#)TI%>;sxYTI|d3PVU{;JTZpO#_7$d}RG)i%qcsneJ_?0}>h7rhScbdWb}W3+ zpyM_WPR7zP?LNL?J<(J* zsFGrp^=b5!_YK7AL-j(OIM~Q0k;SVS`r#Du=3E(X04T$kVOB?5`=ta6npfF)X5E2> zD3%i=PD-wv;Ho#JYAoxLl4LM*Rs$+Nr#M`?vQbtw-kC=}FMF#>f3Uey83nxB;g zj9uNpti~TY$UW3InEPAc@(fXkbtJv%(5AUe-xu-uOyIJw77)HfA z4fe=vttq;3;@)QQ_OtTJzFKu`HRsx$ORLVVTAXaN>inFY?V7#l%3`EX zcX2aPd)9B|2O8RO6t?3Ofjf>l-kViYe0V<}8XxEdWNcrN(+u+qb`^C}ZxrWn4)7=8 CCFFAe 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 1dfef8780a3..00000000000 --- 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 ( B6�A�A0 -.recommendationengine.googleapis.com/EventStoreu -prediction_api_key_registration ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationB�A"� -(ListPredictionApiKeyRegistrationsRequestF -parent ( B6�A�A0 -.recommendationengine.googleapis.com/EventStore - page_size (B�A - -page_token ( B�A"� -)ListPredictionApiKeyRegistrationsResponseq - prediction_api_key_registrations ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration -next_page_token ( "� -)DeletePredictionApiKeyRegistrationRequestV -name ( BH�A�AB -@recommendationengine.googleapis.com/PredictionApiKeyRegistration2� -PredictionApiKeyRegistry� -"CreatePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequestG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration"��A&parent,prediction_api_key_registration���d"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:*� -!ListPredictionApiKeyRegistrationsS.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequestT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse"p�Aparent���a_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations� -"DeletePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest.google.protobuf.Empty"n�Aname���a*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� --com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 68fa1988e19..00000000000 --- 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 ( B5�A�A/ --recommendationengine.googleapis.com/PlacementM - -user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventB�A - page_size (B�A - -page_token ( B�A -filter ( B�A -dry_run (B�AZ -params ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryB�AZ -labels ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryB�AE - 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"q�Aname,user_event���Y"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� --com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 46a976fbd41..00000000000 --- 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.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)Google.Cloud.RecommendationEngine.V1Beta1�)Google\\Cloud\\RecommendationEngine\\V1beta1�,Google::Cloud::RecommendationEngine::V1beta1�Ai -+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/PredictionApiKeyRegistration�projects/{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 eded66ee8391777e030f43fc1b6afb5a188cf7b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3437 zcmb_f-EJF26vmsTNybSNZG$iYsnbxYiPUaXSCnc?3XbEXR-4*QoC<-_GTxmyqi%M$ zv$LiK^^!|&cm%lPQFscjxF~l#0cU>Jb{eC`w7H0^opZi(&Ub$1%;#Su#|iob@6w2J zB4~g+eJqYCPIxS0KMrvxJ368q`|(M_LdqSCw;T9zqlIhR_10BTP2-IF)WzL6?uK;3 z592J@;1m>2XcQ2^;)q6F7SWB~tqv9B)<%|6?$I8Ngrm$L6p<5}Cd8+Bx4E?kLZC<5 zy9%*gm5A;AF^KJ_x3(nWJ%s#_q$xfGivX>vpLaa4f&9tsAovjve7O?W60SadHz2p3zb37;`Ez9^F%ZOMsVyU+pmjRub0U zVKfZ3=rQTBn7i&Usv*cY)i-nBu0pE9xchD~p?Kox{E!3wTMP_By|4QQ04UPnJIBlrK8wY{!&9n})fxR!8CORRi$elx!2Ter^2oe2~bsYdUL z(NhfwmAfHw=Cr`-FBj0Q|^Z^3DDjm1<9Gk6YeB<8Z%P^9~;$G;7uRPQA9h^q!5-#mZr;vG-`HU@xG#TD7sa zR|Byn%U(kBTa{Mzfp^$^)TnGPO|AZ1K(l$uWKHx~%3#EKEEuhcWi+E}B2X2fDy1OB zS>ll(;51EDYKI3(oOEGumtZA; zb@Vntiz+%87qlC51|C=tL$Ul|0uRh=uM2wOz;6lEf52c<0Be2w379awrMpVgR4m_} zz=R3NBybVUge;YmYdRsg8J}?VLAI934}q?Rt>c)a)DxUUDN&cT%5JfIe-iTsrZq&- zWdCEK%gwWg_9C)ItGysSgHZo^YSJw9Gp tH#D^CDs0ys2kyE?ymJvIoQQ8internalAddGeneratedFile( - ' -� -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 ( B6�A�A0 -.recommendationengine.googleapis.com/EventStore -filter ( B�A -force (B�A"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 ( B6�A�A0 -.recommendationengine.googleapis.com/EventStoreM - -user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventB�A"� -CollectUserEventRequestF -parent ( B6�A�A0 -.recommendationengine.googleapis.com/EventStore - -user_event ( B�A -uri ( B�A -ets (B�A"� -ListUserEventsRequestF -parent ( B6�A�A0 -.recommendationengine.googleapis.com/EventStore - page_size (B�A - -page_token ( B�A -filter ( B�A"| -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�Aparent,user_event���`"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write: -user_event� -CollectUserEventB.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.google.api.HttpBody"x�Aparent,user_event,uri,ets���VT/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect� -ListUserEvents@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequestA.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse"d�A parent,filter���NL/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents� -PurgeUserEventsA.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.google.longrunning.Operation"��A� -Agoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponseAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata�Aparent,filter,force���W"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:*� -ImportUserEventsB.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.google.longrunning.Operation"��A~ -Bgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadata�A,parent,request_id,input_config,errors_config���X"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:*W�A#recommendationengine.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� --com.google.cloud.recommendationengine.v1beta1PZacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb�RECAI�)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 f2ad496f059..00000000000 --- 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 6e86c77983a..00000000000 --- 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 560a234a76f..00000000000 --- 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/CollectUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php deleted file mode 100644 index 7572405559b..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php +++ /dev/null @@ -1,219 +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; - - /** - * @param string $parent Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see - * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. - * @param string $userEvent Required. URL encoded UserEvent proto. - * @param 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. - * @param 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. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest - * - * @experimental - */ - public static function build(string $parent, string $userEvent, string $uri, int $ets): self - { - return (new self()) - ->setParent($parent) - ->setUserEvent($userEvent) - ->setUri($uri) - ->setEts($ets); - } - - /** - * 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 2f0d616da1a..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php +++ /dev/null @@ -1,132 +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; - - /** - * @param string $parent Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. Please see - * {@see CatalogServiceClient::catalogName()} for help formatting this field. - * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem Required. The catalog item to create. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CreateCatalogItemRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem): self - { - return (new self()) - ->setParent($parent) - ->setCatalogItem($catalogItem); - } - - /** - * 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 9371234e85e..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php +++ /dev/null @@ -1,132 +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; - - /** - * @param string $parent Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see - * {@see PredictionApiKeyRegistryClient::eventStoreName()} for help formatting this field. - * @param \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $predictionApiKeyRegistration Required. The prediction API key registration. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CreatePredictionApiKeyRegistrationRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $predictionApiKeyRegistration): self - { - return (new self()) - ->setParent($parent) - ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - } - - /** - * 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 76f872cb059..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php +++ /dev/null @@ -1,86 +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 = ''; - - /** - * @param string $name Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. Please see - * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 ff36aef3416..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php +++ /dev/null @@ -1,86 +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 = ''; - - /** - * @param string $name Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * Please see {@see PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName()} for help formatting this field. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 25740f69bf0..00000000000 --- 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 0578372686e..00000000000 --- 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 a0245cbe9b4..00000000000 --- 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 20808ae9628..00000000000 --- 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/GcsSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php deleted file mode 100644 index ad47f31a44f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php +++ /dev/null @@ -1,92 +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 91e51e1c64a..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php +++ /dev/null @@ -1,86 +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 = ''; - - /** - * @param string $name Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. Please see - * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 5790795608f..00000000000 --- 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 9f1a9b4a42c..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php +++ /dev/null @@ -1,224 +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; - - /** - * @param string $parent Required. `projects/1234/locations/global/catalogs/default_catalog` - * Please see {@see CatalogServiceClient::catalogName()} for help formatting this field. - * @param 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. - * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig Required. The desired input location of the data. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig Optional. The desired location of errors incurred during the Import. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest - * - * @experimental - */ - public static function build(string $parent, string $requestId, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig): self - { - return (new self()) - ->setParent($parent) - ->setRequestId($requestId) - ->setInputConfig($inputConfig) - ->setErrorsConfig($errorsConfig); - } - - /** - * 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 f1d250f54ae..00000000000 --- 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 0a56f1f1b5a..00000000000 --- 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 df36e57fb55..00000000000 --- 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 d50c931107f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php +++ /dev/null @@ -1,239 +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; - - /** - * @param string $parent Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * Please see {@see UserEventServiceClient::eventStoreName()} for help formatting this field. - * @param 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. - * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig Required. The desired input location of the data. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig Optional. The desired location of errors incurred during the Import. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest - * - * @experimental - */ - public static function build(string $parent, string $requestId, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $inputConfig, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errorsConfig): self - { - return (new self()) - ->setParent($parent) - ->setRequestId($requestId) - ->setInputConfig($inputConfig) - ->setErrorsConfig($errorsConfig); - } - - /** - * 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 a2c46b8b0d7..00000000000 --- 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 bb1e3c8486e..00000000000 --- 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 782b7c3cc7b..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php +++ /dev/null @@ -1,194 +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 = ''; - - /** - * @param string $parent Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. Please see - * {@see CatalogServiceClient::catalogName()} for help formatting this field. - * @param string $filter Optional. A filter to apply on the list results. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest - * - * @experimental - */ - public static function build(string $parent, string $filter): self - { - return (new self()) - ->setParent($parent) - ->setFilter($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 5e6fc92950b..00000000000 --- 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 fb2ef75e9a9..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php +++ /dev/null @@ -1,158 +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 = ''; - - /** - * @param string $parent Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * Please see {@see PredictionApiKeyRegistryClient::eventStoreName()} for help formatting this field. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 10f6cde3a76..00000000000 --- 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 1d959b454f6..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php +++ /dev/null @@ -1,325 +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 = ''; - - /** - * @param string $parent Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. Please see - * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. - * @param 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 - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest - * - * @experimental - */ - public static function build(string $parent, string $filter): self - { - return (new self()) - ->setParent($parent) - ->setFilter($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 dd173c6ca7a..00000000000 --- 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 b437e2ee547..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php +++ /dev/null @@ -1,598 +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; - - /** - * @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 - * Please see {@see PredictionServiceClient::placementName()} for help formatting this field. - * @param \Google\Cloud\RecommendationEngine\V1beta1\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. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent): self - { - return (new self()) - ->setName($name) - ->setUserEvent($userEvent); - } - - /** - * 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 dd9123fe4ff..00000000000 --- 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 a5b769c9f33..00000000000 --- 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/PredictionApiKeyRegistration.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php deleted file mode 100644 index 07d4b018b1a..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php +++ /dev/null @@ -1,67 +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/ProductCatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php deleted file mode 100644 index adca031c6ce..00000000000 --- 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 7c89cff9e04..00000000000 --- 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 0e852c57127..00000000000 --- 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 1c3d3309882..00000000000 --- 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/ProductDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php deleted file mode 100644 index 4b3b83b30c8..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php +++ /dev/null @@ -1,371 +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 d65f1cc9d8d..00000000000 --- 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 871a95215d5..00000000000 --- 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 8dbccb35565..00000000000 --- 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 46a4a5f8e8b..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php +++ /dev/null @@ -1,258 +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; - - /** - * @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}` - * Please see {@see UserEventServiceClient::eventStoreName()} for help formatting this field. - * @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 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. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest - * - * @experimental - */ - public static function build(string $parent, string $filter, bool $force): self - { - return (new self()) - ->setParent($parent) - ->setFilter($filter) - ->setForce($force); - } - - /** - * 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 2ebd0d0f92e..00000000000 --- 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 67d1426dd8b..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php +++ /dev/null @@ -1,188 +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; - - /** - * @param string $name Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. Please see - * {@see CatalogServiceClient::catalogItemPathName()} for help formatting this field. - * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalogItem, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setName($name) - ->setCatalogItem($catalogItem) - ->setUpdateMask($updateMask); - } - - /** - * 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 1d27319722d..00000000000 --- 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 32d9d868294..00000000000 --- 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 5d66aa96e6e..00000000000 --- 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 65b1597982a..00000000000 --- 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/UserInfo.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php deleted file mode 100644 index caedbf80f65..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php +++ /dev/null @@ -1,271 +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 0f7163b77d2..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php +++ /dev/null @@ -1,132 +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; - - /** - * @param string $parent Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. Please see - * {@see UserEventServiceClient::eventStoreName()} for help formatting this field. - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent Required. User event to write. - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\WriteUserEventRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $userEvent): self - { - return (new self()) - ->setParent($parent) - ->setUserEvent($userEvent); - } - - /** - * 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/samples/V1beta1/CatalogServiceClient/create_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/create_catalog_item.php deleted file mode 100644 index e6e6e0dcdfb..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/create_catalog_item.php +++ /dev/null @@ -1,107 +0,0 @@ -setCategories($catalogItemCategoryHierarchiesCategories); - $catalogItemCategoryHierarchies = [$categoryHierarchy,]; - $catalogItem = (new CatalogItem()) - ->setId($catalogItemId) - ->setCategoryHierarchies($catalogItemCategoryHierarchies) - ->setTitle($catalogItemTitle); - $request = (new CreateCatalogItemRequest()) - ->setParent($formattedParent) - ->setCatalogItem($catalogItem); - - // Call the API and handle any network failures. - try { - /** @var CatalogItem $response */ - $response = $catalogServiceClient->createCatalogItem($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogItemId = '[ID]'; - $catalogItemCategoryHierarchiesCategoriesElement = '[CATEGORIES]'; - $catalogItemTitle = '[TITLE]'; - - create_catalog_item_sample( - $formattedParent, - $catalogItemId, - $catalogItemCategoryHierarchiesCategoriesElement, - $catalogItemTitle - ); -} -// [END recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php deleted file mode 100644 index 0779c3abe47..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/delete_catalog_item.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $catalogServiceClient->deleteCatalogItem($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CatalogServiceClient::catalogItemPathName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[CATALOG_ITEM_PATH]' - ); - - delete_catalog_item_sample($formattedName); -} -// [END recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php deleted file mode 100644 index 636b3ecf635..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/get_catalog_item.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CatalogItem $response */ - $response = $catalogServiceClient->getCatalogItem($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CatalogServiceClient::catalogItemPathName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[CATALOG_ITEM_PATH]' - ); - - get_catalog_item_sample($formattedName); -} -// [END recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php deleted file mode 100644 index 0a8bd9bd41e..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/import_catalog_items.php +++ /dev/null @@ -1,91 +0,0 @@ -setParent($formattedParent) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $catalogServiceClient->importCatalogItems($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportCatalogItemsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - import_catalog_items_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php deleted file mode 100644 index b05eda0fb9f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/list_catalog_items.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $catalogServiceClient->listCatalogItems($request); - - /** @var CatalogItem $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CatalogServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - list_catalog_items_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php deleted file mode 100644 index ff222aac048..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/CatalogServiceClient/update_catalog_item.php +++ /dev/null @@ -1,113 +0,0 @@ -setCategories($catalogItemCategoryHierarchiesCategories); - $catalogItemCategoryHierarchies = [$categoryHierarchy,]; - $catalogItem = (new CatalogItem()) - ->setId($catalogItemId) - ->setCategoryHierarchies($catalogItemCategoryHierarchies) - ->setTitle($catalogItemTitle); - $request = (new UpdateCatalogItemRequest()) - ->setName($formattedName) - ->setCatalogItem($catalogItem); - - // Call the API and handle any network failures. - try { - /** @var CatalogItem $response */ - $response = $catalogServiceClient->updateCatalogItem($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CatalogServiceClient::catalogItemPathName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[CATALOG_ITEM_PATH]' - ); - $catalogItemId = '[ID]'; - $catalogItemCategoryHierarchiesCategoriesElement = '[CATEGORIES]'; - $catalogItemTitle = '[TITLE]'; - - update_catalog_item_sample( - $formattedName, - $catalogItemId, - $catalogItemCategoryHierarchiesCategoriesElement, - $catalogItemTitle - ); -} -// [END recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php deleted file mode 100644 index 95a92212131..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent) - ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - - // Call the API and handle any network failures. - try { - /** @var PredictionApiKeyRegistration $response */ - $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PredictionApiKeyRegistryClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - - create_prediction_api_key_registration_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php deleted file mode 100644 index 44ad813ff6a..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php +++ /dev/null @@ -1,76 +0,0 @@ -` - * Please see {@see PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName()} for help formatting this field. - */ -function delete_prediction_api_key_registration_sample(string $formattedName): void -{ - // Create a client. - $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); - - // Prepare the request message. - $request = (new DeletePredictionApiKeyRegistrationRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $predictionApiKeyRegistryClient->deletePredictionApiKeyRegistration($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PredictionApiKeyRegistryClient::predictionApiKeyRegistrationName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]', - '[PREDICTION_API_KEY_REGISTRATION]' - ); - - delete_prediction_api_key_registration_sample($formattedName); -} -// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php deleted file mode 100644 index 0b4ef207d99..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($request); - - /** @var PredictionApiKeyRegistration $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = PredictionApiKeyRegistryClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - - list_prediction_api_key_registrations_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php deleted file mode 100644 index c9da8a32c3f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/PredictionServiceClient/predict.php +++ /dev/null @@ -1,151 +0,0 @@ -setVisitorId($userEventUserInfoVisitorId); - $userEvent = (new UserEvent()) - ->setEventType($userEventEventType) - ->setUserInfo($userEventUserInfo); - $request = (new PredictRequest()) - ->setName($formattedName) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $predictionServiceClient->predict($request); - - /** @var PredictionResult $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = PredictionServiceClient::placementName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]', - '[PLACEMENT]' - ); - $userEventEventType = '[EVENT_TYPE]'; - $userEventUserInfoVisitorId = '[VISITOR_ID]'; - - predict_sample($formattedName, $userEventEventType, $userEventUserInfoVisitorId); -} -// [END recommendationengine_v1beta1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php deleted file mode 100644 index c8531e0c98e..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/collect_user_event.php +++ /dev/null @@ -1,84 +0,0 @@ -setParent($formattedParent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var HttpBody $response */ - $response = $userEventServiceClient->collectUserEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - $userEvent = '[USER_EVENT]'; - - collect_user_event_sample($formattedParent, $userEvent); -} -// [END recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php deleted file mode 100644 index 84e90f8e9f2..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/import_user_events.php +++ /dev/null @@ -1,98 +0,0 @@ -setParent($formattedParent) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->importUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportUserEventsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - - import_user_events_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php deleted file mode 100644 index c81318d2fe5..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/list_user_events.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $userEventServiceClient->listUserEvents($request); - - /** @var UserEvent $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - - list_user_events_sample($formattedParent); -} -// [END recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php deleted file mode 100644 index 74b292d2ba3..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/purge_user_events.php +++ /dev/null @@ -1,113 +0,0 @@ - "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. - */ -function purge_user_events_sample(string $formattedParent, string $filter): void -{ - // Create a client. - $userEventServiceClient = new UserEventServiceClient(); - - // Prepare the request message. - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->purgeUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var PurgeUserEventsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - $filter = '[FILTER]'; - - purge_user_events_sample($formattedParent, $filter); -} -// [END recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php b/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php deleted file mode 100644 index 2f20bf02909..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/samples/V1beta1/UserEventServiceClient/write_user_event.php +++ /dev/null @@ -1,114 +0,0 @@ -setVisitorId($userEventUserInfoVisitorId); - $userEvent = (new UserEvent()) - ->setEventType($userEventEventType) - ->setUserInfo($userEventUserInfo); - $request = (new WriteUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var UserEvent $response */ - $response = $userEventServiceClient->writeUserEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::eventStoreName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[EVENT_STORE]' - ); - $userEventEventType = '[EVENT_TYPE]'; - $userEventUserInfoVisitorId = '[VISITOR_ID]'; - - write_user_event_sample($formattedParent, $userEventEventType, $userEventUserInfoVisitorId); -} -// [END recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] 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 14c6da839b0..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ - createCatalogItemAsync(CreateCatalogItemRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteCatalogItemAsync(DeleteCatalogItemRequest $request, array $optionalArgs = []) - * @method PromiseInterface getCatalogItemAsync(GetCatalogItemRequest $request, array $optionalArgs = []) - * @method PromiseInterface importCatalogItemsAsync(ImportCatalogItemsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listCatalogItemsAsync(ListCatalogItemsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateCatalogItemAsync(UpdateCatalogItemRequest $request, array $optionalArgs = []) - */ -final class CatalogServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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; - } - - /** - * 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(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->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(string $project, string $location, string $catalog, string $catalogItemPath): string - { - return self::getPathTemplate('catalogItemPath')->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(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a catalog item. - * - * The async variant is {@see CatalogServiceClient::createCatalogItemAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/create_catalog_item.php - * - * @param CreateCatalogItemRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CatalogItem - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function createCatalogItem(CreateCatalogItemRequest $request, array $callOptions = []): CatalogItem - { - return $this->startApiCall('CreateCatalogItem', $request, $callOptions)->wait(); - } - - /** - * Deletes a catalog item. - * - * The async variant is {@see CatalogServiceClient::deleteCatalogItemAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/delete_catalog_item.php - * - * @param DeleteCatalogItemRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - * - * @experimental - */ - public function deleteCatalogItem(DeleteCatalogItemRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteCatalogItem', $request, $callOptions)->wait(); - } - - /** - * Gets a specific catalog item. - * - * The async variant is {@see CatalogServiceClient::getCatalogItemAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/get_catalog_item.php - * - * @param GetCatalogItemRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CatalogItem - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function getCatalogItem(GetCatalogItemRequest $request, array $callOptions = []): CatalogItem - { - return $this->startApiCall('GetCatalogItem', $request, $callOptions)->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. - * - * The async variant is {@see CatalogServiceClient::importCatalogItemsAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/import_catalog_items.php - * - * @param ImportCatalogItemsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function importCatalogItems(ImportCatalogItemsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportCatalogItems', $request, $callOptions)->wait(); - } - - /** - * Gets a list of catalog items. - * - * The async variant is {@see CatalogServiceClient::listCatalogItemsAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/list_catalog_items.php - * - * @param ListCatalogItemsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function listCatalogItems(ListCatalogItemsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCatalogItems', $request, $callOptions); - } - - /** - * Updates a catalog item. Partial updating is supported. Non-existing - * items will be created. - * - * The async variant is {@see CatalogServiceClient::updateCatalogItemAsync()} . - * - * @example samples/V1beta1/CatalogServiceClient/update_catalog_item.php - * - * @param UpdateCatalogItemRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CatalogItem - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function updateCatalogItem(UpdateCatalogItemRequest $request, array $callOptions = []): CatalogItem - { - return $this->startApiCall('UpdateCatalogItem', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php deleted file mode 100644 index 19911f5f772..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionApiKeyRegistryClient.php +++ /dev/null @@ -1,352 +0,0 @@ - createPredictionApiKeyRegistrationAsync(CreatePredictionApiKeyRegistrationRequest $request, array $optionalArgs = []) - * @method PromiseInterface deletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listPredictionApiKeyRegistrationsAsync(ListPredictionApiKeyRegistrationsRequest $request, array $optionalArgs = []) - */ -final class PredictionApiKeyRegistryClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $project, string $location, string $catalog, string $eventStore): string - { - return self::getPathTemplate('eventStore')->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(string $project, string $location, string $catalog, string $eventStore, string $predictionApiKeyRegistration): string - { - return self::getPathTemplate('predictionApiKeyRegistration')->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(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Register an API key for use with predict method. - * - * The async variant is - * {@see PredictionApiKeyRegistryClient::createPredictionApiKeyRegistrationAsync()} - * . - * - * @example samples/V1beta1/PredictionApiKeyRegistryClient/create_prediction_api_key_registration.php - * - * @param CreatePredictionApiKeyRegistrationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PredictionApiKeyRegistration - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function createPredictionApiKeyRegistration(CreatePredictionApiKeyRegistrationRequest $request, array $callOptions = []): PredictionApiKeyRegistration - { - return $this->startApiCall('CreatePredictionApiKeyRegistration', $request, $callOptions)->wait(); - } - - /** - * Unregister an apiKey from using for predict method. - * - * The async variant is - * {@see PredictionApiKeyRegistryClient::deletePredictionApiKeyRegistrationAsync()} - * . - * - * @example samples/V1beta1/PredictionApiKeyRegistryClient/delete_prediction_api_key_registration.php - * - * @param DeletePredictionApiKeyRegistrationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - * - * @experimental - */ - public function deletePredictionApiKeyRegistration(DeletePredictionApiKeyRegistrationRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeletePredictionApiKeyRegistration', $request, $callOptions)->wait(); - } - - /** - * List the registered apiKeys for use with predict method. - * - * The async variant is - * {@see PredictionApiKeyRegistryClient::listPredictionApiKeyRegistrationsAsync()} - * . - * - * @example samples/V1beta1/PredictionApiKeyRegistryClient/list_prediction_api_key_registrations.php - * - * @param ListPredictionApiKeyRegistrationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function listPredictionApiKeyRegistrations(ListPredictionApiKeyRegistrationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListPredictionApiKeyRegistrations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php deleted file mode 100644 index fd42901c84c..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/PredictionServiceClient.php +++ /dev/null @@ -1,262 +0,0 @@ - predictAsync(PredictRequest $request, array $optionalArgs = []) - */ -final class PredictionServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $project, string $location, string $catalog, string $eventStore, string $placement): string - { - return self::getPathTemplate('placement')->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(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * 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). - * - * The async variant is {@see PredictionServiceClient::predictAsync()} . - * - * @example samples/V1beta1/PredictionServiceClient/predict.php - * - * @param PredictRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function predict(PredictRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('Predict', $request, $callOptions); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php deleted file mode 100644 index 8a6e275f2a2..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Client/UserEventServiceClient.php +++ /dev/null @@ -1,432 +0,0 @@ - collectUserEventAsync(CollectUserEventRequest $request, array $optionalArgs = []) - * @method PromiseInterface importUserEventsAsync(ImportUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listUserEventsAsync(ListUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface purgeUserEventsAsync(PurgeUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface writeUserEventAsync(WriteUserEventRequest $request, array $optionalArgs = []) - */ -final class UserEventServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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; - } - - /** - * 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(string $project, string $location, string $catalog, string $eventStore): string - { - return self::getPathTemplate('eventStore')->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(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * 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. - * - * The async variant is {@see UserEventServiceClient::collectUserEventAsync()} . - * - * @example samples/V1beta1/UserEventServiceClient/collect_user_event.php - * - * @param CollectUserEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 HttpBody - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function collectUserEvent(CollectUserEventRequest $request, array $callOptions = []): HttpBody - { - return $this->startApiCall('CollectUserEvent', $request, $callOptions)->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. - * - * The async variant is {@see UserEventServiceClient::importUserEventsAsync()} . - * - * @example samples/V1beta1/UserEventServiceClient/import_user_events.php - * - * @param ImportUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function importUserEvents(ImportUserEventsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportUserEvents', $request, $callOptions)->wait(); - } - - /** - * Gets a list of user events within a time range, with potential filtering. - * - * The async variant is {@see UserEventServiceClient::listUserEventsAsync()} . - * - * @example samples/V1beta1/UserEventServiceClient/list_user_events.php - * - * @param ListUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function listUserEvents(ListUserEventsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUserEvents', $request, $callOptions); - } - - /** - * 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. - * - * The async variant is {@see UserEventServiceClient::purgeUserEventsAsync()} . - * - * @example samples/V1beta1/UserEventServiceClient/purge_user_events.php - * - * @param PurgeUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function purgeUserEvents(PurgeUserEventsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('PurgeUserEvents', $request, $callOptions)->wait(); - } - - /** - * Writes a single user event. - * - * The async variant is {@see UserEventServiceClient::writeUserEventAsync()} . - * - * @example samples/V1beta1/UserEventServiceClient/write_user_event.php - * - * @param WriteUserEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 UserEvent - * - * @throws ApiException Thrown if the API call fails. - * - * @experimental - */ - public function writeUserEvent(WriteUserEventRequest $request, array $callOptions = []): UserEvent - { - return $this->startApiCall('WriteUserEvent', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php deleted file mode 100644 index 25175d0b18f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php +++ /dev/null @@ -1,695 +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 - * - * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\CatalogServiceClient}. - */ -class CatalogServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 642f7463549..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php +++ /dev/null @@ -1,467 +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 - * - * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\PredictionApiKeyRegistryClient}. - */ -class PredictionApiKeyRegistryGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 f71447b5908..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php +++ /dev/null @@ -1,451 +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 - * - * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\PredictionServiceClient}. - */ -class PredictionServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 cbaf47dd220..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php +++ /dev/null @@ -1,724 +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 - * - * @deprecated Please use the new service client {@see \Google\Cloud\RecommendationEngine\V1beta1\Client\UserEventServiceClient}. - */ -class UserEventServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommendationengine.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 aa0ebfce391..00000000000 --- 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', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateCatalogItem' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteCatalogItem' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetCatalogItem' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListCatalogItems' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCatalogItems', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateCatalogItem' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'catalogItemPath' => 'projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}', - ], - ], - ], -]; 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 a1513d07669..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php +++ /dev/null @@ -1,134 +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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deb13af32bd..00000000000 --- 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 d5590b98519..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ - 'CreatePredictionApiKeyRegistration' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeletePredictionApiKeyRegistration' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListPredictionApiKeyRegistrations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getPredictionApiKeyRegistrations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 a0b8022f9ac..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php +++ /dev/null @@ -1,99 +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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 3368352e1f6..00000000000 --- 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 af6dc6eacd8..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ - 'Predict' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\PredictResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'placement' => 'projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}', - ], - ], - ], -]; 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 00812eb2348..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php +++ /dev/null @@ -1,77 +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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 5f920c6228a..00000000000 --- 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 99ff5ec8fa9..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php +++ /dev/null @@ -1,113 +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', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CollectUserEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\HttpBody', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListUserEvents' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUserEvents', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'WriteUserEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\RecommendationEngine\V1beta1\UserEvent', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'eventStore' => 'projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}', - ], - ], - ], -]; 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 071753ea18d..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php +++ /dev/null @@ -1,123 +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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 3fab48e9798..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php +++ /dev/null @@ -1,551 +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([ - 'apiEndpoint' => '', - '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([ - 'apiEndpoint' => '', - '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/Client/CatalogServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/CatalogServiceClientTest.php deleted file mode 100644 index c1184f5ee1c..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/CatalogServiceClientTest.php +++ /dev/null @@ -1,634 +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); - $request = (new CreateCatalogItemRequest()) - ->setParent($formattedParent) - ->setCatalogItem($catalogItem); - $response = $gapicClient->createCatalogItem($request); - $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); - $request = (new CreateCatalogItemRequest()) - ->setParent($formattedParent) - ->setCatalogItem($catalogItem); - try { - $gapicClient->createCatalogItem($request); - // 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]'); - $request = (new DeleteCatalogItemRequest()) - ->setName($formattedName); - $gapicClient->deleteCatalogItem($request); - $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]'); - $request = (new DeleteCatalogItemRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteCatalogItem($request); - // 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]'); - $request = (new GetCatalogItemRequest()) - ->setName($formattedName); - $response = $gapicClient->getCatalogItem($request); - $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]'); - $request = (new GetCatalogItemRequest()) - ->setName($formattedName); - try { - $gapicClient->getCatalogItem($request); - // 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([ - 'apiEndpoint' => '', - '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(); - $request = (new ImportCatalogItemsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importCatalogItems($request); - $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([ - 'apiEndpoint' => '', - '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(); - $request = (new ImportCatalogItemsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importCatalogItems($request); - $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]'); - $request = (new ListCatalogItemsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listCatalogItems($request); - $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]'); - $request = (new ListCatalogItemsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listCatalogItems($request); - // 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); - $request = (new UpdateCatalogItemRequest()) - ->setName($formattedName) - ->setCatalogItem($catalogItem); - $response = $gapicClient->updateCatalogItem($request); - $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); - $request = (new UpdateCatalogItemRequest()) - ->setName($formattedName) - ->setCatalogItem($catalogItem); - try { - $gapicClient->updateCatalogItem($request); - // 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 createCatalogItemAsyncTest() - { - $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); - $request = (new CreateCatalogItemRequest()) - ->setParent($formattedParent) - ->setCatalogItem($catalogItem); - $response = $gapicClient->createCatalogItemAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php deleted file mode 100644 index 3b00fdd0e77..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionApiKeyRegistryClientTest.php +++ /dev/null @@ -1,302 +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(); - $request = (new CreatePredictionApiKeyRegistrationRequest()) - ->setParent($formattedParent) - ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - $response = $gapicClient->createPredictionApiKeyRegistration($request); - $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(); - $request = (new CreatePredictionApiKeyRegistrationRequest()) - ->setParent($formattedParent) - ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - try { - $gapicClient->createPredictionApiKeyRegistration($request); - // 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]'); - $request = (new DeletePredictionApiKeyRegistrationRequest()) - ->setName($formattedName); - $gapicClient->deletePredictionApiKeyRegistration($request); - $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]'); - $request = (new DeletePredictionApiKeyRegistrationRequest()) - ->setName($formattedName); - try { - $gapicClient->deletePredictionApiKeyRegistration($request); - // 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]'); - $request = (new ListPredictionApiKeyRegistrationsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listPredictionApiKeyRegistrations($request); - $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]'); - $request = (new ListPredictionApiKeyRegistrationsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listPredictionApiKeyRegistrations($request); - // 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 createPredictionApiKeyRegistrationAsyncTest() - { - $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(); - $request = (new CreatePredictionApiKeyRegistrationRequest()) - ->setParent($formattedParent) - ->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - $response = $gapicClient->createPredictionApiKeyRegistrationAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php deleted file mode 100644 index 1b161b079c5..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/PredictionServiceClientTest.php +++ /dev/null @@ -1,210 +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); - $request = (new PredictRequest()) - ->setName($formattedName) - ->setUserEvent($userEvent); - $response = $gapicClient->predict($request); - $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); - $request = (new PredictRequest()) - ->setName($formattedName) - ->setUserEvent($userEvent); - try { - $gapicClient->predict($request); - // 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 predictAsyncTest() - { - $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); - $request = (new PredictRequest()) - ->setName($formattedName) - ->setUserEvent($userEvent); - $response = $gapicClient->predictAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php deleted file mode 100644 index f16194b5a66..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/Client/UserEventServiceClientTest.php +++ /dev/null @@ -1,593 +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'; - $request = (new CollectUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - $response = $gapicClient->collectUserEvent($request); - $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'; - $request = (new CollectUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - try { - $gapicClient->collectUserEvent($request); - // 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([ - 'apiEndpoint' => '', - '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(); - $request = (new ImportUserEventsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importUserEvents($request); - $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([ - 'apiEndpoint' => '', - '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(); - $request = (new ImportUserEventsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importUserEvents($request); - $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]'); - $request = (new ListUserEventsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listUserEvents($request); - $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]'); - $request = (new ListUserEventsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listUserEvents($request); - // 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([ - 'apiEndpoint' => '', - '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'; - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeUserEvents($request); - $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([ - 'apiEndpoint' => '', - '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'; - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeUserEvents($request); - $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); - $request = (new WriteUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - $response = $gapicClient->writeUserEvent($request); - $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); - $request = (new WriteUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - try { - $gapicClient->writeUserEvent($request); - // 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 collectUserEventAsyncTest() - { - $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'; - $request = (new CollectUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - $response = $gapicClient->collectUserEventAsync($request)->wait(); - $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()); - } -} 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 682ef8dd758..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php +++ /dev/null @@ -1,252 +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 04411004a7f..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php +++ /dev/null @@ -1,152 +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 5c6e639841b..00000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php +++ /dev/null @@ -1,525 +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([ - 'apiEndpoint' => '', - '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([ - 'apiEndpoint' => '', - '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([ - 'apiEndpoint' => '', - '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([ - 'apiEndpoint' => '', - '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()); - } -} diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php deleted file mode 100644 index 96a11af63961e521d190fba4205f707987057967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3007 zcmb_eOK;mo5Uw76jbdA7A7+)J*{VS!1C0bbEl|jDQ<`EF0=A`!wA&N{6pC8OY-y4p zR|b?o$Nq{Q3iQ}Z5B({<_7~*TpU_#pEI(4%sddqExZk%kv-1t-@e}XZgHK75I@C89 z9gzNnuwzO*-({}p+N3`o4yjK}_r$Yo>Q@PAw8%kACrU%rKS5~Vj(wBX$;fp_Hm#Yq zJ08@0ihvX945(i_-K<$oV2zGhHDm>Fj1wAohDk}Yy}M7DF)*0XZH5G0nGFHt(O?d4jCGDKoNU+?{Msx%yJ#V z0WHU*l?@Vc^1b&x7bD*xiA!ys3`|5!|pa{VEUHFT)&N5>-7<3X$rZevJoH4 z>8v5CL_XH*mz>-o%pcR)(+Tk@8~e_7=r<>rrmOB136nev(-mJs{Vbp}{8gwlrp6dA z9#c`jIaEW}P4*T*-NFK3#))?|Hq8ISudO)S(qND#_bC=(B~1rU&I9;!4K}V_eZt*n zYc(v?>P(?lPd7^+$2?)7;*Hk^adx88Eq!$HeGsM~etYlYTb9HbZ7Bb}1PgHq3wI#T zbs%O)rm`fw3xz>kQ+O9*HZ+P*WQLEm)$`-~4a6mq!|m&^8f&T-jQecjQ4vB&1r|&f z^X4!yhlaw|dNqzW38@<0n(!s8p`4hOoaQgxEPs5_=dDOSu zfjAf9KD>lWic63HxCAIFbm)rn;r55g_N%U<8s|ylC>24%6Ie8HJ#zhtxPSyJTh}6} z$}xx&1oRXgW)pGs1_W9R;#Y>vY9tmAyd=DU61F7Qw2*&*X^cBwn3q6Y#Cs}iJ-$we z)wJ1#*bc>pOR*=FHevk@uY?a^<@||J9hHC1z+xJ(2=B>~t~6Vn=e@%Nt*yxFQ&njc z-w_reFSj(kn8BD9HAOz`sQU9_R#=5XTj@M)b@rtLSt;g(HCV=_)KsKhb&v1K3j(ZY zhng;_2Z?Qt<2uToni%HG-y&_2HgrQ%jud{x1veHTx7Yd(y#Scs#}CTkKKg*ZJyV;{ z@No1^MwBW`d&PYH*W7FAmmHMSxbbTg)wbbTK^4$Z|W!=tI}WFDKGRi`!v+ z;rb)Pv0f%wn0>sJ6Uu*Np?FEQyD%3jKP=Fdtw+~UL@Ii0R;VuFdsqoMdMEL)fDMw% z>zlVAOXdy5Vg97_1qk60=d3~jazD{Y+?tnR?$ofyG-}HA>{pp`6Xqhv-iI|*g05Vs zYb<9;*3}~=5||{*N?S+aWrbx}YN*=2s%iL`+x;g8_posPD~#PcaZ1~K3TbD4kfL@O zw{>3jBlq0Eg>t}|YeptsfBW3iZ`r)uQRLsVcbnnNRSjpZvo?gnI@)|K{gs8!W^iv1 z8`q8?--6(T&h4v9kp8!ng#B5epeAP@Z?2pEJf@1dj~=8$%;(VrI5RNvTDQzAhQ)Aa KG}ldG3h*y7XYoV; diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php deleted file mode 100644 index c295b549cb9..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' -� -5google/cloud/recommender/v1/insight_type_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"� -InsightTypeConfig -name ( ` -insight_type_generation_config ( 28.google.cloud.recommender.v1.InsightTypeGenerationConfig -etag ( / - update_time ( 2.google.protobuf.Timestamp - revision_id ( B�A�AT - annotations ( 2?.google.cloud.recommender.v1.InsightTypeConfig.AnnotationsEntry - display_name ( 2 -AnnotationsEntry -key (  -value ( :8:��A� -,recommender.googleapis.com/InsightTypeConfigJprojects/{project}/locations/{location}/insightTypes/{insight_type}/configTorganizations/{organization}/locations/{location}/insightTypes/{insight_type}/configYbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config"F -InsightTypeGenerationConfig\' -params ( 2.google.protobuf.StructB� -com.google.cloud.recommender.v1BInsightTypeConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php deleted file mode 100644 index f3d0e874402d694acf945e83290e6e7f04a24a64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5056 zcmcIoUsL1O6<>of<`|5*WLYoUX;g2Tg-I$GXEV*1?6yW0tWvbr zkz`tu;js^W?l;I&r(dRT?Mxr?0Wx{%H|V)ne=LL7U8e~z*8TJQopaB>d$^zfdU!R2 zr@|4nsjK_6D_q_P{uLF5uH!p~V+og|UXQwh;S7eRMO{%4>J8zv(H7*o(*7AjJ!j+^ zv?}x+r*F}+VL792*`){=P`gXr^7Y<$sQad4i<}(5)(6xZ>IM~#ng=J;*Sor}caAtu zM`Apk)|jVrzPArxSi0v4@igayuRy@R;poyb4Z-tq(hxo{JmxA9kJirs2M6Rj3H zr8+*)7(WdapQ%2=FhEmO=ZC7Oy5WBhVB5qv@b$s)-LdVPA?=(vHocjS;XeDtOEdIP zt=o+qa)@EP6Pu73^cnm|fM3oVzvM}P5P8IliHH}k_qKl;((zEoU@3P)!v?{>{gb=v z9=Be&`u^QjKQd9c;ZeB3M>~`U%nrdq>FX89Pi6;Mg*3~wVoFHutdLE}b;EE)Hy0Q9 z_dL&ngiXv z(aZs6xnEr3n5PkDn%zW&ZzV5bL+^GmdmYTL2%ixaQRX}04g zasiuI3?0K{g&WB|vw!7##XL9D=W{43Dgm}dvD8znf8;$_{gdNreb*TcHM3hJOyKrY zDBRn*4$GnBAizp>$j0U?!h6k@(r78|3+?PwZOW2zsL1ug1CoJ-=JP^||9(SbMc7S*Wq2TcXnG>vF6Bv|5d%~057h9z@>k*4ZP{`RUd?bW`n(-q zM%2amgn-0Sgo;=B#4T|zP0KRve$6nPkGi03zCVmio9+oJU_8-lR=SBoNVi8MrA?sXI_u8a? zEH3hVdlbQ=f-DBtRp}V=cfeJESO*V-no0jKf=?}4F+u5HX;_IzBo7&^d#ua`wf7;c zVFl&=lEw>cP<;!Kji$M_D=g24x_`y1>mexK#!4x#<>3O~o#B(6XRvgwTO%4) ztgT4(_~hqo_01V|e=!!fxEiA>AFQsj*l`3SO6)56i)B9Z!&_7L z0*dMgZ&uURu?kPJU{1a1Ylh}jg2pE`*KtbU@d{;`_lduNCD-)c1cf1A*^f*zHCbA8 z3WeB0d>idd-uhkGDVX^eLG-Tq=D~op~?K^Ie7WvA@GmjX+L@C6OLs;j5 zfFZ(eV^;jS+>Nsf_+)fqVL63OFANSX!9_V&d8SJDg9`ax!((qESdy$g&id(W)(P}D zV3E5GTkhD?N#Z^y{$EYwlpuNap!DYyWMi{pCneR|@=>F8x0A|3T570m^ztfXRarV? z-B#e_rrbJgv`%WLl8mj@2CU&{?MSX2D93D1nh?mVXKK5qoJMm?EI3;7u@X&Wco~YF zS^8!H9!=ieA#9-C+IJHWAXAgt%DIg0$icF7TvJZ4-_5WLRL?Ny zAdK3Qp#oFP%lk9BE*d`|* zUZ^{~+>g6iHu`!YEwyCn?+Z_k_=}4uu@@IHb_>4sobP>G`^N%&n81Z<-EYFFOAf+3 z#ZEQ+n!9%-zx%-(Z1S7`w|^$b$$l75mmJQ0#LEmC$9Fz?7QaD!96b6Y-iTP}o5qy) OA-*$s%DIJGfd2wdi-vmu diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php deleted file mode 100644 index ca519f51d7a..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' -� -4google/cloud/recommender/v1/recommender_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"� -RecommenderConfig -name ( _ -recommender_generation_config ( 28.google.cloud.recommender.v1.RecommenderGenerationConfig -etag ( / - update_time ( 2.google.protobuf.Timestamp - revision_id ( B�A�AT - annotations ( 2?.google.cloud.recommender.v1.RecommenderConfig.AnnotationsEntry - display_name ( 2 -AnnotationsEntry -key (  -value ( :8:��A� -,recommender.googleapis.com/RecommenderConfigIprojects/{project}/locations/{location}/recommenders/{recommender}/configSorganizations/{organization}/locations/{location}/recommenders/{recommender}/configXbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config"F -RecommenderGenerationConfig\' -params ( 2.google.protobuf.StructB� -com.google.cloud.recommender.v1BRecommenderConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php deleted file mode 100644 index 5b48a3503c1..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php +++ /dev/null @@ -1,127 +0,0 @@ -internalAddGeneratedFile( - ' -�F -5google/cloud/recommender/v1/recommender_service.protogoogle.cloud.recommender.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto)google/cloud/recommender/v1/insight.proto5google/cloud/recommender/v1/insight_type_config.proto0google/cloud/recommender/v1/recommendation.proto4google/cloud/recommender/v1/recommender_config.proto google/protobuf/field_mask.proto"� -ListInsightsRequest> -parent ( B.�A�A( -&recommender.googleapis.com/InsightType - page_size (B�A - -page_token ( B�A -filter ( B�A"g -ListInsightsResponse6 -insights ( 2$.google.cloud.recommender.v1.Insight -next_page_token ( "M -GetInsightRequest8 -name ( B*�A�A$ -"recommender.googleapis.com/Insight"� -MarkInsightAcceptedRequest8 -name ( B*�A�A$ -"recommender.googleapis.com/Insightg -state_metadata ( 2J.google.cloud.recommender.v1.MarkInsightAcceptedRequest.StateMetadataEntryB�A -etag ( B�A4 -StateMetadataEntry -key (  -value ( :8"� -ListRecommendationsRequest> -parent ( B.�A�A( -&recommender.googleapis.com/Recommender - page_size (B�A - -page_token ( B�A -filter ( "| -ListRecommendationsResponseD -recommendations ( 2+.google.cloud.recommender.v1.Recommendation -next_page_token ( "[ -GetRecommendationRequest? -name ( B1�A�A+ -)recommender.googleapis.com/Recommendation"s -"MarkRecommendationDismissedRequest? -name ( B1�A�A+ -)recommender.googleapis.com/Recommendation -etag ( "� - MarkRecommendationClaimedRequest? -name ( B1�A�A+ -)recommender.googleapis.com/Recommendationh -state_metadata ( 2P.google.cloud.recommender.v1.MarkRecommendationClaimedRequest.StateMetadataEntry -etag ( B�A4 -StateMetadataEntry -key (  -value ( :8"� -"MarkRecommendationSucceededRequest? -name ( B1�A�A+ -)recommender.googleapis.com/Recommendationj -state_metadata ( 2R.google.cloud.recommender.v1.MarkRecommendationSucceededRequest.StateMetadataEntry -etag ( B�A4 -StateMetadataEntry -key (  -value ( :8"� -MarkRecommendationFailedRequest? -name ( B1�A�A+ -)recommender.googleapis.com/Recommendationg -state_metadata ( 2O.google.cloud.recommender.v1.MarkRecommendationFailedRequest.StateMetadataEntry -etag ( B�A4 -StateMetadataEntry -key (  -value ( :8"a -GetRecommenderConfigRequestB -name ( B4�A�A. -,recommender.googleapis.com/RecommenderConfig"� -UpdateRecommenderConfigRequestO -recommender_config ( 2..google.cloud.recommender.v1.RecommenderConfigB�A/ - update_mask ( 2.google.protobuf.FieldMask - validate_only ("a -GetInsightTypeConfigRequestB -name ( B4�A�A. -,recommender.googleapis.com/InsightTypeConfig"� -UpdateInsightTypeConfigRequestP -insight_type_config ( 2..google.cloud.recommender.v1.InsightTypeConfigB�A/ - update_mask ( 2.google.protobuf.FieldMask - validate_only (2�. - Recommender� - ListInsights0.google.cloud.recommender.v1.ListInsightsRequest1.google.cloud.recommender.v1.ListInsightsResponse"��Aparent����;/v1/{parent=projects/*/locations/*/insightTypes/*}/insightsZDB/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insightsZ<:/v1/{parent=folders/*/locations/*/insightTypes/*}/insightsZB@/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights� - -GetInsight..google.cloud.recommender.v1.GetInsightRequest$.google.cloud.recommender.v1.Insight"��Aname����;/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}ZDB/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}Z<:/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}ZB@/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}� -MarkInsightAccepted7.google.cloud.recommender.v1.MarkInsightAcceptedRequest$.google.cloud.recommender.v1.Insight"��Aname,state_metadata,etag����"H/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZT"O/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZL"G/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZR"M/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted:*� -ListRecommendations7.google.cloud.recommender.v1.ListRecommendationsRequest8.google.cloud.recommender.v1.ListRecommendationsResponse"��Aparent�A parent,filter����B/v1/{parent=projects/*/locations/*/recommenders/*}/recommendationsZKI/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendationsZCA/v1/{parent=folders/*/locations/*/recommenders/*}/recommendationsZIG/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations� -GetRecommendation5.google.cloud.recommender.v1.GetRecommendationRequest+.google.cloud.recommender.v1.Recommendation"��Aname����B/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}ZKI/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}ZCA/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}ZIG/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}� -MarkRecommendationDismissed?.google.cloud.recommender.v1.MarkRecommendationDismissedRequest+.google.cloud.recommender.v1.Recommendation"�����"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*� -MarkRecommendationClaimed=.google.cloud.recommender.v1.MarkRecommendationClaimedRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"N/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZZ"U/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZR"M/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZX"S/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*� -MarkRecommendationSucceeded?.google.cloud.recommender.v1.MarkRecommendationSucceededRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*� -MarkRecommendationFailed<.google.cloud.recommender.v1.MarkRecommendationFailedRequest+.google.cloud.recommender.v1.Recommendation"��Aname,state_metadata,etag����"M/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZY"T/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZQ"L/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZW"R/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed:*� -GetRecommenderConfig8.google.cloud.recommender.v1.GetRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"��Aname����7/v1/{name=projects/*/locations/*/recommenders/*/config}Z>/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}� -UpdateRecommenderConfig;.google.cloud.recommender.v1.UpdateRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"��Arecommender_config,update_mask����2J/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}:recommender_configZe2O/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}:recommender_configZg2Q/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}:recommender_config� -GetInsightTypeConfig8.google.cloud.recommender.v1.GetInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"��Aname����7/v1/{name=projects/*/locations/*/insightTypes/*/config}Z>/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}� -UpdateInsightTypeConfig;.google.cloud.recommender.v1.UpdateInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"��Ainsight_type_config,update_mask����2K/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}:insight_type_configZg2P/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}:insight_type_configZi2R/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}:insight_type_configN�Arecommender.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.recommender.v1BRecommenderProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb�CREC�Google.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php deleted file mode 100644 index e981e6aba9e..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.recommender.v1.CostProjection - */ -class CostProjection extends \Google\Protobuf\Internal\Message -{ - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - */ - protected $cost = null; - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - */ - protected $duration = null; - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - */ - protected $cost_in_local_currency = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Type\Money $cost - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * @type \Google\Protobuf\Duration $duration - * Duration for which this cost applies. - * @type \Google\Type\Money $cost_in_local_currency - * The approximate cost savings in the billing account's local currency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - * @return \Google\Type\Money|null - */ - public function getCost() - { - return $this->cost; - } - - public function hasCost() - { - return isset($this->cost); - } - - public function clearCost() - { - unset($this->cost); - } - - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - * @param \Google\Type\Money $var - * @return $this - */ - public function setCost($var) - { - GPBUtil::checkMessage($var, \Google\Type\Money::class); - $this->cost = $var; - - return $this; - } - - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - * @return \Google\Type\Money|null - */ - public function getCostInLocalCurrency() - { - return $this->cost_in_local_currency; - } - - public function hasCostInLocalCurrency() - { - return isset($this->cost_in_local_currency); - } - - public function clearCostInLocalCurrency() - { - unset($this->cost_in_local_currency); - } - - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - * @param \Google\Type\Money $var - * @return $this - */ - public function setCostInLocalCurrency($var) - { - GPBUtil::checkMessage($var, \Google\Type\Money::class); - $this->cost_in_local_currency = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php deleted file mode 100644 index 4eefd045c8d..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.GetInsightRequest - */ -class GetInsightRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the insight. Please see - * {@see RecommenderClient::insightName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetInsightRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the insight. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the insight. - * - * 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. Name of the insight. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php deleted file mode 100644 index cf71aa698a6..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.GetInsightTypeConfigRequest - */ -class GetInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the InsightTypeConfig to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * Please see {@see RecommenderClient::insightTypeConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetInsightTypeConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * 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. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php deleted file mode 100644 index b15ce7896af..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.GetRecommendationRequest - */ -class GetRecommendationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetRecommendationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * 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. Name of the recommendation. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php deleted file mode 100644 index ff82145c37d..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.GetRecommenderConfigRequest - */ -class GetRecommenderConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the Recommendation Config to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * Please see {@see RecommenderClient::recommenderConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetRecommenderConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * 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. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php deleted file mode 100644 index 1ae4e114791..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.recommender.v1.Impact - */ -class Impact extends \Google\Protobuf\Internal\Message -{ - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - */ - protected $category = 0; - protected $projection; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $category - * Category that is being targeted. - * @type \Google\Cloud\Recommender\V1\CostProjection $cost_projection - * Use with CategoryType.COST - * @type \Google\Cloud\Recommender\V1\SecurityProjection $security_projection - * Use with CategoryType.SECURITY - * @type \Google\Cloud\Recommender\V1\SustainabilityProjection $sustainability_projection - * Use with CategoryType.SUSTAINABILITY - * @type \Google\Cloud\Recommender\V1\ReliabilityProjection $reliability_projection - * Use with CategoryType.RELIABILITY - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - * @return int - */ - public function getCategory() - { - return $this->category; - } - - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - * @param int $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Impact\Category::class); - $this->category = $var; - - return $this; - } - - /** - * Use with CategoryType.COST - * - * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; - * @return \Google\Cloud\Recommender\V1\CostProjection|null - */ - public function getCostProjection() - { - return $this->readOneof(100); - } - - public function hasCostProjection() - { - return $this->hasOneof(100); - } - - /** - * Use with CategoryType.COST - * - * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; - * @param \Google\Cloud\Recommender\V1\CostProjection $var - * @return $this - */ - public function setCostProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\CostProjection::class); - $this->writeOneof(100, $var); - - return $this; - } - - /** - * Use with CategoryType.SECURITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; - * @return \Google\Cloud\Recommender\V1\SecurityProjection|null - */ - public function getSecurityProjection() - { - return $this->readOneof(101); - } - - public function hasSecurityProjection() - { - return $this->hasOneof(101); - } - - /** - * Use with CategoryType.SECURITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; - * @param \Google\Cloud\Recommender\V1\SecurityProjection $var - * @return $this - */ - public function setSecurityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SecurityProjection::class); - $this->writeOneof(101, $var); - - return $this; - } - - /** - * Use with CategoryType.SUSTAINABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; - * @return \Google\Cloud\Recommender\V1\SustainabilityProjection|null - */ - public function getSustainabilityProjection() - { - return $this->readOneof(102); - } - - public function hasSustainabilityProjection() - { - return $this->hasOneof(102); - } - - /** - * Use with CategoryType.SUSTAINABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; - * @param \Google\Cloud\Recommender\V1\SustainabilityProjection $var - * @return $this - */ - public function setSustainabilityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SustainabilityProjection::class); - $this->writeOneof(102, $var); - - return $this; - } - - /** - * Use with CategoryType.RELIABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; - * @return \Google\Cloud\Recommender\V1\ReliabilityProjection|null - */ - public function getReliabilityProjection() - { - return $this->readOneof(103); - } - - public function hasReliabilityProjection() - { - return $this->hasOneof(103); - } - - /** - * Use with CategoryType.RELIABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; - * @param \Google\Cloud\Recommender\V1\ReliabilityProjection $var - * @return $this - */ - public function setReliabilityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ReliabilityProjection::class); - $this->writeOneof(103, $var); - - return $this; - } - - /** - * @return string - */ - public function getProjection() - { - return $this->whichOneof("projection"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php deleted file mode 100644 index 3edc36ada2d..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.recommender.v1.Impact.Category - */ -class Category -{ - /** - * Default unspecified category. Don't use directly. - * - * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; - */ - const CATEGORY_UNSPECIFIED = 0; - /** - * Indicates a potential increase or decrease in cost. - * - * Generated from protobuf enum COST = 1; - */ - const COST = 1; - /** - * Indicates a potential increase or decrease in security. - * - * Generated from protobuf enum SECURITY = 2; - */ - const SECURITY = 2; - /** - * Indicates a potential increase or decrease in performance. - * - * Generated from protobuf enum PERFORMANCE = 3; - */ - const PERFORMANCE = 3; - /** - * Indicates a potential increase or decrease in manageability. - * - * Generated from protobuf enum MANAGEABILITY = 4; - */ - const MANAGEABILITY = 4; - /** - * Indicates a potential increase or decrease in sustainability. - * - * Generated from protobuf enum SUSTAINABILITY = 5; - */ - const SUSTAINABILITY = 5; - /** - * Indicates a potential increase or decrease in reliability. - * - * Generated from protobuf enum RELIABILITY = 6; - */ - const RELIABILITY = 6; - - private static $valueToName = [ - self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', - self::COST => 'COST', - self::SECURITY => 'SECURITY', - self::PERFORMANCE => 'PERFORMANCE', - self::MANAGEABILITY => 'MANAGEABILITY', - self::SUSTAINABILITY => 'SUSTAINABILITY', - self::RELIABILITY => 'RELIABILITY', - ]; - - 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(Category::class, \Google\Cloud\Recommender\V1\Impact_Category::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php deleted file mode 100644 index 544481b24ea..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php +++ /dev/null @@ -1,502 +0,0 @@ -google.cloud.recommender.v1.Insight - */ -class Insight extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - */ - private $target_resources; - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - */ - protected $insight_subtype = ''; - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - */ - protected $content = null; - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - */ - protected $last_refresh_time = null; - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - */ - protected $observation_period = null; - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - */ - protected $state_info = null; - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - */ - protected $category = 0; - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - */ - protected $severity = 0; - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - */ - private $associated_recommendations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the insight. - * @type string $description - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_resources - * Fully qualified resource names that this insight is targeting. - * @type string $insight_subtype - * Insight subtype. Insight content schema will be stable for a given subtype. - * @type \Google\Protobuf\Struct $content - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * @type \Google\Protobuf\Timestamp $last_refresh_time - * Timestamp of the latest data used to generate the insight. - * @type \Google\Protobuf\Duration $observation_period - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * @type \Google\Cloud\Recommender\V1\InsightStateInfo $state_info - * Information state and metadata. - * @type int $category - * Category being targeted by the insight. - * @type int $severity - * Insight's severity. - * @type string $etag - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * @type array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $associated_recommendations - * Recommendations derived from this insight. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetResources() - { - return $this->target_resources; - } - - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetResources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->target_resources = $arr; - - return $this; - } - - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - * @return string - */ - public function getInsightSubtype() - { - return $this->insight_subtype; - } - - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - * @param string $var - * @return $this - */ - public function setInsightSubtype($var) - { - GPBUtil::checkString($var, True); - $this->insight_subtype = $var; - - return $this; - } - - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - * @return \Google\Protobuf\Struct|null - */ - public function getContent() - { - return $this->content; - } - - public function hasContent() - { - return isset($this->content); - } - - public function clearContent() - { - unset($this->content); - } - - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->content = $var; - - return $this; - } - - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastRefreshTime() - { - return $this->last_refresh_time; - } - - public function hasLastRefreshTime() - { - return isset($this->last_refresh_time); - } - - public function clearLastRefreshTime() - { - unset($this->last_refresh_time); - } - - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastRefreshTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_refresh_time = $var; - - return $this; - } - - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - * @return \Google\Protobuf\Duration|null - */ - public function getObservationPeriod() - { - return $this->observation_period; - } - - public function hasObservationPeriod() - { - return isset($this->observation_period); - } - - public function clearObservationPeriod() - { - unset($this->observation_period); - } - - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setObservationPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->observation_period = $var; - - return $this; - } - - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - * @return \Google\Cloud\Recommender\V1\InsightStateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - * @param \Google\Cloud\Recommender\V1\InsightStateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightStateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - * @return int - */ - public function getCategory() - { - return $this->category; - } - - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - * @param int $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Category::class); - $this->category = $var; - - return $this; - } - - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Severity::class); - $this->severity = $var; - - return $this; - } - - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssociatedRecommendations() - { - return $this->associated_recommendations; - } - - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - * @param array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssociatedRecommendations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight\RecommendationReference::class); - $this->associated_recommendations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php deleted file mode 100644 index 2bd1978a801..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.recommender.v1.Insight.Category - */ -class Category -{ - /** - * Unspecified category. - * - * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; - */ - const CATEGORY_UNSPECIFIED = 0; - /** - * The insight is related to cost. - * - * Generated from protobuf enum COST = 1; - */ - const COST = 1; - /** - * The insight is related to security. - * - * Generated from protobuf enum SECURITY = 2; - */ - const SECURITY = 2; - /** - * The insight is related to performance. - * - * Generated from protobuf enum PERFORMANCE = 3; - */ - const PERFORMANCE = 3; - /** - * This insight is related to manageability. - * - * Generated from protobuf enum MANAGEABILITY = 4; - */ - const MANAGEABILITY = 4; - /** - * The insight is related to sustainability. - * - * Generated from protobuf enum SUSTAINABILITY = 5; - */ - const SUSTAINABILITY = 5; - /** - * This insight is related to reliability. - * - * Generated from protobuf enum RELIABILITY = 6; - */ - const RELIABILITY = 6; - - private static $valueToName = [ - self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', - self::COST => 'COST', - self::SECURITY => 'SECURITY', - self::PERFORMANCE => 'PERFORMANCE', - self::MANAGEABILITY => 'MANAGEABILITY', - self::SUSTAINABILITY => 'SUSTAINABILITY', - self::RELIABILITY => 'RELIABILITY', - ]; - - 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(Category::class, \Google\Cloud\Recommender\V1\Insight_Category::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php deleted file mode 100644 index 2b8fdf78c01..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.recommender.v1.Insight.RecommendationReference - */ -class RecommendationReference extends \Google\Protobuf\Internal\Message -{ - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - */ - protected $recommendation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $recommendation - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - * @return string - */ - public function getRecommendation() - { - return $this->recommendation; - } - - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - * @param string $var - * @return $this - */ - public function setRecommendation($var) - { - GPBUtil::checkString($var, True); - $this->recommendation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RecommendationReference::class, \Google\Cloud\Recommender\V1\Insight_RecommendationReference::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php deleted file mode 100644 index 4370e3d0118..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recommender.v1.Insight.Severity - */ -class Severity -{ - /** - * Insight has unspecified severity. - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * Insight has low severity. - * - * Generated from protobuf enum LOW = 1; - */ - const LOW = 1; - /** - * Insight has medium severity. - * - * Generated from protobuf enum MEDIUM = 2; - */ - const MEDIUM = 2; - /** - * Insight has high severity. - * - * Generated from protobuf enum HIGH = 3; - */ - const HIGH = 3; - /** - * Insight has critical severity. - * - * Generated from protobuf enum CRITICAL = 4; - */ - const CRITICAL = 4; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::LOW => 'LOW', - self::MEDIUM => 'MEDIUM', - self::HIGH => 'HIGH', - self::CRITICAL => 'CRITICAL', - ]; - - 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(Severity::class, \Google\Cloud\Recommender\V1\Insight_Severity::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php deleted file mode 100644 index e34f0b84d94..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.InsightStateInfo - */ -class InsightStateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - */ - protected $state = 0; - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Insight state. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * A map of metadata for the state, provided by user or automations systems. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\InsightStateInfo\State::class); - $this->state = $var; - - return $this; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php deleted file mode 100644 index 648ce14b459..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.recommender.v1.InsightStateInfo.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Insight is active. Content for ACTIVE insights can be updated by Google. - * ACTIVE insights can be marked DISMISSED OR ACCEPTED. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Some action has been taken based on this insight. Insights become - * accepted when a recommendation derived from the insight has been marked - * CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked - * ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED - * insights can only be marked ACCEPTED (which may update state metadata). - * - * Generated from protobuf enum ACCEPTED = 2; - */ - const ACCEPTED = 2; - /** - * Insight is dismissed. Content for DISMISSED insights can be updated by - * Google. DISMISSED insights can be marked as ACTIVE. - * - * Generated from protobuf enum DISMISSED = 3; - */ - const DISMISSED = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::ACCEPTED => 'ACCEPTED', - self::DISMISSED => 'DISMISSED', - ]; - - 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(State::class, \Google\Cloud\Recommender\V1\InsightStateInfo_State::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php deleted file mode 100644 index dc2cf99dabc..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php +++ /dev/null @@ -1,347 +0,0 @@ -google.cloud.recommender.v1.InsightTypeConfig - */ -class InsightTypeConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - */ - protected $insight_type_generation_config = null; - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - */ - private $annotations; - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * @type \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $insight_type_generation_config - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * @type string $etag - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * @type \Google\Protobuf\Timestamp $update_time - * Last time when the config was updated. - * @type string $revision_id - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * @type string $display_name - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - * @return \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig|null - */ - public function getInsightTypeGenerationConfig() - { - return $this->insight_type_generation_config; - } - - public function hasInsightTypeGenerationConfig() - { - return isset($this->insight_type_generation_config); - } - - public function clearInsightTypeGenerationConfig() - { - unset($this->insight_type_generation_config); - } - - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - * @param \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $var - * @return $this - */ - public function setInsightTypeGenerationConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig::class); - $this->insight_type_generation_config = $var; - - return $this; - } - - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @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); - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php deleted file mode 100644 index 93d2117a35c..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.recommender.v1.InsightTypeGenerationConfig - */ -class InsightTypeGenerationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - */ - protected $params = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $params - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @return \Google\Protobuf\Struct|null - */ - public function getParams() - { - return $this->params; - } - - public function hasParams() - { - return isset($this->params); - } - - public function clearParams() - { - unset($this->params); - } - - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParams($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php deleted file mode 100644 index d61b254dc69..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php +++ /dev/null @@ -1,319 +0,0 @@ -google.cloud.recommender.v1.ListInsightsRequest - */ -class ListInsightsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. Please see - * {@see RecommenderClient::insightTypeName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\ListInsightsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * @type string $page_token - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * @type string $filter - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * 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 container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * 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. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * 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. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * 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. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php deleted file mode 100644 index 559624b870f..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommender.v1.ListInsightsResponse - */ -class ListInsightsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - */ - private $insights; - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $insights - * The set of insights for the `parent` resource. - * @type string $next_page_token - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInsights() - { - return $this->insights; - } - - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - * @param array<\Google\Cloud\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInsights($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight::class); - $this->insights = $arr; - - return $this; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php deleted file mode 100644 index 4d1306e50f4..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php +++ /dev/null @@ -1,378 +0,0 @@ -google.cloud.recommender.v1.ListRecommendationsRequest - */ -class ListRecommendationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. Please see - * {@see RecommenderClient::recommenderName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. Please see - * {@see RecommenderClient::recommenderName()} for help formatting this field. - * @param string $filter Filter expression to restrict the recommendations returned. Supported - * filter fields: - * - * * `state_info.state` - * - * * `recommenderSubtype` - * - * * `priority` - * - * * `targetResources` - * - * Examples: - * - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * - * * `priority = P1 OR priority = P2` - * - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * - * The max allowed filter length is 500 characters. - * - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest - * - * @experimental - */ - public static function buildFromParentFilter(string $parent, string $filter): self - { - return (new self()) - ->setParent($parent) - ->setFilter($filter); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * @type string $page_token - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * @type string $filter - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * 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 container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * 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. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * 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. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * 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; - } - - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php deleted file mode 100644 index e1f49c49e2b..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommender.v1.ListRecommendationsResponse - */ -class ListRecommendationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - */ - private $recommendations; - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $recommendations - * The set of recommendations for the `parent` resource. - * @type string $next_page_token - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRecommendations() - { - return $this->recommendations; - } - - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - * @param array<\Google\Cloud\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRecommendations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation::class); - $this->recommendations = $arr; - - return $this; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php deleted file mode 100644 index 44812d4b120..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.recommender.v1.MarkInsightAcceptedRequest - */ -class MarkInsightAcceptedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the insight. Please see - * {@see RecommenderClient::insightName()} for help formatting this field. - * @param array $stateMetadata Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * @param string $etag Required. Fingerprint of the Insight. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkInsightAcceptedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the insight. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * @type string $etag - * Required. Fingerprint of the Insight. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the insight. - * - * 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. Name of the insight. - * - * 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; - } - - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php deleted file mode 100644 index a95547ef0f1..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationClaimedRequest - */ -class MarkRecommendationClaimedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationClaimedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * 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. Name of the recommendation. - * - * 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; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php deleted file mode 100644 index 41cc6032bab..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationDismissedRequest - */ -class MarkRecommendationDismissedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type string $etag - * Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * 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. Name of the recommendation. - * - * 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; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php deleted file mode 100644 index 9130a402746..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationFailedRequest - */ -class MarkRecommendationFailedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationFailedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * 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. Name of the recommendation. - * - * 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; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php deleted file mode 100644 index 5d95a39fbe7..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationSucceededRequest - */ -class MarkRecommendationSucceededRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationSucceededRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * 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. Name of the recommendation. - * - * 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; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php deleted file mode 100644 index 096085bea6f..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php +++ /dev/null @@ -1,564 +0,0 @@ -google.cloud.recommender.v1.Operation - */ -class Operation extends \Google\Protobuf\Internal\Message -{ - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - */ - protected $action = ''; - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - */ - protected $resource_type = ''; - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - */ - protected $resource = ''; - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - */ - protected $path = ''; - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - */ - protected $source_resource = ''; - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - */ - protected $source_path = ''; - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - */ - private $path_filters; - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - */ - private $path_value_matchers; - protected $path_value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $action - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * @type string $resource_type - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * @type string $resource - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * @type string $path - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * @type string $source_resource - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * @type string $source_path - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * @type \Google\Protobuf\Value $value - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * @type \Google\Cloud\Recommender\V1\ValueMatcher $value_matcher - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * @type array|\Google\Protobuf\Internal\MapField $path_filters - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * @type array|\Google\Protobuf\Internal\MapField $path_value_matchers - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - * @param string $var - * @return $this - */ - public function setAction($var) - { - GPBUtil::checkString($var, True); - $this->action = $var; - - return $this; - } - - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - * @return string - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - * @param string $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkString($var, True); - $this->resource_type = $var; - - return $this; - } - - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - * @return string - */ - public function getSourceResource() - { - return $this->source_resource; - } - - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - * @param string $var - * @return $this - */ - public function setSourceResource($var) - { - GPBUtil::checkString($var, True); - $this->source_resource = $var; - - return $this; - } - - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - * @return string - */ - public function getSourcePath() - { - return $this->source_path; - } - - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - * @param string $var - * @return $this - */ - public function setSourcePath($var) - { - GPBUtil::checkString($var, True); - $this->source_path = $var; - - return $this; - } - - /** - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * - * Generated from protobuf field .google.protobuf.Value value = 7; - * @return \Google\Protobuf\Value|null - */ - public function getValue() - { - return $this->readOneof(7); - } - - public function hasValue() - { - return $this->hasOneof(7); - } - - /** - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * - * Generated from protobuf field .google.protobuf.Value value = 7; - * @param \Google\Protobuf\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * - * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; - * @return \Google\Cloud\Recommender\V1\ValueMatcher|null - */ - public function getValueMatcher() - { - return $this->readOneof(10); - } - - public function hasValueMatcher() - { - return $this->hasOneof(10); - } - - /** - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * - * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; - * @param \Google\Cloud\Recommender\V1\ValueMatcher $var - * @return $this - */ - public function setValueMatcher($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ValueMatcher::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPathFilters() - { - return $this->path_filters; - } - - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPathFilters($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->path_filters = $arr; - - return $this; - } - - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPathValueMatchers() - { - return $this->path_value_matchers; - } - - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPathValueMatchers($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\ValueMatcher::class); - $this->path_value_matchers = $arr; - - return $this; - } - - /** - * @return string - */ - public function getPathValue() - { - return $this->whichOneof("path_value"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php deleted file mode 100644 index f074d103714..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommender.v1.OperationGroup - */ -class OperationGroup extends \Google\Protobuf\Internal\Message -{ - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - */ - private $operations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $operations - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOperations() - { - return $this->operations; - } - - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - * @param array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOperations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Operation::class); - $this->operations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php deleted file mode 100644 index 0883027776d..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php +++ /dev/null @@ -1,546 +0,0 @@ -google.cloud.recommender.v1.Recommendation - */ -class Recommendation extends \Google\Protobuf\Internal\Message -{ - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - */ - protected $recommender_subtype = ''; - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - */ - protected $last_refresh_time = null; - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - */ - protected $primary_impact = null; - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - */ - private $additional_impact; - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - */ - protected $priority = 0; - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - */ - protected $content = null; - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - */ - protected $state_info = null; - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - */ - private $associated_insights; - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - */ - protected $xor_group_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of recommendation. - * @type string $description - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * @type string $recommender_subtype - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * @type \Google\Protobuf\Timestamp $last_refresh_time - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * @type \Google\Cloud\Recommender\V1\Impact $primary_impact - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * @type array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $additional_impact - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * @type int $priority - * Recommendation's priority. - * @type \Google\Cloud\Recommender\V1\RecommendationContent $content - * Content of the recommendation describing recommended changes to resources. - * @type \Google\Cloud\Recommender\V1\RecommendationStateInfo $state_info - * Information for state. Contains state and metadata. - * @type string $etag - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * @type array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $associated_insights - * Insights that led to this recommendation. - * @type string $xor_group_id - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - * @return string - */ - public function getRecommenderSubtype() - { - return $this->recommender_subtype; - } - - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - * @param string $var - * @return $this - */ - public function setRecommenderSubtype($var) - { - GPBUtil::checkString($var, True); - $this->recommender_subtype = $var; - - return $this; - } - - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastRefreshTime() - { - return $this->last_refresh_time; - } - - public function hasLastRefreshTime() - { - return isset($this->last_refresh_time); - } - - public function clearLastRefreshTime() - { - unset($this->last_refresh_time); - } - - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastRefreshTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_refresh_time = $var; - - return $this; - } - - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - * @return \Google\Cloud\Recommender\V1\Impact|null - */ - public function getPrimaryImpact() - { - return $this->primary_impact; - } - - public function hasPrimaryImpact() - { - return isset($this->primary_impact); - } - - public function clearPrimaryImpact() - { - unset($this->primary_impact); - } - - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - * @param \Google\Cloud\Recommender\V1\Impact $var - * @return $this - */ - public function setPrimaryImpact($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\Impact::class); - $this->primary_impact = $var; - - return $this; - } - - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdditionalImpact() - { - return $this->additional_impact; - } - - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - * @param array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdditionalImpact($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Impact::class); - $this->additional_impact = $arr; - - return $this; - } - - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Recommendation\Priority::class); - $this->priority = $var; - - return $this; - } - - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - * @return \Google\Cloud\Recommender\V1\RecommendationContent|null - */ - public function getContent() - { - return $this->content; - } - - public function hasContent() - { - return isset($this->content); - } - - public function clearContent() - { - unset($this->content); - } - - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - * @param \Google\Cloud\Recommender\V1\RecommendationContent $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationContent::class); - $this->content = $var; - - return $this; - } - - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - * @return \Google\Cloud\Recommender\V1\RecommendationStateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - * @param \Google\Cloud\Recommender\V1\RecommendationStateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssociatedInsights() - { - return $this->associated_insights; - } - - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - * @param array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssociatedInsights($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation\InsightReference::class); - $this->associated_insights = $arr; - - return $this; - } - - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - * @return string - */ - public function getXorGroupId() - { - return $this->xor_group_id; - } - - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - * @param string $var - * @return $this - */ - public function setXorGroupId($var) - { - GPBUtil::checkString($var, True); - $this->xor_group_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php deleted file mode 100644 index bbf72313b89..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.recommender.v1.Recommendation.InsightReference - */ -class InsightReference extends \Google\Protobuf\Internal\Message -{ - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - */ - protected $insight = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $insight - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - * @return string - */ - public function getInsight() - { - return $this->insight; - } - - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - * @param string $var - * @return $this - */ - public function setInsight($var) - { - GPBUtil::checkString($var, True); - $this->insight = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InsightReference::class, \Google\Cloud\Recommender\V1\Recommendation_InsightReference::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php deleted file mode 100644 index 0077380a565..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recommender.v1.Recommendation.Priority - */ -class Priority -{ - /** - * Recommendation has unspecified priority. - * - * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; - */ - const PRIORITY_UNSPECIFIED = 0; - /** - * Recommendation has P4 priority (lowest priority). - * - * Generated from protobuf enum P4 = 1; - */ - const P4 = 1; - /** - * Recommendation has P3 priority (second lowest priority). - * - * Generated from protobuf enum P3 = 2; - */ - const P3 = 2; - /** - * Recommendation has P2 priority (second highest priority). - * - * Generated from protobuf enum P2 = 3; - */ - const P2 = 3; - /** - * Recommendation has P1 priority (highest priority). - * - * Generated from protobuf enum P1 = 4; - */ - const P1 = 4; - - private static $valueToName = [ - self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', - self::P4 => 'P4', - self::P3 => 'P3', - self::P2 => 'P2', - self::P1 => 'P1', - ]; - - 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(Priority::class, \Google\Cloud\Recommender\V1\Recommendation_Priority::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php deleted file mode 100644 index 8f9bc53a3a9..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.recommender.v1.RecommendationContent - */ -class RecommendationContent extends \Google\Protobuf\Internal\Message -{ - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - */ - private $operation_groups; - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - */ - protected $overview = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $operation_groups - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * @type \Google\Protobuf\Struct $overview - * Condensed overview information about the recommendation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOperationGroups() - { - return $this->operation_groups; - } - - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - * @param array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOperationGroups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\OperationGroup::class); - $this->operation_groups = $arr; - - return $this; - } - - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - * @return \Google\Protobuf\Struct|null - */ - public function getOverview() - { - return $this->overview; - } - - public function hasOverview() - { - return isset($this->overview); - } - - public function clearOverview() - { - unset($this->overview); - } - - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setOverview($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->overview = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php deleted file mode 100644 index af3d2fa1cc7..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.RecommendationStateInfo - */ -class RecommendationStateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - */ - protected $state = 0; - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * A map of metadata for the state, provided by user or automations systems. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo\State::class); - $this->state = $var; - - return $this; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php deleted file mode 100644 index 4813573e86d..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php +++ /dev/null @@ -1,95 +0,0 @@ -google.cloud.recommender.v1.RecommendationStateInfo.State - */ -class State -{ - /** - * Default state. Don't use directly. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Recommendation is active and can be applied. Recommendations content can - * be updated by Google. - * ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Recommendation is in claimed state. Recommendations content is - * immutable and cannot be updated by Google. - * CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - * - * Generated from protobuf enum CLAIMED = 6; - */ - const CLAIMED = 6; - /** - * Recommendation is in succeeded state. Recommendations content is - * immutable and cannot be updated by Google. - * SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * Recommendation is in failed state. Recommendations content is immutable - * and cannot be updated by Google. - * FAILED recommendations can be marked as SUCCEEDED, or FAILED. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * Recommendation is in dismissed state. Recommendation content can be - * updated by Google. - * DISMISSED recommendations can be marked as ACTIVE. - * - * Generated from protobuf enum DISMISSED = 5; - */ - const DISMISSED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::CLAIMED => 'CLAIMED', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::DISMISSED => 'DISMISSED', - ]; - - 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(State::class, \Google\Cloud\Recommender\V1\RecommendationStateInfo_State::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php deleted file mode 100644 index 8e6b676d255..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php +++ /dev/null @@ -1,347 +0,0 @@ -google.cloud.recommender.v1.RecommenderConfig - */ -class RecommenderConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - */ - protected $recommender_generation_config = null; - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - */ - private $annotations; - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * @type \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $recommender_generation_config - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * @type string $etag - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * @type \Google\Protobuf\Timestamp $update_time - * Last time when the config was updated. - * @type string $revision_id - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * @type string $display_name - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); - parent::__construct($data); - } - - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - * @return \Google\Cloud\Recommender\V1\RecommenderGenerationConfig|null - */ - public function getRecommenderGenerationConfig() - { - return $this->recommender_generation_config; - } - - public function hasRecommenderGenerationConfig() - { - return isset($this->recommender_generation_config); - } - - public function clearRecommenderGenerationConfig() - { - unset($this->recommender_generation_config); - } - - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - * @param \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $var - * @return $this - */ - public function setRecommenderGenerationConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderGenerationConfig::class); - $this->recommender_generation_config = $var; - - return $this; - } - - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @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); - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php deleted file mode 100644 index 7c2e642c0a8..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.recommender.v1.RecommenderGenerationConfig - */ -class RecommenderGenerationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - */ - protected $params = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $params - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); - parent::__construct($data); - } - - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @return \Google\Protobuf\Struct|null - */ - public function getParams() - { - return $this->params; - } - - public function hasParams() - { - return isset($this->params); - } - - public function clearParams() - { - unset($this->params); - } - - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParams($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php deleted file mode 100644 index 10f00f46f49..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.ReliabilityProjection - */ -class ReliabilityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - */ - private $risks; - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - */ - protected $details = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $risks - * Reliability risks mitigated by this recommendation. - * @type \Google\Protobuf\Struct $details - * Per-recommender projection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRisks() - { - return $this->risks; - } - - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRisks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Recommender\V1\ReliabilityProjection\RiskType::class); - $this->risks = $arr; - - return $this; - } - - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @return \Google\Protobuf\Struct|null - */ - public function getDetails() - { - return $this->details; - } - - public function hasDetails() - { - return isset($this->details); - } - - public function clearDetails() - { - unset($this->details); - } - - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->details = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php deleted file mode 100644 index 3f37986fd3a..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.recommender.v1.ReliabilityProjection.RiskType - */ -class RiskType -{ - /** - * Default unspecified risk. Don't use directly. - * - * Generated from protobuf enum RISK_TYPE_UNSPECIFIED = 0; - */ - const RISK_TYPE_UNSPECIFIED = 0; - /** - * Potential service downtime. - * - * Generated from protobuf enum SERVICE_DISRUPTION = 1; - */ - const SERVICE_DISRUPTION = 1; - /** - * Potential data loss. - * - * Generated from protobuf enum DATA_LOSS = 2; - */ - const DATA_LOSS = 2; - /** - * Potential access denial. The service is still up but some or all clients - * can't access it. - * - * Generated from protobuf enum ACCESS_DENY = 3; - */ - const ACCESS_DENY = 3; - - private static $valueToName = [ - self::RISK_TYPE_UNSPECIFIED => 'RISK_TYPE_UNSPECIFIED', - self::SERVICE_DISRUPTION => 'SERVICE_DISRUPTION', - self::DATA_LOSS => 'DATA_LOSS', - self::ACCESS_DENY => 'ACCESS_DENY', - ]; - - 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(RiskType::class, \Google\Cloud\Recommender\V1\ReliabilityProjection_RiskType::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php deleted file mode 100644 index dffe739191c..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.recommender.v1.SecurityProjection - */ -class SecurityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - */ - protected $details = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $details - * Additional security impact details that is provided by the recommender. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @return \Google\Protobuf\Struct|null - */ - public function getDetails() - { - return $this->details; - } - - public function hasDetails() - { - return isset($this->details); - } - - public function clearDetails() - { - unset($this->details); - } - - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->details = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php deleted file mode 100644 index a1d4678563e..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.recommender.v1.SustainabilityProjection - */ -class SustainabilityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - */ - protected $kg_c_o2e = 0.0; - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - */ - protected $duration = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $kg_c_o2e - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * @type \Google\Protobuf\Duration $duration - * Duration for which this sustainability applies. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - * @return float - */ - public function getKgCO2E() - { - return $this->kg_c_o2e; - } - - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - * @param float $var - * @return $this - */ - public function setKgCO2E($var) - { - GPBUtil::checkDouble($var); - $this->kg_c_o2e = $var; - - return $this; - } - - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php deleted file mode 100644 index 6c402f186c4..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.recommender.v1.UpdateInsightTypeConfigRequest - */ -class UpdateInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $insight_type_config = null; - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig Required. The InsightTypeConfig to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setInsightTypeConfig($insightTypeConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Recommender\V1\InsightTypeConfig $insight_type_config - * Required. The InsightTypeConfig to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. - * @type bool $validate_only - * If true, validate the request and preview the change, but do not actually - * update it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Recommender\V1\InsightTypeConfig|null - */ - public function getInsightTypeConfig() - { - return $this->insight_type_config; - } - - public function hasInsightTypeConfig() - { - return isset($this->insight_type_config); - } - - public function clearInsightTypeConfig() - { - unset($this->insight_type_config); - } - - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $var - * @return $this - */ - public function setInsightTypeConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeConfig::class); - $this->insight_type_config = $var; - - return $this; - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php deleted file mode 100644 index 9977e4f6fef..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.recommender.v1.UpdateRecommenderConfigRequest - */ -class UpdateRecommenderConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $recommender_config = null; - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig Required. The RecommenderConfig to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Recommender\V1\UpdateRecommenderConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setRecommenderConfig($recommenderConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Recommender\V1\RecommenderConfig $recommender_config - * Required. The RecommenderConfig to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. - * @type bool $validate_only - * If true, validate the request and preview the change, but do not actually - * update it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Recommender\V1\RecommenderConfig|null - */ - public function getRecommenderConfig() - { - return $this->recommender_config; - } - - public function hasRecommenderConfig() - { - return isset($this->recommender_config); - } - - public function clearRecommenderConfig() - { - unset($this->recommender_config); - } - - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Recommender\V1\RecommenderConfig $var - * @return $this - */ - public function setRecommenderConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderConfig::class); - $this->recommender_config = $var; - - return $this; - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php deleted file mode 100644 index eac350eddd6..00000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.ValueMatcher - */ -class ValueMatcher extends \Google\Protobuf\Internal\Message -{ - protected $match_variant; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $matches_pattern - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * - * Generated from protobuf field string matches_pattern = 1; - * @return string - */ - public function getMatchesPattern() - { - return $this->readOneof(1); - } - - public function hasMatchesPattern() - { - return $this->hasOneof(1); - } - - /** - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * - * Generated from protobuf field string matches_pattern = 1; - * @param string $var - * @return $this - */ - public function setMatchesPattern($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getMatchVariant() - { - return $this->whichOneof("match_variant"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php deleted file mode 100644 index ca0fcc05602..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Insight $response */ - $response = $recommenderClient->getInsight($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]', - '[INSIGHT]' - ); - - get_insight_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php deleted file mode 100644 index 3f12da7b22e..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var InsightTypeConfig $response */ - $response = $recommenderClient->getInsightTypeConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightTypeConfigName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]' - ); - - get_insight_type_config_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php deleted file mode 100644 index 6df89a5b303..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Recommendation $response */ - $response = $recommenderClient->getRecommendation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - - get_recommendation_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php deleted file mode 100644 index 510d1a8a891..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var RecommenderConfig $response */ - $response = $recommenderClient->getRecommenderConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommenderConfigName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]' - ); - - get_recommender_config_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php deleted file mode 100644 index 55fbe9d1904..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php +++ /dev/null @@ -1,93 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recommenderClient->listInsights($request); - - /** @var Insight $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecommenderClient::insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - - list_insights_sample($formattedParent); -} -// [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php deleted file mode 100644 index a71ddddb6f9..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php +++ /dev/null @@ -1,93 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $recommenderClient->listRecommendations($request); - - /** @var Recommendation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecommenderClient::recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - - list_recommendations_sample($formattedParent); -} -// [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php deleted file mode 100644 index 8625b5b6fb1..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName) - ->setEtag($etag); - - // Call the API and handle any network failures. - try { - /** @var Insight $response */ - $response = $recommenderClient->markInsightAccepted($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]', - '[INSIGHT]' - ); - $etag = '[ETAG]'; - - mark_insight_accepted_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php deleted file mode 100644 index 2f91137f186..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName) - ->setEtag($etag); - - // Call the API and handle any network failures. - try { - /** @var Recommendation $response */ - $response = $recommenderClient->markRecommendationClaimed($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_claimed_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php deleted file mode 100644 index a460f17bf4b..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Recommendation $response */ - $response = $recommenderClient->markRecommendationDismissed($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - - mark_recommendation_dismissed_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php deleted file mode 100644 index 6925598514b..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName) - ->setEtag($etag); - - // Call the API and handle any network failures. - try { - /** @var Recommendation $response */ - $response = $recommenderClient->markRecommendationFailed($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_failed_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php deleted file mode 100644 index 703d529ce5d..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName) - ->setEtag($etag); - - // Call the API and handle any network failures. - try { - /** @var Recommendation $response */ - $response = $recommenderClient->markRecommendationSucceeded($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_succeeded_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php deleted file mode 100644 index c8e079d7313..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php +++ /dev/null @@ -1,60 +0,0 @@ -setInsightTypeConfig($insightTypeConfig); - - // Call the API and handle any network failures. - try { - /** @var InsightTypeConfig $response */ - $response = $recommenderClient->updateInsightTypeConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php deleted file mode 100644 index bc4ef170eeb..00000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php +++ /dev/null @@ -1,60 +0,0 @@ -setRecommenderConfig($recommenderConfig); - - // Call the API and handle any network failures. - try { - /** @var RecommenderConfig $response */ - $response = $recommenderClient->updateRecommenderConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php b/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php deleted file mode 100644 index 0064262f694..00000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php +++ /dev/null @@ -1,1199 +0,0 @@ - getInsightAsync(GetInsightRequest $request, array $optionalArgs = []) - * @method PromiseInterface getInsightTypeConfigAsync(GetInsightTypeConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface getRecommendationAsync(GetRecommendationRequest $request, array $optionalArgs = []) - * @method PromiseInterface getRecommenderConfigAsync(GetRecommenderConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface listInsightsAsync(ListInsightsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listRecommendationsAsync(ListRecommendationsRequest $request, array $optionalArgs = []) - * @method PromiseInterface markInsightAcceptedAsync(MarkInsightAcceptedRequest $request, array $optionalArgs = []) - * @method PromiseInterface markRecommendationClaimedAsync(MarkRecommendationClaimedRequest $request, array $optionalArgs = []) - * @method PromiseInterface markRecommendationDismissedAsync(MarkRecommendationDismissedRequest $request, array $optionalArgs = []) - * @method PromiseInterface markRecommendationFailedAsync(MarkRecommendationFailedRequest $request, array $optionalArgs = []) - * @method PromiseInterface markRecommendationSucceededAsync(MarkRecommendationSucceededRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateInsightTypeConfigAsync(UpdateInsightTypeConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateRecommenderConfigAsync(UpdateRecommenderConfigRequest $request, array $optionalArgs = []) - */ -final class RecommenderClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.recommender.v1.Recommender'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'recommender.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'recommender.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/recommender_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/recommender_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/recommender_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/recommender_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type resource. - */ - public static function billingAccountLocationInsightTypeName(string $billingAccount, string $location, string $insightType): string - { - return self::getPathTemplate('billingAccountLocationInsightType')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type_config resource. - */ - public static function billingAccountLocationInsightTypeConfigName(string $billingAccount, string $location, string $insightType): string - { - return self::getPathTemplate('billingAccountLocationInsightTypeConfig')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_insight resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted billing_account_location_insight_type_insight resource. - */ - public static function billingAccountLocationInsightTypeInsightName(string $billingAccount, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('billingAccountLocationInsightTypeInsight')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender resource. - */ - public static function billingAccountLocationRecommenderName(string $billingAccount, string $location, string $recommender): string - { - return self::getPathTemplate('billingAccountLocationRecommender')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender_config resource. - */ - public static function billingAccountLocationRecommenderConfigName(string $billingAccount, string $location, string $recommender): string - { - return self::getPathTemplate('billingAccountLocationRecommenderConfig')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_recommendation resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted billing_account_location_recommender_recommendation resource. - */ - public static function billingAccountLocationRecommenderRecommendationName(string $billingAccount, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('billingAccountLocationRecommenderRecommendation')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * - * @return string The formatted folder_location_insight_type resource. - */ - public static function folderLocationInsightTypeName(string $folder, string $location, string $insightType): string - { - return self::getPathTemplate('folderLocationInsightType')->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type_insight resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted folder_location_insight_type_insight resource. - */ - public static function folderLocationInsightTypeInsightName(string $folder, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('folderLocationInsightTypeInsight')->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * - * @return string The formatted folder_location_recommender resource. - */ - public static function folderLocationRecommenderName(string $folder, string $location, string $recommender): string - { - return self::getPathTemplate('folderLocationRecommender')->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender_recommendation resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted folder_location_recommender_recommendation resource. - */ - public static function folderLocationRecommenderRecommendationName(string $folder, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('folderLocationRecommenderRecommendation')->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted insight resource. - */ - public static function insightName(string $project, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('insight')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight_type - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type resource. - */ - public static function insightTypeName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('insightType')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type_config resource. - */ - public static function insightTypeConfigName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('insightTypeConfig')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type resource. - */ - public static function organizationLocationInsightTypeName(string $organization, string $location, string $insightType): string - { - return self::getPathTemplate('organizationLocationInsightType')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_config resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type_config resource. - */ - public static function organizationLocationInsightTypeConfigName(string $organization, string $location, string $insightType): string - { - return self::getPathTemplate('organizationLocationInsightTypeConfig')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_insight resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted organization_location_insight_type_insight resource. - */ - public static function organizationLocationInsightTypeInsightName(string $organization, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('organizationLocationInsightTypeInsight')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender resource. - */ - public static function organizationLocationRecommenderName(string $organization, string $location, string $recommender): string - { - return self::getPathTemplate('organizationLocationRecommender')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_config resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender_config resource. - */ - public static function organizationLocationRecommenderConfigName(string $organization, string $location, string $recommender): string - { - return self::getPathTemplate('organizationLocationRecommenderConfig')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_recommendation resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted organization_location_recommender_recommendation resource. - */ - public static function organizationLocationRecommenderRecommendationName(string $organization, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('organizationLocationRecommenderRecommendation')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type resource. - */ - public static function projectLocationInsightTypeName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('projectLocationInsightType')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type_config resource. - */ - public static function projectLocationInsightTypeConfigName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('projectLocationInsightTypeConfig')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_insight resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted project_location_insight_type_insight resource. - */ - public static function projectLocationInsightTypeInsightName(string $project, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('projectLocationInsightTypeInsight')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender resource. - */ - public static function projectLocationRecommenderName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('projectLocationRecommender')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender_config resource. - */ - public static function projectLocationRecommenderConfigName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('projectLocationRecommenderConfig')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted project_location_recommender_recommendation resource. - */ - public static function projectLocationRecommenderRecommendationName(string $project, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('projectLocationRecommenderRecommendation')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted recommendation resource. - */ - public static function recommendationName(string $project, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('recommendation')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a recommender - * resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender resource. - */ - public static function recommenderName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('recommender')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender_config resource. - */ - public static function recommenderConfigName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('recommenderConfig')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - billingAccountLocationInsightType: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type} - * - billingAccountLocationInsightTypeConfig: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config - * - billingAccountLocationInsightTypeInsight: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - billingAccountLocationRecommender: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender} - * - billingAccountLocationRecommenderConfig: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config - * - billingAccountLocationRecommenderRecommendation: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - folderLocationInsightType: folders/{folder}/locations/{location}/insightTypes/{insight_type} - * - folderLocationInsightTypeInsight: folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - folderLocationRecommender: folders/{folder}/locations/{location}/recommenders/{recommender} - * - folderLocationRecommenderRecommendation: folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - insight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - insightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - insightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightType: organizations/{organization}/locations/{location}/insightTypes/{insight_type} - * - organizationLocationInsightTypeConfig: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightTypeInsight: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - organizationLocationRecommender: organizations/{organization}/locations/{location}/recommenders/{recommender} - * - organizationLocationRecommenderConfig: organizations/{organization}/locations/{location}/recommenders/{recommender}/config - * - organizationLocationRecommenderRecommendation: organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - projectLocationInsightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - projectLocationInsightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - projectLocationInsightTypeInsight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - projectLocationRecommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - projectLocationRecommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - projectLocationRecommenderRecommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - recommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommender.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Gets the requested insight. Requires the recommender.*.get IAM permission - * for the specified insight type. - * - * The async variant is {@see RecommenderClient::getInsightAsync()} . - * - * @example samples/V1/RecommenderClient/get_insight.php - * - * @param GetInsightRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Insight - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInsight(GetInsightRequest $request, array $callOptions = []): Insight - { - return $this->startApiCall('GetInsight', $request, $callOptions)->wait(); - } - - /** - * Gets the requested InsightTypeConfig. There is only one instance of the - * config for each InsightType. - * - * The async variant is {@see RecommenderClient::getInsightTypeConfigAsync()} . - * - * @example samples/V1/RecommenderClient/get_insight_type_config.php - * - * @param GetInsightTypeConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 InsightTypeConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInsightTypeConfig(GetInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig - { - return $this->startApiCall('GetInsightTypeConfig', $request, $callOptions)->wait(); - } - - /** - * Gets the requested recommendation. Requires the recommender.*.get - * IAM permission for the specified recommender. - * - * The async variant is {@see RecommenderClient::getRecommendationAsync()} . - * - * @example samples/V1/RecommenderClient/get_recommendation.php - * - * @param GetRecommendationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRecommendation(GetRecommendationRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('GetRecommendation', $request, $callOptions)->wait(); - } - - /** - * Gets the requested Recommender Config. There is only one instance of the - * config for each Recommender. - * - * The async variant is {@see RecommenderClient::getRecommenderConfigAsync()} . - * - * @example samples/V1/RecommenderClient/get_recommender_config.php - * - * @param GetRecommenderConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RecommenderConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRecommenderConfig(GetRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig - { - return $this->startApiCall('GetRecommenderConfig', $request, $callOptions)->wait(); - } - - /** - * Lists insights for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified insight type. - * - * The async variant is {@see RecommenderClient::listInsightsAsync()} . - * - * @example samples/V1/RecommenderClient/list_insights.php - * - * @param ListInsightsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listInsights(ListInsightsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInsights', $request, $callOptions); - } - - /** - * Lists recommendations for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified recommender. - * - * The async variant is {@see RecommenderClient::listRecommendationsAsync()} . - * - * @example samples/V1/RecommenderClient/list_recommendations.php - * - * @param ListRecommendationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRecommendations(ListRecommendationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRecommendations', $request, $callOptions); - } - - /** - * Marks the Insight State as Accepted. Users can use this method to - * indicate to the Recommender API that they have applied some action based - * on the insight. This stops the insight content from being updated. - * - * MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - * the recommender.*.update IAM permission for the specified insight. - * - * The async variant is {@see RecommenderClient::markInsightAcceptedAsync()} . - * - * @example samples/V1/RecommenderClient/mark_insight_accepted.php - * - * @param MarkInsightAcceptedRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Insight - * - * @throws ApiException Thrown if the API call fails. - */ - public function markInsightAccepted(MarkInsightAcceptedRequest $request, array $callOptions = []): Insight - { - return $this->startApiCall('MarkInsightAccepted', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Claimed. Users can use this method to - * indicate to the Recommender API that they are starting to apply the - * recommendation themselves. This stops the recommendation content from being - * updated. Associated insights are frozen and placed in the ACCEPTED state. - * - * MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - * SUCCEEDED, FAILED, or ACTIVE state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is {@see RecommenderClient::markRecommendationClaimedAsync()} - * . - * - * @example samples/V1/RecommenderClient/mark_recommendation_claimed.php - * - * @param MarkRecommendationClaimedRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationClaimed(MarkRecommendationClaimedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationClaimed', $request, $callOptions)->wait(); - } - - /** - * Mark the Recommendation State as Dismissed. Users can use this method to - * indicate to the Recommender API that an ACTIVE recommendation has to - * be marked back as DISMISSED. - * - * MarkRecommendationDismissed can be applied to recommendations in ACTIVE - * state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is - * {@see RecommenderClient::markRecommendationDismissedAsync()} . - * - * @example samples/V1/RecommenderClient/mark_recommendation_dismissed.php - * - * @param MarkRecommendationDismissedRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationDismissed(MarkRecommendationDismissedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationDismissed', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Failed. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation failed. This stops the recommendation content - * from being updated. Associated insights are frozen and placed in the - * ACCEPTED state. - * - * MarkRecommendationFailed can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is {@see RecommenderClient::markRecommendationFailedAsync()} . - * - * @example samples/V1/RecommenderClient/mark_recommendation_failed.php - * - * @param MarkRecommendationFailedRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationFailed(MarkRecommendationFailedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationFailed', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Succeeded. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation was successful. This stops the recommendation - * content from being updated. Associated insights are frozen and placed in - * the ACCEPTED state. - * - * MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is - * {@see RecommenderClient::markRecommendationSucceededAsync()} . - * - * @example samples/V1/RecommenderClient/mark_recommendation_succeeded.php - * - * @param MarkRecommendationSucceededRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationSucceeded(MarkRecommendationSucceededRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationSucceeded', $request, $callOptions)->wait(); - } - - /** - * Updates an InsightTypeConfig change. This will create a new revision of the - * config. - * - * The async variant is {@see RecommenderClient::updateInsightTypeConfigAsync()} . - * - * @example samples/V1/RecommenderClient/update_insight_type_config.php - * - * @param UpdateInsightTypeConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 InsightTypeConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateInsightTypeConfig(UpdateInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig - { - return $this->startApiCall('UpdateInsightTypeConfig', $request, $callOptions)->wait(); - } - - /** - * Updates a Recommender Config. This will create a new revision of the - * config. - * - * The async variant is {@see RecommenderClient::updateRecommenderConfigAsync()} . - * - * @example samples/V1/RecommenderClient/update_recommender_config.php - * - * @param UpdateRecommenderConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RecommenderConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateRecommenderConfig(UpdateRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig - { - return $this->startApiCall('UpdateRecommenderConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 61d8a5fabcf..00000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.recommender.v1", - "libraryPackage": "Google\\Cloud\\Recommender\\V1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "RecommenderGapicClient", - "rpcs": { - "GetInsight": { - "methods": [ - "getInsight" - ] - }, - "GetInsightTypeConfig": { - "methods": [ - "getInsightTypeConfig" - ] - }, - "GetRecommendation": { - "methods": [ - "getRecommendation" - ] - }, - "GetRecommenderConfig": { - "methods": [ - "getRecommenderConfig" - ] - }, - "ListInsights": { - "methods": [ - "listInsights" - ] - }, - "ListRecommendations": { - "methods": [ - "listRecommendations" - ] - }, - "MarkInsightAccepted": { - "methods": [ - "markInsightAccepted" - ] - }, - "MarkRecommendationClaimed": { - "methods": [ - "markRecommendationClaimed" - ] - }, - "MarkRecommendationDismissed": { - "methods": [ - "markRecommendationDismissed" - ] - }, - "MarkRecommendationFailed": { - "methods": [ - "markRecommendationFailed" - ] - }, - "MarkRecommendationSucceeded": { - "methods": [ - "markRecommendationSucceeded" - ] - }, - "UpdateInsightTypeConfig": { - "methods": [ - "updateInsightTypeConfig" - ] - }, - "UpdateRecommenderConfig": { - "methods": [ - "updateRecommenderConfig" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json deleted file mode 100644 index 4b79a146a7c..00000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "interfaces": { - "google.cloud.recommender.v1.Recommender": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "GetInsight": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetInsightTypeConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetRecommendation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetRecommenderConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListInsights": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListRecommendations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MarkInsightAccepted": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "MarkRecommendationClaimed": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "MarkRecommendationDismissed": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "MarkRecommendationFailed": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "MarkRecommendationSucceeded": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateInsightTypeConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateRecommenderConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php deleted file mode 100644 index f3a5d812aa4..00000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php +++ /dev/null @@ -1,232 +0,0 @@ - [ - 'google.cloud.recommender.v1.Recommender' => [ - 'GetInsight' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Insight', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetInsightTypeConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommendation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommenderConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListInsights' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInsights', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\ListInsightsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListRecommendations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRecommendations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\ListRecommendationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'MarkInsightAccepted' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Insight', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationClaimed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationDismissed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationFailed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationSucceeded' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInsightTypeConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', - 'headerParams' => [ - [ - 'keyName' => 'insight_type_config.name', - 'fieldAccessors' => [ - 'getInsightTypeConfig', - 'getName', - ], - ], - ], - ], - 'UpdateRecommenderConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', - 'headerParams' => [ - [ - 'keyName' => 'recommender_config.name', - 'fieldAccessors' => [ - 'getRecommenderConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'billingAccountLocationInsightType' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}', - 'billingAccountLocationInsightTypeConfig' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config', - 'billingAccountLocationInsightTypeInsight' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'billingAccountLocationRecommender' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}', - 'billingAccountLocationRecommenderConfig' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config', - 'billingAccountLocationRecommenderRecommendation' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'folderLocationInsightType' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}', - 'folderLocationInsightTypeInsight' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'folderLocationRecommender' => 'folders/{folder}/locations/{location}/recommenders/{recommender}', - 'folderLocationRecommenderRecommendation' => 'folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'insight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'insightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', - 'insightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', - 'organizationLocationInsightType' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}', - 'organizationLocationInsightTypeConfig' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config', - 'organizationLocationInsightTypeInsight' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'organizationLocationRecommender' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}', - 'organizationLocationRecommenderConfig' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/config', - 'organizationLocationRecommenderRecommendation' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'projectLocationInsightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', - 'projectLocationInsightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', - 'projectLocationInsightTypeInsight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'projectLocationRecommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', - 'projectLocationRecommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', - 'projectLocationRecommenderRecommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'recommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'recommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', - 'recommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', - ], - ], - ], -]; diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php deleted file mode 100644 index ee41be2d932..00000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php +++ /dev/null @@ -1,366 +0,0 @@ - [ - 'google.cloud.recommender.v1.Recommender' => [ - 'GetInsight' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInsightTypeConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/config}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/config}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommendation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommenderConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/config}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/config}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListInsights' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/insightTypes/*}/insights', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/insightTypes/*}/insights', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRecommendations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/recommenders/*}/recommendations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MarkInsightAccepted' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationClaimed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationDismissed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationFailed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationSucceeded' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInsightTypeConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - ], - ], - 'placeholders' => [ - 'insight_type_config.name' => [ - 'getters' => [ - 'getInsightTypeConfig', - 'getName', - ], - ], - ], - ], - 'UpdateRecommenderConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - ], - ], - 'placeholders' => [ - 'recommender_config.name' => [ - 'getters' => [ - 'getRecommenderConfig', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php b/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php deleted file mode 100644 index c30e9b51c1d..00000000000 --- a/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php +++ /dev/null @@ -1,1062 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RecommenderClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RecommenderClient($options); - } - - /** @test */ - public function getInsightTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag = 'etag3123477'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsight($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightExceptionTest() - { - $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->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - try { - $gapicClient->getInsight($request); - // 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 getInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new GetInsightTypeConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsightTypeConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightTypeConfigExceptionTest() - { - $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->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new GetInsightTypeConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getInsightTypeConfig($request); - // 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 getRecommendationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag = 'etag3123477'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new GetRecommendationRequest()) - ->setName($formattedName); - $response = $gapicClient->getRecommendation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommendation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommendationExceptionTest() - { - $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new GetRecommendationRequest()) - ->setName($formattedName); - try { - $gapicClient->getRecommendation($request); - // 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 getRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new GetRecommenderConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getRecommenderConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommenderConfigExceptionTest() - { - $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->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new GetRecommenderConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getRecommenderConfig($request); - // 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 listInsightsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $insightsElement = new Insight(); - $insights = [ - $insightsElement, - ]; - $expectedResponse = new ListInsightsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInsights($insights); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new ListInsightsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInsights($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInsights()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListInsights', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInsightsExceptionTest() - { - $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->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new ListInsightsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInsights($request); - // 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 listRecommendationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $recommendationsElement = new Recommendation(); - $recommendations = [ - $recommendationsElement, - ]; - $expectedResponse = new ListRecommendationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRecommendations($recommendations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new ListRecommendationsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRecommendations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRecommendations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListRecommendations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRecommendationsExceptionTest() - { - $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->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new ListRecommendationsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRecommendations($request); - // 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 markInsightAcceptedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - $request = (new MarkInsightAcceptedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markInsightAccepted($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkInsightAccepted', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markInsightAcceptedExceptionTest() - { - $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->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - $request = (new MarkInsightAcceptedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markInsightAccepted($request); - // 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 markRecommendationClaimedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationClaimedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationClaimed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationClaimedExceptionTest() - { - $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationClaimedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationClaimed($request); - // 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 markRecommendationDismissedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new MarkRecommendationDismissedRequest()) - ->setName($formattedName); - $response = $gapicClient->markRecommendationDismissed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationDismissed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationDismissedExceptionTest() - { - $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new MarkRecommendationDismissedRequest()) - ->setName($formattedName); - try { - $gapicClient->markRecommendationDismissed($request); - // 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 markRecommendationFailedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationFailedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationFailed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationFailedExceptionTest() - { - $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationFailedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationFailed($request); - // 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 markRecommendationSucceededTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationSucceededRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationSucceeded($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationSucceededExceptionTest() - { - $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->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationSucceededRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationSucceeded($request); - // 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 updateInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $insightTypeConfig = new InsightTypeConfig(); - $request = (new UpdateInsightTypeConfigRequest()) - ->setInsightTypeConfig($insightTypeConfig); - $response = $gapicClient->updateInsightTypeConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getInsightTypeConfig(); - $this->assertProtobufEquals($insightTypeConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateInsightTypeConfigExceptionTest() - { - $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 - $insightTypeConfig = new InsightTypeConfig(); - $request = (new UpdateInsightTypeConfigRequest()) - ->setInsightTypeConfig($insightTypeConfig); - try { - $gapicClient->updateInsightTypeConfig($request); - // 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 updateRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $recommenderConfig = new RecommenderConfig(); - $request = (new UpdateRecommenderConfigRequest()) - ->setRecommenderConfig($recommenderConfig); - $response = $gapicClient->updateRecommenderConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getRecommenderConfig(); - $this->assertProtobufEquals($recommenderConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRecommenderConfigExceptionTest() - { - $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 - $recommenderConfig = new RecommenderConfig(); - $request = (new UpdateRecommenderConfigRequest()) - ->setRecommenderConfig($recommenderConfig); - try { - $gapicClient->updateRecommenderConfig($request); - // 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 getInsightAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag = 'etag3123477'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsightAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php b/owl-bot-staging/Redis/v1/proto/src/GPBMetadata/Google/Cloud/Redis/V1/CloudRedis.php deleted file mode 100644 index c307098716a6d9ddff1ee39b9c234797ae9f59ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10724 zcmb^%&2Jl7eQhV%3($6?e0$ONis`f8{0{@yFs%P`#BkE z&kQr;q}f#k0__1I!~rBONPvV89|!&bIKYuTg2bT`hyy2XT)DvSz4>-L#Obz|#`Au^ z-}`-k&Ak1tv2UO&*)^gOQ?W@iyL*(i_es_;bz5)f?d)#1)gorLp?3_mP0U<2TP$Zw z<$6{uO7+WtYUy3GL6)<7y1v&Y`9@psHuENFs#gBsj`LGyKXZ&GLYmScmZ3CAcCE6q zNo=L5*viftL*FS-^qne2-`T!%AE8EDv8*h6%$}l8Q5OCg-QBj@$Xd2y!+%#*OI9`2 zR+YB;2?+5Z+fv#V0rcart*+LvRb9(cgtFEki#M_kO$vL}&_U=2S&yFz)dT2YN78I! zYD#;jNUVmb8n$j$0CahIkJ!HU=##}8?zNPh+R83EJT5OEWAZ`PHoGKzdp2tlyK8Fq z8Q+w^Q~$4>KH3rtbw|)NooYeXtmWlErhr5oVxg@P%|0E@s!H0;6|%1!sJeMN)GBd3 zWnd;ZbZyVlJn~L@LIdJPL#E7kQ zjKOj1M+Vs`Do1+jkdRZ{$?)iXdaJ3#$jPGO_B*N@146UuyZkC-g+<>JA+0g z4g3tUAU&sl1kC@gB-L$!Jcr@%NGKsov!4vOpfl>FqU6GQLzrX=wk=WO9*!qnyfV%*|MQSt8~Pj1G?i&i!pRJ1B42L zcZA(UGhtFzW1lp;ZNi;r#BQEUtma}+aw*Kh*8p}vb9z^^xl2HYxj+KnMZ+5C-{P`N zo0no}dl@c7P-%h^n}!Y|bC-djoAJP>APR#sPy|FW@7amr;V4bihJ5kA91AutzR07v` zBGR!A2w-(BgMc4__kge#bb;KLKz{=WQ1dZC6hL%HLUs!q+)J}N*8>4wK^K(+MTH{J zCLmA_Z|=p3Zz zucEjiGO!`wZmcR+1gT1~hM}O2ZwgYWE|!E+LClQMb7`|ut}^gZoIw+-g0um^a(P>< zX2$q?XozM%D5IIWBvyNP0xnjBnp6OWfHZJjDhk!2ye?!?{6}a!l#%dx#1+b=l31wA zo8@A!a2TbFQk5Q7M3FI@fH*r_sY=^a6E(5AEfqvrC=|q6EtBL`G+XbNJMhkRbfsPu zN;Ro2i={&KQKc@GOZ~2#N3)bH$Rupl*Tqs@Du52lC6I;cP^t+l8=&|k-$9w)IKe!+ zNYyWcayJ04*6#w~KMLd1OklV?dIlD8uiHYIUa!WN(S_O;I0J|U!T@Fs{)@WDMYK@Z zs@2PzAkd~z64u0`{AKZxEY)gTVkWWt@xO$xq6hwC$m0CHNiSu4Mz;8oY{~DAK zEB~qc*VDY$!@x7|&!>6SZMfi}_vcgo`$K5@Sd8O`C=<>UEIZN2NiW@t$xg>;su+6SIUA;G_orh25tS#-W4R%=oX!WUwpPZWjyHi2J8scLZr9QY8W zqf$bra;{bqDz)`84Y;aQF7|j6P%4*1dA+<<&7^3Ss7W8NU$x8-%@Xy8;>NafUW2>> zDGQ#I>W}1Az;FRa_`fC5c^H}9>KUreRr2*Nw2e?M!~Oa-=&=4HTsp~1KSoo~BD+Lo zI$^j*Ux_jL|6?H+9MU0@+CPckK$8J|+Wn>mGn$6dQF2t#Rk2oB7mHgPqFjGe=}mkr z0dK+{3ep^89>@zN@q@Z7Y(pBR89{z1m5Swukmje+q+1ROa$VXKA;tbXfu=)Rb$TA$ z)49`NJJI1%6sv2%7R&AT>6kPC7K}pB?XX=E9b~AUoSKQZ(L9~u+eeY=dZ=nm{SZbb zI&|e??Ddf0g#>%Zuvl#Jzeu3D7y!J8QZQ?>!kk_@>rtm3l7po}xkd3D3+E9E#iS!_ z6oC#l&?t0=P6ip! zGz%!*P-sKtxiaH>bS23pFeEtdsoaDfu&rvY-3LlfDgFtX*?=*|s~naW&~Kp;L!o1( zJA&U}A$%|S27L({uPe3?CwpC^a$ zHFQ2iN`NV?W}C1h{6a);AnZvNP^6-;DbQjUICkNGoe|ek_CyWN;Lq%t| zj6GAKd#R|pp2zym1PNOye*qMzir+x9Mbak64f8xV@fXn8TEnWb*Bel`Q(aSaBa;?7 zzKq5t&FI?BJO*_S?KLdf*>Sr%&3b9BXNBXFU4Ln16pc7Iv@e%BbVTjdQ=iS;12m!1 z%VCP9I~~_C_?Y`bd^*0tqcrdUZ!&CEW4pLM^2unT+_eJ%-$PSWKqy%rk}GB0+9P@c zh&ss%o`=mpMzi9R0p)!cP3nx9sK8fZ1P(LqNc`g@np=gLRfie1SHI8W9k_{R=zA-f zRxoJ${p}5P$MljA!&nRpP-1PR;#2Y)b-so0@grE3W?^O(?lDiSxA@j+N-a*K5$NsV{TXxL zF&G_(z&g9mQW*N;Nk|uTr`d#egld~(TVPlqXP`7UNE@m%YlLArHv&2zWy#u5{k*^y z!~CBTDC3n$U#>@JDp+99rMOr0?#Gy|mqJeP_8%WoY=1kNTKEv1>2ns{U@V2#9^*@K zPE1LAEYsZxpGFhmXZ-IHC>`A`GNr*VrnF_P+u4OJEwvfbEL~JOWu>>t9jHNPO)hz2 zsHWTO3^>h!xvYKVj@*I*O-uvowCxyj>6fzz1+R7SuM=o8(wyM9rELVtExil3;w%^K zw48p2f9ILt_FCWi%RhgR%;VeiUG=9<`}M$`->v-3&;)-oG`Zs+CD3@N2f;UDZV$nD zjGk09`L~}5Y_N-PMqj_g@D*Ap++oe;1Sy?c!pU5d|Ai8NYea%9wE{VcJ?o zwXm}E2J;C|O}RmxBczURC(%?-H;He1=I-gTdf*0B$j@H1LNFEcR^+86bBbmD^;3n& za@XmimlHSfe!>fn1xly@cq<$Hgw-MQgLS@ey3`QR3~2?NVqyJr zVW!`^n?DP=ecLvy<$V6|@X#$H{%(ynB+l21x8VaAyQQ0*m3=f1?|k}~n-wl-W^3>b zirOICcj!o`R}vpOgnUGJZ?vbo-$=rR(0VfdjNSY0|GOj1x$a)~Kdidtd@C6Gw2%%* TYNO9*g$&a9{O>7xiqQW6Lz|}O diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php deleted file mode 100644 index 93b3257476c..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/CreateInstanceRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.cloud.redis.v1.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The logical name of the Redis instance in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. A Redis [Instance] resource - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - - /** - * @param string $parent Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::locationName()} for help formatting this field. - * @param string $instanceId Required. The logical name of the Redis instance in the customer project - * with the following restrictions: - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @param \Google\Cloud\Redis\V1\Instance $instance Required. A Redis [Instance] resource - * - * @return \Google\Cloud\Redis\V1\CreateInstanceRequest - * - * @experimental - */ - public static function build(string $parent, string $instanceId, \Google\Cloud\Redis\V1\Instance $instance): self - { - return (new self()) - ->setParent($parent) - ->setInstanceId($instanceId) - ->setInstance($instance); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type string $instance_id - * Required. The logical name of the Redis instance in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @type \Google\Cloud\Redis\V1\Instance $instance - * Required. A Redis [Instance] resource - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 logical name of the Redis instance in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. The logical name of the Redis instance in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. A Redis [Instance] resource - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. A Redis [Instance] resource - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\Instance::class); - $this->instance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php deleted file mode 100644 index 76460853e35..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/DeleteInstanceRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.redis.v1.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\V1\DeleteInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php deleted file mode 100644 index 5c28a058dd4..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ExportInstanceRequest.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.redis.v1.ExportInstanceRequest - */ -class ExportInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. Specify data to be exported. - * - * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_config = null; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @param \Google\Cloud\Redis\V1\OutputConfig $outputConfig Required. Specify data to be exported. - * - * @return \Google\Cloud\Redis\V1\ExportInstanceRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Redis\V1\OutputConfig $outputConfig): self - { - return (new self()) - ->setName($name) - ->setOutputConfig($outputConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @type \Google\Cloud\Redis\V1\OutputConfig $output_config - * Required. Specify data to be exported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Specify data to be exported. - * - * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\V1\OutputConfig|null - */ - public function getOutputConfig() - { - return $this->output_config; - } - - public function hasOutputConfig() - { - return isset($this->output_config); - } - - public function clearOutputConfig() - { - unset($this->output_config); - } - - /** - * Required. Specify data to be exported. - * - * Generated from protobuf field .google.cloud.redis.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\V1\OutputConfig $var - * @return $this - */ - public function setOutputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\OutputConfig::class); - $this->output_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php deleted file mode 100644 index b819dcbb3ed..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.redis.v1.FailoverInstanceRequest - */ -class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Available data protection modes that the user can choose. If it's - * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - * - * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data_protection_mode = 0; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * @param int $dataProtectionMode Optional. Available data protection modes that the user can choose. If it's - * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - * For allowed values, use constants defined on {@see \Google\Cloud\Redis\V1\FailoverInstanceRequest\DataProtectionMode} - * - * @return \Google\Cloud\Redis\V1\FailoverInstanceRequest - * - * @experimental - */ - public static function build(string $name, int $dataProtectionMode): self - { - return (new self()) - ->setName($name) - ->setDataProtectionMode($dataProtectionMode); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @type int $data_protection_mode - * Optional. Available data protection modes that the user can choose. If it's - * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * Optional. Available data protection modes that the user can choose. If it's - * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - * - * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDataProtectionMode() - { - return $this->data_protection_mode; - } - - /** - * Optional. Available data protection modes that the user can choose. If it's - * unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - * - * Generated from protobuf field .google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDataProtectionMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\FailoverInstanceRequest\DataProtectionMode::class); - $this->data_protection_mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php deleted file mode 100644 index 1bbce71617b..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/FailoverInstanceRequest/DataProtectionMode.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode - */ -class DataProtectionMode -{ - /** - * Defaults to LIMITED_DATA_LOSS if a data protection mode is not - * specified. - * - * Generated from protobuf enum DATA_PROTECTION_MODE_UNSPECIFIED = 0; - */ - const DATA_PROTECTION_MODE_UNSPECIFIED = 0; - /** - * Instance failover will be protected with data loss control. More - * specifically, the failover will only be performed if the current - * replication offset diff between primary and replica is under a certain - * threshold. - * - * Generated from protobuf enum LIMITED_DATA_LOSS = 1; - */ - const LIMITED_DATA_LOSS = 1; - /** - * Instance failover will be performed without data loss control. - * - * Generated from protobuf enum FORCE_DATA_LOSS = 2; - */ - const FORCE_DATA_LOSS = 2; - - private static $valueToName = [ - self::DATA_PROTECTION_MODE_UNSPECIFIED => 'DATA_PROTECTION_MODE_UNSPECIFIED', - self::LIMITED_DATA_LOSS => 'LIMITED_DATA_LOSS', - self::FORCE_DATA_LOSS => 'FORCE_DATA_LOSS', - ]; - - 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(DataProtectionMode::class, \Google\Cloud\Redis\V1\FailoverInstanceRequest_DataProtectionMode::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php deleted file mode 100644 index c1f41c40102..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsDestination.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.redis.v1.GcsDestination - */ -class GcsDestination extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Data destination URI (e.g. - * 'gs://my_bucket/my_object'). Existing files will be overwritten. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. Data destination URI (e.g. - * 'gs://my_bucket/my_object'). Existing files will be overwritten. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Data destination URI (e.g. - * 'gs://my_bucket/my_object'). Existing files will be overwritten. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. Data destination URI (e.g. - * 'gs://my_bucket/my_object'). Existing files will be overwritten. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php deleted file mode 100644 index 23c862a97ff..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GcsSource.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.redis.v1.GcsSource - */ -class GcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - * - * 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; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php deleted file mode 100644 index d277b7575cb..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceAuthStringRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.redis.v1.GetInstanceAuthStringRequest - */ -class GetInstanceAuthStringRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\V1\GetInstanceAuthStringRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php deleted file mode 100644 index 8ba7a6130d0..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/GetInstanceRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.redis.v1.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\V1\GetInstanceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php deleted file mode 100644 index aeb65492a87..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ImportInstanceRequest.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.redis.v1.ImportInstanceRequest - */ -class ImportInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. Specify data to be imported. - * - * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @param \Google\Cloud\Redis\V1\InputConfig $inputConfig Required. Specify data to be imported. - * - * @return \Google\Cloud\Redis\V1\ImportInstanceRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Redis\V1\InputConfig $inputConfig): self - { - return (new self()) - ->setName($name) - ->setInputConfig($inputConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @type \Google\Cloud\Redis\V1\InputConfig $input_config - * Required. Specify data to be imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Specify data to be imported. - * - * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\V1\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. Specify data to be imported. - * - * Generated from protobuf field .google.cloud.redis.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\V1\InputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\InputConfig::class); - $this->input_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php deleted file mode 100644 index 6a8c0ce00c1..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InputConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.redis.v1.InputConfig - */ -class InputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Redis\V1\GcsSource $gcs_source - * Google Cloud Storage location where input content is located. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.cloud.redis.v1.GcsSource gcs_source = 1; - * @return \Google\Cloud\Redis\V1\GcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(1); - } - - public function hasGcsSource() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.cloud.redis.v1.GcsSource gcs_source = 1; - * @param \Google\Cloud\Redis\V1\GcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\GcsSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php deleted file mode 100644 index c1b99c5ed02..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance.php +++ /dev/null @@ -1,1567 +0,0 @@ -google.cloud.redis.v1.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users may choose which - * specific zone (or collection of zones for cross-zone instances) an instance - * should be provisioned in. Refer to - * [location_id][google.cloud.redis.v1.Instance.location_id] and - * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] - * fields for more details. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * An arbitrary and optional user-provided name for the instance. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Resource labels to represent user provided metadata - * - * Generated from protobuf field map labels = 3; - */ - private $labels; - /** - * Optional. The zone where the instance will be provisioned. If not provided, - * the service will choose a zone from the specified region for the instance. - * For standard tier, additional nodes will be added across multiple zones for - * protection against zonal failures. If specified, at least one node will be - * provisioned in this zone. - * - * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $location_id = ''; - /** - * Optional. If specified, at least one node will be provisioned in this zone - * in addition to the zone specified in location_id. Only applicable to - * standard tier. If provided, it must be a different zone from the one - * provided in [location_id]. Additional nodes beyond the first 2 will be - * placed in zones selected by the service. - * - * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $alternative_location_id = ''; - /** - * Optional. The version of Redis software. - * If not provided, latest supported version will be used. Currently, the - * supported values are: - * * `REDIS_3_2` for Redis 3.2 compatibility - * * `REDIS_4_0` for Redis 4.0 compatibility (default) - * * `REDIS_5_0` for Redis 5.0 compatibility - * * `REDIS_6_X` for Redis 6.x compatibility - * - * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $redis_version = ''; - /** - * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - * that are reserved for this instance. Range must - * be unique and non-overlapping with existing subnets in an authorized - * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - * address ranges associated with this private service access connection. - * If not provided, the service will choose an unused /29 block, for - * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - * the default block size is /28. - * - * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reserved_ip_range = ''; - /** - * Optional. Additional IP range for node placement. Required when enabling - * read replicas on an existing instance. For DIRECT_PEERING mode value must - * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode - * value must be the name of an allocated address range associated with the - * private service access connection, or "auto". - * - * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $secondary_ip_range = ''; - /** - * Output only. Hostname or IP address of the exposed Redis endpoint used by - * clients to connect to the service. - * - * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $host = ''; - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $port = 0; - /** - * Output only. The current zone where the Redis primary node is located. In - * basic tier, this will always be the same as [location_id]. In - * standard tier, this can be the zone of any node in the instance. - * - * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $current_location_id = ''; - /** - * Output only. The time the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The current state of this instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Additional information about the current status of this - * instance, if available. - * - * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Optional. Redis configuration parameters, according to - * http://redis.io/topics/config. Currently, the only supported parameters - * are: - * Redis version 3.2 and newer: - * * maxmemory-policy - * * notify-keyspace-events - * Redis version 4.0 and newer: - * * activedefrag - * * lfu-decay-time - * * lfu-log-factor - * * maxmemory-gb - * Redis version 5.0 and newer: - * * stream-node-max-bytes - * * stream-node-max-entries - * - * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $redis_configs; - /** - * Required. The service tier of the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tier = 0; - /** - * Required. Redis memory size in GiB. - * - * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $memory_size_gb = 0; - /** - * Optional. The full name of the Google Compute Engine - * [network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. If left unspecified, the `default` network - * will be used. - * - * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $authorized_network = ''; - /** - * Output only. Cloud IAM identity used by import / export operations to - * transfer data to/from Cloud Storage. Format is - * "serviceAccount:". The value may change over time - * for a given instance so should be checked before each import/export - * operation. - * - * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $persistence_iam_identity = ''; - /** - * Optional. The network connect mode of the Redis instance. - * If not provided, the connect mode defaults to DIRECT_PEERING. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $connect_mode = 0; - /** - * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If - * set to "true" AUTH is enabled on the instance. Default value is "false" - * meaning AUTH is disabled. - * - * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $auth_enabled = false; - /** - * Output only. List of server CA certificates for the instance. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $server_ca_certs; - /** - * Optional. The TLS mode of the Redis instance. - * If not provided, TLS is disabled for the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transit_encryption_mode = 0; - /** - * Optional. The maintenance policy for the instance. If not provided, - * maintenance events can be performed at any time. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $maintenance_policy = null; - /** - * Output only. Date and time of upcoming maintenance events which have been - * scheduled. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $maintenance_schedule = null; - /** - * Optional. The number of replica nodes. The valid range for the Standard - * Tier with read replicas enabled is [1-5] and defaults to 2. If read - * replicas are not enabled for a Standard Tier instance, the only valid value - * is 1 and the default is 1. The valid value for basic tier is 0 and the - * default is also 0. - * - * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $replica_count = 0; - /** - * Output only. Info per node. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $nodes; - /** - * Output only. Hostname or IP address of the exposed readonly Redis - * endpoint. Standard tier only. Targets all healthy replica nodes in - * instance. Replication is asynchronous and replica nodes will exhibit some - * lag behind the primary. Write requests must target 'host'. - * - * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $read_endpoint = ''; - /** - * Output only. The port number of the exposed readonly redis - * endpoint. Standard tier only. Write requests should target 'port'. - * - * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $read_endpoint_port = 0; - /** - * Optional. Read replicas mode for the instance. Defaults to - * READ_REPLICAS_DISABLED. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $read_replicas_mode = 0; - /** - * Optional. The KMS key reference that the customer provides when trying to - * create the instance. - * - * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $customer_managed_key = ''; - /** - * Optional. Persistence configuration parameters - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $persistence_config = null; - /** - * Optional. reasons that causes instance in "SUSPENDED" state. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $suspension_reasons; - /** - * Optional. The self service update maintenance version. - * The version is date based such as "20210712_00_00". - * - * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $maintenance_version = ''; - /** - * Optional. The available maintenance versions that an instance could update - * to. - * - * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $available_maintenance_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users may choose which - * specific zone (or collection of zones for cross-zone instances) an instance - * should be provisioned in. Refer to - * [location_id][google.cloud.redis.v1.Instance.location_id] and - * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] - * fields for more details. - * @type string $display_name - * An arbitrary and optional user-provided name for the instance. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Resource labels to represent user provided metadata - * @type string $location_id - * Optional. The zone where the instance will be provisioned. If not provided, - * the service will choose a zone from the specified region for the instance. - * For standard tier, additional nodes will be added across multiple zones for - * protection against zonal failures. If specified, at least one node will be - * provisioned in this zone. - * @type string $alternative_location_id - * Optional. If specified, at least one node will be provisioned in this zone - * in addition to the zone specified in location_id. Only applicable to - * standard tier. If provided, it must be a different zone from the one - * provided in [location_id]. Additional nodes beyond the first 2 will be - * placed in zones selected by the service. - * @type string $redis_version - * Optional. The version of Redis software. - * If not provided, latest supported version will be used. Currently, the - * supported values are: - * * `REDIS_3_2` for Redis 3.2 compatibility - * * `REDIS_4_0` for Redis 4.0 compatibility (default) - * * `REDIS_5_0` for Redis 5.0 compatibility - * * `REDIS_6_X` for Redis 6.x compatibility - * @type string $reserved_ip_range - * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - * that are reserved for this instance. Range must - * be unique and non-overlapping with existing subnets in an authorized - * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - * address ranges associated with this private service access connection. - * If not provided, the service will choose an unused /29 block, for - * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - * the default block size is /28. - * @type string $secondary_ip_range - * Optional. Additional IP range for node placement. Required when enabling - * read replicas on an existing instance. For DIRECT_PEERING mode value must - * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode - * value must be the name of an allocated address range associated with the - * private service access connection, or "auto". - * @type string $host - * Output only. Hostname or IP address of the exposed Redis endpoint used by - * clients to connect to the service. - * @type int $port - * Output only. The port number of the exposed Redis endpoint. - * @type string $current_location_id - * Output only. The current zone where the Redis primary node is located. In - * basic tier, this will always be the same as [location_id]. In - * standard tier, this can be the zone of any node in the instance. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the instance was created. - * @type int $state - * Output only. The current state of this instance. - * @type string $status_message - * Output only. Additional information about the current status of this - * instance, if available. - * @type array|\Google\Protobuf\Internal\MapField $redis_configs - * Optional. Redis configuration parameters, according to - * http://redis.io/topics/config. Currently, the only supported parameters - * are: - * Redis version 3.2 and newer: - * * maxmemory-policy - * * notify-keyspace-events - * Redis version 4.0 and newer: - * * activedefrag - * * lfu-decay-time - * * lfu-log-factor - * * maxmemory-gb - * Redis version 5.0 and newer: - * * stream-node-max-bytes - * * stream-node-max-entries - * @type int $tier - * Required. The service tier of the instance. - * @type int $memory_size_gb - * Required. Redis memory size in GiB. - * @type string $authorized_network - * Optional. The full name of the Google Compute Engine - * [network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. If left unspecified, the `default` network - * will be used. - * @type string $persistence_iam_identity - * Output only. Cloud IAM identity used by import / export operations to - * transfer data to/from Cloud Storage. Format is - * "serviceAccount:". The value may change over time - * for a given instance so should be checked before each import/export - * operation. - * @type int $connect_mode - * Optional. The network connect mode of the Redis instance. - * If not provided, the connect mode defaults to DIRECT_PEERING. - * @type bool $auth_enabled - * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If - * set to "true" AUTH is enabled on the instance. Default value is "false" - * meaning AUTH is disabled. - * @type array<\Google\Cloud\Redis\V1\TlsCertificate>|\Google\Protobuf\Internal\RepeatedField $server_ca_certs - * Output only. List of server CA certificates for the instance. - * @type int $transit_encryption_mode - * Optional. The TLS mode of the Redis instance. - * If not provided, TLS is disabled for the instance. - * @type \Google\Cloud\Redis\V1\MaintenancePolicy $maintenance_policy - * Optional. The maintenance policy for the instance. If not provided, - * maintenance events can be performed at any time. - * @type \Google\Cloud\Redis\V1\MaintenanceSchedule $maintenance_schedule - * Output only. Date and time of upcoming maintenance events which have been - * scheduled. - * @type int $replica_count - * Optional. The number of replica nodes. The valid range for the Standard - * Tier with read replicas enabled is [1-5] and defaults to 2. If read - * replicas are not enabled for a Standard Tier instance, the only valid value - * is 1 and the default is 1. The valid value for basic tier is 0 and the - * default is also 0. - * @type array<\Google\Cloud\Redis\V1\NodeInfo>|\Google\Protobuf\Internal\RepeatedField $nodes - * Output only. Info per node. - * @type string $read_endpoint - * Output only. Hostname or IP address of the exposed readonly Redis - * endpoint. Standard tier only. Targets all healthy replica nodes in - * instance. Replication is asynchronous and replica nodes will exhibit some - * lag behind the primary. Write requests must target 'host'. - * @type int $read_endpoint_port - * Output only. The port number of the exposed readonly redis - * endpoint. Standard tier only. Write requests should target 'port'. - * @type int $read_replicas_mode - * Optional. Read replicas mode for the instance. Defaults to - * READ_REPLICAS_DISABLED. - * @type string $customer_managed_key - * Optional. The KMS key reference that the customer provides when trying to - * create the instance. - * @type \Google\Cloud\Redis\V1\PersistenceConfig $persistence_config - * Optional. Persistence configuration parameters - * @type array|\Google\Protobuf\Internal\RepeatedField $suspension_reasons - * Optional. reasons that causes instance in "SUSPENDED" state. - * @type string $maintenance_version - * Optional. The self service update maintenance version. - * The version is date based such as "20210712_00_00". - * @type array|\Google\Protobuf\Internal\RepeatedField $available_maintenance_versions - * Optional. The available maintenance versions that an instance could update - * to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users may choose which - * specific zone (or collection of zones for cross-zone instances) an instance - * should be provisioned in. Refer to - * [location_id][google.cloud.redis.v1.Instance.location_id] and - * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] - * fields for more details. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users may choose which - * specific zone (or collection of zones for cross-zone instances) an instance - * should be provisioned in. Refer to - * [location_id][google.cloud.redis.v1.Instance.location_id] and - * [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] - * fields for more details. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * An arbitrary and optional user-provided name for the instance. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * An arbitrary and optional user-provided name for the instance. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Resource labels to represent user provided metadata - * - * Generated from protobuf field map labels = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Resource labels to represent user provided metadata - * - * Generated from protobuf field map labels = 3; - * @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; - } - - /** - * Optional. The zone where the instance will be provisioned. If not provided, - * the service will choose a zone from the specified region for the instance. - * For standard tier, additional nodes will be added across multiple zones for - * protection against zonal failures. If specified, at least one node will be - * provisioned in this zone. - * - * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLocationId() - { - return $this->location_id; - } - - /** - * Optional. The zone where the instance will be provisioned. If not provided, - * the service will choose a zone from the specified region for the instance. - * For standard tier, additional nodes will be added across multiple zones for - * protection against zonal failures. If specified, at least one node will be - * provisioned in this zone. - * - * Generated from protobuf field string location_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLocationId($var) - { - GPBUtil::checkString($var, True); - $this->location_id = $var; - - return $this; - } - - /** - * Optional. If specified, at least one node will be provisioned in this zone - * in addition to the zone specified in location_id. Only applicable to - * standard tier. If provided, it must be a different zone from the one - * provided in [location_id]. Additional nodes beyond the first 2 will be - * placed in zones selected by the service. - * - * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAlternativeLocationId() - { - return $this->alternative_location_id; - } - - /** - * Optional. If specified, at least one node will be provisioned in this zone - * in addition to the zone specified in location_id. Only applicable to - * standard tier. If provided, it must be a different zone from the one - * provided in [location_id]. Additional nodes beyond the first 2 will be - * placed in zones selected by the service. - * - * Generated from protobuf field string alternative_location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAlternativeLocationId($var) - { - GPBUtil::checkString($var, True); - $this->alternative_location_id = $var; - - return $this; - } - - /** - * Optional. The version of Redis software. - * If not provided, latest supported version will be used. Currently, the - * supported values are: - * * `REDIS_3_2` for Redis 3.2 compatibility - * * `REDIS_4_0` for Redis 4.0 compatibility (default) - * * `REDIS_5_0` for Redis 5.0 compatibility - * * `REDIS_6_X` for Redis 6.x compatibility - * - * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRedisVersion() - { - return $this->redis_version; - } - - /** - * Optional. The version of Redis software. - * If not provided, latest supported version will be used. Currently, the - * supported values are: - * * `REDIS_3_2` for Redis 3.2 compatibility - * * `REDIS_4_0` for Redis 4.0 compatibility (default) - * * `REDIS_5_0` for Redis 5.0 compatibility - * * `REDIS_6_X` for Redis 6.x compatibility - * - * Generated from protobuf field string redis_version = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRedisVersion($var) - { - GPBUtil::checkString($var, True); - $this->redis_version = $var; - - return $this; - } - - /** - * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - * that are reserved for this instance. Range must - * be unique and non-overlapping with existing subnets in an authorized - * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - * address ranges associated with this private service access connection. - * If not provided, the service will choose an unused /29 block, for - * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - * the default block size is /28. - * - * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReservedIpRange() - { - return $this->reserved_ip_range; - } - - /** - * Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - * that are reserved for this instance. Range must - * be unique and non-overlapping with existing subnets in an authorized - * network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - * address ranges associated with this private service access connection. - * If not provided, the service will choose an unused /29 block, for - * example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - * the default block size is /28. - * - * Generated from protobuf field string reserved_ip_range = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReservedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->reserved_ip_range = $var; - - return $this; - } - - /** - * Optional. Additional IP range for node placement. Required when enabling - * read replicas on an existing instance. For DIRECT_PEERING mode value must - * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode - * value must be the name of an allocated address range associated with the - * private service access connection, or "auto". - * - * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSecondaryIpRange() - { - return $this->secondary_ip_range; - } - - /** - * Optional. Additional IP range for node placement. Required when enabling - * read replicas on an existing instance. For DIRECT_PEERING mode value must - * be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode - * value must be the name of an allocated address range associated with the - * private service access connection, or "auto". - * - * Generated from protobuf field string secondary_ip_range = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSecondaryIpRange($var) - { - GPBUtil::checkString($var, True); - $this->secondary_ip_range = $var; - - return $this; - } - - /** - * Output only. Hostname or IP address of the exposed Redis endpoint used by - * clients to connect to the service. - * - * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Output only. Hostname or IP address of the exposed Redis endpoint used by - * clients to connect to the service. - * - * Generated from protobuf field string host = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. The current zone where the Redis primary node is located. In - * basic tier, this will always be the same as [location_id]. In - * standard tier, this can be the zone of any node in the instance. - * - * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getCurrentLocationId() - { - return $this->current_location_id; - } - - /** - * Output only. The current zone where the Redis primary node is located. In - * basic tier, this will always be the same as [location_id]. In - * standard tier, this can be the zone of any node in the instance. - * - * Generated from protobuf field string current_location_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setCurrentLocationId($var) - { - GPBUtil::checkString($var, True); - $this->current_location_id = $var; - - return $this; - } - - /** - * Output only. The time the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The current state of this instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of this instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current status of this - * instance, if available. - * - * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Additional information about the current status of this - * instance, if available. - * - * Generated from protobuf field string status_message = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Optional. Redis configuration parameters, according to - * http://redis.io/topics/config. Currently, the only supported parameters - * are: - * Redis version 3.2 and newer: - * * maxmemory-policy - * * notify-keyspace-events - * Redis version 4.0 and newer: - * * activedefrag - * * lfu-decay-time - * * lfu-log-factor - * * maxmemory-gb - * Redis version 5.0 and newer: - * * stream-node-max-bytes - * * stream-node-max-entries - * - * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getRedisConfigs() - { - return $this->redis_configs; - } - - /** - * Optional. Redis configuration parameters, according to - * http://redis.io/topics/config. Currently, the only supported parameters - * are: - * Redis version 3.2 and newer: - * * maxmemory-policy - * * notify-keyspace-events - * Redis version 4.0 and newer: - * * activedefrag - * * lfu-decay-time - * * lfu-log-factor - * * maxmemory-gb - * Redis version 5.0 and newer: - * * stream-node-max-bytes - * * stream-node-max-entries - * - * Generated from protobuf field map redis_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setRedisConfigs($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->redis_configs = $arr; - - return $this; - } - - /** - * Required. The service tier of the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getTier() - { - return $this->tier; - } - - /** - * Required. The service tier of the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.Tier tier = 17 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setTier($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\Tier::class); - $this->tier = $var; - - return $this; - } - - /** - * Required. Redis memory size in GiB. - * - * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getMemorySizeGb() - { - return $this->memory_size_gb; - } - - /** - * Required. Redis memory size in GiB. - * - * Generated from protobuf field int32 memory_size_gb = 18 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setMemorySizeGb($var) - { - GPBUtil::checkInt32($var); - $this->memory_size_gb = $var; - - return $this; - } - - /** - * Optional. The full name of the Google Compute Engine - * [network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. If left unspecified, the `default` network - * will be used. - * - * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAuthorizedNetwork() - { - return $this->authorized_network; - } - - /** - * Optional. The full name of the Google Compute Engine - * [network](https://cloud.google.com/vpc/docs/vpc) to which the - * instance is connected. If left unspecified, the `default` network - * will be used. - * - * Generated from protobuf field string authorized_network = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAuthorizedNetwork($var) - { - GPBUtil::checkString($var, True); - $this->authorized_network = $var; - - return $this; - } - - /** - * Output only. Cloud IAM identity used by import / export operations to - * transfer data to/from Cloud Storage. Format is - * "serviceAccount:". The value may change over time - * for a given instance so should be checked before each import/export - * operation. - * - * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPersistenceIamIdentity() - { - return $this->persistence_iam_identity; - } - - /** - * Output only. Cloud IAM identity used by import / export operations to - * transfer data to/from Cloud Storage. Format is - * "serviceAccount:". The value may change over time - * for a given instance so should be checked before each import/export - * operation. - * - * Generated from protobuf field string persistence_iam_identity = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPersistenceIamIdentity($var) - { - GPBUtil::checkString($var, True); - $this->persistence_iam_identity = $var; - - return $this; - } - - /** - * Optional. The network connect mode of the Redis instance. - * If not provided, the connect mode defaults to DIRECT_PEERING. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getConnectMode() - { - return $this->connect_mode; - } - - /** - * Optional. The network connect mode of the Redis instance. - * If not provided, the connect mode defaults to DIRECT_PEERING. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ConnectMode connect_mode = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setConnectMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\ConnectMode::class); - $this->connect_mode = $var; - - return $this; - } - - /** - * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If - * set to "true" AUTH is enabled on the instance. Default value is "false" - * meaning AUTH is disabled. - * - * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAuthEnabled() - { - return $this->auth_enabled; - } - - /** - * Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If - * set to "true" AUTH is enabled on the instance. Default value is "false" - * meaning AUTH is disabled. - * - * Generated from protobuf field bool auth_enabled = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAuthEnabled($var) - { - GPBUtil::checkBool($var); - $this->auth_enabled = $var; - - return $this; - } - - /** - * Output only. List of server CA certificates for the instance. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServerCaCerts() - { - return $this->server_ca_certs; - } - - /** - * Output only. List of server CA certificates for the instance. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.TlsCertificate server_ca_certs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\V1\TlsCertificate>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServerCaCerts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\TlsCertificate::class); - $this->server_ca_certs = $arr; - - return $this; - } - - /** - * Optional. The TLS mode of the Redis instance. - * If not provided, TLS is disabled for the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTransitEncryptionMode() - { - return $this->transit_encryption_mode; - } - - /** - * Optional. The TLS mode of the Redis instance. - * If not provided, TLS is disabled for the instance. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.TransitEncryptionMode transit_encryption_mode = 26 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTransitEncryptionMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\TransitEncryptionMode::class); - $this->transit_encryption_mode = $var; - - return $this; - } - - /** - * Optional. The maintenance policy for the instance. If not provided, - * maintenance events can be performed at any time. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\V1\MaintenancePolicy|null - */ - public function getMaintenancePolicy() - { - return $this->maintenance_policy; - } - - public function hasMaintenancePolicy() - { - return isset($this->maintenance_policy); - } - - public function clearMaintenancePolicy() - { - unset($this->maintenance_policy); - } - - /** - * Optional. The maintenance policy for the instance. If not provided, - * maintenance events can be performed at any time. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenancePolicy maintenance_policy = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\V1\MaintenancePolicy $var - * @return $this - */ - public function setMaintenancePolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\MaintenancePolicy::class); - $this->maintenance_policy = $var; - - return $this; - } - - /** - * Output only. Date and time of upcoming maintenance events which have been - * scheduled. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Redis\V1\MaintenanceSchedule|null - */ - public function getMaintenanceSchedule() - { - return $this->maintenance_schedule; - } - - public function hasMaintenanceSchedule() - { - return isset($this->maintenance_schedule); - } - - public function clearMaintenanceSchedule() - { - unset($this->maintenance_schedule); - } - - /** - * Output only. Date and time of upcoming maintenance events which have been - * scheduled. - * - * Generated from protobuf field .google.cloud.redis.v1.MaintenanceSchedule maintenance_schedule = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Redis\V1\MaintenanceSchedule $var - * @return $this - */ - public function setMaintenanceSchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\MaintenanceSchedule::class); - $this->maintenance_schedule = $var; - - return $this; - } - - /** - * Optional. The number of replica nodes. The valid range for the Standard - * Tier with read replicas enabled is [1-5] and defaults to 2. If read - * replicas are not enabled for a Standard Tier instance, the only valid value - * is 1 and the default is 1. The valid value for basic tier is 0 and the - * default is also 0. - * - * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getReplicaCount() - { - return $this->replica_count; - } - - /** - * Optional. The number of replica nodes. The valid range for the Standard - * Tier with read replicas enabled is [1-5] and defaults to 2. If read - * replicas are not enabled for a Standard Tier instance, the only valid value - * is 1 and the default is 1. The valid value for basic tier is 0 and the - * default is also 0. - * - * Generated from protobuf field int32 replica_count = 31 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setReplicaCount($var) - { - GPBUtil::checkInt32($var); - $this->replica_count = $var; - - return $this; - } - - /** - * Output only. Info per node. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Output only. Info per node. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.NodeInfo nodes = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\V1\NodeInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\NodeInfo::class); - $this->nodes = $arr; - - return $this; - } - - /** - * Output only. Hostname or IP address of the exposed readonly Redis - * endpoint. Standard tier only. Targets all healthy replica nodes in - * instance. Replication is asynchronous and replica nodes will exhibit some - * lag behind the primary. Write requests must target 'host'. - * - * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReadEndpoint() - { - return $this->read_endpoint; - } - - /** - * Output only. Hostname or IP address of the exposed readonly Redis - * endpoint. Standard tier only. Targets all healthy replica nodes in - * instance. Replication is asynchronous and replica nodes will exhibit some - * lag behind the primary. Write requests must target 'host'. - * - * Generated from protobuf field string read_endpoint = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReadEndpoint($var) - { - GPBUtil::checkString($var, True); - $this->read_endpoint = $var; - - return $this; - } - - /** - * Output only. The port number of the exposed readonly redis - * endpoint. Standard tier only. Write requests should target 'port'. - * - * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getReadEndpointPort() - { - return $this->read_endpoint_port; - } - - /** - * Output only. The port number of the exposed readonly redis - * endpoint. Standard tier only. Write requests should target 'port'. - * - * Generated from protobuf field int32 read_endpoint_port = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setReadEndpointPort($var) - { - GPBUtil::checkInt32($var); - $this->read_endpoint_port = $var; - - return $this; - } - - /** - * Optional. Read replicas mode for the instance. Defaults to - * READ_REPLICAS_DISABLED. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getReadReplicasMode() - { - return $this->read_replicas_mode; - } - - /** - * Optional. Read replicas mode for the instance. Defaults to - * READ_REPLICAS_DISABLED. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance.ReadReplicasMode read_replicas_mode = 35 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setReadReplicasMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\Instance\ReadReplicasMode::class); - $this->read_replicas_mode = $var; - - return $this; - } - - /** - * Optional. The KMS key reference that the customer provides when trying to - * create the instance. - * - * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCustomerManagedKey() - { - return $this->customer_managed_key; - } - - /** - * Optional. The KMS key reference that the customer provides when trying to - * create the instance. - * - * Generated from protobuf field string customer_managed_key = 36 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCustomerManagedKey($var) - { - GPBUtil::checkString($var, True); - $this->customer_managed_key = $var; - - return $this; - } - - /** - * Optional. Persistence configuration parameters - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\V1\PersistenceConfig|null - */ - public function getPersistenceConfig() - { - return $this->persistence_config; - } - - public function hasPersistenceConfig() - { - return isset($this->persistence_config); - } - - public function clearPersistenceConfig() - { - unset($this->persistence_config); - } - - /** - * Optional. Persistence configuration parameters - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig persistence_config = 37 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\V1\PersistenceConfig $var - * @return $this - */ - public function setPersistenceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\PersistenceConfig::class); - $this->persistence_config = $var; - - return $this; - } - - /** - * Optional. reasons that causes instance in "SUSPENDED" state. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSuspensionReasons() - { - return $this->suspension_reasons; - } - - /** - * Optional. reasons that causes instance in "SUSPENDED" state. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance.SuspensionReason suspension_reasons = 38 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSuspensionReasons($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Redis\V1\Instance\SuspensionReason::class); - $this->suspension_reasons = $arr; - - return $this; - } - - /** - * Optional. The self service update maintenance version. - * The version is date based such as "20210712_00_00". - * - * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getMaintenanceVersion() - { - return $this->maintenance_version; - } - - /** - * Optional. The self service update maintenance version. - * The version is date based such as "20210712_00_00". - * - * Generated from protobuf field string maintenance_version = 39 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setMaintenanceVersion($var) - { - GPBUtil::checkString($var, True); - $this->maintenance_version = $var; - - return $this; - } - - /** - * Optional. The available maintenance versions that an instance could update - * to. - * - * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAvailableMaintenanceVersions() - { - return $this->available_maintenance_versions; - } - - /** - * Optional. The available maintenance versions that an instance could update - * to. - * - * Generated from protobuf field repeated string available_maintenance_versions = 40 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAvailableMaintenanceVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->available_maintenance_versions = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php deleted file mode 100644 index 73de1e2672a..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ConnectMode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.redis.v1.Instance.ConnectMode - */ -class ConnectMode -{ - /** - * Not set. - * - * Generated from protobuf enum CONNECT_MODE_UNSPECIFIED = 0; - */ - const CONNECT_MODE_UNSPECIFIED = 0; - /** - * Connect via direct peering to the Memorystore for Redis hosted service. - * - * Generated from protobuf enum DIRECT_PEERING = 1; - */ - const DIRECT_PEERING = 1; - /** - * Connect your Memorystore for Redis instance using Private Service - * Access. Private services access provides an IP address range for multiple - * Google Cloud services, including Memorystore. - * - * Generated from protobuf enum PRIVATE_SERVICE_ACCESS = 2; - */ - const PRIVATE_SERVICE_ACCESS = 2; - - private static $valueToName = [ - self::CONNECT_MODE_UNSPECIFIED => 'CONNECT_MODE_UNSPECIFIED', - self::DIRECT_PEERING => 'DIRECT_PEERING', - self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS', - ]; - - 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(ConnectMode::class, \Google\Cloud\Redis\V1\Instance_ConnectMode::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php deleted file mode 100644 index c965b023cc5..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/ReadReplicasMode.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.redis.v1.Instance.ReadReplicasMode - */ -class ReadReplicasMode -{ - /** - * If not set, Memorystore Redis backend will default to - * READ_REPLICAS_DISABLED. - * - * Generated from protobuf enum READ_REPLICAS_MODE_UNSPECIFIED = 0; - */ - const READ_REPLICAS_MODE_UNSPECIFIED = 0; - /** - * If disabled, read endpoint will not be provided and the instance cannot - * scale up or down the number of replicas. - * - * Generated from protobuf enum READ_REPLICAS_DISABLED = 1; - */ - const READ_REPLICAS_DISABLED = 1; - /** - * If enabled, read endpoint will be provided and the instance can scale - * up and down the number of replicas. Not valid for basic tier. - * - * Generated from protobuf enum READ_REPLICAS_ENABLED = 2; - */ - const READ_REPLICAS_ENABLED = 2; - - private static $valueToName = [ - self::READ_REPLICAS_MODE_UNSPECIFIED => 'READ_REPLICAS_MODE_UNSPECIFIED', - self::READ_REPLICAS_DISABLED => 'READ_REPLICAS_DISABLED', - self::READ_REPLICAS_ENABLED => 'READ_REPLICAS_ENABLED', - ]; - - 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(ReadReplicasMode::class, \Google\Cloud\Redis\V1\Instance_ReadReplicasMode::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php deleted file mode 100644 index 937abb39ac8..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/State.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.redis.v1.Instance.State - */ -class State -{ - /** - * Not set. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Redis instance is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * Redis instance has been created and is fully usable. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * Redis instance configuration is being updated. Certain kinds of updates - * may cause the instance to become unusable while the update is in - * progress. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * Redis instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * Redis instance is being repaired and may be unusable. - * - * Generated from protobuf enum REPAIRING = 5; - */ - const REPAIRING = 5; - /** - * Maintenance is being performed on this Redis instance. - * - * Generated from protobuf enum MAINTENANCE = 6; - */ - const MAINTENANCE = 6; - /** - * Redis instance is importing data (availability may be affected). - * - * Generated from protobuf enum IMPORTING = 8; - */ - const IMPORTING = 8; - /** - * Redis instance is failing over (availability may be affected). - * - * Generated from protobuf enum FAILING_OVER = 9; - */ - const FAILING_OVER = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::READY => 'READY', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::REPAIRING => 'REPAIRING', - self::MAINTENANCE => 'MAINTENANCE', - self::IMPORTING => 'IMPORTING', - self::FAILING_OVER => 'FAILING_OVER', - ]; - - 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(State::class, \Google\Cloud\Redis\V1\Instance_State::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php deleted file mode 100644 index 88c2c61370c..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/SuspensionReason.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.redis.v1.Instance.SuspensionReason - */ -class SuspensionReason -{ - /** - * Not set. - * - * Generated from protobuf enum SUSPENSION_REASON_UNSPECIFIED = 0; - */ - const SUSPENSION_REASON_UNSPECIFIED = 0; - /** - * Something wrong with the CMEK key provided by customer. - * - * Generated from protobuf enum CUSTOMER_MANAGED_KEY_ISSUE = 1; - */ - const CUSTOMER_MANAGED_KEY_ISSUE = 1; - - private static $valueToName = [ - self::SUSPENSION_REASON_UNSPECIFIED => 'SUSPENSION_REASON_UNSPECIFIED', - self::CUSTOMER_MANAGED_KEY_ISSUE => 'CUSTOMER_MANAGED_KEY_ISSUE', - ]; - - 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(SuspensionReason::class, \Google\Cloud\Redis\V1\Instance_SuspensionReason::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php deleted file mode 100644 index 3ee1210c014..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/Tier.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.redis.v1.Instance.Tier - */ -class Tier -{ - /** - * Not set. - * - * Generated from protobuf enum TIER_UNSPECIFIED = 0; - */ - const TIER_UNSPECIFIED = 0; - /** - * BASIC tier: standalone instance - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * STANDARD_HA tier: highly available primary/replica instances - * - * Generated from protobuf enum STANDARD_HA = 3; - */ - const STANDARD_HA = 3; - - private static $valueToName = [ - self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', - self::BASIC => 'BASIC', - self::STANDARD_HA => 'STANDARD_HA', - ]; - - 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(Tier::class, \Google\Cloud\Redis\V1\Instance_Tier::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php deleted file mode 100644 index 01e5a5abcd7..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/Instance/TransitEncryptionMode.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.redis.v1.Instance.TransitEncryptionMode - */ -class TransitEncryptionMode -{ - /** - * Not set. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - */ - const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - /** - * Client to Server traffic encryption enabled with server authentication. - * - * Generated from protobuf enum SERVER_AUTHENTICATION = 1; - */ - const SERVER_AUTHENTICATION = 1; - /** - * TLS is disabled for the instance. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', - self::SERVER_AUTHENTICATION => 'SERVER_AUTHENTICATION', - self::DISABLED => 'DISABLED', - ]; - - 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(TransitEncryptionMode::class, \Google\Cloud\Redis\V1\Instance_TransitEncryptionMode::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php deleted file mode 100644 index 9fd5e9c5dce..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/InstanceAuthString.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.redis.v1.InstanceAuthString - */ -class InstanceAuthString extends \Google\Protobuf\Internal\Message -{ - /** - * AUTH string set on the instance. - * - * Generated from protobuf field string auth_string = 1; - */ - protected $auth_string = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $auth_string - * AUTH string set on the instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * AUTH string set on the instance. - * - * Generated from protobuf field string auth_string = 1; - * @return string - */ - public function getAuthString() - { - return $this->auth_string; - } - - /** - * AUTH string set on the instance. - * - * Generated from protobuf field string auth_string = 1; - * @param string $var - * @return $this - */ - public function setAuthString($var) - { - GPBUtil::checkString($var, True); - $this->auth_string = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php deleted file mode 100644 index 86d5cb38230..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesRequest.php +++ /dev/null @@ -1,187 +0,0 @@ -google.cloud.redis.v1.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] - * to determine if there are more instances left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The `next_page_token` value returned from a previous - * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if - * any. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\V1\ListInstancesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type int $page_size - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] - * to determine if there are more instances left to be queried. - * @type string $page_token - * The `next_page_token` value returned from a previous - * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if - * any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] - * to determine if there are more instances left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] - * to determine if there are more instances left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous - * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous - * [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @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/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php deleted file mode 100644 index 05758cf987b..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ListInstancesResponse.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.redis.v1.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of Redis instances in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/instances/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListInstances". - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; - */ - private $instances; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Redis\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * A list of Redis instances in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/instances/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListInstances". - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * A list of Redis instances in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/instances/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListInstances". - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * A list of Redis instances in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/instances/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListInstances". - * - * Generated from protobuf field repeated .google.cloud.redis.v1.Instance instances = 1; - * @param array<\Google\Cloud\Redis\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\Instance::class); - $this->instances = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php deleted file mode 100644 index 5b5e9b78592..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/LocationMetadata.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.redis.v1.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The set of available zones in the location. The map is keyed - * by the lowercase ID of each zone, as defined by GCE. These keys can be - * specified in `location_id` or `alternative_location_id` fields when - * creating a Redis instance. - * - * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $available_zones; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $available_zones - * Output only. The set of available zones in the location. The map is keyed - * by the lowercase ID of each zone, as defined by GCE. These keys can be - * specified in `location_id` or `alternative_location_id` fields when - * creating a Redis instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The set of available zones in the location. The map is keyed - * by the lowercase ID of each zone, as defined by GCE. These keys can be - * specified in `location_id` or `alternative_location_id` fields when - * creating a Redis instance. - * - * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAvailableZones() - { - return $this->available_zones; - } - - /** - * Output only. The set of available zones in the location. The map is keyed - * by the lowercase ID of each zone, as defined by GCE. These keys can be - * specified in `location_id` or `alternative_location_id` fields when - * creating a Redis instance. - * - * Generated from protobuf field map available_zones = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAvailableZones($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\ZoneMetadata::class); - $this->available_zones = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php deleted file mode 100644 index 87f04daa9b8..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenancePolicy.php +++ /dev/null @@ -1,201 +0,0 @@ -google.cloud.redis.v1.MaintenancePolicy - */ -class MaintenancePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the policy was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Description of what this policy is for. Create/Update methods - * return INVALID_ARGUMENT if the length is greater than 512. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Optional. Maintenance window that is applied to resources covered by this - * policy. Minimum 1. For the current version, the maximum number of - * weekly_window is expected to be one. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $weekly_maintenance_window; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the policy was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the policy was last updated. - * @type string $description - * Optional. Description of what this policy is for. Create/Update methods - * return INVALID_ARGUMENT if the length is greater than 512. - * @type array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $weekly_maintenance_window - * Optional. Maintenance window that is applied to resources covered by this - * policy. Minimum 1. For the current version, the maximum number of - * weekly_window is expected to be one. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time when the policy was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the policy was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Description of what this policy is for. Create/Update methods - * return INVALID_ARGUMENT if the length is greater than 512. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. Description of what this policy is for. Create/Update methods - * return INVALID_ARGUMENT if the length is greater than 512. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. Maintenance window that is applied to resources covered by this - * policy. Minimum 1. For the current version, the maximum number of - * weekly_window is expected to be one. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWeeklyMaintenanceWindow() - { - return $this->weekly_maintenance_window; - } - - /** - * Optional. Maintenance window that is applied to resources covered by this - * policy. Minimum 1. For the current version, the maximum number of - * weekly_window is expected to be one. - * - * Generated from protobuf field repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWeeklyMaintenanceWindow($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\WeeklyMaintenanceWindow::class); - $this->weekly_maintenance_window = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php deleted file mode 100644 index d94661e6262..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/MaintenanceSchedule.php +++ /dev/null @@ -1,217 +0,0 @@ -google.cloud.redis.v1.MaintenanceSchedule - */ -class MaintenanceSchedule extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The start time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. The end time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * If the scheduled maintenance can be rescheduled, default is true. - * - * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; - * @deprecated - */ - protected $can_reschedule = false; - /** - * Output only. The deadline that the maintenance schedule start time can not - * go beyond, including reschedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $schedule_deadline_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The start time of any upcoming scheduled maintenance for this - * instance. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The end time of any upcoming scheduled maintenance for this - * instance. - * @type bool $can_reschedule - * If the scheduled maintenance can be rescheduled, default is true. - * @type \Google\Protobuf\Timestamp $schedule_deadline_time - * Output only. The deadline that the maintenance schedule start time can not - * go beyond, including reschedule. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The start time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The start time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The end time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The end time of any upcoming scheduled maintenance for this - * instance. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * If the scheduled maintenance can be rescheduled, default is true. - * - * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getCanReschedule() - { - @trigger_error('can_reschedule is deprecated.', E_USER_DEPRECATED); - return $this->can_reschedule; - } - - /** - * If the scheduled maintenance can be rescheduled, default is true. - * - * Generated from protobuf field bool can_reschedule = 3 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setCanReschedule($var) - { - @trigger_error('can_reschedule is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->can_reschedule = $var; - - return $this; - } - - /** - * Output only. The deadline that the maintenance schedule start time can not - * go beyond, including reschedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleDeadlineTime() - { - return $this->schedule_deadline_time; - } - - public function hasScheduleDeadlineTime() - { - return isset($this->schedule_deadline_time); - } - - public function clearScheduleDeadlineTime() - { - unset($this->schedule_deadline_time); - } - - /** - * Output only. The deadline that the maintenance schedule start time can not - * go beyond, including reschedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_deadline_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleDeadlineTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_deadline_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php deleted file mode 100644 index 227e48aa4f6..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/NodeInfo.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.redis.v1.NodeInfo - */ -class NodeInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Node identifying string. e.g. 'node-0', 'node-1' - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $id = ''; - /** - * Output only. Location of the node. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $zone = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Output only. Node identifying string. e.g. 'node-0', 'node-1' - * @type string $zone - * Output only. Location of the node. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Node identifying string. e.g. 'node-0', 'node-1' - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Node identifying string. e.g. 'node-0', 'node-1' - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Output only. Location of the node. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getZone() - { - return $this->zone; - } - - /** - * Output only. Location of the node. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setZone($var) - { - GPBUtil::checkString($var, True); - $this->zone = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php deleted file mode 100644 index 713790d8885..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OperationMetadata.php +++ /dev/null @@ -1,291 +0,0 @@ -google.cloud.redis.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * End timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * Operation target. - * - * Generated from protobuf field string target = 3; - */ - protected $target = ''; - /** - * Operation verb. - * - * Generated from protobuf field string verb = 4; - */ - protected $verb = ''; - /** - * Operation status details. - * - * Generated from protobuf field string status_detail = 5; - */ - protected $status_detail = ''; - /** - * Specifies if cancellation was requested for the operation. - * - * Generated from protobuf field bool cancel_requested = 6; - */ - protected $cancel_requested = false; - /** - * API version. - * - * Generated from protobuf field string api_version = 7; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Creation timestamp. - * @type \Google\Protobuf\Timestamp $end_time - * End timestamp. - * @type string $target - * Operation target. - * @type string $verb - * Operation verb. - * @type string $status_detail - * Operation status details. - * @type bool $cancel_requested - * Specifies if cancellation was requested for the operation. - * @type string $api_version - * API version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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); - } - - /** - * Creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * End timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * End timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Operation target. - * - * Generated from protobuf field string target = 3; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Operation target. - * - * Generated from protobuf field string target = 3; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Operation verb. - * - * Generated from protobuf field string verb = 4; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Operation verb. - * - * Generated from protobuf field string verb = 4; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Operation status details. - * - * Generated from protobuf field string status_detail = 5; - * @return string - */ - public function getStatusDetail() - { - return $this->status_detail; - } - - /** - * Operation status details. - * - * Generated from protobuf field string status_detail = 5; - * @param string $var - * @return $this - */ - public function setStatusDetail($var) - { - GPBUtil::checkString($var, True); - $this->status_detail = $var; - - return $this; - } - - /** - * Specifies if cancellation was requested for the operation. - * - * Generated from protobuf field bool cancel_requested = 6; - * @return bool - */ - public function getCancelRequested() - { - return $this->cancel_requested; - } - - /** - * Specifies if cancellation was requested for the operation. - * - * Generated from protobuf field bool cancel_requested = 6; - * @param bool $var - * @return $this - */ - public function setCancelRequested($var) - { - GPBUtil::checkBool($var); - $this->cancel_requested = $var; - - return $this; - } - - /** - * API version. - * - * Generated from protobuf field string api_version = 7; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * API version. - * - * Generated from protobuf field string api_version = 7; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php deleted file mode 100644 index c275fbabc10..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/OutputConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.redis.v1.OutputConfig - */ -class OutputConfig extends \Google\Protobuf\Internal\Message -{ - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Redis\V1\GcsDestination $gcs_destination - * Google Cloud Storage destination for output content. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage destination for output content. - * - * Generated from protobuf field .google.cloud.redis.v1.GcsDestination gcs_destination = 1; - * @return \Google\Cloud\Redis\V1\GcsDestination|null - */ - public function getGcsDestination() - { - return $this->readOneof(1); - } - - public function hasGcsDestination() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage destination for output content. - * - * Generated from protobuf field .google.cloud.redis.v1.GcsDestination gcs_destination = 1; - * @param \Google\Cloud\Redis\V1\GcsDestination $var - * @return $this - */ - public function setGcsDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\GcsDestination::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php deleted file mode 100644 index 66c5e6bd4da..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.redis.v1.PersistenceConfig - */ -class PersistenceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Controls whether Persistence features are enabled. - * If not provided, the existing value will be used. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $persistence_mode = 0; - /** - * Optional. Period between RDB snapshots. Snapshots will be attempted every - * period starting from the provided snapshot start time. For example, a start - * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing - * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, - * 18:45, and 00:45 the next day, and so on. If not provided, - * TWENTY_FOUR_HOURS will be used as default. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rdb_snapshot_period = 0; - /** - * Output only. The next time that a snapshot attempt is scheduled to occur. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $rdb_next_snapshot_time = null; - /** - * Optional. Date and time that the first snapshot was/will be attempted, and - * to which future snapshots will be aligned. If not provided, the current - * time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rdb_snapshot_start_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $persistence_mode - * Optional. Controls whether Persistence features are enabled. - * If not provided, the existing value will be used. - * @type int $rdb_snapshot_period - * Optional. Period between RDB snapshots. Snapshots will be attempted every - * period starting from the provided snapshot start time. For example, a start - * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing - * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, - * 18:45, and 00:45 the next day, and so on. If not provided, - * TWENTY_FOUR_HOURS will be used as default. - * @type \Google\Protobuf\Timestamp $rdb_next_snapshot_time - * Output only. The next time that a snapshot attempt is scheduled to occur. - * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time - * Optional. Date and time that the first snapshot was/will be attempted, and - * to which future snapshots will be aligned. If not provided, the current - * time will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Controls whether Persistence features are enabled. - * If not provided, the existing value will be used. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPersistenceMode() - { - return $this->persistence_mode; - } - - /** - * Optional. Controls whether Persistence features are enabled. - * If not provided, the existing value will be used. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPersistenceMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\PersistenceConfig\PersistenceMode::class); - $this->persistence_mode = $var; - - return $this; - } - - /** - * Optional. Period between RDB snapshots. Snapshots will be attempted every - * period starting from the provided snapshot start time. For example, a start - * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing - * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, - * 18:45, and 00:45 the next day, and so on. If not provided, - * TWENTY_FOUR_HOURS will be used as default. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRdbSnapshotPeriod() - { - return $this->rdb_snapshot_period; - } - - /** - * Optional. Period between RDB snapshots. Snapshots will be attempted every - * period starting from the provided snapshot start time. For example, a start - * time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing - * until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, - * 18:45, and 00:45 the next day, and so on. If not provided, - * TWENTY_FOUR_HOURS will be used as default. - * - * Generated from protobuf field .google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRdbSnapshotPeriod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\PersistenceConfig\SnapshotPeriod::class); - $this->rdb_snapshot_period = $var; - - return $this; - } - - /** - * Output only. The next time that a snapshot attempt is scheduled to occur. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRdbNextSnapshotTime() - { - return $this->rdb_next_snapshot_time; - } - - public function hasRdbNextSnapshotTime() - { - return isset($this->rdb_next_snapshot_time); - } - - public function clearRdbNextSnapshotTime() - { - unset($this->rdb_next_snapshot_time); - } - - /** - * Output only. The next time that a snapshot attempt is scheduled to occur. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRdbNextSnapshotTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->rdb_next_snapshot_time = $var; - - return $this; - } - - /** - * Optional. Date and time that the first snapshot was/will be attempted, and - * to which future snapshots will be aligned. If not provided, the current - * time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRdbSnapshotStartTime() - { - return $this->rdb_snapshot_start_time; - } - - public function hasRdbSnapshotStartTime() - { - return isset($this->rdb_snapshot_start_time); - } - - public function clearRdbSnapshotStartTime() - { - unset($this->rdb_snapshot_start_time); - } - - /** - * Optional. Date and time that the first snapshot was/will be attempted, and - * to which future snapshots will be aligned. If not provided, the current - * time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRdbSnapshotStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->rdb_snapshot_start_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php deleted file mode 100644 index 0a752391e7d..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/PersistenceMode.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.redis.v1.PersistenceConfig.PersistenceMode - */ -class PersistenceMode -{ - /** - * Not set. - * - * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; - */ - const PERSISTENCE_MODE_UNSPECIFIED = 0; - /** - * Persistence is disabled for the instance, - * and any existing snapshots are deleted. - * - * Generated from protobuf enum DISABLED = 1; - */ - const DISABLED = 1; - /** - * RDB based Persistence is enabled. - * - * Generated from protobuf enum RDB = 2; - */ - const RDB = 2; - - private static $valueToName = [ - self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', - self::DISABLED => 'DISABLED', - self::RDB => 'RDB', - ]; - - 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(PersistenceMode::class, \Google\Cloud\Redis\V1\PersistenceConfig_PersistenceMode::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php deleted file mode 100644 index 43807bc8a3c..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/PersistenceConfig/SnapshotPeriod.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod - */ -class SnapshotPeriod -{ - /** - * Not set. - * - * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; - */ - const SNAPSHOT_PERIOD_UNSPECIFIED = 0; - /** - * Snapshot every 1 hour. - * - * Generated from protobuf enum ONE_HOUR = 3; - */ - const ONE_HOUR = 3; - /** - * Snapshot every 6 hours. - * - * Generated from protobuf enum SIX_HOURS = 4; - */ - const SIX_HOURS = 4; - /** - * Snapshot every 12 hours. - * - * Generated from protobuf enum TWELVE_HOURS = 5; - */ - const TWELVE_HOURS = 5; - /** - * Snapshot every 24 hours. - * - * Generated from protobuf enum TWENTY_FOUR_HOURS = 6; - */ - const TWENTY_FOUR_HOURS = 6; - - private static $valueToName = [ - self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', - self::ONE_HOUR => 'ONE_HOUR', - self::SIX_HOURS => 'SIX_HOURS', - self::TWELVE_HOURS => 'TWELVE_HOURS', - self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', - ]; - - 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(SnapshotPeriod::class, \Google\Cloud\Redis\V1\PersistenceConfig_SnapshotPeriod::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php deleted file mode 100644 index bbffe6f4526..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest.php +++ /dev/null @@ -1,190 +0,0 @@ -google.cloud.redis.v1.RescheduleMaintenanceRequest - */ -class RescheduleMaintenanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - * well. - * - * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $reschedule_type = 0; - /** - * Optional. Timestamp when the maintenance shall be rescheduled to if - * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - * example `2012-11-15T16:19:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $schedule_time = null; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * @param int $rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - * well. - * For allowed values, use constants defined on {@see \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest\RescheduleType} - * @param \Google\Protobuf\Timestamp $scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if - * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - * example `2012-11-15T16:19:00.094Z`. - * - * @return \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest - * - * @experimental - */ - public static function build(string $name, int $rescheduleType, \Google\Protobuf\Timestamp $scheduleTime): self - { - return (new self()) - ->setName($name) - ->setRescheduleType($rescheduleType) - ->setScheduleTime($scheduleTime); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @type int $reschedule_type - * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - * well. - * @type \Google\Protobuf\Timestamp $schedule_time - * Optional. Timestamp when the maintenance shall be rescheduled to if - * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - * example `2012-11-15T16:19:00.094Z`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - * well. - * - * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getRescheduleType() - { - return $this->reschedule_type; - } - - /** - * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - * well. - * - * Generated from protobuf field .google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setRescheduleType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest\RescheduleType::class); - $this->reschedule_type = $var; - - return $this; - } - - /** - * Optional. Timestamp when the maintenance shall be rescheduled to if - * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - * example `2012-11-15T16:19:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Optional. Timestamp when the maintenance shall be rescheduled to if - * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - * example `2012-11-15T16:19:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php deleted file mode 100644 index 3840b66fdee..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/RescheduleMaintenanceRequest/RescheduleType.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType - */ -class RescheduleType -{ - /** - * Not set. - * - * Generated from protobuf enum RESCHEDULE_TYPE_UNSPECIFIED = 0; - */ - const RESCHEDULE_TYPE_UNSPECIFIED = 0; - /** - * If the user wants to schedule the maintenance to happen now. - * - * Generated from protobuf enum IMMEDIATE = 1; - */ - const IMMEDIATE = 1; - /** - * If the user wants to use the existing maintenance policy to find the - * next available window. - * - * Generated from protobuf enum NEXT_AVAILABLE_WINDOW = 2; - */ - const NEXT_AVAILABLE_WINDOW = 2; - /** - * If the user wants to reschedule the maintenance to a specific time. - * - * Generated from protobuf enum SPECIFIC_TIME = 3; - */ - const SPECIFIC_TIME = 3; - - private static $valueToName = [ - self::RESCHEDULE_TYPE_UNSPECIFIED => 'RESCHEDULE_TYPE_UNSPECIFIED', - self::IMMEDIATE => 'IMMEDIATE', - self::NEXT_AVAILABLE_WINDOW => 'NEXT_AVAILABLE_WINDOW', - self::SPECIFIC_TIME => 'SPECIFIC_TIME', - ]; - - 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(RescheduleType::class, \Google\Cloud\Redis\V1\RescheduleMaintenanceRequest_RescheduleType::class); - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php deleted file mode 100644 index 69e8f18cf28..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/TlsCertificate.php +++ /dev/null @@ -1,239 +0,0 @@ -google.cloud.redis.v1.TlsCertificate - */ -class TlsCertificate extends \Google\Protobuf\Internal\Message -{ - /** - * Serial number, as extracted from the certificate. - * - * Generated from protobuf field string serial_number = 1; - */ - protected $serial_number = ''; - /** - * PEM representation. - * - * Generated from protobuf field string cert = 2; - */ - protected $cert = ''; - /** - * Output only. The time when the certificate was created in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the certificate expires in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Sha1 Fingerprint of the certificate. - * - * Generated from protobuf field string sha1_fingerprint = 5; - */ - protected $sha1_fingerprint = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $serial_number - * Serial number, as extracted from the certificate. - * @type string $cert - * PEM representation. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the certificate was created in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. The time when the certificate expires in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * @type string $sha1_fingerprint - * Sha1 Fingerprint of the certificate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Serial number, as extracted from the certificate. - * - * Generated from protobuf field string serial_number = 1; - * @return string - */ - public function getSerialNumber() - { - return $this->serial_number; - } - - /** - * Serial number, as extracted from the certificate. - * - * Generated from protobuf field string serial_number = 1; - * @param string $var - * @return $this - */ - public function setSerialNumber($var) - { - GPBUtil::checkString($var, True); - $this->serial_number = $var; - - return $this; - } - - /** - * PEM representation. - * - * Generated from protobuf field string cert = 2; - * @return string - */ - public function getCert() - { - return $this->cert; - } - - /** - * PEM representation. - * - * Generated from protobuf field string cert = 2; - * @param string $var - * @return $this - */ - public function setCert($var) - { - GPBUtil::checkString($var, True); - $this->cert = $var; - - return $this; - } - - /** - * Output only. The time when the certificate was created in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time when the certificate was created in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the certificate expires in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. The time when the certificate expires in [RFC - * 3339](https://tools.ietf.org/html/rfc3339) format, for example - * `2020-05-18T00:00:00.094Z`. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Sha1 Fingerprint of the certificate. - * - * Generated from protobuf field string sha1_fingerprint = 5; - * @return string - */ - public function getSha1Fingerprint() - { - return $this->sha1_fingerprint; - } - - /** - * Sha1 Fingerprint of the certificate. - * - * Generated from protobuf field string sha1_fingerprint = 5; - * @param string $var - * @return $this - */ - public function setSha1Fingerprint($var) - { - GPBUtil::checkString($var, True); - $this->sha1_fingerprint = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php deleted file mode 100644 index 2f63235ec8b..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpdateInstanceRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.redis.v1.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Instance][google.cloud.redis.v1.Instance]: - * * `displayName` - * * `labels` - * * `memorySizeGb` - * * `redisConfig` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = null; - - /** - * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Instance][google.cloud.redis.v1.Instance]: - * - * * `displayName` - * * `labels` - * * `memorySizeGb` - * * `redisConfig` - * * `replica_count` - * @param \Google\Cloud\Redis\V1\Instance $instance Required. Update description. - * Only fields specified in update_mask are updated. - * - * @return \Google\Cloud\Redis\V1\UpdateInstanceRequest - * - * @experimental - */ - public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Redis\V1\Instance $instance): self - { - return (new self()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Instance][google.cloud.redis.v1.Instance]: - * * `displayName` - * * `labels` - * * `memorySizeGb` - * * `redisConfig` - * * `replica_count` - * @type \Google\Cloud\Redis\V1\Instance $instance - * Required. Update description. - * Only fields specified in update_mask are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Instance][google.cloud.redis.v1.Instance]: - * * `displayName` - * * `labels` - * * `memorySizeGb` - * * `redisConfig` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Instance][google.cloud.redis.v1.Instance]: - * * `displayName` - * * `labels` - * * `memorySizeGb` - * * `redisConfig` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\V1\Instance::class); - $this->instance = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php deleted file mode 100644 index 9d09acc837f..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/UpgradeInstanceRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.redis.v1.UpgradeInstanceRequest - */ -class UpgradeInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. Specifies the target version of Redis software to upgrade to. - * - * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $redis_version = ''; - - /** - * @param string $name Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClient::instanceName()} for help formatting this field. - * @param string $redisVersion Required. Specifies the target version of Redis software to upgrade to. - * - * @return \Google\Cloud\Redis\V1\UpgradeInstanceRequest - * - * @experimental - */ - public static function build(string $name, string $redisVersion): self - { - return (new self()) - ->setName($name) - ->setRedisVersion($redisVersion); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * @type string $redis_version - * Required. Specifies the target version of Redis software to upgrade to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis instance resource name using the form: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region. - * - * 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. Specifies the target version of Redis software to upgrade to. - * - * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRedisVersion() - { - return $this->redis_version; - } - - /** - * Required. Specifies the target version of Redis software to upgrade to. - * - * Generated from protobuf field string redis_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRedisVersion($var) - { - GPBUtil::checkString($var, True); - $this->redis_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php deleted file mode 100644 index c30f75038ba..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/WeeklyMaintenanceWindow.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.redis.v1.WeeklyMaintenanceWindow - */ -class WeeklyMaintenanceWindow extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The day of week that maintenance updates occur. - * - * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $day = 0; - /** - * Required. Start time of the window in UTC time. - * - * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $start_time = null; - /** - * Output only. Duration of the maintenance window. The current window is - * fixed at 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $duration = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $day - * Required. The day of week that maintenance updates occur. - * @type \Google\Type\TimeOfDay $start_time - * Required. Start time of the window in UTC time. - * @type \Google\Protobuf\Duration $duration - * Output only. Duration of the maintenance window. The current window is - * fixed at 1 hour. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - - /** - * Required. The day of week that maintenance updates occur. - * - * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDay() - { - return $this->day; - } - - /** - * Required. The day of week that maintenance updates occur. - * - * Generated from protobuf field .google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDay($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day = $var; - - return $this; - } - - /** - * Required. Start time of the window in UTC time. - * - * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Type\TimeOfDay|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Required. Start time of the window in UTC time. - * - * Generated from protobuf field .google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Type\TimeOfDay $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Duration of the maintenance window. The current window is - * fixed at 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Output only. Duration of the maintenance window. The current window is - * fixed at 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php b/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php deleted file mode 100644 index 5044198e104..00000000000 --- a/owl-bot-staging/Redis/v1/proto/src/Google/Cloud/Redis/V1/ZoneMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.redis.v1.ZoneMetadata - */ -class ZoneMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php deleted file mode 100644 index 3f0b2760910..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/create_instance.php +++ /dev/null @@ -1,139 +0,0 @@ -setName($instanceName) - ->setTier($instanceTier) - ->setMemorySizeGb($instanceMemorySizeGb); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->createInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); - $instanceId = '[INSTANCE_ID]'; - $instanceName = '[NAME]'; - $instanceTier = Tier::TIER_UNSPECIFIED; - $instanceMemorySizeGb = 0; - - create_instance_sample( - $formattedParent, - $instanceId, - $instanceName, - $instanceTier, - $instanceMemorySizeGb - ); -} -// [END redis_v1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php deleted file mode 100644 index 353af566e15..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/delete_instance.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->deleteInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - delete_instance_sample($formattedName); -} -// [END redis_v1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php deleted file mode 100644 index 9d69ccd1647..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/export_instance.php +++ /dev/null @@ -1,92 +0,0 @@ -setName($name) - ->setOutputConfig($outputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->exportInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - export_instance_sample($name); -} -// [END redis_v1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php deleted file mode 100644 index b963dfebc84..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/failover_instance.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->failoverInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - failover_instance_sample($formattedName); -} -// [END redis_v1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php deleted file mode 100644 index 5d8663d459d..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Instance $response */ - $response = $cloudRedisClient->getInstance($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_sample($formattedName); -} -// [END redis_v1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php deleted file mode 100644 index 7f765809d70..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_instance_auth_string.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var InstanceAuthString $response */ - $response = $cloudRedisClient->getInstanceAuthString($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_auth_string_sample($formattedName); -} -// [END redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php deleted file mode 100644 index 0152cf8a497..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END redis_v1_generated_CloudRedis_GetLocation_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php deleted file mode 100644 index 9b070b04bac..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/import_instance.php +++ /dev/null @@ -1,94 +0,0 @@ -setName($name) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->importInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - import_instance_sample($name); -} -// [END redis_v1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php deleted file mode 100644 index b460ce81ced..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_instances.php +++ /dev/null @@ -1,86 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudRedisClient->listInstances($request); - - /** @var Instance $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); - - list_instances_sample($formattedParent); -} -// [END redis_v1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php deleted file mode 100644 index d477ab8f231..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END redis_v1_generated_CloudRedis_ListLocations_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php deleted file mode 100644 index 412a8b3ab27..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/reschedule_maintenance.php +++ /dev/null @@ -1,91 +0,0 @@ -setName($formattedName) - ->setRescheduleType($rescheduleType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->rescheduleMaintenance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; - - reschedule_maintenance_sample($formattedName, $rescheduleType); -} -// [END redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php deleted file mode 100644 index 835331e01e6..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/update_instance.php +++ /dev/null @@ -1,111 +0,0 @@ -setName($instanceName) - ->setTier($instanceTier) - ->setMemorySizeGb($instanceMemorySizeGb); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->updateInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $instanceName = '[NAME]'; - $instanceTier = Tier::TIER_UNSPECIFIED; - $instanceMemorySizeGb = 0; - - update_instance_sample($instanceName, $instanceTier, $instanceMemorySizeGb); -} -// [END redis_v1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php b/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php deleted file mode 100644 index e99f0ce1f63..00000000000 --- a/owl-bot-staging/Redis/v1/samples/V1/CloudRedisClient/upgrade_instance.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName) - ->setRedisVersion($redisVersion); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->upgradeInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $redisVersion = '[REDIS_VERSION]'; - - upgrade_instance_sample($formattedName, $redisVersion); -} -// [END redis_v1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php b/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php deleted file mode 100644 index 15bab8ef620..00000000000 --- a/owl-bot-staging/Redis/v1/src/V1/Client/CloudRedisClient.php +++ /dev/null @@ -1,709 +0,0 @@ - createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface exportInstanceAsync(ExportInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface failoverInstanceAsync(FailoverInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getInstanceAuthStringAsync(GetInstanceAuthStringRequest $request, array $optionalArgs = []) - * @method PromiseInterface importInstanceAsync(ImportInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) - * @method PromiseInterface rescheduleMaintenanceAsync(RescheduleMaintenanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface upgradeInstanceAsync(UpgradeInstanceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class CloudRedisClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.redis.v1.CloudRedis'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'redis.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'redis.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_redis_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName(string $project, string $location, string $instance): string - { - return self::getPathTemplate('instance')->render([ - 'project' => $project, - 'location' => $location, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - instance: projects/{project}/locations/{location}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'redis.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Redis instance based on the specified tier and memory size. - * - * By default, the instance is accessible from the project's - * [default network](https://cloud.google.com/vpc/docs/vpc). - * - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. Once the operation is completed the Redis - * instance will be fully functional. Completed longrunning.Operation will - * contain the new instance object in the response field. - * - * The returned operation is automatically deleted after a few hours, so there - * is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClient::createInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/create_instance.php - * - * @param CreateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); - } - - /** - * Deletes a specific Redis instance. Instance stops serving and data is - * deleted. - * - * The async variant is {@see CloudRedisClient::deleteInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/delete_instance.php - * - * @param DeleteInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); - } - - /** - * Export Redis instance data into a Redis RDB format file in Cloud Storage. - * - * Redis will continue serving during this operation. - * - * The returned operation is automatically deleted after a few hours, so - * there is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClient::exportInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/export_instance.php - * - * @param ExportInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportInstance(ExportInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportInstance', $request, $callOptions)->wait(); - } - - /** - * Initiates a failover of the primary node to current replica node for a - * specific STANDARD tier Cloud Memorystore for Redis instance. - * - * The async variant is {@see CloudRedisClient::failoverInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/failover_instance.php - * - * @param FailoverInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function failoverInstance(FailoverInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('FailoverInstance', $request, $callOptions)->wait(); - } - - /** - * Gets the details of a specific Redis instance. - * - * The async variant is {@see CloudRedisClient::getInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/get_instance.php - * - * @param GetInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Instance - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance - { - return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); - } - - /** - * Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - * instance the response will be empty. This information is not included in - * the details returned to GetInstance. - * - * The async variant is {@see CloudRedisClient::getInstanceAuthStringAsync()} . - * - * @example samples/V1/CloudRedisClient/get_instance_auth_string.php - * - * @param GetInstanceAuthStringRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 InstanceAuthString - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInstanceAuthString(GetInstanceAuthStringRequest $request, array $callOptions = []): InstanceAuthString - { - return $this->startApiCall('GetInstanceAuthString', $request, $callOptions)->wait(); - } - - /** - * Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - * - * Redis may stop serving during this operation. Instance state will be - * IMPORTING for entire operation. When complete, the instance will contain - * only data from the imported file. - * - * The returned operation is automatically deleted after a few hours, so - * there is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClient::importInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/import_instance.php - * - * @param ImportInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importInstance(ImportInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportInstance', $request, $callOptions)->wait(); - } - - /** - * Lists all Redis instances owned by a project in either the specified - * location (region) or all locations. - * - * The location should have the following format: - * - * * `projects/{project_id}/locations/{location_id}` - * - * If `location_id` is specified as `-` (wildcard), then all regions - * available to the project are queried, and the results are aggregated. - * - * The async variant is {@see CloudRedisClient::listInstancesAsync()} . - * - * @example samples/V1/CloudRedisClient/list_instances.php - * - * @param ListInstancesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInstances', $request, $callOptions); - } - - /** - * Reschedule maintenance for a given instance in a given project and - * location. - * - * The async variant is {@see CloudRedisClient::rescheduleMaintenanceAsync()} . - * - * @example samples/V1/CloudRedisClient/reschedule_maintenance.php - * - * @param RescheduleMaintenanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function rescheduleMaintenance(RescheduleMaintenanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RescheduleMaintenance', $request, $callOptions)->wait(); - } - - /** - * Updates the metadata and configuration of a specific Redis instance. - * - * Completed longrunning.Operation will contain the new instance object - * in the response field. The returned operation is automatically deleted - * after a few hours, so there is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClient::updateInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/update_instance.php - * - * @param UpdateInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); - } - - /** - * Upgrades Redis instance to the newer Redis version specified in the - * request. - * - * The async variant is {@see CloudRedisClient::upgradeInstanceAsync()} . - * - * @example samples/V1/CloudRedisClient/upgrade_instance.php - * - * @param UpgradeInstanceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function upgradeInstance(UpgradeInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpgradeInstance', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see CloudRedisClient::getLocationAsync()} . - * - * @example samples/V1/CloudRedisClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see CloudRedisClient::listLocationsAsync()} . - * - * @example samples/V1/CloudRedisClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 66b8e98718c..00000000000 --- a/owl-bot-staging/Redis/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.redis.v1", - "libraryPackage": "Google\\Cloud\\Redis\\V1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisGapicClient", - "rpcs": { - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "ExportInstance": { - "methods": [ - "exportInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "GetInstanceAuthString": { - "methods": [ - "getInstanceAuthString" - ] - }, - "ImportInstance": { - "methods": [ - "importInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "RescheduleMaintenance": { - "methods": [ - "rescheduleMaintenance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgradeInstance" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json deleted file mode 100644 index 364a78c114b..00000000000 --- a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_client_config.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "interfaces": { - "google.cloud.redis.v1.CloudRedis": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "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 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "FailoverInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetInstanceAuthString": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ImportInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListInstances": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RescheduleMaintenance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpgradeInstance": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php deleted file mode 100644 index 17c14a91b86..00000000000 --- a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_descriptor_config.php +++ /dev/null @@ -1,263 +0,0 @@ - [ - 'google.cloud.redis.v1.CloudRedis' => [ - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ExportInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ImportInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RescheduleMaintenance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'instance.name', - 'fieldAccessors' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'UpgradeInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\Redis\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\V1\Instance', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetInstanceAuthString' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\V1\InstanceAuthString', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Redis\V1\ListInstancesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php b/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php deleted file mode 100644 index 2eb88bbbd4f..00000000000 --- a/owl-bot-staging/Redis/v1/src/V1/resources/cloud_redis_rest_client_config.php +++ /dev/null @@ -1,234 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.redis.v1.CloudRedis' => [ - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:export', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:failover', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInstanceAuthString' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}/authString', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:import', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RescheduleMaintenance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpgradeInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:upgrade', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php b/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php deleted file mode 100644 index 7f0c89d1fd5..00000000000 --- a/owl-bot-staging/Redis/v1/tests/Unit/V1/Client/CloudRedisClientTest.php +++ /dev/null @@ -1,1882 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudRedisClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudRedisClient($options); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceTier = Tier::TIER_UNSPECIFIED; - $instance->setTier($instanceTier); - $instanceMemorySizeGb = 193936814; - $instance->setMemorySizeGb($instanceMemorySizeGb); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $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.redis.v1.CloudRedis/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceTier = Tier::TIER_UNSPECIFIED; - $instance->setTier($instanceTier); - $instanceMemorySizeGb = 193936814; - $instance->setMemorySizeGb($instanceMemorySizeGb); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 deleteInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $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.redis.v1.CloudRedis/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteInstanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 exportInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $outputConfig = new OutputConfig(); - $request = (new ExportInstanceRequest()) - ->setName($name) - ->setOutputConfig($outputConfig); - $response = $gapicClient->exportInstance($request); - $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.redis.v1.CloudRedis/ExportInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getOutputConfig(); - $this->assertProtobufEquals($outputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportInstanceTest'); - $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 exportInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportInstanceTest'); - $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 - $name = 'name3373707'; - $outputConfig = new OutputConfig(); - $request = (new ExportInstanceRequest()) - ->setName($name) - ->setOutputConfig($outputConfig); - $response = $gapicClient->exportInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportInstanceTest'); - 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 failoverInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/failoverInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/failoverInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new FailoverInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->failoverInstance($request); - $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.redis.v1.CloudRedis/FailoverInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - $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 failoverInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/failoverInstanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new FailoverInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->failoverInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->getInstance($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.v1.CloudRedis/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - try { - $gapicClient->getInstance($request); - // 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 getInstanceAuthStringTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $authString = 'authString-554020216'; - $expectedResponse = new InstanceAuthString(); - $expectedResponse->setAuthString($authString); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceAuthStringRequest()) - ->setName($formattedName); - $response = $gapicClient->getInstanceAuthString($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.v1.CloudRedis/GetInstanceAuthString', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceAuthStringExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceAuthStringRequest()) - ->setName($formattedName); - try { - $gapicClient->getInstanceAuthString($request); - // 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 importInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $inputConfig = new InputConfig(); - $request = (new ImportInstanceRequest()) - ->setName($name) - ->setInputConfig($inputConfig); - $response = $gapicClient->importInstance($request); - $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.redis.v1.CloudRedis/ImportInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importInstanceTest'); - $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 importInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importInstanceTest'); - $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 - $name = 'name3373707'; - $inputConfig = new InputConfig(); - $request = (new ImportInstanceRequest()) - ->setName($name) - ->setInputConfig($inputConfig); - $response = $gapicClient->importInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importInstanceTest'); - 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInstances($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.v1.CloudRedis/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInstances($request); - // 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 rescheduleMaintenanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/rescheduleMaintenanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/rescheduleMaintenanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; - $request = (new RescheduleMaintenanceRequest()) - ->setName($formattedName) - ->setRescheduleType($rescheduleType); - $response = $gapicClient->rescheduleMaintenance($request); - $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.redis.v1.CloudRedis/RescheduleMaintenance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getRescheduleType(); - $this->assertProtobufEquals($rescheduleType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rescheduleMaintenanceTest'); - $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 rescheduleMaintenanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/rescheduleMaintenanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; - $request = (new RescheduleMaintenanceRequest()) - ->setName($formattedName) - ->setRescheduleType($rescheduleType); - $response = $gapicClient->rescheduleMaintenance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rescheduleMaintenanceTest'); - 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 updateInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceTier = Tier::TIER_UNSPECIFIED; - $instance->setTier($instanceTier); - $instanceMemorySizeGb = 193936814; - $instance->setMemorySizeGb($instanceMemorySizeGb); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $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.redis.v1.CloudRedis/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateInstanceTest'); - $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 - $updateMask = new FieldMask(); - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceTier = Tier::TIER_UNSPECIFIED; - $instance->setTier($instanceTier); - $instanceMemorySizeGb = 193936814; - $instance->setMemorySizeGb($instanceMemorySizeGb); - $request = (new UpdateInstanceRequest()) - ->setUpdateMask($updateMask) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 upgradeInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/upgradeInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion2 = 'redisVersion2-1453337401'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion2); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/upgradeInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $redisVersion = 'redisVersion-685310444'; - $request = (new UpgradeInstanceRequest()) - ->setName($formattedName) - ->setRedisVersion($redisVersion); - $response = $gapicClient->upgradeInstance($request); - $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.redis.v1.CloudRedis/UpgradeInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getRedisVersion(); - $this->assertProtobufEquals($redisVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); - $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 upgradeInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/upgradeInstanceTest'); - $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 - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $redisVersion = 'redisVersion-685310444'; - $request = (new UpgradeInstanceRequest()) - ->setName($formattedName) - ->setRedisVersion($redisVersion); - $response = $gapicClient->upgradeInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createInstanceAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $locationId = 'locationId552319461'; - $alternativeLocationId = 'alternativeLocationId-718920621'; - $redisVersion = 'redisVersion-685310444'; - $reservedIpRange = 'reservedIpRange-1082940580'; - $secondaryIpRange = 'secondaryIpRange-1484975472'; - $host = 'host3208616'; - $port = 3446913; - $currentLocationId = 'currentLocationId1312712735'; - $statusMessage = 'statusMessage-239442758'; - $memorySizeGb = 34199707; - $authorizedNetwork = 'authorizedNetwork-1733809270'; - $persistenceIamIdentity = 'persistenceIamIdentity1061944584'; - $authEnabled = true; - $replicaCount = 564075208; - $readEndpoint = 'readEndpoint-2081202658'; - $readEndpointPort = 1676143102; - $customerManagedKey = 'customerManagedKey-1392642338'; - $maintenanceVersion = 'maintenanceVersion-588975188'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setAlternativeLocationId($alternativeLocationId); - $expectedResponse->setRedisVersion($redisVersion); - $expectedResponse->setReservedIpRange($reservedIpRange); - $expectedResponse->setSecondaryIpRange($secondaryIpRange); - $expectedResponse->setHost($host); - $expectedResponse->setPort($port); - $expectedResponse->setCurrentLocationId($currentLocationId); - $expectedResponse->setStatusMessage($statusMessage); - $expectedResponse->setMemorySizeGb($memorySizeGb); - $expectedResponse->setAuthorizedNetwork($authorizedNetwork); - $expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity); - $expectedResponse->setAuthEnabled($authEnabled); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setReadEndpoint($readEndpoint); - $expectedResponse->setReadEndpointPort($readEndpointPort); - $expectedResponse->setCustomerManagedKey($customerManagedKey); - $expectedResponse->setMaintenanceVersion($maintenanceVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceTier = Tier::TIER_UNSPECIFIED; - $instance->setTier($instanceTier); - $instanceMemorySizeGb = 193936814; - $instance->setMemorySizeGb($instanceMemorySizeGb); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstanceAsync($request)->wait(); - $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.redis.v1.CloudRedis/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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()); - } -} diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php deleted file mode 100644 index ca7ebc33312f87bc11e52448e82a5a795f30bf79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8132 zcmb^$O>^7U(IEA?l=bl>*|h995begcYEu=HHYpv~1wSM*BYu>moXEoj1Cfw~m;z7$ zv@1JmGQFgiP7gix(o4_1cBY*kbIPSN?evmM+nJu+=^x0c`#u1YB4tWSbP@R8?!Nur zef!>hXz$x_L*CF$-O)U~DeoN0-o7r|j^$Ymt0nKWcXxG1ZdeDl(bAo`EN4n`u~d_@ znS5;-QC+L;H1wprXIXnKeYMfD+Rar*ZyGLsw_Q(nR-dl%WtAMt{ny1w_7`b|ylB-uJIs9hi>W|j$12kHi>&k4K?TSr!0W$vC?VXma*=Mgz z)r2al=S>vU)LQk7?lv65_AIB2pvmN(?gh%FE4S~6V<|afSH8`8OeXu7d?0&HTkk$y zmL1(|JLY}HHzjZseANdiPqB@wkXO$E(;a*ktb z21bjg9oU0$nSe$@(We+-}H7Yxo- z%{&xaR|S5srBf4%O+SSNo1D7?G?akwSq~sQ-x?es_7@2j(vFUqROF+I{?j(vi~JDA zY|TL>L?v0eJ(;@mFD3M~as!rIR)afkoU?}Na^sk7S2x85xlEHCQ>$t;qalVKMs)Hn zjEjwE7*`{SHw29nOcED7r5H8=a5!_6>Ob?;uA`Xh$UH>aCYq?R zukEySJU@(r{|@c8WnAJNo? z)y5PsfqSELPs&~Rr6iG`0MWR5p0iw_9#~C18bPS(#P^19AoR)+3y8<)lE-k_b2QU6 zJXJRv&Y?|4--Ui2ji=Oil0YY=hwHK!>Ao%Xjw zxe(n>LBw_&xM}Vhdv0`wMfB|QLwHI-A|C+3>gZxlM=#KY;-d?Usketv5=@ml_#HDy zq(+?@4G|b~ktyt*(-DnVC@!bxW=+pImx)JGEchj7zp{5Y>flw$6}(q|GtXMwy9#M2zSRjA#8 zMo${$$z&N81VC@nq3L;)MQLgg=GA^8smrkFFZZCP#$bfXv-Bp+_1TR?ApAr>wVX}o*YnxT>;*Cf6X{A;spX3svl3R6 zF(qBgKg!OA=+0I-!*{~;S0=leWpE?O4__*eUtQ@)63zE9n$KN*A-;}QgKlf}h5vbk z-6`v?5Kep@rDkCoFRNWSI|VSonizD+)HF)mJ!DY#Anl#6}ii z+|<2imh+^mzl(hebLgc!)A{*|f@;ksw#Bp|3Q7#tKihIV-eIv|AquuxL9P|$?@XyS z9Q&077ke@sxejxJsK|M=ckJS$i#yg1a8|Ct%&z4;!@7WXHPvaewkzNr`&(h3pb_P0 zGaaq4Y8v}21arYn&z}^KV}+gv-Oxh61`}93cyGXaw4o^TFvg>XH?5pW)I3(A9o|6m zrK>PaD?r;-@v7!x_uJhJ+<;4>XVS4sYM7N5xfVeNZ7?Z6dex? z9s5TZFBk*5A<}}m1I@(4nyRZih>66RWg>~vumm)KUcA7G4LU1#A?UXPBTp>-L4vEV zKq61DmB$7M&+=RO?QfZ{IAu1yuNmeNMpy6yLuQH|D;iOL`egFcm&zw+Xg5je{OM%1 z>-eA#PDNlcuvF~xafqH&aIu*iVI3iL?dinEFtzb?)>pUVT`Qet?lJc8%^klp;E|x5 z_k>C&)m=-Gwr1`6wD}$N+_aU_dKc}bKZjs4IF2|lPo;28&35-Ky!GjhVe!l~ohW}} zapF}$7*&XLX_!lRRk+-9CdRzuogtw}c-@}vC5+YmYPG18tGQB5EoUqFQl`IJmWo+5 zSK6vzwY-SUNB#r$tBM747N%MVt!!7bX_S#R2%GOK+bCVE3Ny!in#gbs^;XSSYuREts}@R`0sTfMUsY0@*nLQ3 z9Kz^DNEbhlaU}X*2`&w85Xpx*g0i_eJF@ay2^I%lZb|(X z+^AKQVl`h=(R(V}<&)HU6XcTs1KB0A2KP>as%9(b(oA_6o%u92xuxQ4DDefrT;H1p z`J)6=-QzKm7~*=}z+&FA^yZmx`1~#Q;44MUEr0R%|NJHtCwJ*%&I>-ud=ON`m9EBm zrPEN8-{ak-GYulcZs#3PpXpOhG-LO_QrIZ0hf6veJAube&%bg+{*7&J&+v~7(^U_& z&+BWxg1d&(@t|Feee$Jpy)&?y=i@m(HpUrs93LURQs%`40MxXWrQ+_z3C8u=$m)H7-yDp3#g zDJ6P-3aee=;c(YCp7@Wq8D_h;V`mDQj?Mlj!Szl^(0=y#ER|$@pF3eb`D%1u2gBTb z(9yAScgUrQ!u<1e#v9lVA1&p+R2Bw}fB&Y$_dU;cldG%Go;?#12k#_wa*E-M&&2m^ zyh-6j^B{%e{AGMYd9`vgoogle.cloud.redis.cluster.v1.AuthorizationMode - */ -class AuthorizationMode -{ - /** - * Not set. - * - * Generated from protobuf enum AUTH_MODE_UNSPECIFIED = 0; - */ - const AUTH_MODE_UNSPECIFIED = 0; - /** - * IAM basic authorization mode - * - * Generated from protobuf enum AUTH_MODE_IAM_AUTH = 1; - */ - const AUTH_MODE_IAM_AUTH = 1; - /** - * Authorization disabled mode - * - * Generated from protobuf enum AUTH_MODE_DISABLED = 2; - */ - const AUTH_MODE_DISABLED = 2; - - private static $valueToName = [ - self::AUTH_MODE_UNSPECIFIED => 'AUTH_MODE_UNSPECIFIED', - self::AUTH_MODE_IAM_AUTH => 'AUTH_MODE_IAM_AUTH', - self::AUTH_MODE_DISABLED => 'AUTH_MODE_DISABLED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php deleted file mode 100644 index 65adb51a42b..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.redis.cluster.v1.CertificateAuthority - */ -class CertificateAuthority extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. Unique name of the resource in this scope including project, - * location and cluster using the form: - * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - protected $server_ca; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $managed_server_ca - * @type string $name - * Identifier. Unique name of the resource in this scope including project, - * location and cluster using the form: - * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; - * @return \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority|null - */ - public function getManagedServerCa() - { - return $this->readOneof(1); - } - - public function hasManagedServerCa() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; - * @param \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $var - * @return $this - */ - public function setManagedServerCa($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Identifier. Unique name of the resource in this scope including project, - * location and cluster using the form: - * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. Unique name of the resource in this scope including project, - * location and cluster using the form: - * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * @return string - */ - public function getServerCa() - { - return $this->whichOneof("server_ca"); - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php deleted file mode 100644 index e5e61afb262..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority - */ -class ManagedCertificateAuthority extends \Google\Protobuf\Internal\Message -{ - /** - * The PEM encoded CA certificate chains for redis managed - * server authentication - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; - */ - private $ca_certs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $ca_certs - * The PEM encoded CA certificate chains for redis managed - * server authentication - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * The PEM encoded CA certificate chains for redis managed - * server authentication - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCaCerts() - { - return $this->ca_certs; - } - - /** - * The PEM encoded CA certificate chains for redis managed - * server authentication - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; - * @param array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCaCerts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain::class); - $this->ca_certs = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ManagedCertificateAuthority::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php deleted file mode 100644 index 6aa46fd7e72..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain - */ -class CertChain extends \Google\Protobuf\Internal\Message -{ - /** - * The certificates that form the CA chain, from leaf to root order. - * - * Generated from protobuf field repeated string certificates = 1; - */ - private $certificates; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $certificates - * The certificates that form the CA chain, from leaf to root order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * The certificates that form the CA chain, from leaf to root order. - * - * Generated from protobuf field repeated string certificates = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCertificates() - { - return $this->certificates; - } - - /** - * The certificates that form the CA chain, from leaf to root order. - * - * Generated from protobuf field repeated string certificates = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCertificates($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->certificates = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CertChain::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority_CertChain::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php deleted file mode 100644 index 58b6ccfa3e6..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php +++ /dev/null @@ -1,821 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster - */ -class Cluster extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $replica_count = null; - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $authorization_mode = 0; - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transit_encryption_mode = 0; - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_gb = null; - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $shard_count = null; - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - */ - private $psc_configs; - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $discovery_endpoints; - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $psc_connections; - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state_info = null; - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $node_type = 0; - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $persistence_config = null; - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $redis_configs; - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $precise_size_gb = null; - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $zone_distribution_config = null; - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $deletion_protection_enabled = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp associated with the cluster creation request. - * @type int $state - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * @type string $uid - * Output only. System assigned, unique identifier for the cluster. - * @type int $replica_count - * Optional. The number of replica nodes per shard. - * @type int $authorization_mode - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * @type int $transit_encryption_mode - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * @type int $size_gb - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * @type int $shard_count - * Required. Number of shards for the Redis cluster. - * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * @type array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $discovery_endpoints - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * @type array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $psc_connections - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info - * Output only. Additional information about the current state of the cluster. - * @type int $node_type - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $persistence_config - * Optional. Persistence config (RDB, AOF) for the cluster. - * @type array|\Google\Protobuf\Internal\MapField $redis_configs - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * @type float $precise_size_gb - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * @type \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $zone_distribution_config - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * @type bool $deletion_protection_enabled - * Optional. The delete operation will fail when the value is set to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\Cluster\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getReplicaCount() - { - return isset($this->replica_count) ? $this->replica_count : 0; - } - - public function hasReplicaCount() - { - return isset($this->replica_count); - } - - public function clearReplicaCount() - { - unset($this->replica_count); - } - - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setReplicaCount($var) - { - GPBUtil::checkInt32($var); - $this->replica_count = $var; - - return $this; - } - - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAuthorizationMode() - { - return $this->authorization_mode; - } - - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAuthorizationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\AuthorizationMode::class); - $this->authorization_mode = $var; - - return $this; - } - - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTransitEncryptionMode() - { - return $this->transit_encryption_mode; - } - - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTransitEncryptionMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\TransitEncryptionMode::class); - $this->transit_encryption_mode = $var; - - return $this; - } - - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSizeGb() - { - return isset($this->size_gb) ? $this->size_gb : 0; - } - - public function hasSizeGb() - { - return isset($this->size_gb); - } - - public function clearSizeGb() - { - unset($this->size_gb); - } - - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSizeGb($var) - { - GPBUtil::checkInt32($var); - $this->size_gb = $var; - - return $this; - } - - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getShardCount() - { - return isset($this->shard_count) ? $this->shard_count : 0; - } - - public function hasShardCount() - { - return isset($this->shard_count); - } - - public function clearShardCount() - { - unset($this->shard_count); - } - - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setShardCount($var) - { - GPBUtil::checkInt32($var); - $this->shard_count = $var; - - return $this; - } - - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPscConfigs() - { - return $this->psc_configs; - } - - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPscConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); - $this->psc_configs = $arr; - - return $this; - } - - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDiscoveryEndpoints() - { - return $this->discovery_endpoints; - } - - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDiscoveryEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint::class); - $this->discovery_endpoints = $arr; - - return $this; - } - - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPscConnections() - { - return $this->psc_connections; - } - - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPscConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConnection::class); - $this->psc_connections = $arr; - - return $this; - } - - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getNodeType() - { - return $this->node_type; - } - - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setNodeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\NodeType::class); - $this->node_type = $var; - - return $this; - } - - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig|null - */ - public function getPersistenceConfig() - { - return $this->persistence_config; - } - - public function hasPersistenceConfig() - { - return isset($this->persistence_config); - } - - public function clearPersistenceConfig() - { - unset($this->persistence_config); - } - - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $var - * @return $this - */ - public function setPersistenceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig::class); - $this->persistence_config = $var; - - return $this; - } - - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getRedisConfigs() - { - return $this->redis_configs; - } - - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setRedisConfigs($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->redis_configs = $arr; - - return $this; - } - - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getPreciseSizeGb() - { - return isset($this->precise_size_gb) ? $this->precise_size_gb : 0.0; - } - - public function hasPreciseSizeGb() - { - return isset($this->precise_size_gb); - } - - public function clearPreciseSizeGb() - { - unset($this->precise_size_gb); - } - - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setPreciseSizeGb($var) - { - GPBUtil::checkDouble($var); - $this->precise_size_gb = $var; - - return $this; - } - - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig|null - */ - public function getZoneDistributionConfig() - { - return $this->zone_distribution_config; - } - - public function hasZoneDistributionConfig() - { - return isset($this->zone_distribution_config); - } - - public function clearZoneDistributionConfig() - { - unset($this->zone_distribution_config); - } - - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $var - * @return $this - */ - public function setZoneDistributionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig::class); - $this->zone_distribution_config = $var; - - return $this; - } - - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDeletionProtectionEnabled() - { - return isset($this->deletion_protection_enabled) ? $this->deletion_protection_enabled : false; - } - - public function hasDeletionProtectionEnabled() - { - return isset($this->deletion_protection_enabled); - } - - public function clearDeletionProtectionEnabled() - { - unset($this->deletion_protection_enabled); - } - - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDeletionProtectionEnabled($var) - { - GPBUtil::checkBool($var); - $this->deletion_protection_enabled = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php deleted file mode 100644 index 3cd28633110..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.State - */ -class State -{ - /** - * Not set. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Redis cluster is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * Redis cluster has been created and is fully usable. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * Redis cluster configuration is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * Redis cluster is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - ]; - - 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(State::class, \Google\Cloud\Redis\Cluster\V1\Cluster_State::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php deleted file mode 100644 index 05eb2f09fd6..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.StateInfo - */ -class StateInfo extends \Google\Protobuf\Internal\Message -{ - protected $info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $update_info - * Describes ongoing update on the cluster when cluster state is UPDATING. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Describes ongoing update on the cluster when cluster state is UPDATING. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo|null - */ - public function getUpdateInfo() - { - return $this->readOneof(1); - } - - public function hasUpdateInfo() - { - return $this->hasOneof(1); - } - - /** - * Describes ongoing update on the cluster when cluster state is UPDATING. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $var - * @return $this - */ - public function setUpdateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getInfo() - { - return $this->whichOneof("info"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php deleted file mode 100644 index ad999e1fee0..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo - */ -class UpdateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - */ - protected $target_shard_count = null; - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - */ - protected $target_replica_count = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $target_shard_count - * Target number of shards for redis cluster - * @type int $target_replica_count - * Target number of replica nodes per shard. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - * @return int - */ - public function getTargetShardCount() - { - return isset($this->target_shard_count) ? $this->target_shard_count : 0; - } - - public function hasTargetShardCount() - { - return isset($this->target_shard_count); - } - - public function clearTargetShardCount() - { - unset($this->target_shard_count); - } - - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - * @param int $var - * @return $this - */ - public function setTargetShardCount($var) - { - GPBUtil::checkInt32($var); - $this->target_shard_count = $var; - - return $this; - } - - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - * @return int - */ - public function getTargetReplicaCount() - { - return isset($this->target_replica_count) ? $this->target_replica_count : 0; - } - - public function hasTargetReplicaCount() - { - return isset($this->target_replica_count); - } - - public function clearTargetReplicaCount() - { - unset($this->target_replica_count); - } - - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - * @param int $var - * @return $this - */ - public function setTargetReplicaCount($var) - { - GPBUtil::checkInt32($var); - $this->target_replica_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpdateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo_UpdateInfo::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php deleted file mode 100644 index b17af3046ed..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig - */ -class ClusterPersistenceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The mode of persistence. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mode = 0; - /** - * Optional. RDB configuration. This field will be ignored if mode is not RDB. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rdb_config = null; - /** - * Optional. AOF configuration. This field will be ignored if mode is not AOF. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $aof_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Optional. The mode of persistence. - * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $rdb_config - * Optional. RDB configuration. This field will be ignored if mode is not RDB. - * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $aof_config - * Optional. AOF configuration. This field will be ignored if mode is not AOF. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The mode of persistence. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Optional. The mode of persistence. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\PersistenceMode::class); - $this->mode = $var; - - return $this; - } - - /** - * Optional. RDB configuration. This field will be ignored if mode is not RDB. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig|null - */ - public function getRdbConfig() - { - return $this->rdb_config; - } - - public function hasRdbConfig() - { - return isset($this->rdb_config); - } - - public function clearRdbConfig() - { - unset($this->rdb_config); - } - - /** - * Optional. RDB configuration. This field will be ignored if mode is not RDB. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $var - * @return $this - */ - public function setRdbConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig::class); - $this->rdb_config = $var; - - return $this; - } - - /** - * Optional. AOF configuration. This field will be ignored if mode is not AOF. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig|null - */ - public function getAofConfig() - { - return $this->aof_config; - } - - public function hasAofConfig() - { - return isset($this->aof_config); - } - - public function clearAofConfig() - { - unset($this->aof_config); - } - - /** - * Optional. AOF configuration. This field will be ignored if mode is not AOF. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $var - * @return $this - */ - public function setAofConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig::class); - $this->aof_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php deleted file mode 100644 index 8aab049465e..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig - */ -class AOFConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. fsync configuration. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $append_fsync = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $append_fsync - * Optional. fsync configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Optional. fsync configuration. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAppendFsync() - { - return $this->append_fsync; - } - - /** - * Optional. fsync configuration. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAppendFsync($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig\AppendFsync::class); - $this->append_fsync = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AOFConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php deleted file mode 100644 index ec1a3a6654a..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync - */ -class AppendFsync -{ - /** - * Not set. Default: EVERYSEC - * - * Generated from protobuf enum APPEND_FSYNC_UNSPECIFIED = 0; - */ - const APPEND_FSYNC_UNSPECIFIED = 0; - /** - * Never fsync. Normally Linux will flush data every 30 seconds with this - * configuration, but it's up to the kernel's exact tuning. - * - * Generated from protobuf enum NO = 1; - */ - const NO = 1; - /** - * fsync every second. Fast enough, and you may lose 1 second of data if - * there is a disaster - * - * Generated from protobuf enum EVERYSEC = 2; - */ - const EVERYSEC = 2; - /** - * fsync every time new commands are appended to the AOF. It has the best - * data loss protection at the cost of performance - * - * Generated from protobuf enum ALWAYS = 3; - */ - const ALWAYS = 3; - - private static $valueToName = [ - self::APPEND_FSYNC_UNSPECIFIED => 'APPEND_FSYNC_UNSPECIFIED', - self::NO => 'NO', - self::EVERYSEC => 'EVERYSEC', - self::ALWAYS => 'ALWAYS', - ]; - - 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(AppendFsync::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig_AppendFsync::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php deleted file mode 100644 index 0b99ded98eb..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode - */ -class PersistenceMode -{ - /** - * Not set. - * - * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; - */ - const PERSISTENCE_MODE_UNSPECIFIED = 0; - /** - * Persistence is disabled, and any snapshot data is deleted. - * - * Generated from protobuf enum DISABLED = 1; - */ - const DISABLED = 1; - /** - * RDB based persistence is enabled. - * - * Generated from protobuf enum RDB = 2; - */ - const RDB = 2; - /** - * AOF based persistence is enabled. - * - * Generated from protobuf enum AOF = 3; - */ - const AOF = 3; - - private static $valueToName = [ - self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', - self::DISABLED => 'DISABLED', - self::RDB => 'RDB', - self::AOF => 'AOF', - ]; - - 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(PersistenceMode::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_PersistenceMode::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php deleted file mode 100644 index 2d16c395c5e..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig - */ -class RDBConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Period between RDB snapshots. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rdb_snapshot_period = 0; - /** - * Optional. The time that the first snapshot was/will be attempted, and to - * which future snapshots will be aligned. If not provided, the current time - * will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rdb_snapshot_start_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $rdb_snapshot_period - * Optional. Period between RDB snapshots. - * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time - * Optional. The time that the first snapshot was/will be attempted, and to - * which future snapshots will be aligned. If not provided, the current time - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Period between RDB snapshots. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRdbSnapshotPeriod() - { - return $this->rdb_snapshot_period; - } - - /** - * Optional. Period between RDB snapshots. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRdbSnapshotPeriod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig\SnapshotPeriod::class); - $this->rdb_snapshot_period = $var; - - return $this; - } - - /** - * Optional. The time that the first snapshot was/will be attempted, and to - * which future snapshots will be aligned. If not provided, the current time - * will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRdbSnapshotStartTime() - { - return $this->rdb_snapshot_start_time; - } - - public function hasRdbSnapshotStartTime() - { - return isset($this->rdb_snapshot_start_time); - } - - public function clearRdbSnapshotStartTime() - { - unset($this->rdb_snapshot_start_time); - } - - /** - * Optional. The time that the first snapshot was/will be attempted, and to - * which future snapshots will be aligned. If not provided, the current time - * will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRdbSnapshotStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->rdb_snapshot_start_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RDBConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php deleted file mode 100644 index 21d491f77fd..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod - */ -class SnapshotPeriod -{ - /** - * Not set. - * - * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; - */ - const SNAPSHOT_PERIOD_UNSPECIFIED = 0; - /** - * One hour. - * - * Generated from protobuf enum ONE_HOUR = 1; - */ - const ONE_HOUR = 1; - /** - * Six hours. - * - * Generated from protobuf enum SIX_HOURS = 2; - */ - const SIX_HOURS = 2; - /** - * Twelve hours. - * - * Generated from protobuf enum TWELVE_HOURS = 3; - */ - const TWELVE_HOURS = 3; - /** - * Twenty four hours. - * - * Generated from protobuf enum TWENTY_FOUR_HOURS = 4; - */ - const TWENTY_FOUR_HOURS = 4; - - private static $valueToName = [ - self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', - self::ONE_HOUR => 'ONE_HOUR', - self::SIX_HOURS => 'SIX_HOURS', - self::TWELVE_HOURS => 'TWELVE_HOURS', - self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', - ]; - - 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(SnapshotPeriod::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig_SnapshotPeriod::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php deleted file mode 100644 index a4ec433911f..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php +++ /dev/null @@ -1,238 +0,0 @@ -google.cloud.redis.cluster.v1.CreateClusterRequest - */ -class CreateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = null; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. The cluster that is to be created. - * @param string $clusterId Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * @return \Google\Cloud\Redis\Cluster\V1\CreateClusterRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Redis\Cluster\V1\Cluster $cluster, string $clusterId): self - { - return (new self()) - ->setParent($parent) - ->setCluster($cluster) - ->setClusterId($clusterId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type string $cluster_id - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster - * Required. The cluster that is to be created. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->cluster = $var; - - return $this; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php deleted file mode 100644 index c8eb432dad7..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.redis.cluster.v1.DeleteClusterRequest - */ -class DeleteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php deleted file mode 100644 index fc450c18b9c..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.redis.cluster.v1.DiscoveryEndpoint - */ -class DiscoveryEndpoint extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $address = ''; - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $port = 0; - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $psc_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $address - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * @type int $port - * Output only. The port number of the exposed Redis endpoint. - * @type \Google\Cloud\Redis\Cluster\V1\PscConfig $psc_config - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Redis\Cluster\V1\PscConfig|null - */ - public function getPscConfig() - { - return $this->psc_config; - } - - public function hasPscConfig() - { - return isset($this->psc_config); - } - - public function clearPscConfig() - { - unset($this->psc_config); - } - - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Redis\Cluster\V1\PscConfig $var - * @return $this - */ - public function setPscConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); - $this->psc_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php deleted file mode 100644 index 5a8f0feed58..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest - */ -class GetClusterCertificateAuthorityRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis cluster certificate authority resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis cluster certificate authority resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::certificateAuthorityName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis cluster certificate authority resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis cluster certificate authority resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - * where `location_id` refers to a GCP region. - * - * 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. Redis cluster certificate authority resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - * where `location_id` refers to a GCP region. - * - * 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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php deleted file mode 100644 index e457cb50362..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.redis.cluster.v1.GetClusterRequest - */ -class GetClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\GetClusterRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php deleted file mode 100644 index 7d993d799de..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.redis.cluster.v1.ListClustersRequest - */ -class ListClustersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\ListClustersRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type int $page_size - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * @type string $page_token - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - * @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/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php deleted file mode 100644 index efc059d380c..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.redis.cluster.v1.ListClustersResponse - */ -class ListClustersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - */ - private $clusters; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClusters() - { - return $this->clusters; - } - - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - * @param array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClusters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->clusters = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php deleted file mode 100644 index 3fe082e637c..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.redis.cluster.v1.NodeType - */ -class NodeType -{ - /** - * Generated from protobuf enum NODE_TYPE_UNSPECIFIED = 0; - */ - const NODE_TYPE_UNSPECIFIED = 0; - /** - * Redis shared core nano node_type. - * - * Generated from protobuf enum REDIS_SHARED_CORE_NANO = 1; - */ - const REDIS_SHARED_CORE_NANO = 1; - /** - * Redis highmem medium node_type. - * - * Generated from protobuf enum REDIS_HIGHMEM_MEDIUM = 2; - */ - const REDIS_HIGHMEM_MEDIUM = 2; - /** - * Redis highmem xlarge node_type. - * - * Generated from protobuf enum REDIS_HIGHMEM_XLARGE = 3; - */ - const REDIS_HIGHMEM_XLARGE = 3; - /** - * Redis standard small node_type. - * - * Generated from protobuf enum REDIS_STANDARD_SMALL = 4; - */ - const REDIS_STANDARD_SMALL = 4; - - private static $valueToName = [ - self::NODE_TYPE_UNSPECIFIED => 'NODE_TYPE_UNSPECIFIED', - self::REDIS_SHARED_CORE_NANO => 'REDIS_SHARED_CORE_NANO', - self::REDIS_HIGHMEM_MEDIUM => 'REDIS_HIGHMEM_MEDIUM', - self::REDIS_HIGHMEM_XLARGE => 'REDIS_HIGHMEM_XLARGE', - self::REDIS_STANDARD_SMALL => 'REDIS_STANDARD_SMALL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php deleted file mode 100644 index 9abe7ef897e..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.redis.cluster.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php deleted file mode 100644 index ee2fe513f10..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.redis.cluster.v1.PscConfig - */ -class PscConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $network = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php deleted file mode 100644 index 318d11f6936..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php +++ /dev/null @@ -1,227 +0,0 @@ -google.cloud.redis.cluster.v1.PscConnection - */ -class PscConnection extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $psc_connection_id = ''; - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $address = ''; - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $forwarding_rule = ''; - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $project_id = ''; - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - */ - protected $network = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $psc_connection_id - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * @type string $address - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * @type string $forwarding_rule - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * @type string $project_id - * Output only. The consumer project_id where the forwarding rule is created - * from. - * @type string $network - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPscConnectionId() - { - return $this->psc_connection_id; - } - - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPscConnectionId($var) - { - GPBUtil::checkString($var, True); - $this->psc_connection_id = $var; - - return $this; - } - - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getForwardingRule() - { - return $this->forwarding_rule; - } - - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setForwardingRule($var) - { - GPBUtil::checkString($var, True); - $this->forwarding_rule = $var; - - return $this; - } - - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php deleted file mode 100644 index 70baeb4693b..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.redis.cluster.v1.TransitEncryptionMode - */ -class TransitEncryptionMode -{ - /** - * In-transit encryption not set. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - */ - const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - /** - * In-transit encryption disabled. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_DISABLED = 1; - */ - const TRANSIT_ENCRYPTION_MODE_DISABLED = 1; - /** - * Use server managed encryption for in-transit encryption. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; - */ - const TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; - - private static $valueToName = [ - self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', - self::TRANSIT_ENCRYPTION_MODE_DISABLED => 'TRANSIT_ENCRYPTION_MODE_DISABLED', - self::TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION => 'TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php deleted file mode 100644 index 0f67d0fe41e..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -google.cloud.redis.cluster.v1.UpdateClusterRequest - */ -class UpdateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = null; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - - /** - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. Update description. - * Only fields specified in update_mask are updated. - * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * - * * `size_gb` - * * `replica_count` - * - * @return \Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Redis\Cluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCluster($cluster) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster - * Required. Update description. - * Only fields specified in update_mask are updated. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->cluster = $var; - - return $this; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * 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; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php deleted file mode 100644 index 1645d3cf3f6..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.redis.cluster.v1.ZoneDistributionConfig - */ -class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - * specified. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mode = 0; - /** - * Optional. When SINGLE ZONE distribution is selected, zone field would be - * used to allocate all resources in that zone. This is not applicable to - * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $zone = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - * specified. - * @type string $zone - * Optional. When SINGLE ZONE distribution is selected, zone field would be - * used to allocate all resources in that zone. This is not applicable to - * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - * specified. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - * specified. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig\ZoneDistributionMode::class); - $this->mode = $var; - - return $this; - } - - /** - * Optional. When SINGLE ZONE distribution is selected, zone field would be - * used to allocate all resources in that zone. This is not applicable to - * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getZone() - { - return $this->zone; - } - - /** - * Optional. When SINGLE ZONE distribution is selected, zone field would be - * used to allocate all resources in that zone. This is not applicable to - * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - * - * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setZone($var) - { - GPBUtil::checkString($var, True); - $this->zone = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php deleted file mode 100644 index a1d1598e503..00000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode - */ -class ZoneDistributionMode -{ - /** - * Not Set. Default: MULTI_ZONE - * - * Generated from protobuf enum ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; - */ - const ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; - /** - * Distribute all resources across 3 zones picked at random, within the - * region. - * - * Generated from protobuf enum MULTI_ZONE = 1; - */ - const MULTI_ZONE = 1; - /** - * Distribute all resources in a single zone. The zone field must be - * specified, when this mode is selected. - * - * Generated from protobuf enum SINGLE_ZONE = 2; - */ - const SINGLE_ZONE = 2; - - private static $valueToName = [ - self::ZONE_DISTRIBUTION_MODE_UNSPECIFIED => 'ZONE_DISTRIBUTION_MODE_UNSPECIFIED', - self::MULTI_ZONE => 'MULTI_ZONE', - self::SINGLE_ZONE => 'SINGLE_ZONE', - ]; - - 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(ZoneDistributionMode::class, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig_ZoneDistributionMode::class); - diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php deleted file mode 100644 index 54dd9d7d736..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php +++ /dev/null @@ -1,132 +0,0 @@ -setNetwork($clusterPscConfigsNetwork); - $clusterPscConfigs = [$pscConfig,]; - $cluster = (new Cluster()) - ->setName($clusterName) - ->setShardCount($clusterShardCount) - ->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->createCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $clusterName = '[NAME]'; - $clusterShardCount = 0; - $clusterPscConfigsNetwork = '[NETWORK]'; - - create_cluster_sample( - $formattedParent, - $clusterId, - $clusterName, - $clusterShardCount, - $clusterPscConfigsNetwork - ); -} -// [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php deleted file mode 100644 index ee3e020173b..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->deleteCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - delete_cluster_sample($formattedName); -} -// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php deleted file mode 100644 index 6fb81f5b64b..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Cluster $response */ - $response = $cloudRedisClusterClient->getCluster($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - get_cluster_sample($formattedName); -} -// [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php deleted file mode 100644 index b23b63cb2e2..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CertificateAuthority $response */ - $response = $cloudRedisClusterClient->getClusterCertificateAuthority($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClusterClient::certificateAuthorityName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - get_cluster_certificate_authority_sample($formattedName); -} -// [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php deleted file mode 100644 index a92286bb407..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END redis_v1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php deleted file mode 100644 index 8c213fe52b8..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php +++ /dev/null @@ -1,86 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudRedisClusterClient->listClusters($request); - - /** @var Cluster $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); - - list_clusters_sample($formattedParent); -} -// [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php deleted file mode 100644 index 484811919b9..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END redis_v1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php deleted file mode 100644 index da166dd875d..00000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php +++ /dev/null @@ -1,108 +0,0 @@ -setNetwork($clusterPscConfigsNetwork); - $clusterPscConfigs = [$pscConfig,]; - $cluster = (new Cluster()) - ->setName($clusterName) - ->setShardCount($clusterShardCount) - ->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->updateCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $clusterName = '[NAME]'; - $clusterShardCount = 0; - $clusterPscConfigsNetwork = '[NETWORK]'; - - update_cluster_sample($clusterName, $clusterShardCount, $clusterPscConfigsNetwork); -} -// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php b/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php deleted file mode 100644 index 1b1d8df65b7..00000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php +++ /dev/null @@ -1,576 +0,0 @@ - createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) - * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) - * @method PromiseInterface getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = []) - * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class CloudRedisClusterClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.redis.cluster.v1.CloudRedisCluster'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'redis.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'redis.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_redis_cluster_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * certificate_authority resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted certificate_authority resource. - */ - public static function certificateAuthorityName(string $project, string $location, string $cluster): string - { - return self::getPathTemplate('certificateAuthority')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName(string $project, string $location, string $cluster): string - { - return self::getPathTemplate('cluster')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - location: projects/{project}/locations/{location} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'redis.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Redis cluster based on the specified properties. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. Once the operation is completed the Redis - * cluster will be fully functional. The completed longrunning.Operation will - * contain the new cluster object in the response field. - * - * The returned operation is automatically deleted after a few hours, so there - * is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClusterClient::createClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/create_cluster.php - * - * @param CreateClusterRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); - } - - /** - * Deletes a specific Redis cluster. Cluster stops serving and data is - * deleted. - * - * The async variant is {@see CloudRedisClusterClient::deleteClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/delete_cluster.php - * - * @param DeleteClusterRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); - } - - /** - * Gets the details of a specific Redis cluster. - * - * The async variant is {@see CloudRedisClusterClient::getClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_cluster.php - * - * @param GetClusterRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Cluster - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster - { - return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); - } - - /** - * Gets the details of certificate authority information for Redis cluster. - * - * The async variant is - * {@see CloudRedisClusterClient::getClusterCertificateAuthorityAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php - * - * @param GetClusterCertificateAuthorityRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CertificateAuthority - * - * @throws ApiException Thrown if the API call fails. - */ - public function getClusterCertificateAuthority(GetClusterCertificateAuthorityRequest $request, array $callOptions = []): CertificateAuthority - { - return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait(); - } - - /** - * Lists all Redis clusters owned by a project in either the specified - * location (region) or all locations. - * - * The location should have the following format: - * - * * `projects/{project_id}/locations/{location_id}` - * - * If `location_id` is specified as `-` (wildcard), then all regions - * available to the project are queried, and the results are aggregated. - * - * The async variant is {@see CloudRedisClusterClient::listClustersAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/list_clusters.php - * - * @param ListClustersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListClusters', $request, $callOptions); - } - - /** - * Updates the metadata and configuration of a specific Redis cluster. - * - * Completed longrunning.Operation will contain the new cluster object - * in the response field. The returned operation is automatically deleted - * after a few hours, so there is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClusterClient::updateClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/update_cluster.php - * - * @param UpdateClusterRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see CloudRedisClusterClient::getLocationAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see CloudRedisClusterClient::listLocationsAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json b/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 3c75e8b0b86..00000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.redis.cluster.v1", - "libraryPackage": "Google\\Cloud\\Redis\\Cluster\\V1", - "services": { - "CloudRedisCluster": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClusterGapicClient", - "rpcs": { - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetClusterCertificateAuthority": { - "methods": [ - "getClusterCertificateAuthority" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json deleted file mode 100644 index 11c25ca9ac4..00000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.redis.cluster.v1.CloudRedisCluster": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "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 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetClusterCertificateAuthority": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListClusters": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php deleted file mode 100644 index 686a9576bac..00000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php +++ /dev/null @@ -1,169 +0,0 @@ - [ - 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ - 'CreateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'cluster.name', - 'fieldAccessors' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\Cluster', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetClusterCertificateAuthority' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\CertificateAuthority', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListClusters' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getClusters', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\ListClustersResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'certificateAuthority' => 'projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority', - 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php deleted file mode 100644 index 69fe4ba287c..00000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php +++ /dev/null @@ -1,174 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ - 'CreateCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'cluster_id', - ], - ], - 'DeleteCluster' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetClusterCertificateAuthority' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListClusters' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', - 'body' => 'cluster', - 'placeholders' => [ - 'cluster.name' => [ - 'getters' => [ - 'getCluster', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php deleted file mode 100644 index de2b3c0055d..00000000000 --- a/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php +++ /dev/null @@ -1,940 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudRedisClusterClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudRedisClusterClient($options); - } - - /** @test */ - public function createClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($request); - $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.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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 createClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createClusterTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - 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 deleteClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($request); - $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.redis.cluster.v1.CloudRedisCluster/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $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 deleteClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteClusterTest'); - $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 - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - 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 getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->getCluster($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - try { - $gapicClient->getCluster($request); - // 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 getClusterCertificateAuthorityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new CertificateAuthority(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterCertificateAuthorityRequest()) - ->setName($formattedName); - $response = $gapicClient->getClusterCertificateAuthority($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterCertificateAuthorityExceptionTest() - { - $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->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterCertificateAuthorityRequest()) - ->setName($formattedName); - try { - $gapicClient->getClusterCertificateAuthority($request); - // 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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listClusters($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listClusters($request); - // 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 updateClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($request); - $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.redis.cluster.v1.CloudRedisCluster/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $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 updateClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateClusterTest'); - $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 - $updateMask = new FieldMask(); - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createClusterAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createClusterAsync($request)->wait(); - $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.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php deleted file mode 100644 index 3bcfe86bbbf41822c6380029e18cfe855b68980d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5416 zcmcIoOHUhD6z-Tn!i6N{@(9p8CPShS3gZH4RSludfDJ+lfr6oG>&P1HYkQjU%yec9 zrIbwEckj6m z-gCs~ zM!^V->?$>qT_#4dTX7@V-T4Io@|NNI@(MEsj)07R-0GfX=4C%H0{rW?>E}$_3{1l^ zKgS*|%0);41$^zCV2?`EKcFhiuXB$>F zh5Wo{x`E?uVo^;ip&$$;`7(KrZ%fRXMR}58)U*bWi*n#qQFM1%_E1pu>;;OO7&s39 z$~Fm_?wVQMwjB}$$M!X??o-`FE5&8YM0U`b&Weew!V)SQ`=;Y{rYcg~zSf#i$?nc( z@vlt>C;PBt%}&)GId;jb+O}zzvKubxj?SVQ77Gp2y5T=#j!M#XKeOAB=7 zU6YriUMPgsw}QKMGOQO;J$J!hx4=wCZ3=HPag}zpdaA3{{rT~$+@9f@xb;a5u?8RK znn|)yB!!aOvFB0wzUe#LPG0&ds;X|nBq&L7qB=Bk@669Qy1VcxU!wm zGwIyU&aCaG2P7Q1fmHfY8p~{@-``1ZXRt&IB0DycN9>Q|ElE-`U|k1-hh^!C-82-^J$vg71LyJOH>FpA4I`Ygyr zpwPlrJ_bYE$nf%I7QoQcm^;MTrtXBzAwdYbaqPXrh>OZ6VEB~r|Iw3eFt|*cC|(K= zKo1KVO-ctbBdJIz55Q2=s<`MhZ~?6ccqyz87TvEUFt|f|v=u0#*C{B7`GR*oVLa|w zBVU9E7jtC<3`MaBSClWnm33zy#S#AJ4uW?8EZ|-=ZF=zH%8Srxy>FB!0M>UGm|BE) z7+hr6(wH?k-gGD0YRU&-Fh%L^6}zY4XhsbSf1;p~|V5z2Cs8*iIcl!=;7PtGrY|MUCA2pl3~!Vx(d7mJ*zr;gzd66lMt z8Js^8QAAo`y5E@+qZ#E|P3OlrMR*bRMFtu8qXaI-=n1}c<}NXL0q*Ti)i^w*rZdi@ z=!PJSpwoQH%J7*4`lAE{&yGY?TtK`oAV#iLYIrMF(kJ?j@H*6#@NgtqPAS%5B^pVM zFTv*+Y?NZ!02>u=6RZ&f8#N&Mp{7FycDl+gNQ5RS@H=y_(;{Wd>Zw`{9r;xPpw3Eg zPDHQeFqtd81_zg9d;Y`uKO!i9XTBT=JVlaL5WDkt2h*nQ!tMM^5s7_OYSX}2j&m!@@1rd^cG)G3M7#0)S>11Pa$JVP22J3cU;F|xe2HOP{X z)(LLN1+E;J;V*FFCve~g^a!_{dZ3qH87`dIU42CU$RzHNi{pL2o_*eref{(kr{jP{ zRKON?HG-R{(MP0%k>lFL)@>6tdaV|Ak#2V#!^EzHP;L)B+pC~_u2^}OntFE6)v;?e3sd*mSi@OBJ0MS3E*Dwtod4vYi(URfS4a*>gW*X1w?KV+M zGd)Z_jOw;}md?N-X0T`JIJ1m=pG8d%9~l#CA(m zRZ-fQM6|M#%yJNxxieZQ<6~5m5s;gRxIG+?j*yE<&$Tuy>C-XM9LrBAK}o31W>f(?w0km9&R7N?fqx*#zCqi-hrW@-drcbZHR&*$ zz884a9D_C_%ckFO>A+HEf)-0zy%FRrP`Dqn3>^oe2Z6}Yy7J+gOh4)lr$3OV2jv5@ zFfMO<+BGr>iS&)dAEv=o%?g|9ps=8e%R`YWLyaVQP`OouIXFvbNLB3p}8VRNP zS}lVoyz0W*2nKv`by`-QM4t*dP8?jY<8xX*j(Q6CeahiqGwz)tMlE2i_SQ!gJ^(#xMtN#tHCfoGDs8t6}w=*VF^WNDv-T&48P6fd_vPz^$R2zz;9PI%E;>o1W~F;_|7= zhrsuL{`GTW0jAj+am-qObAUnl@d^A*0B?_B9d29*b&ORA_vxD%`-v7ar>b8Z9DW+6 zMz$cuNHEPBtN7zU<8Rytgh;=&Nz{E&|SritpQdM#{D9{7p)9_KAQ9N~^F zDp6=fc+BCHV`n39;==zQju#8f;QTHCSfMk3VZ?6N@I1ECz|7G7M^!>-%a_m$a#lW7 z?}S9HIA_r~lOKp{7cfaiVA2bue-d7(i87AHS8dDeZ~ZNRMLMTLV$Pd6TX0|)@HMC;e7WoEhp#7{_icM*<)^@D zyM|;2?}XFX7&-Yh@vy)bercO6{L+4~@bCJ+9i(dZMW|5=eiKAL3Id%P{Z;TfA^L6< sh5J#IAxDZ*%{H#`$2t2b+Qe4;T|2g#vlYS6$E@XC(_f!YzzG2V0e@7Ad;kCd diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php deleted file mode 100644 index 69919eb3a5c5ce55acb67262352dc1663d86047f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5620 zcmcIo%WvF77{^JICX+tWNw#@NZH-fC+9qBlTOM+of|K1wK}i$xl7N*~&hBJm;Iquy!1gP4HiEn#lTmYX@qQ}LVVXK5_xfL zeuV@^$q0=6BD0cTpjPthNh|s7%zcE4mf`#I8n=d?AQ}GL>W*a=Wj`U{7=Mu3`BEluygB26pl)?@#6)rFq(-emJ(sjOM8kO|HOd5U)F3UP!A5X3))+YFxRnK4AiSow{ z2)=T8M{|S~$P$+j@FR&pq#_hh{y2xuL!KzB;VbAICA3jVmL~h>yPxUZcnI~nh6mvo z?Ghg)Jc1C|qbdcnG}I zV0wgk3Ex8lMUQ}Ff$n0o7gh#l$AuHIMK!9n&>(14UEpP|b-rz_60wNT>T6F6A_#{- zd9+`E?#4@~*D`j9<&Pq{8}Qx}c+aZEC@9NJEoTSb5#5P2K8*%q-|ztH-X}+4w(v#N zb6{9i66Q(kdQ(!~Mm;R9IEAikZ0ei2!q(%BwcNteqorJS@Fk2;ufDLkw4EE2@Gu(8 z=9Y6Hvz~i*E4Q%;5?$Kjb3KdhGN7Wg`C-U60bSv%aIB_931MCse)36O+%nJfuD|u^j@&7qqM>Ee7lwUdc`T~hu$23m?QSgHVYLgVc_DE2 zi5)NMtEk_l3qG8-tfqTd&@t4bzvmnl!fGh7((YqR%03!SdiPy8u?W^sp9lkFhbDcp z-J}D)%QpEqC@?HBkV-y}QX9nZihDea(QYy7fq;6v5<=9pMLXH1QbAW6t^c39*+#<) ztd$#T;vqWEL&xg6gUHc+cPS=HCG3hj8BQm;gVx2rat9tneQ*s5j2$cNsXp3b0J(I; zs-sW&QbNO9j96am9w^Om!lFdZYP1>D=s*sOaRj9jXvEHy&k$a54oCyY|K5D~6@*LB z$EMBh6i~6TbE4jHN(v3d{710fL&I4{urC~#0-;Elj(mQAu5Q_3BfogBV`!woxbQps z6pD#E^zl~`LUl64vn{EiF3kCDylpyBZq{^mrhoqXpI>*4;1qqtJfY|6oXZ~{={v{x z8wp*AGZ}7uNX5kktk+s@C8-q>jB>4}^GgOpc?n;LKeh0;61tS6Cj5F!M@a<%@Qsf3 zIK+vX9&#*0n8HJGgqqK28UG-miwW|j;EtaACf+E~H$ z4gDgaff(K3jELo#*R7azo0~CC^y~EmG-J1#K1v}@$)^dD?dOIv-n0|73NW<>*Oc!e zF9{B7BQFX0Hn*~v%uB*VJufi|xpM}E{4Al%4fKaww_Afoo1nK&bfq5uvsgFId=tv` z=JBrb?us*RZQQfV+0%> zL_9*LMFhIr4RLBF$;o!Lrl(?v>+Trr8D;A1KnABE0{HQ-q!WFjjaSTXdU-DhTwhD4 z4-XGH;OL2CRD->6GB^#d(_q)}DpQ?_!{EUvO*^)AH2;@`Cg9y9f^rr)&0iGP2KWt} zHR=78P&Awlu%}nqIW?&S%y7<&81g5ZyL124m+!i6EV5yxxN+1*u7o2`bvtt+ zB=UTo84WbKOdckh&%2b+jHWR=n$}=Q)3!4^y};gqlera*bEd*!VQjWYrw3-S$y||1 LhV#E;bd1nHW>tFi diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php deleted file mode 100644 index 0ebffddc7ed..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php +++ /dev/null @@ -1,81 +0,0 @@ -internalAddGeneratedFile( - ' -� -2google/cloud/resourcemanager/v3/tag_bindings.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto"� - -TagBinding -name ( B�A -parent (  - tag_value ( ! -tag_value_namespaced_name ( :N�AK -.cloudresourcemanager.googleapis.com/TagBindingtagBindings/{tag_binding}" -CreateTagBindingMetadata"| -CreateTagBindingRequestE - tag_binding ( 2+.google.cloud.resourcemanager.v3.TagBindingB�A - validate_only (B�A" -DeleteTagBindingMetadata"_ -DeleteTagBindingRequestD -name ( B6�A�A0 -.cloudresourcemanager.googleapis.com/TagBinding"d -ListTagBindingsRequest -parent ( B �A�A* - page_size (B�A - -page_token ( B�A"u -ListTagBindingsResponseA - tag_bindings ( 2+.google.cloud.resourcemanager.v3.TagBinding -next_page_token ( "` -ListEffectiveTagsRequest -parent ( B�A - page_size (B�A - -page_token ( B�A"{ -ListEffectiveTagsResponseE -effective_tags ( 2-.google.cloud.resourcemanager.v3.EffectiveTag -next_page_token ( "� - EffectiveTagD - tag_value ( B1�A. -,cloudresourcemanager.googleapis.com/TagValue -namespaced_tag_value ( @ -tag_key ( B/�A, -*cloudresourcemanager.googleapis.com/TagKey -namespaced_tag_key (  -tag_key_parent_name (  - inherited (2� - TagBindings� -ListTagBindings7.google.cloud.resourcemanager.v3.ListTagBindingsRequest8.google.cloud.resourcemanager.v3.ListTagBindingsResponse" �Aparent���/v3/tagBindings� -CreateTagBinding8.google.cloud.resourcemanager.v3.CreateTagBindingRequest.google.longrunning.Operation"[�A& - -TagBindingCreateTagBindingMetadata�A tag_binding���"/v3/tagBindings: tag_binding� -DeleteTagBinding8.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.google.longrunning.Operation"\\�A1 -google.protobuf.EmptyDeleteTagBindingMetadata�Aname���*/v3/{name=tagBindings/**}� -ListEffectiveTags9.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse""�Aparent���/v3/effectiveTags��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� -#com.google.cloud.resourcemanager.v3BTagBindingsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php deleted file mode 100644 index c1adf3076f1..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php +++ /dev/null @@ -1,66 +0,0 @@ -internalAddGeneratedFile( - ' -� -/google/cloud/resourcemanager/v3/tag_holds.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"� -TagHold -name ( B�A -holder ( B�A -origin ( B�A - help_link ( B�A4 - create_time ( 2.google.protobuf.TimestampB�A:[�AX -+cloudresourcemanager.googleapis.com/TagHold)tagValues/{tag_value}/tagHolds/{tag_hold}"� -CreateTagHoldRequestC -parent ( B3�A�A-+cloudresourcemanager.googleapis.com/TagHold? -tag_hold ( 2(.google.cloud.resourcemanager.v3.TagHoldB�A - validate_only (B�A" -CreateTagHoldMetadata"u -DeleteTagHoldRequestA -name ( B3�A�A- -+cloudresourcemanager.googleapis.com/TagHold - validate_only (B�A" -DeleteTagHoldMetadata"� -ListTagHoldsRequestC -parent ( B3�A�A-+cloudresourcemanager.googleapis.com/TagHold - page_size (B�A - -page_token ( B�A -filter ( B�A"l -ListTagHoldsResponse; - tag_holds ( 2(.google.cloud.resourcemanager.v3.TagHold -next_page_token ( 2� -TagHolds� - CreateTagHold5.google.cloud.resourcemanager.v3.CreateTagHoldRequest.google.longrunning.Operation"h�A -TagHoldCreateTagHoldMetadata�Aparent,tag_hold���-"!/v3/{parent=tagValues/*}/tagHolds:tag_hold� - DeleteTagHold5.google.cloud.resourcemanager.v3.DeleteTagHoldRequest.google.longrunning.Operation"a�A. -google.protobuf.EmptyDeleteTagHoldMetadata�Aname���#*!/v3/{name=tagValues/*/tagHolds/*}� - ListTagHolds4.google.cloud.resourcemanager.v3.ListTagHoldsRequest5.google.cloud.resourcemanager.v3.ListTagHoldsResponse"2�Aparent���#!/v3/{parent=tagValues/*}/tagHolds��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� -#com.google.cloud.resourcemanager.v3B TagHoldsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php deleted file mode 100644 index 85b35f549341b97fe9306587862a565cb1d3896d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4764 zcmb_gOK;p%6vj#Ox|z~&)27o=X^qn=X-GXJ>7qEK;AAFIMAD3sG)Tx|aAxjIta@x? zds0G`4GUHvAt80eiXDg_z+a$C*hNC>qN_^$0al#*@_6zfGosl{RU6shnRG|=w@9nESrVc#;O>tw&Nn1-=E7}6$b6Vf#jzo;u)S3 znt8fVqf9C93aSW!Ybi}>SS;NTOOD;h@6Y7nryQ`Ti}hUldfVE#SaVzP%lk?EgaKKu zSTTZ(76=;g$SNlC17feTWAS$6Csm$*CyqTnr*5&C7?1F{*l7x3Rd*9dpMv{eArq8En;%xG>FjfhQ>1w4#;p#$+K z;fttm-*%gX$H(ZouNcKw<|3M6pd}wg0~1()%8?GOFfZc{o}g_g{}leA-R*EwQMAty zUUQt=|0gKik zif<_;)M0>qh@=5;Es>P6;mi0;Z!B>uhr;Hk;xYO_w+}{B10&z)9 z+HwEy;QyBwX(?s(CB=3Cn8qOiPTfNTBE^BdqoqfirH!p(`O(9zQgLZ@d9_#=c>|B2 z%*s-+yu7+u{KQ;a8&PIoX3zjXP=uc;XgHNfc<$V6Nl6Q`=I(W;#B)`k0l=K|@K_;hA%HNMt3bjuT%SKQdYKVlc+=WeVdd?L-TZDXh3n9payW z3#a5Op6>+N8Cjm|9OLaY#w;F7xhmgkn)p`*Wzs2#&ks#nT>9>9d8pI`p(hidw({J( zk#zo3Q~t=5RfaoNOUKrbYxsA7o6fur;HJepgj;Qcn>HX5>Bt;~P}BA`-Q)uSEhr4S zH8Fdg5kd&)$B5B7%+GL`be48-n6!9@hbgojCT*Z~m=v3*PG>VzwhXX2xk_M7MjQrB zeSbzzFG^%rj>+)rgf@R<4$5JHxok?i%{(SQrqYPs4wFp{X#C#+kge3W6F}07=Kxte zGB3$Jr};p9E}kg0H^uXtg77vBD-5{XC;l+$-N9@v9Qa)YhlKdLO#?88a;zb1@L!p)q z6k}?zJAdNKFFiL`*rSTRL?2c3P4TF*&Yx!Vow?^y!V>Q;$-|3~vEb$9RgcEa7zVRr m7{?45#?IVsKf5i>O(gfuY5uB_dIUN10fb5Nhl)dVh|s^Gp-XoF diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php deleted file mode 100644 index c29cec5332a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php +++ /dev/null @@ -1,90 +0,0 @@ -internalAddGeneratedFile( - ' -� -0google/cloud/resourcemanager/v3/tag_values.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� -TagValue -name ( B�A -parent ( B�A - -short_name ( B�A�A -namespaced_name ( B�A - description ( B�A4 - create_time ( 2.google.protobuf.TimestampB�A4 - update_time ( 2.google.protobuf.TimestampB�A -etag ( B�A:K�AH -,cloudresourcemanager.googleapis.com/TagValuetagValues/{tag_value}R"b -ListTagValuesRequest -parent ( B �A�A* - page_size (B�A - -page_token ( B�A"o -ListTagValuesResponse= - -tag_values ( 2).google.cloud.resourcemanager.v3.TagValue -next_page_token ( "X -GetTagValueRequestB -name ( B4�A�A. -,cloudresourcemanager.googleapis.com/TagValue"b -GetNamespacedTagValueRequestB -name ( B4�A�A. -,cloudresourcemanager.googleapis.com/TagValue"v -CreateTagValueRequestA - tag_value ( 2).google.cloud.resourcemanager.v3.TagValueB�A - validate_only (B�A" -CreateTagValueMetadata"� -UpdateTagValueRequestA - tag_value ( 2).google.cloud.resourcemanager.v3.TagValueB�A4 - update_mask ( 2.google.protobuf.FieldMaskB�A - validate_only (B�A" -UpdateTagValueMetadata"� -DeleteTagValueRequestB -name ( B4�A�A. -,cloudresourcemanager.googleapis.com/TagValue - validate_only (B�A -etag ( B�A" -DeleteTagValueMetadata2� - TagValues� - ListTagValues5.google.cloud.resourcemanager.v3.ListTagValuesRequest6.google.cloud.resourcemanager.v3.ListTagValuesResponse"�Aparent��� /v3/tagValues� - GetTagValue3.google.cloud.resourcemanager.v3.GetTagValueRequest).google.cloud.resourcemanager.v3.TagValue"%�Aname���/v3/{name=tagValues/*}� -GetNamespacedTagValue=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest).google.cloud.resourcemanager.v3.TagValue"\'�Aname���/v3/tagValues/namespaced� -CreateTagValue6.google.cloud.resourcemanager.v3.CreateTagValueRequest.google.longrunning.Operation"Q�A" -TagValueCreateTagValueMetadata�A tag_value���" /v3/tagValues: tag_value� -UpdateTagValue6.google.cloud.resourcemanager.v3.UpdateTagValueRequest.google.longrunning.Operation"p�A" -TagValueUpdateTagValueMetadata�Atag_value,update_mask���-2 /v3/{tag_value.name=tagValues/*}: tag_value� -DeleteTagValue6.google.cloud.resourcemanager.v3.DeleteTagValueRequest.google.longrunning.Operation"J�A" -TagValueDeleteTagValueMetadata�Aname���*/v3/{name=tagValues/*}� - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"=�Aresource���,"\'/v3/{resource=tagValues/*}:getIamPolicy:*� - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"D�Aresource,policy���,"\'/v3/{resource=tagValues/*}:setIamPolicy:*� -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"O�Aresource,permissions���2"-/v3/{resource=tagValues/*}:testIamPermissions:*��A#cloudresourcemanager.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� -#com.google.cloud.resourcemanager.v3BTagValuesProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb�Google.Cloud.ResourceManager.V3�Google\\Cloud\\ResourceManager\\V3�"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php deleted file mode 100644 index 965bede9e76..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.resourcemanager.v3.CreateFolderMetadata - */ -class CreateFolderMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - */ - protected $parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The display name of the folder. - * @type string $parent - * The resource name of the folder or organization we are creating the folder - * under. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php deleted file mode 100644 index 492c53088fb..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php +++ /dev/null @@ -1,95 +0,0 @@ -google.cloud.resourcemanager.v3.CreateFolderRequest - */ -class CreateFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $folder = null; - - /** - * @param \Google\Cloud\ResourceManager\V3\Folder $folder Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * @return \Google\Cloud\ResourceManager\V3\CreateFolderRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\Folder $folder): self - { - return (new self()) - ->setFolder($folder); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Folder $folder - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Folder|null - */ - public function getFolder() - { - return $this->folder; - } - - public function hasFolder() - { - return isset($this->folder); - } - - public function clearFolder() - { - unset($this->folder); - } - - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Folder $var - * @return $this - */ - public function setFolder($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folder = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php deleted file mode 100644 index 64d5f69ff7b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.resourcemanager.v3.CreateProjectMetadata - */ -class CreateProjectMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - */ - protected $gettable = false; - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - */ - protected $ready = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Creation time of the project creation workflow. - * @type bool $gettable - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * @type bool $ready - * True if the project creation process is complete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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); - } - - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - * @return bool - */ - public function getGettable() - { - return $this->gettable; - } - - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - * @param bool $var - * @return $this - */ - public function setGettable($var) - { - GPBUtil::checkBool($var); - $this->gettable = $var; - - return $this; - } - - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - * @return bool - */ - public function getReady() - { - return $this->ready; - } - - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - * @param bool $var - * @return $this - */ - public function setReady($var) - { - GPBUtil::checkBool($var); - $this->ready = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php deleted file mode 100644 index 3abfa5c1a38..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.resourcemanager.v3.CreateProjectRequest - */ -class CreateProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project = null; - - /** - * @param \Google\Cloud\ResourceManager\V3\Project $project Required. The Project to create. - * - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * @return \Google\Cloud\ResourceManager\V3\CreateProjectRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\Project $project): self - { - return (new self()) - ->setProject($project); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Project $project - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Project|null - */ - public function getProject() - { - return $this->project; - } - - public function hasProject() - { - return isset($this->project); - } - - public function clearProject() - { - unset($this->project); - } - - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Project $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); - $this->project = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php deleted file mode 100644 index 417b98c428c..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagBindingMetadata - */ -class CreateTagBindingMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php deleted file mode 100644 index 46cd126d333..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagBindingRequest - */ -class CreateTagBindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_binding = null; - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\ResourceManager\V3\TagBinding $tagBinding Required. The TagBinding to be created. - * - * @return \Google\Cloud\ResourceManager\V3\CreateTagBindingRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\TagBinding $tagBinding): self - { - return (new self()) - ->setTagBinding($tagBinding); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagBinding $tag_binding - * Required. The TagBinding to be created. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagBinding|null - */ - public function getTagBinding() - { - return $this->tag_binding; - } - - public function hasTagBinding() - { - return isset($this->tag_binding); - } - - public function clearTagBinding() - { - unset($this->tag_binding); - } - - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagBinding $var - * @return $this - */ - public function setTagBinding($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagBinding::class); - $this->tag_binding = $var; - - return $this; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php deleted file mode 100644 index ad0b4f18f9b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagHoldMetadata - */ -class CreateTagHoldMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php deleted file mode 100644 index 9570f169d0a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagHoldRequest - */ -class CreateTagHoldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_hold = null; - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. Please see - * {@see TagHoldsClient::tagValueName()} for help formatting this field. - * @param \Google\Cloud\ResourceManager\V3\TagHold $tagHold Required. The TagHold to be created. - * - * @return \Google\Cloud\ResourceManager\V3\CreateTagHoldRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\ResourceManager\V3\TagHold $tagHold): self - { - return (new self()) - ->setParent($parent) - ->setTagHold($tagHold); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * @type \Google\Cloud\ResourceManager\V3\TagHold $tag_hold - * Required. The TagHold to be created. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * 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 TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * 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 TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagHold|null - */ - public function getTagHold() - { - return $this->tag_hold; - } - - public function hasTagHold() - { - return isset($this->tag_hold); - } - - public function clearTagHold() - { - unset($this->tag_hold); - } - - /** - * Required. The TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagHold $var - * @return $this - */ - public function setTagHold($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagHold::class); - $this->tag_hold = $var; - - return $this; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php deleted file mode 100644 index 6dcfd2f3e91..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagKeyMetadata - */ -class CreateTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php deleted file mode 100644 index 1fefbae7ed7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagKeyRequest - */ -class CreateTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_key = null; - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\ResourceManager\V3\TagKey $tagKey Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * @return \Google\Cloud\ResourceManager\V3\CreateTagKeyRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\TagKey $tagKey): self - { - return (new self()) - ->setTagKey($tagKey); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @type bool $validate_only - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagKey|null - */ - public function getTagKey() - { - return $this->tag_key; - } - - public function hasTagKey() - { - return isset($this->tag_key); - } - - public function clearTagKey() - { - unset($this->tag_key); - } - - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagKey $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_key = $var; - - return $this; - } - - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php deleted file mode 100644 index 4783b3262ba..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagValueMetadata - */ -class CreateTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php deleted file mode 100644 index 11be5a0d290..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagValueRequest - */ -class CreateTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_value = null; - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\ResourceManager\V3\TagValue $tagValue Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * @return \Google\Cloud\ResourceManager\V3\CreateTagValueRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\TagValue $tagValue): self - { - return (new self()) - ->setTagValue($tagValue); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @type bool $validate_only - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagValue|null - */ - public function getTagValue() - { - return $this->tag_value; - } - - public function hasTagValue() - { - return isset($this->tag_value); - } - - public function clearTagValue() - { - unset($this->tag_value); - } - - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagValue $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_value = $var; - - return $this; - } - - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php deleted file mode 100644 index 218142421f9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteFolderMetadata - */ -class DeleteFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php deleted file mode 100644 index dabb2171694..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteFolderRequest - */ -class DeleteFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. Please see - * {@see FoldersClient::folderName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteFolderRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_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. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php deleted file mode 100644 index e1f9c485620..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteOrganizationMetadata - */ -class DeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php deleted file mode 100644 index ccb5bc729ca..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteProjectMetadata - */ -class DeleteProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php deleted file mode 100644 index dc03f91ecc5..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteProjectRequest - */ -class DeleteProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Project (for example, `projects/415104041262`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the Project (for example, `projects/415104041262`). Please see - * {@see ProjectsClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteProjectRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the Project (for example, `projects/415104041262`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Project (for example, `projects/415104041262`). - * - * 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 name of the Project (for example, `projects/415104041262`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php deleted file mode 100644 index ceaecd1073f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagBindingMetadata - */ -class DeleteTagBindingMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php deleted file mode 100644 index 3d3141e6ba2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagBindingRequest - */ -class DeleteTagBindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). Please see - * {@see TagBindingsClient::tagBindingName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * 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 name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php deleted file mode 100644 index dc16e59f2a7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagHoldMetadata - */ -class DeleteTagHoldMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php deleted file mode 100644 index 10b92c6d1a7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagHoldRequest - */ -class DeleteTagHoldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. Please see - * {@see TagHoldsClient::tagHoldName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-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. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-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; - } - - /** - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php deleted file mode 100644 index f4c10627911..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagKeyMetadata - */ -class DeleteTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php deleted file mode 100644 index 7c44199f39b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagKeyRequest - */ -class DeleteTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * @param string $name Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. Please see - * {@see TagKeysClient::tagKeyName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * @type bool $validate_only - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * 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 resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * 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; - } - - /** - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php deleted file mode 100644 index 0b447cb8bcd..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagValueMetadata - */ -class DeleteTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php deleted file mode 100644 index 49144e5ddee..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagValueRequest - */ -class DeleteTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Resource name for TagValue to be deleted in the format - * tagValues/456. Please see - * {@see TagValuesClient::tagValueName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\DeleteTagValueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * @type bool $validate_only - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * 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. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * 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; - } - - /** - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php deleted file mode 100644 index 321ccbdb024..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php +++ /dev/null @@ -1,289 +0,0 @@ -google.cloud.resourcemanager.v3.EffectiveTag - */ -class EffectiveTag extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - */ - protected $tag_value = ''; - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - */ - protected $namespaced_tag_value = ''; - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - */ - protected $tag_key = ''; - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - */ - protected $namespaced_tag_key = ''; - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - */ - protected $tag_key_parent_name = ''; - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - */ - protected $inherited = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $tag_value - * Resource name for TagValue in the format `tagValues/456`. - * @type string $namespaced_tag_value - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * @type string $tag_key - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * @type string $namespaced_tag_key - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * @type string $tag_key_parent_name - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * @type bool $inherited - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getTagValue() - { - return $this->tag_value; - } - - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkString($var, True); - $this->tag_value = $var; - - return $this; - } - - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - * @return string - */ - public function getNamespacedTagValue() - { - return $this->namespaced_tag_value; - } - - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - * @param string $var - * @return $this - */ - public function setNamespacedTagValue($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_value = $var; - - return $this; - } - - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getTagKey() - { - return $this->tag_key; - } - - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkString($var, True); - $this->tag_key = $var; - - return $this; - } - - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - * @return string - */ - public function getNamespacedTagKey() - { - return $this->namespaced_tag_key; - } - - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - * @param string $var - * @return $this - */ - public function setNamespacedTagKey($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_key = $var; - - return $this; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @return string - */ - public function getTagKeyParentName() - { - return $this->tag_key_parent_name; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @param string $var - * @return $this - */ - public function setTagKeyParentName($var) - { - GPBUtil::checkString($var, True); - $this->tag_key_parent_name = $var; - - return $this; - } - - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - * @return bool - */ - public function getInherited() - { - return $this->inherited; - } - - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - * @param bool $var - * @return $this - */ - public function setInherited($var) - { - GPBUtil::checkBool($var); - $this->inherited = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php deleted file mode 100644 index a2a3f4bc7eb..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php +++ /dev/null @@ -1,392 +0,0 @@ -google.cloud.resourcemanager.v3.Folder - */ -class Folder extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - */ - protected $display_name = ''; - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * @type string $parent - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * @type string $display_name - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * @type int $state - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Timestamp when the folder was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Timestamp when the folder was last modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Timestamp when the folder was requested to be deleted. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Folder\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php deleted file mode 100644 index 1758cdf0f34..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.resourcemanager.v3.Folder.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The folder has been marked for deletion by the user. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - 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(State::class, \Google\Cloud\ResourceManager\V3\Folder_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php deleted file mode 100644 index e24bc7bd945..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.resourcemanager.v3.GetFolderRequest - */ -class GetFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. Please see - * {@see FoldersClient::folderName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetFolderRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_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. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php deleted file mode 100644 index 075ebc7bea6..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest - */ -class GetNamespacedTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. Please see - * {@see TagKeysClient::tagKeyName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * 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. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php deleted file mode 100644 index b7850628639..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest - */ -class GetNamespacedTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A namespaced tag value name in the following format: - * - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * Please see {@see TagValuesClient::tagValueName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * 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. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php deleted file mode 100644 index cb606425175..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.resourcemanager.v3.GetOrganizationRequest - */ -class GetOrganizationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". Please see - * {@see OrganizationsClient::organizationName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetOrganizationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * 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 resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php deleted file mode 100644 index c4a9092bbc8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.resourcemanager.v3.GetProjectRequest - */ -class GetProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project (for example, `projects/415104041262`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the project (for example, `projects/415104041262`). Please see - * {@see ProjectsClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetProjectRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the project (for example, `projects/415104041262`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project (for example, `projects/415104041262`). - * - * 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 name of the project (for example, `projects/415104041262`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php deleted file mode 100644 index ded215b74f7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.resourcemanager.v3.GetTagKeyRequest - */ -class GetTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. Please see - * {@see TagKeysClient::tagKeyName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetTagKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * 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. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php deleted file mode 100644 index b20eae9c9e8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.resourcemanager.v3.GetTagValueRequest - */ -class GetTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. Please see - * {@see TagValuesClient::tagValueName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\GetTagValueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * 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. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php deleted file mode 100644 index 545b9e85568..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.resourcemanager.v3.ListEffectiveTagsRequest - */ -class ListEffectiveTagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * @return \Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @type int $page_size - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the 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. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php deleted file mode 100644 index 8c970dbe1d0..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListEffectiveTagsResponse - */ -class ListEffectiveTagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - */ - private $effective_tags; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags - * A possibly paginated list of effective tags for the specified resource. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEffectiveTags() - { - return $this->effective_tags; - } - - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - * @param array<\Google\Cloud\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEffectiveTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\EffectiveTag::class); - $this->effective_tags = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php deleted file mode 100644 index 8c6ebb0b7e9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php +++ /dev/null @@ -1,234 +0,0 @@ -google.cloud.resourcemanager.v3.ListFoldersRequest - */ -class ListFoldersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * @return \Google\Cloud\ResourceManager\V3\ListFoldersRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * @type int $page_size - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * @type bool $show_deleted - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * 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 name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * 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. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate 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. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * 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. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php deleted file mode 100644 index 72d6127db51..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.resourcemanager.v3.ListFoldersResponse - */ -class ListFoldersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - */ - private $folders; - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFolders() - { - return $this->folders; - } - - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFolders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folders = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php deleted file mode 100644 index fc0eeb55b49..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.resourcemanager.v3.ListProjectsRequest - */ -class ListProjectsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * @return \Google\Cloud\ResourceManager\V3\ListProjectsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * @type int $page_size - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * @type bool $show_deleted - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * 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 name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * 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. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php deleted file mode 100644 index 4714956716e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.resourcemanager.v3.ListProjectsResponse - */ -class ListProjectsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - */ - private $projects; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects - * The list of Projects under the parent. This list can be paginated. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProjects() - { - return $this->projects; - } - - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProjects($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); - $this->projects = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php deleted file mode 100644 index c11d2e2b258..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagBindingsRequest - */ -class ListTagBindingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * @return \Google\Cloud\ResourceManager\V3\ListTagBindingsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @type int $page_size - * Optional. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * 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 full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * 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. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the 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. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php deleted file mode 100644 index f71e67a1f32..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagBindingsResponse - */ -class ListTagBindingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - */ - private $tag_bindings; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $tag_bindings - * A possibly paginated list of TagBindings for the specified resource. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagBindings() - { - return $this->tag_bindings; - } - - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagBindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagBinding::class); - $this->tag_bindings = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php deleted file mode 100644 index c1f0e4ac519..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php +++ /dev/null @@ -1,236 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagHoldsRequest - */ -class ListTagHoldsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. Please see - * {@see TagHoldsClient::tagValueName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\ListTagHoldsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * @type int $page_size - * Optional. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * @type string $filter - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * 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 parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * 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. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the 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. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * 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. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php deleted file mode 100644 index 8d12cbcf049..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagHoldsResponse - */ -class ListTagHoldsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - */ - private $tag_holds; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $tag_holds - * A possibly paginated list of TagHolds. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagHolds() - { - return $this->tag_holds; - } - - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagHolds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagHold::class); - $this->tag_holds = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php deleted file mode 100644 index 09ad5cd4499..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagKeysRequest - */ -class ListTagKeysRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * @return \Google\Cloud\ResourceManager\V3\ListTagKeysRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * @type int $page_size - * Optional. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * 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 TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * 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. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the 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. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php deleted file mode 100644 index ff989a9f578..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagKeysResponse - */ -class ListTagKeysResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - */ - private $tag_keys; - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * 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\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $tag_keys - * List of TagKeys that live under the specified parent in the request. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagKeys() - { - return $this->tag_keys; - } - - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_keys = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php deleted file mode 100644 index dd1ef80c869..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagValuesRequest - */ -class ListTagValuesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. - * - * @return \Google\Cloud\ResourceManager\V3\ListTagValuesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. - * @type int $page_size - * Optional. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. - * - * 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. - * - * 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. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the 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. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php deleted file mode 100644 index ff490de7417..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagValuesResponse - */ -class ListTagValuesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - */ - private $tag_values; - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid 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\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $tag_values - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagValues() - { - return $this->tag_values; - } - - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_values = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php deleted file mode 100644 index da8f8448b18..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.resourcemanager.v3.MoveFolderMetadata - */ -class MoveFolderMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - */ - protected $source_parent = ''; - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - */ - protected $destination_parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The display name of the folder. - * @type string $source_parent - * The resource name of the folder's parent. - * @type string $destination_parent - * The resource name of the folder or organization to move the folder to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - * @return string - */ - public function getSourceParent() - { - return $this->source_parent; - } - - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - * @param string $var - * @return $this - */ - public function setSourceParent($var) - { - GPBUtil::checkString($var, True); - $this->source_parent = $var; - - return $this; - } - - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php deleted file mode 100644 index 61aa48a22f2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.resourcemanager.v3.MoveFolderRequest - */ -class MoveFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $destination_parent = ''; - - /** - * @param string $name Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * Please see {@see FoldersClient::folderName()} for help formatting this field. - * @param string $destinationParent Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * @return \Google\Cloud\ResourceManager\V3\MoveFolderRequest - * - * @experimental - */ - public static function build(string $name, string $destinationParent): self - { - return (new self()) - ->setName($name) - ->setDestinationParent($destinationParent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * @type string $destination_parent - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_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. The resource name of the Folder to move. - * Must be of the form folders/{folder_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 resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php deleted file mode 100644 index 4dc990631f4..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.MoveProjectMetadata - */ -class MoveProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php deleted file mode 100644 index 86b27336455..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.resourcemanager.v3.MoveProjectRequest - */ -class MoveProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to move. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $destination_parent = ''; - - /** - * @param string $name Required. The name of the project to move. Please see - * {@see ProjectsClient::projectName()} for help formatting this field. - * @param string $destinationParent Required. The new parent to move the Project under. - * - * @return \Google\Cloud\ResourceManager\V3\MoveProjectRequest - * - * @experimental - */ - public static function build(string $name, string $destinationParent): self - { - return (new self()) - ->setName($name) - ->setDestinationParent($destinationParent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the project to move. - * @type string $destination_parent - * Required. The new parent to move the Project under. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to move. - * - * 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 name of the project to move. - * - * 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 new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * Required. The new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php deleted file mode 100644 index d641338f6e8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php +++ /dev/null @@ -1,372 +0,0 @@ -google.cloud.resourcemanager.v3.Organization - */ -class Organization extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $display_name = ''; - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - protected $owner; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * @type string $display_name - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * @type string $directory_customer_id - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * @type int $state - * Output only. The organization's current lifecycle state. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Timestamp when the Organization was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Timestamp when the Organization was last modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Timestamp when the Organization was requested for deletion. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * - * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getDirectoryCustomerId() - { - return $this->readOneof(3); - } - - public function hasDirectoryCustomerId() - { - return $this->hasOneof(3); - } - - /** - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * - * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setDirectoryCustomerId($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Organization\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * @return string - */ - public function getOwner() - { - return $this->whichOneof("owner"); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php deleted file mode 100644 index afee81887ea..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.resourcemanager.v3.Organization.State - */ -class State -{ - /** - * Unspecified state. This is only useful for distinguishing unset values. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The organization has been marked for deletion by the user. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - 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(State::class, \Google\Cloud\ResourceManager\V3\Organization_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php deleted file mode 100644 index 066d475cb2f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php +++ /dev/null @@ -1,489 +0,0 @@ -google.cloud.resourcemanager.v3.Project - */ -class Project extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $parent = ''; - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $project_id = ''; - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_name = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The most recent time this resource was modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * @type string $parent - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * @type string $project_id - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * @type int $state - * Output only. The project lifecycle state. - * @type string $display_name - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The most recent time this resource was modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. The time at which this resource was requested for deletion. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Project\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The most recent time this resource was modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The most recent time this resource was modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php deleted file mode 100644 index ce98594b31e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.resourcemanager.v3.Project.State - */ -class State -{ - /** - * Unspecified state. This is only used/useful for distinguishing - * unset values. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The project has been marked for deletion by the user - * (by invoking - * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]) - * or by the system (Google Cloud Platform). - * This can generally be reversed by invoking [UndeleteProject] - * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - 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(State::class, \Google\Cloud\ResourceManager\V3\Project_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php deleted file mode 100644 index 77092359f1d..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.resourcemanager.v3.Purpose - */ -class Purpose -{ - /** - * Unspecified purpose. - * - * Generated from protobuf enum PURPOSE_UNSPECIFIED = 0; - */ - const PURPOSE_UNSPECIFIED = 0; - /** - * Purpose for Compute Engine firewalls. - * A corresponding `purpose_data` should be set for the network the tag is - * intended for. The key should be `network` and the value should be in - * either of these two formats: - * - - * `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` - * - `{project_id}/{network_name}` - * Examples: - * - - * `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` - * - `fail-closed-load-testing/load-testing-network` - * - * Generated from protobuf enum GCE_FIREWALL = 1; - */ - const GCE_FIREWALL = 1; - - private static $valueToName = [ - self::PURPOSE_UNSPECIFIED => 'PURPOSE_UNSPECIFIED', - self::GCE_FIREWALL => 'GCE_FIREWALL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php deleted file mode 100644 index c4fe151d856..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php +++ /dev/null @@ -1,290 +0,0 @@ -google.cloud.resourcemanager.v3.SearchFoldersRequest - */ -class SearchFoldersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - - /** - * @param string $query Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * - * Some example queries are: - * - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * @return \Google\Cloud\ResourceManager\V3\SearchFoldersRequest - * - * @experimental - */ - public static function build(string $query): self - { - return (new self()) - ->setQuery($query); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_size - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * @type string $query - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php deleted file mode 100644 index 39fe82fe371..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.resourcemanager.v3.SearchFoldersResponse - */ -class SearchFoldersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - */ - private $folders; - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders - * A possibly paginated folder search results. - * the specified parent resource. - * @type string $next_page_token - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFolders() - { - return $this->folders; - } - - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFolders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folders = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php deleted file mode 100644 index 5304f599c05..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php +++ /dev/null @@ -1,234 +0,0 @@ -google.cloud.resourcemanager.v3.SearchOrganizationsRequest - */ -class SearchOrganizationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - - /** - * @param string $query Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * - * - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * @return \Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest - * - * @experimental - */ - public static function build(string $query): self - { - return (new self()) - ->setQuery($query); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_size - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * @type string $query - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php deleted file mode 100644 index 74823ebb56d..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.resourcemanager.v3.SearchOrganizationsResponse - */ -class SearchOrganizationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - */ - private $organizations; - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * 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\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $organizations - * The list of Organizations that matched the search query, possibly - * paginated. - * @type string $next_page_token - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOrganizations() - { - return $this->organizations; - } - - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOrganizations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Organization::class); - $this->organizations = $arr; - - return $this; - } - - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php deleted file mode 100644 index d84f0d7330b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php +++ /dev/null @@ -1,302 +0,0 @@ -google.cloud.resourcemanager.v3.SearchProjectsRequest - */ -class SearchProjectsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * @param string $query Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * - * Search expressions are case insensitive. - * - * Some examples queries: - * - * - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * @return \Google\Cloud\ResourceManager\V3\SearchProjectsRequest - * - * @experimental - */ - public static function build(string $query): self - { - return (new self()) - ->setQuery($query); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * @type int $page_size - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php deleted file mode 100644 index 3e3f0aaddf9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.resourcemanager.v3.SearchProjectsResponse - */ -class SearchProjectsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - */ - private $projects; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects - * The list of Projects that matched the list filter query. This list can - * be paginated. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProjects() - { - return $this->projects; - } - - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProjects($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); - $this->projects = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php deleted file mode 100644 index 217deee78cb..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.resourcemanager.v3.TagBinding - */ -class TagBinding extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - */ - protected $parent = ''; - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - */ - protected $tag_value = ''; - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - */ - protected $tag_value_namespaced_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * @type string $parent - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * @type string $tag_value - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * @type string $tag_value_namespaced_name - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - * @return string - */ - public function getTagValue() - { - return $this->tag_value; - } - - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - * @param string $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkString($var, True); - $this->tag_value = $var; - - return $this; - } - - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - * @return string - */ - public function getTagValueNamespacedName() - { - return $this->tag_value_namespaced_name; - } - - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - * @param string $var - * @return $this - */ - public function setTagValueNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->tag_value_namespaced_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php deleted file mode 100644 index 7e2ee136616..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.resourcemanager.v3.TagHold - */ -class TagHold extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $holder = ''; - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $origin = ''; - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $help_link = ''; - /** - * Output only. The time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * @type string $holder - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * @type string $origin - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * @type string $help_link - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time this TagHold was created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getHolder() - { - return $this->holder; - } - - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setHolder($var) - { - GPBUtil::checkString($var, True); - $this->holder = $var; - - return $this; - } - - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrigin() - { - return $this->origin; - } - - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrigin($var) - { - GPBUtil::checkString($var, True); - $this->origin = $var; - - return $this; - } - - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getHelpLink() - { - return $this->help_link; - } - - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setHelpLink($var) - { - GPBUtil::checkString($var, True); - $this->help_link = $var; - - return $this; - } - - /** - * Output only. The time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php deleted file mode 100644 index a329b18ef1d..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php +++ /dev/null @@ -1,477 +0,0 @@ -google.cloud.resourcemanager.v3.TagKey - */ -class TagKey extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $parent = ''; - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $short_name = ''; - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $namespaced_name = ''; - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $purpose = 0; - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $purpose_data; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * @type string $parent - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * @type string $short_name - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * @type string $namespaced_name - * Output only. Immutable. Namespaced name of the TagKey. - * @type string $description - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time. - * @type string $etag - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * @type int $purpose - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * @type array|\Google\Protobuf\Internal\MapField $purpose_data - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getShortName() - { - return $this->short_name; - } - - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setShortName($var) - { - GPBUtil::checkString($var, True); - $this->short_name = $var; - - return $this; - } - - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getNamespacedName() - { - return $this->namespaced_name; - } - - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_name = $var; - - return $this; - } - - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPurpose() - { - return $this->purpose; - } - - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPurpose($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Purpose::class); - $this->purpose = $var; - - return $this; - } - - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPurposeData() - { - return $this->purpose_data; - } - - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPurposeData($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->purpose_data = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php deleted file mode 100644 index 6a2d8efaf8b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php +++ /dev/null @@ -1,374 +0,0 @@ -google.cloud.resourcemanager.v3.TagValue - */ -class TagValue extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $parent = ''; - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $short_name = ''; - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $namespaced_name = ''; - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * @type string $parent - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * @type string $short_name - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * @type string $namespaced_name - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * @type string $description - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time. - * @type string $etag - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getShortName() - { - return $this->short_name; - } - - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setShortName($var) - { - GPBUtil::checkString($var, True); - $this->short_name = $var; - - return $this; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getNamespacedName() - { - return $this->namespaced_name; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_name = $var; - - return $this; - } - - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php deleted file mode 100644 index 25c40d3462a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteFolderMetadata - */ -class UndeleteFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php deleted file mode 100644 index e1308f1bd4e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteFolderRequest - */ -class UndeleteFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. Please see - * {@see FoldersClient::folderName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\UndeleteFolderRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_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. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php deleted file mode 100644 index 4652f9473a9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata - */ -class UndeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php deleted file mode 100644 index 2dcdba313d1..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteProjectMetadata - */ -class UndeleteProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php deleted file mode 100644 index 080d2b97982..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteProjectRequest - */ -class UndeleteProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project (for example, `projects/415104041262`). - * Required. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the project (for example, `projects/415104041262`). - * - * Required. Please see - * {@see ProjectsClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceManager\V3\UndeleteProjectRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the project (for example, `projects/415104041262`). - * Required. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project (for example, `projects/415104041262`). - * Required. - * - * 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 name of the project (for example, `projects/415104041262`). - * Required. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php deleted file mode 100644 index 4048d4d5bc3..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateFolderMetadata - */ -class UpdateFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php deleted file mode 100644 index 51fcccc6af2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateFolderRequest - */ -class UpdateFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $folder = null; - /** - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\ResourceManager\V3\Folder $folder Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * @param \Google\Protobuf\FieldMask $updateMask Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * @return \Google\Cloud\ResourceManager\V3\UpdateFolderRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\Folder $folder, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setFolder($folder) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Folder $folder - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Folder|null - */ - public function getFolder() - { - return $this->folder; - } - - public function hasFolder() - { - return isset($this->folder); - } - - public function clearFolder() - { - unset($this->folder); - } - - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Folder $var - * @return $this - */ - public function setFolder($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folder = $var; - - return $this; - } - - /** - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php deleted file mode 100644 index 9f46eb9a63c..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateProjectMetadata - */ -class UpdateProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php deleted file mode 100644 index 744e08216d1..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateProjectRequest - */ -class UpdateProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project = null; - /** - * Optional. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\ResourceManager\V3\Project $project Required. The new definition of the project. - * @param \Google\Protobuf\FieldMask $updateMask Optional. An update mask to selectively update fields. - * - * @return \Google\Cloud\ResourceManager\V3\UpdateProjectRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\Project $project, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setProject($project) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Project $project - * Required. The new definition of the project. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. An update mask to selectively update fields. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Project|null - */ - public function getProject() - { - return $this->project; - } - - public function hasProject() - { - return isset($this->project); - } - - public function clearProject() - { - unset($this->project); - } - - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Project $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); - $this->project = $var; - - return $this; - } - - /** - * Optional. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php deleted file mode 100644 index deef54c740c..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagKeyMetadata - */ -class UpdateTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php deleted file mode 100644 index 7bbd0760c73..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagKeyRequest - */ -class UpdateTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_key = null; - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\ResourceManager\V3\TagKey $tagKey Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * @param \Google\Protobuf\FieldMask $updateMask Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * @return \Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\TagKey $tagKey, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setTagKey($tagKey) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * @type bool $validate_only - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagKey|null - */ - public function getTagKey() - { - return $this->tag_key; - } - - public function hasTagKey() - { - return isset($this->tag_key); - } - - public function clearTagKey() - { - unset($this->tag_key); - } - - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagKey $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_key = $var; - - return $this; - } - - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php deleted file mode 100644 index 2503e836508..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagValueMetadata - */ -class UpdateTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php deleted file mode 100644 index 125d6761dfb..00000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagValueRequest - */ -class UpdateTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_value = null; - /** - * Optional. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\ResourceManager\V3\TagValue $tagValue Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * @param \Google\Protobuf\FieldMask $updateMask Optional. Fields to be updated. - * - * @return \Google\Cloud\ResourceManager\V3\UpdateTagValueRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ResourceManager\V3\TagValue $tagValue, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setTagValue($tagValue) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Fields to be updated. - * @type bool $validate_only - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagValue|null - */ - public function getTagValue() - { - return $this->tag_value; - } - - public function hasTagValue() - { - return isset($this->tag_value); - } - - public function clearTagValue() - { - unset($this->tag_value); - } - - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagValue $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_value = $var; - - return $this; - } - - /** - * Optional. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php deleted file mode 100644 index 30273263a0b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php +++ /dev/null @@ -1,112 +0,0 @@ -setParent($folderParent); - $request = (new CreateFolderRequest()) - ->setFolder($folder); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->createFolder($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $folderParent = '[PARENT]'; - - create_folder_sample($folderParent); -} -// [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php deleted file mode 100644 index cef9c00ca8a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php +++ /dev/null @@ -1,94 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->deleteFolder($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FoldersClient::folderName('[FOLDER]'); - - delete_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php deleted file mode 100644 index b6712e919f2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Folder $response */ - $response = $foldersClient->getFolder($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FoldersClient::folderName('[FOLDER]'); - - get_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php deleted file mode 100644 index 8e37a069b5b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php +++ /dev/null @@ -1,75 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $foldersClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php deleted file mode 100644 index 57faa6cf2dc..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $foldersClient->listFolders($request); - - /** @var Folder $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_folders_sample($parent); -} -// [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php deleted file mode 100644 index bdc0df3c8cd..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php +++ /dev/null @@ -1,105 +0,0 @@ -setName($formattedName) - ->setDestinationParent($destinationParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->moveFolder($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FoldersClient::folderName('[FOLDER]'); - $destinationParent = '[DESTINATION_PARENT]'; - - move_folder_sample($formattedName, $destinationParent); -} -// [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php deleted file mode 100644 index cf499fa89b4..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php +++ /dev/null @@ -1,67 +0,0 @@ -searchFolders($request); - - /** @var Folder $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php deleted file mode 100644 index e1de0478933..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $foldersClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php deleted file mode 100644 index 1527da453d8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php +++ /dev/null @@ -1,82 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $foldersClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php deleted file mode 100644 index 8fec83f5907..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php +++ /dev/null @@ -1,94 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->undeleteFolder($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FoldersClient::folderName('[FOLDER]'); - - undelete_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php deleted file mode 100644 index 7fae0b9ef92..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php +++ /dev/null @@ -1,105 +0,0 @@ -setParent($folderParent); - $updateMask = new FieldMask(); - $request = (new UpdateFolderRequest()) - ->setFolder($folder) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->updateFolder($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $folderParent = '[PARENT]'; - - update_folder_sample($folderParent); -} -// [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php deleted file mode 100644 index f0dce09f595..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php +++ /dev/null @@ -1,76 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $organizationsClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php deleted file mode 100644 index 6f4e79269d0..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Organization $response */ - $response = $organizationsClient->getOrganization($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OrganizationsClient::organizationName('[ORGANIZATION]'); - - get_organization_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php deleted file mode 100644 index 9d35014e064..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php +++ /dev/null @@ -1,68 +0,0 @@ -searchOrganizations($request); - - /** @var Organization $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php deleted file mode 100644 index a73ef30663f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php +++ /dev/null @@ -1,78 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $organizationsClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php deleted file mode 100644 index c6821dcbb82..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php +++ /dev/null @@ -1,82 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $organizationsClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php deleted file mode 100644 index 09f7d056814..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php +++ /dev/null @@ -1,75 +0,0 @@ -setProject($project); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectsClient->createProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php deleted file mode 100644 index ce8691d0cb9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php +++ /dev/null @@ -1,115 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectsClient->deleteProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProjectsClient::projectName('[PROJECT]'); - - delete_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php deleted file mode 100644 index fe9a820f7ce..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php +++ /dev/null @@ -1,73 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $projectsClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php deleted file mode 100644 index fd3601fd509..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Project $response */ - $response = $projectsClient->getProject($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProjectsClient::projectName('[PROJECT]'); - - get_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php deleted file mode 100644 index e270c89dda4..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $projectsClient->listProjects($request); - - /** @var Project $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_projects_sample($parent); -} -// [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php deleted file mode 100644 index a6d84c56e29..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php +++ /dev/null @@ -1,101 +0,0 @@ -setName($formattedName) - ->setDestinationParent($destinationParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectsClient->moveProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProjectsClient::projectName('[PROJECT]'); - $destinationParent = '[DESTINATION_PARENT]'; - - move_project_sample($formattedName, $destinationParent); -} -// [END cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php deleted file mode 100644 index 60b34f3fddb..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php +++ /dev/null @@ -1,71 +0,0 @@ -searchProjects($request); - - /** @var Project $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php deleted file mode 100644 index bf8d180b3e2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php +++ /dev/null @@ -1,113 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $projectsClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php deleted file mode 100644 index 8e3cdb58be5..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php +++ /dev/null @@ -1,79 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $projectsClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php deleted file mode 100644 index d81ca3464f2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php +++ /dev/null @@ -1,93 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectsClient->undeleteProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProjectsClient::projectName('[PROJECT]'); - - undelete_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php deleted file mode 100644 index b17fd2e4f65..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php +++ /dev/null @@ -1,76 +0,0 @@ -setProject($project); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectsClient->updateProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php deleted file mode 100644 index 42f06bd25f0..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php +++ /dev/null @@ -1,71 +0,0 @@ -setTagBinding($tagBinding); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagBindingsClient->createTagBinding($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagBinding $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php deleted file mode 100644 index 0b1fa2eaec9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php +++ /dev/null @@ -1,82 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagBindingsClient->deleteTagBinding($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagBindingsClient::tagBindingName('[TAG_BINDING]'); - - delete_tag_binding_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php deleted file mode 100644 index 9ce7917808f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tagBindingsClient->listEffectiveTags($request); - - /** @var EffectiveTag $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_effective_tags_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php deleted file mode 100644 index 1609d5315e2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tagBindingsClient->listTagBindings($request); - - /** @var TagBinding $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_tag_bindings_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php deleted file mode 100644 index b86a239fb91..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php +++ /dev/null @@ -1,92 +0,0 @@ -setHolder($tagHoldHolder); - $request = (new CreateTagHoldRequest()) - ->setParent($formattedParent) - ->setTagHold($tagHold); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagHoldsClient->createTagHold($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagHold $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = TagHoldsClient::tagValueName('[TAG_VALUE]'); - $tagHoldHolder = '[HOLDER]'; - - create_tag_hold_sample($formattedParent, $tagHoldHolder); -} -// [END cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php deleted file mode 100644 index 24f484e4f7a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagHoldsClient->deleteTagHold($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagHoldsClient::tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - - delete_tag_hold_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php deleted file mode 100644 index bd220c74ea7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tagHoldsClient->listTagHolds($request); - - /** @var TagHold $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = TagHoldsClient::tagValueName('[TAG_VALUE]'); - - list_tag_holds_sample($formattedParent); -} -// [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php deleted file mode 100644 index dd8624bafa3..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php +++ /dev/null @@ -1,92 +0,0 @@ -setShortName($tagKeyShortName); - $request = (new CreateTagKeyRequest()) - ->setTagKey($tagKey); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagKeysClient->createTagKey($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $tagKeyShortName = '[SHORT_NAME]'; - - create_tag_key_sample($tagKeyShortName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php deleted file mode 100644 index 81ae58c6bde..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagKeysClient->deleteTagKey($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); - - delete_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php deleted file mode 100644 index 1cc5b669df5..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php +++ /dev/null @@ -1,76 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $tagKeysClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php deleted file mode 100644 index 618c6ff0393..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var TagKey $response */ - $response = $tagKeysClient->getNamespacedTagKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); - - get_namespaced_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php deleted file mode 100644 index 88f482a6a8f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var TagKey $response */ - $response = $tagKeysClient->getTagKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagKeysClient::tagKeyName('[TAG_KEY]'); - - get_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php deleted file mode 100644 index 3995dc0e069..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tagKeysClient->listTagKeys($request); - - /** @var TagKey $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_tag_keys_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php deleted file mode 100644 index 2e068ef74a1..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $tagKeysClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php deleted file mode 100644 index d25e5c6aba7..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php +++ /dev/null @@ -1,82 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $tagKeysClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php deleted file mode 100644 index d799ce5e757..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php +++ /dev/null @@ -1,89 +0,0 @@ -setShortName($tagKeyShortName); - $request = (new UpdateTagKeyRequest()) - ->setTagKey($tagKey); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagKeysClient->updateTagKey($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $tagKeyShortName = '[SHORT_NAME]'; - - update_tag_key_sample($tagKeyShortName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php deleted file mode 100644 index 3a5774d5f00..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php +++ /dev/null @@ -1,92 +0,0 @@ -setShortName($tagValueShortName); - $request = (new CreateTagValueRequest()) - ->setTagValue($tagValue); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagValuesClient->createTagValue($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $tagValueShortName = '[SHORT_NAME]'; - - create_tag_value_sample($tagValueShortName); -} -// [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php deleted file mode 100644 index 3daadd457da..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagValuesClient->deleteTagValue($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); - - delete_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php deleted file mode 100644 index f258cacf49e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php +++ /dev/null @@ -1,76 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $tagValuesClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php deleted file mode 100644 index 40c29338a6d..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var TagValue $response */ - $response = $tagValuesClient->getNamespacedTagValue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); - - get_namespaced_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php deleted file mode 100644 index 1722af1de80..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var TagValue $response */ - $response = $tagValuesClient->getTagValue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TagValuesClient::tagValueName('[TAG_VALUE]'); - - get_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php deleted file mode 100644 index 5dfb8504d4e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php +++ /dev/null @@ -1,75 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tagValuesClient->listTagValues($request); - - /** @var TagValue $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_tag_values_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php deleted file mode 100644 index 6020b679341..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $tagValuesClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php deleted file mode 100644 index 945e3f282cc..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php +++ /dev/null @@ -1,82 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $tagValuesClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php deleted file mode 100644 index 83f91c2c3e9..00000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php +++ /dev/null @@ -1,89 +0,0 @@ -setShortName($tagValueShortName); - $request = (new UpdateTagValueRequest()) - ->setTagValue($tagValue); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagValuesClient->updateTagValue($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $tagValueShortName = '[SHORT_NAME]'; - - update_tag_value_sample($tagValueShortName); -} -// [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php deleted file mode 100644 index 650a95686c8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/FoldersClient.php +++ /dev/null @@ -1,684 +0,0 @@ - createFolderAsync(CreateFolderRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteFolderAsync(DeleteFolderRequest $request, array $optionalArgs = []) - * @method PromiseInterface getFolderAsync(GetFolderRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface listFoldersAsync(ListFoldersRequest $request, array $optionalArgs = []) - * @method PromiseInterface moveFolderAsync(MoveFolderRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchFoldersAsync(SearchFoldersRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface undeleteFolderAsync(UndeleteFolderRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateFolderAsync(UpdateFolderRequest $request, array $optionalArgs = []) - */ -final class FoldersClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Folders'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/folders_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/folders_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/folders_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/folders_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a folder - * resource. - * - * @param string $folder - * - * @return string The formatted folder resource. - */ - public static function folderName(string $folder): string - { - return self::getPathTemplate('folder')->render([ - 'folder' => $folder, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folder: folders/{folder} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a folder in the resource hierarchy. - * Returns an `Operation` which can be used to track the progress of the - * folder creation workflow. - * Upon success, the `Operation.response` field will be populated with the - * created Folder. - * - * In order to succeed, the addition of this new folder must not violate - * the folder naming, height, or fanout constraints. - * - * + The folder's `display_name` must be distinct from all other folders that - * share its parent. - * + The addition of the folder must not cause the active folder hierarchy - * to exceed a height of 10. Note, the full active + deleted folder hierarchy - * is allowed to reach a height of 20; this provides additional headroom when - * moving folders that contain deleted folders. - * + The addition of the folder must not cause the total number of folders - * under its parent to exceed 300. - * - * If the operation fails due to a folder constraint violation, some errors - * may be returned by the `CreateFolder` request, with status code - * `FAILED_PRECONDITION` and an error description. Other folder constraint - * violations will be communicated in the `Operation`, with the specific - * `PreconditionFailure` returned in the details list in the `Operation.error` - * field. - * - * The caller must have `resourcemanager.folders.create` permission on the - * identified parent. - * - * The async variant is {@see FoldersClient::createFolderAsync()} . - * - * @example samples/V3/FoldersClient/create_folder.php - * - * @param CreateFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createFolder(CreateFolderRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateFolder', $request, $callOptions)->wait(); - } - - /** - * Requests deletion of a folder. The folder is moved into the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state immediately, and is deleted approximately 30 days later. This method - * may only be called on an empty folder, where a folder is empty if it - * doesn't contain any folders or projects in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If - * called on a folder in - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state the operation will result in a no-op success. - * The caller must have `resourcemanager.folders.delete` permission on the - * identified folder. - * - * The async variant is {@see FoldersClient::deleteFolderAsync()} . - * - * @example samples/V3/FoldersClient/delete_folder.php - * - * @param DeleteFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteFolder(DeleteFolderRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteFolder', $request, $callOptions)->wait(); - } - - /** - * Retrieves a folder identified by the supplied resource name. - * Valid folder resource names have the format `folders/{folder_id}` - * (for example, `folders/1234`). - * The caller must have `resourcemanager.folders.get` permission on the - * identified folder. - * - * The async variant is {@see FoldersClient::getFolderAsync()} . - * - * @example samples/V3/FoldersClient/get_folder.php - * - * @param GetFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Folder - * - * @throws ApiException Thrown if the API call fails. - */ - public function getFolder(GetFolderRequest $request, array $callOptions = []): Folder - { - return $this->startApiCall('GetFolder', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a folder. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the folder's resource name, for example: "folders/1234". - * The caller must have `resourcemanager.folders.getIamPolicy` permission - * on the identified folder. - * - * The async variant is {@see FoldersClient::getIamPolicyAsync()} . - * - * @example samples/V3/FoldersClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Lists the folders that are direct descendants of supplied parent resource. - * `list()` provides a strongly consistent view of the folders underneath - * the specified parent resource. - * `list()` returns folders sorted based upon the (ascending) lexical ordering - * of their display_name. - * The caller must have `resourcemanager.folders.list` permission on the - * identified parent. - * - * The async variant is {@see FoldersClient::listFoldersAsync()} . - * - * @example samples/V3/FoldersClient/list_folders.php - * - * @param ListFoldersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listFolders(ListFoldersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListFolders', $request, $callOptions); - } - - /** - * Moves a folder under a new resource parent. - * Returns an `Operation` which can be used to track the progress of the - * folder move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved folder. - * Upon failure, a `FolderOperationError` categorizing the failure cause will - * be returned - if the failure occurs synchronously then the - * `FolderOperationError` will be returned in the `Status.details` field. - * If it occurs asynchronously, then the FolderOperation will be returned - * in the `Operation.error` field. - * In addition, the `Operation.metadata` field will be populated with a - * `FolderOperation` message as an aid to stateless clients. - * Folder moves will be rejected if they violate either the naming, height, - * or fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.move` - * permission on the folder's current and proposed new parent. - * - * The async variant is {@see FoldersClient::moveFolderAsync()} . - * - * @example samples/V3/FoldersClient/move_folder.php - * - * @param MoveFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function moveFolder(MoveFolderRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('MoveFolder', $request, $callOptions)->wait(); - } - - /** - * Search for folders that match specific filter criteria. - * `search()` provides an eventually consistent view of the folders a user has - * access to which meet the specified filter criteria. - * - * This will only return folders on which the caller has the - * permission `resourcemanager.folders.get`. - * - * The async variant is {@see FoldersClient::searchFoldersAsync()} . - * - * @example samples/V3/FoldersClient/search_folders.php - * - * @param SearchFoldersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchFolders(SearchFoldersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchFolders', $request, $callOptions); - } - - /** - * Sets the access control policy on a folder, replacing any existing policy. - * The `resource` field should be the folder's resource name, for example: - * "folders/1234". - * The caller must have `resourcemanager.folders.setIamPolicy` permission - * on the identified folder. - * - * The async variant is {@see FoldersClient::setIamPolicyAsync()} . - * - * @example samples/V3/FoldersClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified folder. - * The `resource` field should be the folder's resource name, - * for example: "folders/1234". - * - * There are no permissions required for making this API call. - * - * The async variant is {@see FoldersClient::testIamPermissionsAsync()} . - * - * @example samples/V3/FoldersClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Cancels the deletion request for a folder. This method may be called on a - * folder in any state. If the folder is in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the - * result will be a no-op success. In order to succeed, the folder's parent - * must be in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In - * addition, reintroducing the folder into the tree must not violate folder - * naming, height, and fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.undelete` - * permission on the identified folder. - * - * The async variant is {@see FoldersClient::undeleteFolderAsync()} . - * - * @example samples/V3/FoldersClient/undelete_folder.php - * - * @param UndeleteFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function undeleteFolder(UndeleteFolderRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UndeleteFolder', $request, $callOptions)->wait(); - } - - /** - * Updates a folder, changing its `display_name`. - * Changes to the folder `display_name` will be rejected if they violate - * either the `display_name` formatting rules or the naming constraints - * described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. - * - * The folder's `display_name` must start and end with a letter or digit, - * may contain letters, digits, spaces, hyphens and underscores and can be - * between 3 and 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - * The caller must have `resourcemanager.folders.update` permission on the - * identified folder. - * - * If the update fails due to the unique name constraint then a - * `PreconditionFailure` explaining this violation will be returned - * in the Status.details field. - * - * The async variant is {@see FoldersClient::updateFolderAsync()} . - * - * @example samples/V3/FoldersClient/update_folder.php - * - * @param UpdateFolderRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateFolder(UpdateFolderRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateFolder', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php deleted file mode 100644 index 7bdbe0d01a8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/OrganizationsClient.php +++ /dev/null @@ -1,375 +0,0 @@ - getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getOrganizationAsync(GetOrganizationRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchOrganizationsAsync(SearchOrganizationsRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - */ -final class OrganizationsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Organizations'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/organizations_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/organizations_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/organizations_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/organizations_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a organization - * resource. - * - * @param string $organization - * - * @return string The formatted organization resource. - */ - public static function organizationName(string $organization): string - { - return self::getPathTemplate('organization')->render([ - 'organization' => $organization, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - organization: organizations/{organization} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Gets the access control policy for an organization resource. The policy may - * be empty if no such policy or resource exists. The `resource` field should - * be the organization's resource name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.getIamPolicy` on the specified organization. - * - * The async variant is {@see OrganizationsClient::getIamPolicyAsync()} . - * - * @example samples/V3/OrganizationsClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Fetches an organization resource identified by the specified resource name. - * - * The async variant is {@see OrganizationsClient::getOrganizationAsync()} . - * - * @example samples/V3/OrganizationsClient/get_organization.php - * - * @param GetOrganizationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Organization - * - * @throws ApiException Thrown if the API call fails. - */ - public function getOrganization(GetOrganizationRequest $request, array $callOptions = []): Organization - { - return $this->startApiCall('GetOrganization', $request, $callOptions)->wait(); - } - - /** - * Searches organization resources that are visible to the user and satisfy - * the specified filter. This method returns organizations in an unspecified - * order. New organizations do not necessarily appear at the end of the - * results, and may take a small amount of time to appear. - * - * Search will only return organizations on which the user has the permission - * `resourcemanager.organizations.get` - * - * The async variant is {@see OrganizationsClient::searchOrganizationsAsync()} . - * - * @example samples/V3/OrganizationsClient/search_organizations.php - * - * @param SearchOrganizationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchOrganizations(SearchOrganizationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchOrganizations', $request, $callOptions); - } - - /** - * Sets the access control policy on an organization resource. Replaces any - * existing policy. The `resource` field should be the organization's resource - * name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.setIamPolicy` on the specified organization. - * - * The async variant is {@see OrganizationsClient::setIamPolicyAsync()} . - * - * @example samples/V3/OrganizationsClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns the permissions that a caller has on the specified organization. - * The `resource` field should be the organization's resource name, - * for example: "organizations/123". - * - * There are no permissions required for making this API call. - * - * The async variant is {@see OrganizationsClient::testIamPermissionsAsync()} . - * - * @example samples/V3/OrganizationsClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php deleted file mode 100644 index d17191d8afe..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/ProjectsClient.php +++ /dev/null @@ -1,702 +0,0 @@ - createProjectAsync(CreateProjectRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteProjectAsync(DeleteProjectRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getProjectAsync(GetProjectRequest $request, array $optionalArgs = []) - * @method PromiseInterface listProjectsAsync(ListProjectsRequest $request, array $optionalArgs = []) - * @method PromiseInterface moveProjectAsync(MoveProjectRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchProjectsAsync(SearchProjectsRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface undeleteProjectAsync(UndeleteProjectRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateProjectAsync(UpdateProjectRequest $request, array $optionalArgs = []) - */ -final class ProjectsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Projects'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/projects_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/projects_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - project: projects/{project} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Request that a new project be created. The result is an `Operation` which - * can be used to track the creation process. This process usually takes a few - * seconds, but can sometimes take much longer. The tracking `Operation` is - * automatically deleted after a few hours, so there is no need to call - * `DeleteOperation`. - * - * The async variant is {@see ProjectsClient::createProjectAsync()} . - * - * @example samples/V3/ProjectsClient/create_project.php - * - * @param CreateProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createProject(CreateProjectRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateProject', $request, $callOptions)->wait(); - } - - /** - * Marks the project identified by the specified - * `name` (for example, `projects/415104041262`) for deletion. - * - * This method will only affect the project if it has a lifecycle state of - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. - * - * This method changes the Project's lifecycle state from - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] - * to - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. - * The deletion starts at an unspecified time, - * at which point the Project is no longer accessible. - * - * Until the deletion completes, you can check the lifecycle state - * checked by retrieving the project with [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * and the project remains visible to [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects]. - * However, you cannot update the project. - * - * After the deletion completes, the project is not retrievable by - * the [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects], and - * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] - * methods. - * - * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - * project will not cause an error, but also won't do anything. - * - * The caller must have `resourcemanager.projects.delete` permissions for this - * project. - * - * The async variant is {@see ProjectsClient::deleteProjectAsync()} . - * - * @example samples/V3/ProjectsClient/delete_project.php - * - * @param DeleteProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteProject(DeleteProjectRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteProject', $request, $callOptions)->wait(); - } - - /** - * Returns the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * Permission is denied if the policy or the resource do not exist. - * - * The async variant is {@see ProjectsClient::getIamPolicyAsync()} . - * - * @example samples/V3/ProjectsClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Retrieves the project identified by the specified `name` (for example, - * `projects/415104041262`). - * - * The caller must have `resourcemanager.projects.get` permission - * for this project. - * - * The async variant is {@see ProjectsClient::getProjectAsync()} . - * - * @example samples/V3/ProjectsClient/get_project.php - * - * @param GetProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Project - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProject(GetProjectRequest $request, array $callOptions = []): Project - { - return $this->startApiCall('GetProject', $request, $callOptions)->wait(); - } - - /** - * Lists projects that are direct children of the specified folder or - * organization resource. `list()` provides a strongly consistent view of the - * projects underneath the specified parent resource. `list()` returns - * projects sorted based upon the (ascending) lexical ordering of their - * `display_name`. The caller must have `resourcemanager.projects.list` - * permission on the identified parent. - * - * The async variant is {@see ProjectsClient::listProjectsAsync()} . - * - * @example samples/V3/ProjectsClient/list_projects.php - * - * @param ListProjectsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProjects(ListProjectsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProjects', $request, $callOptions); - } - - /** - * Move a project to another place in your resource hierarchy, under a new - * resource parent. - * - * Returns an operation which can be used to track the process of the project - * move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved project. - * - * The caller must have `resourcemanager.projects.move` permission on the - * project, on the project's current and proposed new parent. - * - * If project has no current parent, or it currently does not have an - * associated organization resource, you will also need the - * `resourcemanager.projects.setIamPolicy` permission in the project. - * - * - * - * The async variant is {@see ProjectsClient::moveProjectAsync()} . - * - * @example samples/V3/ProjectsClient/move_project.php - * - * @param MoveProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function moveProject(MoveProjectRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('MoveProject', $request, $callOptions)->wait(); - } - - /** - * Search for projects that the caller has both `resourcemanager.projects.get` - * permission on, and also satisfy the specified query. - * - * This method returns projects in an unspecified order. - * - * This method is eventually consistent with project mutations; this means - * that a newly created project may not appear in the results or recent - * updates to an existing project may not be reflected in the results. To - * retrieve the latest state of a project, use the - * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. - * - * The async variant is {@see ProjectsClient::searchProjectsAsync()} . - * - * @example samples/V3/ProjectsClient/search_projects.php - * - * @param SearchProjectsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchProjects(SearchProjectsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchProjects', $request, $callOptions); - } - - /** - * Sets the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * - * CAUTION: This method will replace the existing policy, and cannot be used - * to append additional IAM settings. - * - * Note: Removing service accounts from policies or changing their roles can - * render services completely inoperable. It is important to understand how - * the service account is being used before removing or updating its roles. - * - * The following constraints apply when using `setIamPolicy()`: - * - * + Project does not support `allUsers` and `allAuthenticatedUsers` as - * `members` in a `Binding` of a `Policy`. - * - * + The owner role can be granted to a `user`, `serviceAccount`, or a group - * that is part of an organization. For example, - * group@myownpersonaldomain.com could be added as an owner to a project in - * the myownpersonaldomain.com organization, but not the examplepetstore.com - * organization. - * - * + Service accounts can be made owners of a project directly - * without any restrictions. However, to be added as an owner, a user must be - * invited using the Cloud Platform console and must accept the invitation. - * - * + A user cannot be granted the owner role using `setIamPolicy()`. The user - * must be granted the owner role using the Cloud Platform Console and must - * explicitly accept the invitation. - * - * + Invitations to grant the owner role cannot be sent using - * `setIamPolicy()`; - * they must be sent only using the Cloud Platform Console. - * - * + If the project is not part of an organization, there must be at least - * one owner who has accepted the Terms of Service (ToS) agreement in the - * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - * from the policy will fail. This restriction also applies to legacy - * projects that no longer have owners who have accepted the ToS. Edits to - * IAM policies will be rejected until the lack of a ToS-accepting owner is - * rectified. If the project is part of an organization, you can remove all - * owners, potentially making the organization inaccessible. - * - * The async variant is {@see ProjectsClient::setIamPolicyAsync()} . - * - * @example samples/V3/ProjectsClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - * - * The async variant is {@see ProjectsClient::testIamPermissionsAsync()} . - * - * @example samples/V3/ProjectsClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Restores the project identified by the specified - * `name` (for example, `projects/415104041262`). - * You can only use this method for a project that has a lifecycle state of - * [DELETE_REQUESTED] - * [Projects.State.DELETE_REQUESTED]. - * After deletion starts, the project cannot be restored. - * - * The caller must have `resourcemanager.projects.undelete` permission for - * this project. - * - * The async variant is {@see ProjectsClient::undeleteProjectAsync()} . - * - * @example samples/V3/ProjectsClient/undelete_project.php - * - * @param UndeleteProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function undeleteProject(UndeleteProjectRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UndeleteProject', $request, $callOptions)->wait(); - } - - /** - * Updates the `display_name` and labels of the project identified by the - * specified `name` (for example, `projects/415104041262`). Deleting all - * labels requires an update mask for labels field. - * - * The caller must have `resourcemanager.projects.update` permission for this - * project. - * - * The async variant is {@see ProjectsClient::updateProjectAsync()} . - * - * @example samples/V3/ProjectsClient/update_project.php - * - * @param UpdateProjectRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateProject(UpdateProjectRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateProject', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php deleted file mode 100644 index 5056c5bc427..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagBindingsClient.php +++ /dev/null @@ -1,385 +0,0 @@ - createTagBindingAsync(CreateTagBindingRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteTagBindingAsync(DeleteTagBindingRequest $request, array $optionalArgs = []) - * @method PromiseInterface listEffectiveTagsAsync(ListEffectiveTagsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTagBindingsAsync(ListTagBindingsRequest $request, array $optionalArgs = []) - */ -final class TagBindingsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagBindings'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_bindings_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_bindings_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_bindings_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_bindings_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_binding - * resource. - * - * @param string $tagBinding - * - * @return string The formatted tag_binding resource. - */ - public static function tagBindingName(string $tagBinding): string - { - return self::getPathTemplate('tagBinding')->render([ - 'tag_binding' => $tagBinding, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagBinding: tagBindings/{tag_binding} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a TagBinding between a TagValue and a Google Cloud resource. - * - * The async variant is {@see TagBindingsClient::createTagBindingAsync()} . - * - * @example samples/V3/TagBindingsClient/create_tag_binding.php - * - * @param CreateTagBindingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTagBinding(CreateTagBindingRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateTagBinding', $request, $callOptions)->wait(); - } - - /** - * Deletes a TagBinding. - * - * The async variant is {@see TagBindingsClient::deleteTagBindingAsync()} . - * - * @example samples/V3/TagBindingsClient/delete_tag_binding.php - * - * @param DeleteTagBindingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteTagBinding(DeleteTagBindingRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteTagBinding', $request, $callOptions)->wait(); - } - - /** - * Return a list of effective tags for the given Google Cloud resource, as - * specified in `parent`. - * - * The async variant is {@see TagBindingsClient::listEffectiveTagsAsync()} . - * - * @example samples/V3/TagBindingsClient/list_effective_tags.php - * - * @param ListEffectiveTagsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEffectiveTags(ListEffectiveTagsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEffectiveTags', $request, $callOptions); - } - - /** - * Lists the TagBindings for the given Google Cloud resource, as specified - * with `parent`. - * - * NOTE: The `parent` field is expected to be a full resource name: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * The async variant is {@see TagBindingsClient::listTagBindingsAsync()} . - * - * @example samples/V3/TagBindingsClient/list_tag_bindings.php - * - * @param ListTagBindingsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTagBindings(ListTagBindingsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTagBindings', $request, $callOptions); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php deleted file mode 100644 index b3382dbd82e..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagHoldsClient.php +++ /dev/null @@ -1,374 +0,0 @@ - createTagHoldAsync(CreateTagHoldRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteTagHoldAsync(DeleteTagHoldRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTagHoldsAsync(ListTagHoldsRequest $request, array $optionalArgs = []) - */ -final class TagHoldsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagHolds'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_holds_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_holds_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_holds_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_holds_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_hold - * resource. - * - * @param string $tagValue - * @param string $tagHold - * - * @return string The formatted tag_hold resource. - */ - public static function tagHoldName(string $tagValue, string $tagHold): string - { - return self::getPathTemplate('tagHold')->render([ - 'tag_value' => $tagValue, - 'tag_hold' => $tagHold, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_value - * resource. - * - * @param string $tagValue - * - * @return string The formatted tag_value resource. - */ - public static function tagValueName(string $tagValue): string - { - return self::getPathTemplate('tagValue')->render([ - 'tag_value' => $tagValue, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagHold: tagValues/{tag_value}/tagHolds/{tag_hold} - * - tagValue: tagValues/{tag_value} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same - * resource and origin exists under the same TagValue. - * - * The async variant is {@see TagHoldsClient::createTagHoldAsync()} . - * - * @example samples/V3/TagHoldsClient/create_tag_hold.php - * - * @param CreateTagHoldRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTagHold(CreateTagHoldRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateTagHold', $request, $callOptions)->wait(); - } - - /** - * Deletes a TagHold. - * - * The async variant is {@see TagHoldsClient::deleteTagHoldAsync()} . - * - * @example samples/V3/TagHoldsClient/delete_tag_hold.php - * - * @param DeleteTagHoldRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteTagHold(DeleteTagHoldRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteTagHold', $request, $callOptions)->wait(); - } - - /** - * Lists TagHolds under a TagValue. - * - * The async variant is {@see TagHoldsClient::listTagHoldsAsync()} . - * - * @example samples/V3/TagHoldsClient/list_tag_holds.php - * - * @param ListTagHoldsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTagHolds(ListTagHoldsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTagHolds', $request, $callOptions); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php deleted file mode 100644 index 6f4b1144d5b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagKeysClient.php +++ /dev/null @@ -1,541 +0,0 @@ - createTagKeyAsync(CreateTagKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteTagKeyAsync(DeleteTagKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getNamespacedTagKeyAsync(GetNamespacedTagKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getTagKeyAsync(GetTagKeyRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTagKeysAsync(ListTagKeysRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateTagKeyAsync(UpdateTagKeyRequest $request, array $optionalArgs = []) - */ -final class TagKeysClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagKeys'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_keys_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_keys_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_keys_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_keys_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_key - * resource. - * - * @param string $tagKey - * - * @return string The formatted tag_key resource. - */ - public static function tagKeyName(string $tagKey): string - { - return self::getPathTemplate('tagKey')->render([ - 'tag_key' => $tagKey, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagKey: tagKeys/{tag_key} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new TagKey. If another request with the same parameters is - * sent while the original request is in process, the second request - * will receive an error. A maximum of 1000 TagKeys can exist under a parent - * at any given time. - * - * The async variant is {@see TagKeysClient::createTagKeyAsync()} . - * - * @example samples/V3/TagKeysClient/create_tag_key.php - * - * @param CreateTagKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTagKey(CreateTagKeyRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateTagKey', $request, $callOptions)->wait(); - } - - /** - * Deletes a TagKey. The TagKey cannot be deleted if it has any child - * TagValues. - * - * The async variant is {@see TagKeysClient::deleteTagKeyAsync()} . - * - * @example samples/V3/TagKeysClient/delete_tag_key.php - * - * @param DeleteTagKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteTagKey(DeleteTagKeyRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteTagKey', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a TagKey. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagKey's resource name. For example, "tagKeys/1234". - * The caller must have - * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - * the specified TagKey. - * - * The async variant is {@see TagKeysClient::getIamPolicyAsync()} . - * - * @example samples/V3/TagKeysClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Retrieves a TagKey by its namespaced name. - * This method will return `PERMISSION_DENIED` if the key does not exist - * or the user does not have permission to view it. - * - * The async variant is {@see TagKeysClient::getNamespacedTagKeyAsync()} . - * - * @example samples/V3/TagKeysClient/get_namespaced_tag_key.php - * - * @param GetNamespacedTagKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TagKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNamespacedTagKey(GetNamespacedTagKeyRequest $request, array $callOptions = []): TagKey - { - return $this->startApiCall('GetNamespacedTagKey', $request, $callOptions)->wait(); - } - - /** - * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - * key does not exist or the user does not have permission to view it. - * - * The async variant is {@see TagKeysClient::getTagKeyAsync()} . - * - * @example samples/V3/TagKeysClient/get_tag_key.php - * - * @param GetTagKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TagKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function getTagKey(GetTagKeyRequest $request, array $callOptions = []): TagKey - { - return $this->startApiCall('GetTagKey', $request, $callOptions)->wait(); - } - - /** - * Lists all TagKeys for a parent resource. - * - * The async variant is {@see TagKeysClient::listTagKeysAsync()} . - * - * @example samples/V3/TagKeysClient/list_tag_keys.php - * - * @param ListTagKeysRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTagKeys(ListTagKeysRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTagKeys', $request, $callOptions); - } - - /** - * Sets the access control policy on a TagKey, replacing any existing - * policy. The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - * on the identified tagValue. - * - * The async variant is {@see TagKeysClient::setIamPolicyAsync()} . - * - * @example samples/V3/TagKeysClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified TagKey. - * The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * - * There are no permissions required for making this API call. - * - * The async variant is {@see TagKeysClient::testIamPermissionsAsync()} . - * - * @example samples/V3/TagKeysClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates the attributes of the TagKey resource. - * - * The async variant is {@see TagKeysClient::updateTagKeyAsync()} . - * - * @example samples/V3/TagKeysClient/update_tag_key.php - * - * @param UpdateTagKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateTagKey(UpdateTagKeyRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateTagKey', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php deleted file mode 100644 index 49fe9f81ec5..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Client/TagValuesClient.php +++ /dev/null @@ -1,541 +0,0 @@ - createTagValueAsync(CreateTagValueRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteTagValueAsync(DeleteTagValueRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getNamespacedTagValueAsync(GetNamespacedTagValueRequest $request, array $optionalArgs = []) - * @method PromiseInterface getTagValueAsync(GetTagValueRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTagValuesAsync(ListTagValuesRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateTagValueAsync(UpdateTagValueRequest $request, array $optionalArgs = []) - */ -final class TagValuesClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagValues'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudresourcemanager.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudresourcemanager.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_values_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_values_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_values_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_values_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_value - * resource. - * - * @param string $tagValue - * - * @return string The formatted tag_value resource. - */ - public static function tagValueName(string $tagValue): string - { - return self::getPathTemplate('tagValue')->render([ - 'tag_value' => $tagValue, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagValue: tagValues/{tag_value} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudresourcemanager.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a TagValue as a child of the specified TagKey. If a another - * request with the same parameters is sent while the original request is in - * process the second request will receive an error. A maximum of 1000 - * TagValues can exist under a TagKey at any given time. - * - * The async variant is {@see TagValuesClient::createTagValueAsync()} . - * - * @example samples/V3/TagValuesClient/create_tag_value.php - * - * @param CreateTagValueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTagValue(CreateTagValueRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateTagValue', $request, $callOptions)->wait(); - } - - /** - * Deletes a TagValue. The TagValue cannot have any bindings when it is - * deleted. - * - * The async variant is {@see TagValuesClient::deleteTagValueAsync()} . - * - * @example samples/V3/TagValuesClient/delete_tag_value.php - * - * @param DeleteTagValueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteTagValue(DeleteTagValueRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteTagValue', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a TagValue. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagValue's resource name. For example: `tagValues/1234`. - * The caller must have the - * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - * the identified TagValue to get the access control policy. - * - * The async variant is {@see TagValuesClient::getIamPolicyAsync()} . - * - * @example samples/V3/TagValuesClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Retrieves a TagValue by its namespaced name. - * This method will return `PERMISSION_DENIED` if the value does not exist - * or the user does not have permission to view it. - * - * The async variant is {@see TagValuesClient::getNamespacedTagValueAsync()} . - * - * @example samples/V3/TagValuesClient/get_namespaced_tag_value.php - * - * @param GetNamespacedTagValueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TagValue - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNamespacedTagValue(GetNamespacedTagValueRequest $request, array $callOptions = []): TagValue - { - return $this->startApiCall('GetNamespacedTagValue', $request, $callOptions)->wait(); - } - - /** - * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - * value does not exist or the user does not have permission to view it. - * - * The async variant is {@see TagValuesClient::getTagValueAsync()} . - * - * @example samples/V3/TagValuesClient/get_tag_value.php - * - * @param GetTagValueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TagValue - * - * @throws ApiException Thrown if the API call fails. - */ - public function getTagValue(GetTagValueRequest $request, array $callOptions = []): TagValue - { - return $this->startApiCall('GetTagValue', $request, $callOptions)->wait(); - } - - /** - * Lists all TagValues for a specific TagKey. - * - * The async variant is {@see TagValuesClient::listTagValuesAsync()} . - * - * @example samples/V3/TagValuesClient/list_tag_values.php - * - * @param ListTagValuesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTagValues(ListTagValuesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTagValues', $request, $callOptions); - } - - /** - * Sets the access control policy on a TagValue, replacing any existing - * policy. The `resource` field should be the TagValue's resource name. - * For example: `tagValues/1234`. - * The caller must have `resourcemanager.tagValues.setIamPolicy` permission - * on the identified tagValue. - * - * The async variant is {@see TagValuesClient::setIamPolicyAsync()} . - * - * @example samples/V3/TagValuesClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified TagValue. - * The `resource` field should be the TagValue's resource name. For example: - * `tagValues/1234`. - * - * There are no permissions required for making this API call. - * - * The async variant is {@see TagValuesClient::testIamPermissionsAsync()} . - * - * @example samples/V3/TagValuesClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates the attributes of the TagValue resource. - * - * The async variant is {@see TagValuesClient::updateTagValueAsync()} . - * - * @example samples/V3/TagValuesClient/update_tag_value.php - * - * @param UpdateTagValueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateTagValue(UpdateTagValueRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateTagValue', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json b/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json deleted file mode 100644 index ff967076dcd..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.resourcemanager.v3", - "libraryPackage": "Google\\Cloud\\ResourceManager\\V3", - "services": { - "Folders": { - "clients": { - "grpc": { - "libraryClient": "FoldersGapicClient", - "rpcs": { - "CreateFolder": { - "methods": [ - "createFolder" - ] - }, - "DeleteFolder": { - "methods": [ - "deleteFolder" - ] - }, - "GetFolder": { - "methods": [ - "getFolder" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "ListFolders": { - "methods": [ - "listFolders" - ] - }, - "MoveFolder": { - "methods": [ - "moveFolder" - ] - }, - "SearchFolders": { - "methods": [ - "searchFolders" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UndeleteFolder": { - "methods": [ - "undeleteFolder" - ] - }, - "UpdateFolder": { - "methods": [ - "updateFolder" - ] - } - } - } - } - }, - "Organizations": { - "clients": { - "grpc": { - "libraryClient": "OrganizationsGapicClient", - "rpcs": { - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetOrganization": { - "methods": [ - "getOrganization" - ] - }, - "SearchOrganizations": { - "methods": [ - "searchOrganizations" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "Projects": { - "clients": { - "grpc": { - "libraryClient": "ProjectsGapicClient", - "rpcs": { - "CreateProject": { - "methods": [ - "createProject" - ] - }, - "DeleteProject": { - "methods": [ - "deleteProject" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetProject": { - "methods": [ - "getProject" - ] - }, - "ListProjects": { - "methods": [ - "listProjects" - ] - }, - "MoveProject": { - "methods": [ - "moveProject" - ] - }, - "SearchProjects": { - "methods": [ - "searchProjects" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UndeleteProject": { - "methods": [ - "undeleteProject" - ] - }, - "UpdateProject": { - "methods": [ - "updateProject" - ] - } - } - } - } - }, - "TagBindings": { - "clients": { - "grpc": { - "libraryClient": "TagBindingsGapicClient", - "rpcs": { - "CreateTagBinding": { - "methods": [ - "createTagBinding" - ] - }, - "DeleteTagBinding": { - "methods": [ - "deleteTagBinding" - ] - }, - "ListEffectiveTags": { - "methods": [ - "listEffectiveTags" - ] - }, - "ListTagBindings": { - "methods": [ - "listTagBindings" - ] - } - } - } - } - }, - "TagHolds": { - "clients": { - "grpc": { - "libraryClient": "TagHoldsGapicClient", - "rpcs": { - "CreateTagHold": { - "methods": [ - "createTagHold" - ] - }, - "DeleteTagHold": { - "methods": [ - "deleteTagHold" - ] - }, - "ListTagHolds": { - "methods": [ - "listTagHolds" - ] - } - } - } - } - }, - "TagKeys": { - "clients": { - "grpc": { - "libraryClient": "TagKeysGapicClient", - "rpcs": { - "CreateTagKey": { - "methods": [ - "createTagKey" - ] - }, - "DeleteTagKey": { - "methods": [ - "deleteTagKey" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetNamespacedTagKey": { - "methods": [ - "getNamespacedTagKey" - ] - }, - "GetTagKey": { - "methods": [ - "getTagKey" - ] - }, - "ListTagKeys": { - "methods": [ - "listTagKeys" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateTagKey": { - "methods": [ - "updateTagKey" - ] - } - } - } - } - }, - "TagValues": { - "clients": { - "grpc": { - "libraryClient": "TagValuesGapicClient", - "rpcs": { - "CreateTagValue": { - "methods": [ - "createTagValue" - ] - }, - "DeleteTagValue": { - "methods": [ - "deleteTagValue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetNamespacedTagValue": { - "methods": [ - "getNamespacedTagValue" - ] - }, - "GetTagValue": { - "methods": [ - "getTagValue" - ] - }, - "ListTagValues": { - "methods": [ - "listTagValues" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateTagValue": { - "methods": [ - "updateTagValue" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json deleted file mode 100644 index 23bc7198bcd..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.Folders": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateFolder": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteFolder": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetFolder": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListFolders": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveFolder": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SearchFolders": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UndeleteFolder": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateFolder": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php deleted file mode 100644 index f3c92fc6037..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php +++ /dev/null @@ -1,191 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Folders' => [ - 'CreateFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - ], - 'DeleteFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MoveFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UndeleteFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'folder.name', - 'fieldAccessors' => [ - 'getFolder', - 'getName', - ], - ], - ], - ], - 'GetFolder' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\Folder', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'ListFolders' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFolders', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListFoldersResponse', - ], - 'SearchFolders' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFolders', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchFoldersResponse', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'folder' => 'folders/{folder}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php deleted file mode 100644 index 94bf6dd0606..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php +++ /dev/null @@ -1,156 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Folders' => [ - 'CreateFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/folders', - 'body' => 'folder', - ], - 'DeleteFolder' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=folders/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFolder' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=folders/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'ListFolders' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/folders', - 'queryParams' => [ - 'parent', - ], - ], - 'MoveFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=folders/*}:move', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchFolders' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/folders:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UndeleteFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=folders/*}:undelete', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateFolder' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{folder.name=folders/*}', - 'body' => 'folder', - 'placeholders' => [ - 'folder.name' => [ - 'getters' => [ - 'getFolder', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json deleted file mode 100644 index cd3f3bc9c02..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.Organizations": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetOrganization": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SearchOrganizations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php deleted file mode 100644 index 7a585fc164c..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Organizations' => [ - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetOrganization' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\Organization', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'SearchOrganizations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getOrganizations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchOrganizationsResponse', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'organization' => 'organizations/{organization}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php deleted file mode 100644 index b1c01902a19..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php +++ /dev/null @@ -1,93 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Organizations' => [ - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetOrganization' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=organizations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchOrganizations' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/organizations:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json deleted file mode 100644 index bf38535bd8a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.Projects": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetProject": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListProjects": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SearchProjects": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UndeleteProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php deleted file mode 100644 index 4452903d703..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php +++ /dev/null @@ -1,191 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Projects' => [ - 'CreateProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - ], - 'DeleteProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MoveProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UndeleteProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'project.name', - 'fieldAccessors' => [ - 'getProject', - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetProject' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\Project', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListProjects' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProjects', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListProjectsResponse', - ], - 'SearchProjects' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProjects', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\SearchProjectsResponse', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'project' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php deleted file mode 100644 index 7a584fdaf5c..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php +++ /dev/null @@ -1,153 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Projects' => [ - 'CreateProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/projects', - 'body' => 'project', - ], - 'DeleteProject' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetProject' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListProjects' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/projects', - 'queryParams' => [ - 'parent', - ], - ], - 'MoveProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}:move', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchProjects' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/projects:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UndeleteProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}:undelete', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateProject' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{project.name=projects/*}', - 'body' => 'project', - 'placeholders' => [ - 'project.name' => [ - 'getters' => [ - 'getProject', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json deleted file mode 100644 index 8f187c5e23a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagBindings": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagBinding": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagBinding": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListEffectiveTags": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTagBindings": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php deleted file mode 100644 index 696b63047a8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php +++ /dev/null @@ -1,85 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagBindings' => [ - 'CreateTagBinding' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagBinding', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagBindingMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - ], - 'DeleteTagBinding' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagBindingMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListEffectiveTags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEffectiveTags', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListEffectiveTagsResponse', - ], - 'ListTagBindings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagBindings', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagBindingsResponse', - ], - 'templateMap' => [ - 'tagBinding' => 'tagBindings/{tag_binding}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php deleted file mode 100644 index dfe8673c329..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php +++ /dev/null @@ -1,72 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagBindings' => [ - 'CreateTagBinding' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagBindings', - 'body' => 'tag_binding', - ], - 'DeleteTagBinding' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagBindings/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEffectiveTags' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/effectiveTags', - 'queryParams' => [ - 'parent', - ], - ], - 'ListTagBindings' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagBindings', - 'queryParams' => [ - 'parent', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json deleted file mode 100644 index bf327d859db..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagHolds": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateTagHold": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteTagHold": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTagHolds": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php deleted file mode 100644 index 197711c58ff..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php +++ /dev/null @@ -1,90 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagHolds' => [ - 'CreateTagHold' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagHold', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagHoldMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteTagHold' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagHoldMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTagHolds' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagHolds', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagHoldsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'tagHold' => 'tagValues/{tag_value}/tagHolds/{tag_hold}', - 'tagValue' => 'tagValues/{tag_value}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php deleted file mode 100644 index 9615ac90f61..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagHolds' => [ - 'CreateTagHold' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', - 'body' => 'tag_hold', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteTagHold' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagValues/*/tagHolds/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagHolds' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json deleted file mode 100644 index 75f389d694a..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagKeys": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespacedTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTagKeys": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php deleted file mode 100644 index 47f92359652..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php +++ /dev/null @@ -1,145 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagKeys' => [ - 'CreateTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - ], - 'DeleteTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'tag_key.name', - 'fieldAccessors' => [ - 'getTagKey', - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\TagKey', - ], - 'GetTagKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\TagKey', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTagKeys' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagKeys', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagKeysResponse', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'tagKey' => 'tagKeys/{tag_key}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php deleted file mode 100644 index 92b3ead1458..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php +++ /dev/null @@ -1,132 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagKeys' => [ - 'CreateTagKey' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagKeys', - 'body' => 'tag_key', - ], - 'DeleteTagKey' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagKeys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagKeys/namespaced', - 'queryParams' => [ - 'name', - ], - ], - 'GetTagKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=tagKeys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagKeys' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagKeys', - 'queryParams' => [ - 'parent', - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateTagKey' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{tag_key.name=tagKeys/*}', - 'body' => 'tag_key', - 'placeholders' => [ - 'tag_key.name' => [ - 'getters' => [ - 'getTagKey', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json deleted file mode 100644 index f9fae4e4bfd..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagValues": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespacedTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTagValues": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php deleted file mode 100644 index 6cc049800ae..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php +++ /dev/null @@ -1,145 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagValues' => [ - 'CreateTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - ], - 'DeleteTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'tag_value.name', - 'fieldAccessors' => [ - 'getTagValue', - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagValue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\TagValue', - ], - 'GetTagValue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\TagValue', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTagValues' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagValues', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceManager\V3\ListTagValuesResponse', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'tagValue' => 'tagValues/{tag_value}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php deleted file mode 100644 index ab34cd4357b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php +++ /dev/null @@ -1,132 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagValues' => [ - 'CreateTagValue' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagValues', - 'body' => 'tag_value', - ], - 'DeleteTagValue' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagValues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagValue' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagValues/namespaced', - 'queryParams' => [ - 'name', - ], - ], - 'GetTagValue' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=tagValues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagValues' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagValues', - 'queryParams' => [ - 'parent', - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateTagValue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{tag_value.name=tagValues/*}', - 'body' => 'tag_value', - 'placeholders' => [ - 'tag_value.name' => [ - 'getters' => [ - 'getTagValue', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php deleted file mode 100644 index 34f0a88299d..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/FoldersClientTest.php +++ /dev/null @@ -1,1232 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FoldersClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FoldersClient($options); - } - - /** @test */ - public function createFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $request = (new CreateFolderRequest()) - ->setFolder($folder); - $response = $gapicClient->createFolder($request); - $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.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFolder(); - $this->assertProtobufEquals($folder, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFolderTest'); - $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 createFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createFolderTest'); - $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 - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $request = (new CreateFolderRequest()) - ->setFolder($folder); - $response = $gapicClient->createFolder($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFolderTest'); - 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 deleteFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $request = (new DeleteFolderRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteFolder($request); - $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.resourcemanager.v3.Folders/DeleteFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); - $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 deleteFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteFolderTest'); - $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 - $formattedName = $gapicClient->folderName('[FOLDER]'); - $request = (new DeleteFolderRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteFolder($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); - 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 getFolderTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $request = (new GetFolderRequest()) - ->setName($formattedName); - $response = $gapicClient->getFolder($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/GetFolder', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFolderExceptionTest() - { - $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->folderName('[FOLDER]'); - $request = (new GetFolderRequest()) - ->setName($formattedName); - try { - $gapicClient->getFolder($request); - // 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 listFoldersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $foldersElement = new Folder(); - $folders = [ - $foldersElement, - ]; - $expectedResponse = new ListFoldersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFolders($folders); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListFoldersRequest()) - ->setParent($parent); - $response = $gapicClient->listFolders($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/ListFolders', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFoldersExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListFoldersRequest()) - ->setParent($parent); - try { - $gapicClient->listFolders($request); - // 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 moveFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/moveFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $destinationParent = 'destinationParent-1362053637'; - $request = (new MoveFolderRequest()) - ->setName($formattedName) - ->setDestinationParent($destinationParent); - $response = $gapicClient->moveFolder($request); - $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.resourcemanager.v3.Folders/MoveFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationParent(); - $this->assertProtobufEquals($destinationParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveFolderTest'); - $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 moveFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/moveFolderTest'); - $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 - $formattedName = $gapicClient->folderName('[FOLDER]'); - $destinationParent = 'destinationParent-1362053637'; - $request = (new MoveFolderRequest()) - ->setName($formattedName) - ->setDestinationParent($destinationParent); - $response = $gapicClient->moveFolder($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveFolderTest'); - 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 searchFoldersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $foldersElement = new Folder(); - $folders = [ - $foldersElement, - ]; - $expectedResponse = new SearchFoldersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFolders($folders); - $transport->addResponse($expectedResponse); - $request = new SearchFoldersRequest(); - $response = $gapicClient->searchFolders($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SearchFolders', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchFoldersExceptionTest() - { - $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); - $request = new SearchFoldersRequest(); - try { - $gapicClient->searchFolders($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 undeleteFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/undeleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeleteFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $request = (new UndeleteFolderRequest()) - ->setName($formattedName); - $response = $gapicClient->undeleteFolder($request); - $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.resourcemanager.v3.Folders/UndeleteFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); - $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 undeleteFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/undeleteFolderTest'); - $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 - $formattedName = $gapicClient->folderName('[FOLDER]'); - $request = (new UndeleteFolderRequest()) - ->setName($formattedName); - $response = $gapicClient->undeleteFolder($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); - 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 updateFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $updateMask = new FieldMask(); - $request = (new UpdateFolderRequest()) - ->setFolder($folder) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateFolder($request); - $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.resourcemanager.v3.Folders/UpdateFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFolder(); - $this->assertProtobufEquals($folder, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFolderTest'); - $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 updateFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateFolderTest'); - $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 - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $updateMask = new FieldMask(); - $request = (new UpdateFolderRequest()) - ->setFolder($folder) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateFolder($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFolderTest'); - 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 createFolderAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $request = (new CreateFolderRequest()) - ->setFolder($folder); - $response = $gapicClient->createFolderAsync($request)->wait(); - $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.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFolder(); - $this->assertProtobufEquals($folder, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFolderTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php deleted file mode 100644 index c8d7573aa2b..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/OrganizationsClientTest.php +++ /dev/null @@ -1,440 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return OrganizationsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new OrganizationsClient($options); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getOrganizationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $directoryCustomerId = 'directoryCustomerId813284938'; - $etag = 'etag3123477'; - $expectedResponse = new Organization(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDirectoryCustomerId($directoryCustomerId); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->organizationName('[ORGANIZATION]'); - $request = (new GetOrganizationRequest()) - ->setName($formattedName); - $response = $gapicClient->getOrganization($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetOrganization', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getOrganizationExceptionTest() - { - $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->organizationName('[ORGANIZATION]'); - $request = (new GetOrganizationRequest()) - ->setName($formattedName); - try { - $gapicClient->getOrganization($request); - // 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 searchOrganizationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $organizationsElement = new Organization(); - $organizations = [ - $organizationsElement, - ]; - $expectedResponse = new SearchOrganizationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setOrganizations($organizations); - $transport->addResponse($expectedResponse); - $request = new SearchOrganizationsRequest(); - $response = $gapicClient->searchOrganizations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getOrganizations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchOrganizationsExceptionTest() - { - $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); - $request = new SearchOrganizationsRequest(); - try { - $gapicClient->searchOrganizations($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 getIamPolicyAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicyAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php deleted file mode 100644 index e4437871a5f..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/ProjectsClientTest.php +++ /dev/null @@ -1,1229 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ProjectsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ProjectsClient($options); - } - - /** @test */ - public function createProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $project = new Project(); - $request = (new CreateProjectRequest()) - ->setProject($project); - $response = $gapicClient->createProject($request); - $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.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProject(); - $this->assertProtobufEquals($project, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createProjectTest'); - $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 createProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createProjectTest'); - $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 - $project = new Project(); - $request = (new CreateProjectRequest()) - ->setProject($project); - $response = $gapicClient->createProject($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createProjectTest'); - 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 deleteProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $request = (new DeleteProjectRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProject($request); - $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.resourcemanager.v3.Projects/DeleteProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); - $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 deleteProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteProjectTest'); - $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 - $formattedName = $gapicClient->projectName('[PROJECT]'); - $request = (new DeleteProjectRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProject($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); - 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getProjectTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $request = (new GetProjectRequest()) - ->setName($formattedName); - $response = $gapicClient->getProject($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/GetProject', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProjectExceptionTest() - { - $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->projectName('[PROJECT]'); - $request = (new GetProjectRequest()) - ->setName($formattedName); - try { - $gapicClient->getProject($request); - // 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 listProjectsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $projectsElement = new Project(); - $projects = [ - $projectsElement, - ]; - $expectedResponse = new ListProjectsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProjects($projects); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListProjectsRequest()) - ->setParent($parent); - $response = $gapicClient->listProjects($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/ListProjects', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProjectsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListProjectsRequest()) - ->setParent($parent); - try { - $gapicClient->listProjects($request); - // 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 moveProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/moveProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $destinationParent = 'destinationParent-1362053637'; - $request = (new MoveProjectRequest()) - ->setName($formattedName) - ->setDestinationParent($destinationParent); - $response = $gapicClient->moveProject($request); - $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.resourcemanager.v3.Projects/MoveProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationParent(); - $this->assertProtobufEquals($destinationParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveProjectTest'); - $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 moveProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/moveProjectTest'); - $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 - $formattedName = $gapicClient->projectName('[PROJECT]'); - $destinationParent = 'destinationParent-1362053637'; - $request = (new MoveProjectRequest()) - ->setName($formattedName) - ->setDestinationParent($destinationParent); - $response = $gapicClient->moveProject($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveProjectTest'); - 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 searchProjectsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $projectsElement = new Project(); - $projects = [ - $projectsElement, - ]; - $expectedResponse = new SearchProjectsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProjects($projects); - $transport->addResponse($expectedResponse); - $request = new SearchProjectsRequest(); - $response = $gapicClient->searchProjects($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SearchProjects', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchProjectsExceptionTest() - { - $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); - $request = new SearchProjectsRequest(); - try { - $gapicClient->searchProjects($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 undeleteProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/undeleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeleteProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $request = (new UndeleteProjectRequest()) - ->setName($formattedName); - $response = $gapicClient->undeleteProject($request); - $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.resourcemanager.v3.Projects/UndeleteProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); - $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 undeleteProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/undeleteProjectTest'); - $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 - $formattedName = $gapicClient->projectName('[PROJECT]'); - $request = (new UndeleteProjectRequest()) - ->setName($formattedName); - $response = $gapicClient->undeleteProject($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); - 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 updateProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $project = new Project(); - $request = (new UpdateProjectRequest()) - ->setProject($project); - $response = $gapicClient->updateProject($request); - $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.resourcemanager.v3.Projects/UpdateProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProject(); - $this->assertProtobufEquals($project, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateProjectTest'); - $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 updateProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateProjectTest'); - $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 - $project = new Project(); - $request = (new UpdateProjectRequest()) - ->setProject($project); - $response = $gapicClient->updateProject($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateProjectTest'); - 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 createProjectAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $project = new Project(); - $request = (new CreateProjectRequest()) - ->setProject($project); - $response = $gapicClient->createProjectAsync($request)->wait(); - $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.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProject(); - $this->assertProtobufEquals($project, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createProjectTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php deleted file mode 100644 index 560f038ccc2..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagBindingsClientTest.php +++ /dev/null @@ -1,539 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagBindingsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagBindingsClient($options); - } - - /** @test */ - public function createTagBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $tagValue = 'tagValue2092898444'; - $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; - $expectedResponse = new TagBinding(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setTagValue($tagValue); - $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagBinding = new TagBinding(); - $request = (new CreateTagBindingRequest()) - ->setTagBinding($tagBinding); - $response = $gapicClient->createTagBinding($request); - $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.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagBinding(); - $this->assertProtobufEquals($tagBinding, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); - $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 createTagBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagBindingTest'); - $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 - $tagBinding = new TagBinding(); - $request = (new CreateTagBindingRequest()) - ->setTagBinding($tagBinding); - $response = $gapicClient->createTagBinding($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); - 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 deleteTagBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); - $request = (new DeleteTagBindingRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagBinding($request); - $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.resourcemanager.v3.TagBindings/DeleteTagBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); - $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 deleteTagBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagBindingTest'); - $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 - $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); - $request = (new DeleteTagBindingRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagBinding($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); - 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 listEffectiveTagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $effectiveTagsElement = new EffectiveTag(); - $effectiveTags = [ - $effectiveTagsElement, - ]; - $expectedResponse = new ListEffectiveTagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEffectiveTags($effectiveTags); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListEffectiveTagsRequest()) - ->setParent($parent); - $response = $gapicClient->listEffectiveTags($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEffectiveTags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEffectiveTagsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListEffectiveTagsRequest()) - ->setParent($parent); - try { - $gapicClient->listEffectiveTags($request); - // 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 listTagBindingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagBindingsElement = new TagBinding(); - $tagBindings = [ - $tagBindingsElement, - ]; - $expectedResponse = new ListTagBindingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagBindings($tagBindings); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListTagBindingsRequest()) - ->setParent($parent); - $response = $gapicClient->listTagBindings($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagBindings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagBindingsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListTagBindingsRequest()) - ->setParent($parent); - try { - $gapicClient->listTagBindings($request); - // 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 createTagBindingAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $tagValue = 'tagValue2092898444'; - $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; - $expectedResponse = new TagBinding(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setTagValue($tagValue); - $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagBinding = new TagBinding(); - $request = (new CreateTagBindingRequest()) - ->setTagBinding($tagBinding); - $response = $gapicClient->createTagBindingAsync($request)->wait(); - $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.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagBinding(); - $this->assertProtobufEquals($tagBinding, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php deleted file mode 100644 index 635c0497818..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagHoldsClientTest.php +++ /dev/null @@ -1,480 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagHoldsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagHoldsClient($options); - } - - /** @test */ - public function createTagHoldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $holder = 'holder-1211707988'; - $origin = 'origin-1008619738'; - $helpLink = 'helpLink1297152568'; - $expectedResponse = new TagHold(); - $expectedResponse->setName($name); - $expectedResponse->setHolder($holder); - $expectedResponse->setOrigin($origin); - $expectedResponse->setHelpLink($helpLink); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagHoldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $tagHold = new TagHold(); - $tagHoldHolder = 'tagHoldHolder-501201275'; - $tagHold->setHolder($tagHoldHolder); - $request = (new CreateTagHoldRequest()) - ->setParent($formattedParent) - ->setTagHold($tagHold); - $response = $gapicClient->createTagHold($request); - $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.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTagHold(); - $this->assertProtobufEquals($tagHold, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); - $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 createTagHoldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagHoldTest'); - $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->tagValueName('[TAG_VALUE]'); - $tagHold = new TagHold(); - $tagHoldHolder = 'tagHoldHolder-501201275'; - $tagHold->setHolder($tagHoldHolder); - $request = (new CreateTagHoldRequest()) - ->setParent($formattedParent) - ->setTagHold($tagHold); - $response = $gapicClient->createTagHold($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); - 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 deleteTagHoldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagHoldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - $request = (new DeleteTagHoldRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagHold($request); - $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.resourcemanager.v3.TagHolds/DeleteTagHold', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); - $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 deleteTagHoldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagHoldTest'); - $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 - $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - $request = (new DeleteTagHoldRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagHold($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); - 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 listTagHoldsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagHoldsElement = new TagHold(); - $tagHolds = [ - $tagHoldsElement, - ]; - $expectedResponse = new ListTagHoldsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagHolds($tagHolds); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $request = (new ListTagHoldsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listTagHolds($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagHolds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagHoldsExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - $request = (new ListTagHoldsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listTagHolds($request); - // 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 createTagHoldAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $holder = 'holder-1211707988'; - $origin = 'origin-1008619738'; - $helpLink = 'helpLink1297152568'; - $expectedResponse = new TagHold(); - $expectedResponse->setName($name); - $expectedResponse->setHolder($holder); - $expectedResponse->setOrigin($origin); - $expectedResponse->setHelpLink($helpLink); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagHoldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $tagHold = new TagHold(); - $tagHoldHolder = 'tagHoldHolder-501201275'; - $tagHold->setHolder($tagHoldHolder); - $request = (new CreateTagHoldRequest()) - ->setParent($formattedParent) - ->setTagHold($tagHold); - $response = $gapicClient->createTagHoldAsync($request)->wait(); - $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.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTagHold(); - $this->assertProtobufEquals($tagHold, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php deleted file mode 100644 index bb277362eb8..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagKeysClientTest.php +++ /dev/null @@ -1,988 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagKeysClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagKeysClient($options); - } - - /** @test */ - public function createTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $request = (new CreateTagKeyRequest()) - ->setTagKey($tagKey); - $response = $gapicClient->createTagKey($request); - $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.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagKey(); - $this->assertProtobufEquals($tagKey, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); - $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 createTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagKeyTest'); - $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 - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $request = (new CreateTagKeyRequest()) - ->setTagKey($tagKey); - $response = $gapicClient->createTagKey($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); - 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 deleteTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $request = (new DeleteTagKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagKey($request); - $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.resourcemanager.v3.TagKeys/DeleteTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); - $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 deleteTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagKeyTest'); - $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 - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $request = (new DeleteTagKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagKey($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); - 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getNamespacedTagKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $request = (new GetNamespacedTagKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->getNamespacedTagKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetNamespacedTagKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespacedTagKeyExceptionTest() - { - $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->tagKeyName('[TAG_KEY]'); - $request = (new GetNamespacedTagKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->getNamespacedTagKey($request); - // 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 getTagKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $request = (new GetTagKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->getTagKey($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/GetTagKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagKeyExceptionTest() - { - $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->tagKeyName('[TAG_KEY]'); - $request = (new GetTagKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->getTagKey($request); - // 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 listTagKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagKeysElement = new TagKey(); - $tagKeys = [ - $tagKeysElement, - ]; - $expectedResponse = new ListTagKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagKeys($tagKeys); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListTagKeysRequest()) - ->setParent($parent); - $response = $gapicClient->listTagKeys($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagKeysExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListTagKeysRequest()) - ->setParent($parent); - try { - $gapicClient->listTagKeys($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 updateTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $request = (new UpdateTagKeyRequest()) - ->setTagKey($tagKey); - $response = $gapicClient->updateTagKey($request); - $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.resourcemanager.v3.TagKeys/UpdateTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagKey(); - $this->assertProtobufEquals($tagKey, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); - $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 updateTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateTagKeyTest'); - $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 - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $request = (new UpdateTagKeyRequest()) - ->setTagKey($tagKey); - $response = $gapicClient->updateTagKey($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); - 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 createTagKeyAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $request = (new CreateTagKeyRequest()) - ->setTagKey($tagKey); - $response = $gapicClient->createTagKeyAsync($request)->wait(); - $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.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagKey(); - $this->assertProtobufEquals($tagKey, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php deleted file mode 100644 index 50c0dfee188..00000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/Client/TagValuesClientTest.php +++ /dev/null @@ -1,988 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagValuesClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagValuesClient($options); - } - - /** @test */ - public function createTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $request = (new CreateTagValueRequest()) - ->setTagValue($tagValue); - $response = $gapicClient->createTagValue($request); - $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.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagValue(); - $this->assertProtobufEquals($tagValue, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagValueTest'); - $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 createTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagValueTest'); - $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 - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $request = (new CreateTagValueRequest()) - ->setTagValue($tagValue); - $response = $gapicClient->createTagValue($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagValueTest'); - 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 deleteTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $request = (new DeleteTagValueRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagValue($request); - $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.resourcemanager.v3.TagValues/DeleteTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); - $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 deleteTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteTagValueTest'); - $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 - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $request = (new DeleteTagValueRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteTagValue($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); - 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getNamespacedTagValueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $request = (new GetNamespacedTagValueRequest()) - ->setName($formattedName); - $response = $gapicClient->getNamespacedTagValue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetNamespacedTagValue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespacedTagValueExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - $request = (new GetNamespacedTagValueRequest()) - ->setName($formattedName); - try { - $gapicClient->getNamespacedTagValue($request); - // 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 getTagValueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $request = (new GetTagValueRequest()) - ->setName($formattedName); - $response = $gapicClient->getTagValue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/GetTagValue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagValueExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - $request = (new GetTagValueRequest()) - ->setName($formattedName); - try { - $gapicClient->getTagValue($request); - // 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 listTagValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagValuesElement = new TagValue(); - $tagValues = [ - $tagValuesElement, - ]; - $expectedResponse = new ListTagValuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagValues($tagValues); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListTagValuesRequest()) - ->setParent($parent); - $response = $gapicClient->listTagValues($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagValues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagValuesExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListTagValuesRequest()) - ->setParent($parent); - try { - $gapicClient->listTagValues($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 updateTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $request = (new UpdateTagValueRequest()) - ->setTagValue($tagValue); - $response = $gapicClient->updateTagValue($request); - $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.resourcemanager.v3.TagValues/UpdateTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagValue(); - $this->assertProtobufEquals($tagValue, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); - $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 updateTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateTagValueTest'); - $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 - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $request = (new UpdateTagValueRequest()) - ->setTagValue($tagValue); - $response = $gapicClient->updateTagValue($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); - 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 createTagValueAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $request = (new CreateTagValueRequest()) - ->setTagValue($tagValue); - $response = $gapicClient->createTagValueAsync($request)->wait(); - $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.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagValue(); - $this->assertProtobufEquals($tagValue, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagValueTest'); - $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()); - } -} diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php b/owl-bot-staging/ResourceSettings/v1/proto/src/GPBMetadata/Google/Cloud/Resourcesettings/V1/ResourceSettings.php deleted file mode 100644 index 0ddd1d8f7c88c52b096800ab85dfa2b2b8b3fc65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3819 zcmbVP&2Jk;6z|&k@=MaD(~r2JQnzkVoQSLy7ZBPst=5T?TFQsjIIgHHR%?6gENpg{ z-LXR&Swe8(h6G$Wa6|k9To8h5kLA`=4_xS9fKU(2&d#paPNKxkCF?iu{pP*j`&4tACR$x1 zT4kN#RaQK_%Huw~N_lY!pk`>UD+X&jd@ncxk^b4Os-f3JmuQ6kyQ{mZZt6tW4E-4m zb6IR?hKni4aotACtP$NZMbBW{tl{*W=wo`icWsN(vMdG;7CojYOO=92uw!aQWfi+M zN4JUP6sf8#H!%tM^(5&zzO4tRH^j8>qbwhDa#NJcX@)C?j!iO{&65vAGlv((58a{g4l0>|iC05K*e=$q##hGc2t=T#)d5dZn0%U(F^=lkPc@?7x81nieDTqQkfgZuwK5vZVD3y$77bPF(bRQ)S6?9ZC{z{3X z`!H@;HO)}ln$g0^F$PwdJsYj;>7zVc!gL_e{%B(kkr)iZcY}sU<7p< zKxH-{BpeZbkd$Rtq9Z61u(L=<$EVZ_H*>_lRI{~T#ZD&^m}ZXnm+JA@LFtBN)UiV? z{EyQ$-?yBmX6n!UmdPANf1YZU`aK4hxO)NP=qgOqb=NkuL*@ie<`o#P^ASONG8ywI zK$jumV6CoNrg4~zQ_&dOgoHNs~-BioU#%_LUDD_)cckq#kxT0!o=(inKqAydlQ7H{{Tj)Q@}H?61h}%HyM(9JeT+Y+2n5}L5nFTU z+~Ed^S4!+ZB@V*8S4y_l#HveAI#yl7h~|Nbi1isZS$QSU5)8F=YXQbNrpGk82}#;6CE7x2 zxsZR-*KF4T^{nQUox%$3I}vX7$n$G!`ISfC2WO`^s?VvK`EXD(zs6FXmkO`_um1Y``Wds)VOZL}tXFvC44DQkk&zZHAyVl>OMejXQ6rL9S%WH5;q?f0r6~4hZrEZ2g5qX*g zV!OK3ACX=CR}g-QiRUVI*?RQS^^e7gl>q(UEWuVZ(7AX#QevfK|P j%jL!D2&JD`_h!Sp{d@j{DDr+f_3gwo{WnerIspFz4MzrJ diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php deleted file mode 100644 index c6eee9fa8d1..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/GetSettingRequest.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.resourcesettings.v1.GetSettingRequest - */ -class GetSettingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the setting to get. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for naming - * requirements. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; - */ - protected $view = 0; - - /** - * @param string $name Required. The name of the setting to get. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for naming - * requirements. Please see - * {@see ResourceSettingsServiceClient::settingName()} for help formatting this field. - * - * @return \Google\Cloud\ResourceSettings\V1\GetSettingRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the setting to get. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for naming - * requirements. - * @type int $view - * The SettingView for this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the setting to get. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for naming - * requirements. - * - * 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 name of the setting to get. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for naming - * requirements. - * - * 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; - } - - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php deleted file mode 100644 index 55dbf4f3fa7..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsRequest.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.resourcesettings.v1.ListSettingsRequest - */ -class ListSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Cloud resource that parents the setting. Must be in one of - * the following forms: - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Unused. The size of the page to be returned. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * Unused. A page token used to retrieve the next page. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; - */ - protected $view = 0; - - /** - * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of - * the following forms: - * - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * - * @return \Google\Cloud\ResourceSettings\V1\ListSettingsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The Cloud resource that parents the setting. Must be in one of - * the following forms: - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * @type int $page_size - * Unused. The size of the page to be returned. - * @type string $page_token - * Unused. A page token used to retrieve the next page. - * @type int $view - * The SettingView for this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Cloud resource that parents the setting. Must be in one of - * the following forms: - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * - * 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 Cloud resource that parents the setting. Must be in one of - * the following forms: - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * - * 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; - } - - /** - * Unused. The size of the page to be returned. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Unused. The size of the page to be returned. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Unused. A page token used to retrieve the next page. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Unused. A page token used to retrieve the next page. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The SettingView for this request. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingView view = 4; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php deleted file mode 100644 index 7b1ed2d089d..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/ListSettingsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.resourcesettings.v1.ListSettingsResponse - */ -class ListSettingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of settings that are available at the specified Cloud resource. - * - * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; - */ - private $settings; - /** - * Unused. A page token used to retrieve the next page. - * - * 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\ResourceSettings\V1\Setting>|\Google\Protobuf\Internal\RepeatedField $settings - * A list of settings that are available at the specified Cloud resource. - * @type string $next_page_token - * Unused. A page token used to retrieve the next page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * A list of settings that are available at the specified Cloud resource. - * - * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSettings() - { - return $this->settings; - } - - /** - * A list of settings that are available at the specified Cloud resource. - * - * Generated from protobuf field repeated .google.cloud.resourcesettings.v1.Setting settings = 1; - * @param array<\Google\Cloud\ResourceSettings\V1\Setting>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceSettings\V1\Setting::class); - $this->settings = $arr; - - return $this; - } - - /** - * Unused. A page token used to retrieve the next page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Unused. A page token used to retrieve the next page. - * - * 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/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php deleted file mode 100644 index 5f66a0f4311..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Setting.php +++ /dev/null @@ -1,329 +0,0 @@ -google.cloud.resourcesettings.v1.Setting - */ -class Setting extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the setting. Must be in one of the following forms: - * * `projects/{project_number}/settings/{setting_name}` - * * `folders/{folder_id}/settings/{setting_name}` - * * `organizations/{organization_id}/settings/{setting_name}` - * For example, "/projects/123/settings/gcp-enableMyFeature" - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. Metadata about a setting which is not editable by the end - * user. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $metadata = null; - /** - * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of - * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent - * with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; - */ - protected $local_value = null; - /** - * Output only. The computed effective value of the setting at the given - * parent resource (based on the resource hierarchy). - * The effective value evaluates to one of the following options in the given - * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: - * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] - * 2. if one of the given resource's ancestors have a local setting value, - * the local value at the nearest such ancestor - * 3. the setting's default value: - * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] - * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must - * always be consistent with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $effective_value = null; - /** - * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] - * for more details. - * - * Generated from protobuf field string etag = 10; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the setting. Must be in one of the following forms: - * * `projects/{project_number}/settings/{setting_name}` - * * `folders/{folder_id}/settings/{setting_name}` - * * `organizations/{organization_id}/settings/{setting_name}` - * For example, "/projects/123/settings/gcp-enableMyFeature" - * @type \Google\Cloud\ResourceSettings\V1\SettingMetadata $metadata - * Output only. Metadata about a setting which is not editable by the end - * user. - * @type \Google\Cloud\ResourceSettings\V1\Value $local_value - * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of - * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent - * with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * @type \Google\Cloud\ResourceSettings\V1\Value $effective_value - * Output only. The computed effective value of the setting at the given - * parent resource (based on the resource hierarchy). - * The effective value evaluates to one of the following options in the given - * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: - * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] - * 2. if one of the given resource's ancestors have a local setting value, - * the local value at the nearest such ancestor - * 3. the setting's default value: - * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] - * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must - * always be consistent with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * @type string $etag - * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] - * for more details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the setting. Must be in one of the following forms: - * * `projects/{project_number}/settings/{setting_name}` - * * `folders/{folder_id}/settings/{setting_name}` - * * `organizations/{organization_id}/settings/{setting_name}` - * For example, "/projects/123/settings/gcp-enableMyFeature" - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the setting. Must be in one of the following forms: - * * `projects/{project_number}/settings/{setting_name}` - * * `folders/{folder_id}/settings/{setting_name}` - * * `organizations/{organization_id}/settings/{setting_name}` - * For example, "/projects/123/settings/gcp-enableMyFeature" - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Metadata about a setting which is not editable by the end - * user. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\ResourceSettings\V1\SettingMetadata|null - */ - public function getMetadata() - { - return $this->metadata; - } - - public function hasMetadata() - { - return isset($this->metadata); - } - - public function clearMetadata() - { - unset($this->metadata); - } - - /** - * Output only. Metadata about a setting which is not editable by the end - * user. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\ResourceSettings\V1\SettingMetadata $var - * @return $this - */ - public function setMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\SettingMetadata::class); - $this->metadata = $var; - - return $this; - } - - /** - * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of - * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent - * with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; - * @return \Google\Cloud\ResourceSettings\V1\Value|null - */ - public function getLocalValue() - { - return $this->local_value; - } - - public function hasLocalValue() - { - return isset($this->local_value); - } - - public function clearLocalValue() - { - unset($this->local_value); - } - - /** - * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of - * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent - * with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; - * @param \Google\Cloud\ResourceSettings\V1\Value $var - * @return $this - */ - public function setLocalValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); - $this->local_value = $var; - - return $this; - } - - /** - * Output only. The computed effective value of the setting at the given - * parent resource (based on the resource hierarchy). - * The effective value evaluates to one of the following options in the given - * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: - * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] - * 2. if one of the given resource's ancestors have a local setting value, - * the local value at the nearest such ancestor - * 3. the setting's default value: - * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] - * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must - * always be consistent with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\ResourceSettings\V1\Value|null - */ - public function getEffectiveValue() - { - return $this->effective_value; - } - - public function hasEffectiveValue() - { - return isset($this->effective_value); - } - - public function clearEffectiveValue() - { - unset($this->effective_value); - } - - /** - * Output only. The computed effective value of the setting at the given - * parent resource (based on the resource hierarchy). - * The effective value evaluates to one of the following options in the given - * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: - * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] - * 2. if one of the given resource's ancestors have a local setting value, - * the local value at the nearest such ancestor - * 3. the setting's default value: - * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] - * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must - * always be consistent with the data type defined in - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\ResourceSettings\V1\Value $var - * @return $this - */ - public function setEffectiveValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); - $this->effective_value = $var; - - return $this; - } - - /** - * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] - * for more details. - * - * Generated from protobuf field string etag = 10; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] - * for more details. - * - * Generated from protobuf field string etag = 10; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php deleted file mode 100644 index 0c7450691b7..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata.php +++ /dev/null @@ -1,229 +0,0 @@ -google.cloud.resourcesettings.v1.SettingMetadata - */ -class SettingMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The human readable name for this setting. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * A detailed description of what this setting does. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * A flag indicating that values of this setting cannot be modified (see - * documentation of the specific setting for updates and reasons). - * - * Generated from protobuf field bool read_only = 3; - */ - protected $read_only = false; - /** - * The data type for this setting. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; - */ - protected $data_type = 0; - /** - * The value provided by - * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] - * if no setting value is explicitly set. - * Note: not all settings have a default value. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; - */ - protected $default_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The human readable name for this setting. - * @type string $description - * A detailed description of what this setting does. - * @type bool $read_only - * A flag indicating that values of this setting cannot be modified (see - * documentation of the specific setting for updates and reasons). - * @type int $data_type - * The data type for this setting. - * @type \Google\Cloud\ResourceSettings\V1\Value $default_value - * The value provided by - * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] - * if no setting value is explicitly set. - * Note: not all settings have a default value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * The human readable name for this setting. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The human readable name for this setting. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * A detailed description of what this setting does. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A detailed description of what this setting does. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * A flag indicating that values of this setting cannot be modified (see - * documentation of the specific setting for updates and reasons). - * - * Generated from protobuf field bool read_only = 3; - * @return bool - */ - public function getReadOnly() - { - return $this->read_only; - } - - /** - * A flag indicating that values of this setting cannot be modified (see - * documentation of the specific setting for updates and reasons). - * - * Generated from protobuf field bool read_only = 3; - * @param bool $var - * @return $this - */ - public function setReadOnly($var) - { - GPBUtil::checkBool($var); - $this->read_only = $var; - - return $this; - } - - /** - * The data type for this setting. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; - * @return int - */ - public function getDataType() - { - return $this->data_type; - } - - /** - * The data type for this setting. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4; - * @param int $var - * @return $this - */ - public function setDataType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingMetadata\DataType::class); - $this->data_type = $var; - - return $this; - } - - /** - * The value provided by - * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] - * if no setting value is explicitly set. - * Note: not all settings have a default value. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; - * @return \Google\Cloud\ResourceSettings\V1\Value|null - */ - public function getDefaultValue() - { - return $this->default_value; - } - - public function hasDefaultValue() - { - return isset($this->default_value); - } - - public function clearDefaultValue() - { - unset($this->default_value); - } - - /** - * The value provided by - * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] - * if no setting value is explicitly set. - * Note: not all settings have a default value. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; - * @param \Google\Cloud\ResourceSettings\V1\Value $var - * @return $this - */ - public function setDefaultValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class); - $this->default_value = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php deleted file mode 100644 index 933bb281ab6..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingMetadata/DataType.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.resourcesettings.v1.SettingMetadata.DataType - */ -class DataType -{ - /** - * Unspecified data type. - * - * Generated from protobuf enum DATA_TYPE_UNSPECIFIED = 0; - */ - const DATA_TYPE_UNSPECIFIED = 0; - /** - * A boolean setting. - * - * Generated from protobuf enum BOOLEAN = 1; - */ - const BOOLEAN = 1; - /** - * A string setting. - * - * Generated from protobuf enum STRING = 2; - */ - const STRING = 2; - /** - * A string set setting. - * - * Generated from protobuf enum STRING_SET = 3; - */ - const STRING_SET = 3; - /** - * A Enum setting - * - * Generated from protobuf enum ENUM_VALUE = 4; - */ - const ENUM_VALUE = 4; - - private static $valueToName = [ - self::DATA_TYPE_UNSPECIFIED => 'DATA_TYPE_UNSPECIFIED', - self::BOOLEAN => 'BOOLEAN', - self::STRING => 'STRING', - self::STRING_SET => 'STRING_SET', - self::ENUM_VALUE => 'ENUM_VALUE', - ]; - - 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(DataType::class, \Google\Cloud\ResourceSettings\V1\SettingMetadata_DataType::class); - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php deleted file mode 100644 index 80dad94f8b5..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/SettingView.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.resourcesettings.v1.SettingView - */ -class SettingView -{ - /** - * The default / unset value. - * The API will default to the SETTING_VIEW_BASIC view. - * - * Generated from protobuf enum SETTING_VIEW_UNSPECIFIED = 0; - */ - const SETTING_VIEW_UNSPECIFIED = 0; - /** - * Include - * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata], but - * nothing else. This is the default value (for both ListSettings and - * GetSetting). - * - * Generated from protobuf enum SETTING_VIEW_BASIC = 1; - */ - const SETTING_VIEW_BASIC = 1; - /** - * Include - * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value], - * but nothing else. - * - * Generated from protobuf enum SETTING_VIEW_EFFECTIVE_VALUE = 2; - */ - const SETTING_VIEW_EFFECTIVE_VALUE = 2; - /** - * Include - * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value], - * but nothing else. - * - * Generated from protobuf enum SETTING_VIEW_LOCAL_VALUE = 3; - */ - const SETTING_VIEW_LOCAL_VALUE = 3; - - private static $valueToName = [ - self::SETTING_VIEW_UNSPECIFIED => 'SETTING_VIEW_UNSPECIFIED', - self::SETTING_VIEW_BASIC => 'SETTING_VIEW_BASIC', - self::SETTING_VIEW_EFFECTIVE_VALUE => 'SETTING_VIEW_EFFECTIVE_VALUE', - self::SETTING_VIEW_LOCAL_VALUE => 'SETTING_VIEW_LOCAL_VALUE', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php deleted file mode 100644 index 9f21c56b455..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/UpdateSettingRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.resourcesettings.v1.UpdateSettingRequest - */ -class UpdateSettingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The setting to update. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $setting = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceSettings\V1\Setting $setting - * Required. The setting to update. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The setting to update. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceSettings\V1\Setting|null - */ - public function getSetting() - { - return $this->setting; - } - - public function hasSetting() - { - return isset($this->setting); - } - - public function clearSetting() - { - unset($this->setting); - } - - /** - * Required. The setting to update. See - * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceSettings\V1\Setting $var - * @return $this - */ - public function setSetting($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Setting::class); - $this->setting = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php deleted file mode 100644 index e43966d7129..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.resourcesettings.v1.Value - */ -class Value extends \Google\Protobuf\Internal\Message -{ - protected $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $boolean_value - * Defines this value as being a boolean value. - * @type string $string_value - * Defines this value as being a string value. - * @type \Google\Cloud\ResourceSettings\V1\Value\StringSet $string_set_value - * Defines this value as being a StringSet. - * @type \Google\Cloud\ResourceSettings\V1\Value\EnumValue $enum_value - * Defines this value as being a Enum. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * Defines this value as being a boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @return bool - */ - public function getBooleanValue() - { - return $this->readOneof(1); - } - - public function hasBooleanValue() - { - return $this->hasOneof(1); - } - - /** - * Defines this value as being a boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @param bool $var - * @return $this - */ - public function setBooleanValue($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Defines this value as being a string value. - * - * Generated from protobuf field string string_value = 2; - * @return string - */ - public function getStringValue() - { - return $this->readOneof(2); - } - - public function hasStringValue() - { - return $this->hasOneof(2); - } - - /** - * Defines this value as being a string value. - * - * Generated from protobuf field string string_value = 2; - * @param string $var - * @return $this - */ - public function setStringValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Defines this value as being a StringSet. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3; - * @return \Google\Cloud\ResourceSettings\V1\Value\StringSet|null - */ - public function getStringSetValue() - { - return $this->readOneof(3); - } - - public function hasStringSetValue() - { - return $this->hasOneof(3); - } - - /** - * Defines this value as being a StringSet. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3; - * @param \Google\Cloud\ResourceSettings\V1\Value\StringSet $var - * @return $this - */ - public function setStringSetValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\StringSet::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Defines this value as being a Enum. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4; - * @return \Google\Cloud\ResourceSettings\V1\Value\EnumValue|null - */ - public function getEnumValue() - { - return $this->readOneof(4); - } - - public function hasEnumValue() - { - return $this->hasOneof(4); - } - - /** - * Defines this value as being a Enum. - * - * Generated from protobuf field .google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4; - * @param \Google\Cloud\ResourceSettings\V1\Value\EnumValue $var - * @return $this - */ - public function setEnumValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\EnumValue::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - -} - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php deleted file mode 100644 index b1b28bd7172..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/EnumValue.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.resourcesettings.v1.Value.EnumValue - */ -class EnumValue extends \Google\Protobuf\Internal\Message -{ - /** - * The value of this enum - * - * Generated from protobuf field string value = 1; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $value - * The value of this enum - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * The value of this enum - * - * Generated from protobuf field string value = 1; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value of this enum - * - * Generated from protobuf field string value = 1; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnumValue::class, \Google\Cloud\ResourceSettings\V1\Value_EnumValue::class); - diff --git a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php b/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php deleted file mode 100644 index 2639831851a..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/proto/src/Google/Cloud/ResourceSettings/V1/Value/StringSet.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.resourcesettings.v1.Value.StringSet - */ -class StringSet extends \Google\Protobuf\Internal\Message -{ - /** - * The strings in the set - * - * Generated from protobuf field repeated string values = 1; - */ - private $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $values - * The strings in the set - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce(); - parent::__construct($data); - } - - /** - * The strings in the set - * - * Generated from protobuf field repeated string values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * The strings in the set - * - * Generated from protobuf field repeated string values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringSet::class, \Google\Cloud\ResourceSettings\V1\Value_StringSet::class); - diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php deleted file mode 100644 index 9e69e9c6355..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/get_setting.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Setting $response */ - $response = $resourceSettingsServiceClient->getSetting($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ResourceSettingsServiceClient::settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); - - get_setting_sample($formattedName); -} -// [END resourcesettings_v1_generated_ResourceSettingsService_GetSetting_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php deleted file mode 100644 index eae0ab609c4..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/list_settings.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $resourceSettingsServiceClient->listSettings($request); - - /** @var Setting $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_settings_sample($parent); -} -// [END resourcesettings_v1_generated_ResourceSettingsService_ListSettings_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php b/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php deleted file mode 100644 index 69c6244265c..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/samples/V1/ResourceSettingsServiceClient/update_setting.php +++ /dev/null @@ -1,74 +0,0 @@ -setSetting($setting); - - // Call the API and handle any network failures. - try { - /** @var Setting $response */ - $response = $resourceSettingsServiceClient->updateSetting($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END resourcesettings_v1_generated_ResourceSettingsService_UpdateSetting_sync] diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php b/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php deleted file mode 100644 index 43c970351b4..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/src/V1/Client/ResourceSettingsServiceClient.php +++ /dev/null @@ -1,387 +0,0 @@ - getSettingAsync(GetSettingRequest $request, array $optionalArgs = []) - * @method PromiseInterface listSettingsAsync(ListSettingsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateSettingAsync(UpdateSettingRequest $request, array $optionalArgs = []) - */ -final class ResourceSettingsServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.resourcesettings.v1.ResourceSettingsService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'resourcesettings.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'resourcesettings.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/resource_settings_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/resource_settings_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/resource_settings_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/resource_settings_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_setting_name resource. - * - * @param string $folder - * @param string $settingName - * - * @return string The formatted folder_setting_name resource. - */ - public static function folderSettingNameName(string $folder, string $settingName): string - { - return self::getPathTemplate('folderSettingName')->render([ - 'folder' => $folder, - 'setting_name' => $settingName, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_setting_name resource. - * - * @param string $organization - * @param string $settingName - * - * @return string The formatted organization_setting_name resource. - */ - public static function organizationSettingNameName(string $organization, string $settingName): string - { - return self::getPathTemplate('organizationSettingName')->render([ - 'organization' => $organization, - 'setting_name' => $settingName, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_number_setting_name resource. - * - * @param string $projectNumber - * @param string $settingName - * - * @return string The formatted project_number_setting_name resource. - */ - public static function projectNumberSettingNameName(string $projectNumber, string $settingName): string - { - return self::getPathTemplate('projectNumberSettingName')->render([ - 'project_number' => $projectNumber, - 'setting_name' => $settingName, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a setting - * resource. - * - * @param string $projectNumber - * @param string $settingName - * - * @return string The formatted setting resource. - */ - public static function settingName(string $projectNumber, string $settingName): string - { - return self::getPathTemplate('setting')->render([ - 'project_number' => $projectNumber, - 'setting_name' => $settingName, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderSettingName: folders/{folder}/settings/{setting_name} - * - organizationSettingName: organizations/{organization}/settings/{setting_name} - * - projectNumberSettingName: projects/{project_number}/settings/{setting_name} - * - setting: projects/{project_number}/settings/{setting_name} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'resourcesettings.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Gets a setting. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * setting does not exist. - * - * The async variant is {@see ResourceSettingsServiceClient::getSettingAsync()} . - * - * @example samples/V1/ResourceSettingsServiceClient/get_setting.php - * - * @param GetSettingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Setting - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSetting(GetSettingRequest $request, array $callOptions = []): Setting - { - return $this->startApiCall('GetSetting', $request, $callOptions)->wait(); - } - - /** - * Lists all the settings that are available on the Cloud resource `parent`. - * - * The async variant is {@see ResourceSettingsServiceClient::listSettingsAsync()} . - * - * @example samples/V1/ResourceSettingsServiceClient/list_settings.php - * - * @param ListSettingsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSettings(ListSettingsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSettings', $request, $callOptions); - } - - /** - * Updates a setting. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * setting does not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.FAILED_PRECONDITION` if - * the setting is flagged as read only. - * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag - * supplied in the request does not match the persisted etag of the setting - * value. - * - * On success, the response will contain only `name`, `local_value` and - * `etag`. The `metadata` and `effective_value` cannot be updated through - * this API. - * - * Note: the supplied setting will perform a full overwrite of the - * `local_value` field. - * - * The async variant is {@see ResourceSettingsServiceClient::updateSettingAsync()} - * . - * - * @example samples/V1/ResourceSettingsServiceClient/update_setting.php - * - * @param UpdateSettingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Setting - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSetting(UpdateSettingRequest $request, array $callOptions = []): Setting - { - return $this->startApiCall('UpdateSetting', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json b/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 497c42f7092..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.resourcesettings.v1", - "libraryPackage": "Google\\Cloud\\ResourceSettings\\V1", - "services": { - "ResourceSettingsService": { - "clients": { - "grpc": { - "libraryClient": "ResourceSettingsServiceGapicClient", - "rpcs": { - "GetSetting": { - "methods": [ - "getSetting" - ] - }, - "ListSettings": { - "methods": [ - "listSettings" - ] - }, - "UpdateSetting": { - "methods": [ - "updateSetting" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json deleted file mode 100644 index 598f9f1eed9..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_client_config.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcesettings.v1.ResourceSettingsService": { - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "GetSetting": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListSettings": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateSetting": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php deleted file mode 100644 index 1a389b803c1..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_descriptor_config.php +++ /dev/null @@ -1,79 +0,0 @@ - [ - 'google.cloud.resourcesettings.v1.ResourceSettingsService' => [ - 'GetSetting' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceSettings\V1\Setting', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListSettings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSettings', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ResourceSettings\V1\ListSettingsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSetting' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ResourceSettings\V1\Setting', - 'headerParams' => [ - [ - 'keyName' => 'setting.name', - 'fieldAccessors' => [ - 'getSetting', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'folderSettingName' => 'folders/{folder}/settings/{setting_name}', - 'organizationSettingName' => 'organizations/{organization}/settings/{setting_name}', - 'projectNumberSettingName' => 'projects/{project_number}/settings/{setting_name}', - 'setting' => 'projects/{project_number}/settings/{setting_name}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php b/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php deleted file mode 100644 index af1aea76015..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/src/V1/resources/resource_settings_service_rest_client_config.php +++ /dev/null @@ -1,96 +0,0 @@ - [ - 'google.cloud.resourcesettings.v1.ResourceSettingsService' => [ - 'GetSetting' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/settings/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/settings/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/settings/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListSettings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*}/settings', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*}/settings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/settings', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSetting' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{setting.name=organizations/*/settings/*}', - 'body' => 'setting', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{setting.name=folders/*/settings/*}', - 'body' => 'setting', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{setting.name=projects/*/settings/*}', - 'body' => 'setting', - ], - ], - 'placeholders' => [ - 'setting.name' => [ - 'getters' => [ - 'getSetting', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php b/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php deleted file mode 100644 index 68b79b6962d..00000000000 --- a/owl-bot-staging/ResourceSettings/v1/tests/Unit/V1/Client/ResourceSettingsServiceClientTest.php +++ /dev/null @@ -1,300 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ResourceSettingsServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ResourceSettingsServiceClient($options); - } - - /** @test */ - public function getSettingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Setting(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); - $request = (new GetSettingRequest()) - ->setName($formattedName); - $response = $gapicClient->getSetting($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/GetSetting', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSettingExceptionTest() - { - $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->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); - $request = (new GetSettingRequest()) - ->setName($formattedName); - try { - $gapicClient->getSetting($request); - // 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 listSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $settingsElement = new Setting(); - $settings = [ - $settingsElement, - ]; - $expectedResponse = new ListSettingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSettings($settings); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListSettingsRequest()) - ->setParent($parent); - $response = $gapicClient->listSettings($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSettings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/ListSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSettingsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $request = (new ListSettingsRequest()) - ->setParent($parent); - try { - $gapicClient->listSettings($request); - // 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 updateSettingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new Setting(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $setting = new Setting(); - $request = (new UpdateSettingRequest()) - ->setSetting($setting); - $response = $gapicClient->updateSetting($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/UpdateSetting', $actualFuncCall); - $actualValue = $actualRequestObject->getSetting(); - $this->assertProtobufEquals($setting, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSettingExceptionTest() - { - $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 - $setting = new Setting(); - $request = (new UpdateSettingRequest()) - ->setSetting($setting); - try { - $gapicClient->updateSetting($request); - // 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 getSettingAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Setting(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->settingName('[PROJECT_NUMBER]', '[SETTING_NAME]'); - $request = (new GetSettingRequest()) - ->setName($formattedName); - $response = $gapicClient->getSettingAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcesettings.v1.ResourceSettingsService/GetSetting', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php deleted file mode 100644 index ad28cd54f00..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/AnalyticsService.php +++ /dev/null @@ -1,36 +0,0 @@ -internalAddGeneratedFile( - ' -� -.google/cloud/retail/v2/analytics_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto*google/cloud/retail/v2/export_config.proto#google/longrunning/operations.proto2� -AnalyticsService� -ExportAnalyticsMetrics5.google.cloud.retail.v2.ExportAnalyticsMetricsRequest.google.longrunning.Operation"��A^ -5google.cloud.retail.v2.ExportAnalyticsMetricsResponse%google.cloud.retail.v2.ExportMetadata���K"F/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BAnalyticsServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Catalog.php deleted file mode 100644 index b421b2082c35c38f63489d95268a0fa9689a9869..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4735 zcmbtY&vV*F6fQV+?1z6~#UYqU9EErqCv{;;JFTNMNikrT#>OtjG;Nq@gjlc=A!#Jx z+RgaT{ujOW*xuX!p?^iL&Gg=D-|k960h3`IUo2MdeednJZ=b&1FCSY+7TgxMi9u|| zB`vXeD!NBRv~1HgRZ|z6y>^?}qH1<6O(%9n6pMReWv?cdisjlZbal+0trAJ>m}W;O zSyeZCt*lL4Mbop#xvZ+Vif(o?3=qIjy2P;*m5AH>o4aV$!uO4B=G!Px-$s@BHtM+t z0IIGyj#%Ir@CroyvwBTkQ$@#BT>Q7HIkIMGuBPbPPniEhv90J1LEmB9cF#~<%``;n zuxF@b?XJi%sqLy|;(Q;9em47*0-S!MY`DZW6unU-j%sU`Yufv0DoGvU2E@^kwYy$e z3a7QjHJ+m+4JG+dbnPAqM;ArptY;e!Sl$%iEO=_1!&TnW8e1CCTbtxaIo3>DlKQji zgN$;m5^vqc_8M56M#1cMO=JA1gZ|~NW!i4RG}>Bce3W2OY8n=jt8}gNec57u{7Cbb zF5hYeE477nycTdvnZ5&mtib9x1uP`ERfd&$hL?HfIG0-XycJ8s;^*A*nor#x1|7?hZL7I_FqefrMsskTl!@GWyc@ zvU_TgWJHXt%?QXzm)Po&Vz{zOC~<+6){@(_){;?bnf`A9;@+OjyRNM@doB^;F!7R{ za;(jX*ZHV$1*SAZ?l~kmgKpDwa6%}FOhRRKa>LkD4Eyoe*hLPs<>PoEYOv@K zg%Tag`!d76KQ{J3fZ(CZa1EKj6&=QoG3-ZUW0xq-P=GoJSnjq)j>CD+GHhvVY;5j6 zgqQd?Fw2rQ({z;m4ABFw=|<#4xDEf?@-G~I-S!M-QL^>U?HdYa$dDam{Lwens?KCB${XQ_D)cQh#=gt%o(-WyCBnI2J7c3UiHo_M$+28E3+}fx>gIH2@BO;x=$@kzx zPd9SygObt7;Q1;$ICbF(_OKU3b)D=h@98Y7o5(3D9USu?&$1rPIOaW_Wdm}&HA??F ziJ}cpaXO*y?_9V9%y$)6JwmxCn|6!Xysrt@V4JWs|mc zg3DlZ+#~jxnZ&j+r}SJC2Nl~uz$8^8)A;R3hG6gnXZ28ZGL_3TTrBs=NM3_U6tTL> z)RWJKtHKQ2!b2nKpnjIJr=m@Z9&)Knq*88%+aJQ!7BNnB4Sn89gG#cCr|}W2ur&JE zT*>!ynC|CL$70rX^T**NsB*q|66n=Es3b~{7wED z+&F)e`e{lR-internalAddGeneratedFile( - ' -�$ -,google/cloud/retail/v2/catalog_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/retail/v2/catalog.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"w -ListCatalogsRequest9 -parent ( B)�A�A# -!locations.googleapis.com/Location - page_size ( - -page_token ( "b -ListCatalogsResponse1 -catalogs ( 2.google.cloud.retail.v2.Catalog -next_page_token ( "~ -UpdateCatalogRequest5 -catalog ( 2.google.cloud.retail.v2.CatalogB�A/ - update_mask ( 2.google.protobuf.FieldMask"� -SetDefaultBranchRequest3 -catalog ( B"�A -retail.googleapis.com/Catalog4 - branch_id ( B!�A -retail.googleapis.com/Branch -note (  -force ("N -GetDefaultBranchRequest3 -catalog ( B"�A -retail.googleapis.com/Catalog"� -GetDefaultBranchResponse1 -branch ( B!�A -retail.googleapis.com/Branch, -set_time ( 2.google.protobuf.Timestamp -note ( "Z -GetCompletionConfigRequest< -name ( B.�A�A( -&retail.googleapis.com/CompletionConfig"� -UpdateCompletionConfigRequestH -completion_config ( 2(.google.cloud.retail.v2.CompletionConfigB�A/ - update_mask ( 2.google.protobuf.FieldMask"Z -GetAttributesConfigRequest< -name ( B.�A�A( -&retail.googleapis.com/AttributesConfig"� -UpdateAttributesConfigRequestH -attributes_config ( 2(.google.cloud.retail.v2.AttributesConfigB�A/ - update_mask ( 2.google.protobuf.FieldMask"� -AddCatalogAttributeRequestI -attributes_config ( B.�A�A( -&retail.googleapis.com/AttributesConfigH -catalog_attribute ( 2(.google.cloud.retail.v2.CatalogAttributeB�A"| -RemoveCatalogAttributeRequestI -attributes_config ( B.�A�A( -&retail.googleapis.com/AttributesConfig -key ( B�A"� -ReplaceCatalogAttributeRequestI -attributes_config ( B.�A�A( -&retail.googleapis.com/AttributesConfigH -catalog_attribute ( 2(.google.cloud.retail.v2.CatalogAttributeB�A/ - update_mask ( 2.google.protobuf.FieldMask2� -CatalogService� - ListCatalogs+.google.cloud.retail.v2.ListCatalogsRequest,.google.cloud.retail.v2.ListCatalogsResponse"=�Aparent���.,/v2/{parent=projects/*/locations/*}/catalogs� - UpdateCatalog,.google.cloud.retail.v2.UpdateCatalogRequest.google.cloud.retail.v2.Catalog"[�Acatalog,update_mask���?24/v2/{catalog.name=projects/*/locations/*/catalogs/*}:catalog� -SetDefaultBranch/.google.cloud.retail.v2.SetDefaultBranchRequest.google.protobuf.Empty"U�Acatalog���E"@/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch:*� -GetDefaultBranch/.google.cloud.retail.v2.GetDefaultBranchRequest0.google.cloud.retail.v2.GetDefaultBranchResponse"R�Acatalog���B@/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch� -GetCompletionConfig2.google.cloud.retail.v2.GetCompletionConfigRequest(.google.cloud.retail.v2.CompletionConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}� -UpdateCompletionConfig5.google.cloud.retail.v2.UpdateCompletionConfigRequest(.google.cloud.retail.v2.CompletionConfig"��Acompletion_config,update_mask���d2O/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}:completion_config� -GetAttributesConfig2.google.cloud.retail.v2.GetAttributesConfigRequest(.google.cloud.retail.v2.AttributesConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}� -UpdateAttributesConfig5.google.cloud.retail.v2.UpdateAttributesConfigRequest(.google.cloud.retail.v2.AttributesConfig"��Aattributes_config,update_mask���d2O/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}:attributes_config� -AddCatalogAttribute2.google.cloud.retail.v2.AddCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"i���c"^/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute:*� -RemoveCatalogAttribute5.google.cloud.retail.v2.RemoveCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"l���f"a/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute:*� -ReplaceCatalogAttribute6.google.cloud.retail.v2.ReplaceCatalogAttributeRequest(.google.cloud.retail.v2.AttributesConfig"m���g"b/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BCatalogServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Common.php deleted file mode 100644 index 5456558d657a3f2cc5e14a010e7b94b882c7acab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4745 zcma)A-*VeZ8L#XnjXx(%qUNNj52UJFPTdj|aHnUAO99)lQ-d2D+bPiTjF9EEvmk4Q z{-iNXZy6Y#;xNO_c>vx4E_ep6x#j`*c2`p3#Lh`C8d>}Oe*693Py3^vxF;?=)((k7 zJTo9eZ7|h>6Qa2u3z)@hZ4iz|#M3M`aj8u_UDFO)+EJ^g)eaiHM+o&<=vkzsjTsx; zWZ$w`INbM0U{ZVkw78GJ33GJ82jG|!;=86rw8M7g9SRN2!0aCiXury#{f>b4-xps4 zShnf=T2)ZMA3?)^ZaA>1rTKvw;GZYdH>g7cYTEPZ8k z$0CJin&jlNPh5u9zR_Z3+S~zXe81rY#B)r$e?WZ8qi(>wHj0)?V-h58<8KPjqHQ@H z9ccxrW2tmS$v0Zyh2-MynuZ<=J?FL1n-hFWp89iKRd#8=PKiCNkQ4KiGOtuRx9Xf^ z9yBqmM==(GIdSJ>g+spgV;Y%X9u5<0>zE0JL_e3P=`h0Rd!Rf!? zpdMn>I&7Ml52wW7I~ktojLA;=raatv9S%|N!@6sZiD6;+jG0G?zjGT|GC3VG=ew=J z(y3{O1T|F(8C3-sg|=->%)mO?N#VPd9EHp|s}6v%@dBZo0A-80*u28_Q||9us1cS4(>8&?O6`GLV*!5pDUwpfTax)daxWAq9Kl!g4;Tj<7hj|{0t ztb`;j_FotbLDGpZ2~QWcnL|FBQ^TJ+%$ZL7Sf^z{_k(M7Y6)mJLMEg=xIbiu!%#Kf zXBNc}#jJO3z)) z!TaJ`L+c!kM*{Z7I>#pJzJq%nnJ_Hh8O}Aq`At#axLLX%LdJ@lOH^);7Acl=lS=wO zAzmcL&oF-OjXf5+K5m3rlYha_Xq$NrXT-REI6*QGD|A9_elUu#@=O=+W6+-z zSg)cF*`yqsBg1wUL?={aI1e9Aqde zdM4IxCu<6>Rn{PDoFgl%060HJviTyc*Fzht(B|P3Ht_VBy0K?BAtU;}L5H#OuVAS$ zK|i3^(@9Z^#=z}7A#{8a$SCm6@R1IK6QS=?{tQ;cY>9J$x(RnCIKWN9iHIQ@f+lW~ zGs_NrKBB~n{AlNkT;4nr^4xgkEqBR9`Dl?_kBgNhNF#;#W1i*zl7>v%qZSb+egn*pTn}#wi{s3+DlxdHAnauq74^f?o~i)78!r zu3kHms4rnNLY}!eO~^?`9{tzNJ$1-Rn4I6_slK z&bvmos4e14;`i!`cjOTEjmUf(mOJ<<B3U}H?VT-6Ip^-I3Ye`z6v@qcv2U8*3ct9PvK}76+*ZNZY$g7 z=Ws6?>co;qaN3TdypsPa1$UdwGVO+QiV)^aMbF_A(fLj<0c2z-_5!g}wz%*}O#-9- z47*C)1$<#qw)o{D|IaF+C+)+pIRPrQ3!6A)$MtORLXL)W9`xI}53qh2l7;l|$TV`+ zm+{apgV}$&NRLb1tCV`BJjbrKm9XQ;FrwooIVHCG1?0=UUZ+tx?$wNH>!{v1G@7;d zwWe`=)NR+Qje4VYuyISx!*09NIykQOqUFn|4TZ~8%e`{56;oW1Nj;~q+GTdg=ldRd zK>ap6=(d{2y+-TE=>57~yR@wa-s&6+^&%aV& zw?p_RKb{nroy_s&jDvaGa`|ud`>;1l*fr{nX0O(1932|1w$N(U59qJOh=WGATxp`e z6!kmsXt7-FNQ$MO|5bs{y5j7Jy@J(JHGQHM;EA-vNX$F#Vu;H4->gcH;o(Bb$Qg=y zolvFI`enDak*fSdfgJj4L1I<1^6o=?v$vHGMfpJ%f90~t{+PvgEv8HHxC8vT9oU-3dex`BzWVDJv+zo`cjR4NHnsU%^g j();3IS$v1Sc$(YinternalAddGeneratedFile( - ' -� -/google/cloud/retail/v2/completion_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto#google/longrunning/operations.proto"� -CompleteQueryRequest6 -catalog ( B%�A�A -retail.googleapis.com/Catalog -query ( B�A - -visitor_id (  -language_codes (  - device_type (  -dataset (  -max_suggestions ($ -enable_attribute_suggestions ( -entity - ( "� -CompleteQueryResponseZ -completion_results ( 2>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult -attribution_token ( c -recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB^ -attribute_results ( 2C.google.cloud.retail.v2.CompleteQueryResponse.AttributeResultsEntry� -CompletionResult - -suggestion ( b - -attributes ( 2N.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.AttributesEntryZ -AttributesEntry -key ( 6 -value ( 2\'.google.cloud.retail.v2.CustomAttribute:8/ -RecentSearchResult - recent_search ( :& -AttributeResult - suggestions ( v -AttributeResultsEntry -key ( L -value ( 2=.google.cloud.retail.v2.CompleteQueryResponse.AttributeResult:82� -CompletionService� - CompleteQuery,.google.cloud.retail.v2.CompleteQueryRequest-.google.cloud.retail.v2.CompleteQueryResponse"E���?=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery� -ImportCompletionData3.google.cloud.retail.v2.ImportCompletionDataRequest.google.longrunning.Operation"��A\\ -3google.cloud.retail.v2.ImportCompletionDataResponse%google.cloud.retail.v2.ImportMetadata���I"D/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BCompletionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Control.php deleted file mode 100644 index 1c5526688448af68ce6a200a48e9f9900646ccc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1465 zcma)6%}(1u5N;9(VvCTP0}7}}+Y*UTfi1Z=Q(EN*C{k&nH04lPvNrZ6*=pl;z3WI6 zblPtmd04yX``Tr%37@7r(2-^`nL;W$J)_>=}TB8vKWaEaBJ;xH0Q zc!J|WJRH&pdtwqYP9p>3b_aj#^zm`~tp5U_QpAx*Z9EcU#Hs0V5&LFD6=B?*TBaug z6$x&nga`#>LS;xiich=EbI9_EBF<@wby^A5>7`ib!a79A<3vi_(j4dtVfcmdfHMzE zMHKwim~>gd6eFB{2mMEQNVuecy`MXb15Ys#-~`YKJX+twnls6*g#zk5!nvAm(gG;o zISUkx0>Yg(m0rX`C892*+V+U5dE=6k`d;>ILdS-ykmI0_C^ z-3h^L9yt&6su42hgi-D{>6lEJh-~||s#}sp&>qdc+oMtceH^DHCKC}n{A$|DgSRYe zT*LS0eL4Xb)#sHZb?&0S%c%Ak`&2e`mXVsw&?Ymc*4Ac*CLsgs>B_X@wssa0C-QaD z%bz8*l9{ZskCvjC)9Ml~)Sp_veCS>(YP)VdgD7hhhIpJtfVnESi~IcrdRbfU`WDnQ%n77{OTJ3&_Ay*internalAddGeneratedFile( - ' -� -,google/cloud/retail/v2/control_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/retail/v2/control.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -CreateControlRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog5 -control ( 2.google.cloud.retail.v2.ControlB�A - -control_id ( B�A"~ -UpdateControlRequest5 -control ( 2.google.cloud.retail.v2.ControlB�A/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteControlRequest3 -name ( B%�A�A -retail.googleapis.com/Control"H -GetControlRequest3 -name ( B%�A�A -retail.googleapis.com/Control"� -ListControlsRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog - page_size (B�A - -page_token ( B�A -filter ( B�A"b -ListControlsResponse1 -controls ( 2.google.cloud.retail.v2.Control -next_page_token ( 2� -ControlService� - CreateControl,.google.cloud.retail.v2.CreateControlRequest.google.cloud.retail.v2.Control"d�Aparent,control,control_id���B"7/v2/{parent=projects/*/locations/*/catalogs/*}/controls:control� - DeleteControl,.google.cloud.retail.v2.DeleteControlRequest.google.protobuf.Empty"F�Aname���9*7/v2/{name=projects/*/locations/*/catalogs/*/controls/*}� - UpdateControl,.google.cloud.retail.v2.UpdateControlRequest.google.cloud.retail.v2.Control"f�Acontrol,update_mask���J2?/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}:control� - -GetControl).google.cloud.retail.v2.GetControlRequest.google.cloud.retail.v2.Control"F�Aname���97/v2/{name=projects/*/locations/*/catalogs/*/controls/*}� - ListControls+.google.cloud.retail.v2.ListControlsRequest,.google.cloud.retail.v2.ListControlsResponse"H�Aparent���97/v2/{parent=projects/*/locations/*/catalogs/*}/controlsI�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BControlServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ExportConfig.php deleted file mode 100644 index e619134ed1cb47ed4aae99b7b8b89417fe7ad0b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2256 zcma)7U2hvj6s;X8&@oBq61AxXWiUZ;si98@w;O+PUYHm2cbBP zq{KbL^wbccpAm+K=cAOySgJ_DYm>?$&8VVLN`Hc*?BYq3N&*BoV<&kQE6Osg0S8%3 zn%mfN>ex-r;OM)!Na;|k0ZN4XnIa;K(r}N+SWvE*IE2t3NQf#m)PI`WZd*-9C%9>I z41ya;?qVf!GQB&-AYU%B9h0{vxG2BE8G>~<4WChxj=SU}I-^Vk!R4tgN#;QZ#9iUS zs8Wt23iqg@Q@;3)10IL3;J$J>8)KyZ{A=oj?u^H!uFt@L%~A=i%NF{xh8`~NJnycJ z^^Hq?>r(%$UBB-*B2K}(Ru5~|`p0g`SQk9dQpKTNz&#frc-+#roJ+gVcw0s99psAV z%9_@DiPn->4#%Jw&A_rO+o<45v(|p>&(6!AhWq_kg6#_E^IP6)v_7KAk2w+NS4gXd z^vi`vyEOS;6I@}ge}Pu7?&du}cbGZLFc);l1)0z{Ci~mnrMI1GouCh9P zKEHJx`b!0UWU(D6=yPZw5;~E9*MNYeQhDp>ofvXYSu&mYw`j!)VSCz!ReN(0wT)EX zDq5b<6dH*=SVN#yn@G_Ky%ws)f@Tym&0e<&wC3_tgDqWvk z?R^wIhn=<(R*Y=ufH1XfXXK-u;^VjK@}PIr*?;kS^={wHY2VCge_-acf8747SP0z& zFGe`b@PDfJEhq>KDhMnr2#(vMW#i|^TV-c|WGCX(0M%`k#xsVeiL@i`0$m{VFWYb7 AE&u=k diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php deleted file mode 100644 index 6eae16d4295..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestion.php +++ /dev/null @@ -1,40 +0,0 @@ -internalAddGeneratedFile( - ' -� -0google/cloud/retail/v2/generative_question.protogoogle.cloud.retail.v2"u - GenerativeQuestionsFeatureConfig -catalog ( B�A -feature_enabled (B�A -minimum_products (B�A"� -GenerativeQuestionConfig -catalog ( B�A -facet ( B�A -generated_question ( B�A -final_question ( B�A -example_values ( B�A - frequency (B�A$ -allowed_in_conversation (B�AB� -com.google.cloud.retail.v2BGenerativeQuestionProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php deleted file mode 100644 index a3d9d98c38e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/GenerativeQuestionService.php +++ /dev/null @@ -1,59 +0,0 @@ -internalAddGeneratedFile( - ' -� -8google/cloud/retail/v2/generative_question_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto0google/cloud/retail/v2/generative_question.proto google/protobuf/field_mask.proto"� --UpdateGenerativeQuestionsFeatureConfigRequestj -#generative_questions_feature_config ( 28.google.cloud.retail.v2.GenerativeQuestionsFeatureConfigB�A4 - update_mask ( 2.google.protobuf.FieldMaskB�A"d -*GetGenerativeQuestionsFeatureConfigRequest6 -catalog ( B%�A�A -retail.googleapis.com/Catalog"] -$ListGenerativeQuestionConfigsRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog"~ -%ListGenerativeQuestionConfigsResponseU -generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfig"� -%UpdateGenerativeQuestionConfigRequestY -generative_question_config ( 20.google.cloud.retail.v2.GenerativeQuestionConfigB�A4 - update_mask ( 2.google.protobuf.FieldMaskB�A"� -+BatchUpdateGenerativeQuestionConfigsRequest5 -parent ( B%�A�A -retail.googleapis.com/CatalogT -requests ( 2=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequestB�A"� -,BatchUpdateGenerativeQuestionConfigsResponseZ -generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfigB�A2� -GenerativeQuestionService� -&UpdateGenerativeQuestionsFeatureConfigE.google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"��A/generative_questions_feature_config,update_mask����2m/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature:#generative_questions_feature_config� -#GetGenerativeQuestionsFeatureConfigB.google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"[�Acatalog���KI/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature� -ListGenerativeQuestionConfigs<.google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest=.google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse"S�Aparent���DB/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions� -UpdateGenerativeQuestionConfig=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest0.google.cloud.retail.v2.GenerativeQuestionConfig"��A&generative_question_config,update_mask���{2]/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion:generative_question_config� -$BatchUpdateGenerativeQuestionConfigsC.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequestD.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse"j�Aparent,requests���R"M/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BGenerativeQuestionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ImportConfig.php deleted file mode 100644 index 854cd533e53961ea0d54dfd23d3e16414c7c3846..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4253 zcmc&%OLN;)6t3+Ol4F{tN|QKgOB6TI^d%4GHFa9Rb{y9;&I8BIf-$3!+L9N_zK1chm!+hOz>@MwT0v5nF`owb$lc?4G(hkaY4Bu!~1wyOL5n2s_ z&^pX-0+^QJd1_4{l?4!d1uFizLEECH>iLF`|JJFeQ=9tKu;`cQ$`iF~SRO%uVcBkA zn?7}Hl`HJoCfT^FN=z=h?mFoD6E!kvpGN~D(W==#VYXqlwuomk>iQ1bN6|u|NBlU3 z{AA;9crAycU3Ej+SSSn``9$?uK+fK-su;e2*_*;{4)7xW)fy47qDx!blvte-IWmr^ z!wQ8{uTDY6sWwQM!ilv8GStHGbOO_#{Mtc)XC7gdV`BdUh&Uy}^Bu$cZ1U@4-6q94 z^o_ndxo*QXTL)Ngfj7BM^TZ{sEo`sRDx%sRen7+8Dt05nruw%IKQ$SVi+#Pc9kU{`*US|47@Az97?tBj1dbkn>yj?3?(COKz-3h zxh}6(y^l!?C00YISi+Ao6ACPa0?ajYyp;kk{1CdA^D)Lbq!A*|vyWh=YI+BPoRlR1 zYP*522aI}|gqqrzDW!fbCY53J`M;w2?6fItZOhI zxy7+{eoJNwMbr6fnzT#f*K0h*PcJD70Q&Kqn7&RsnO8U_w}4;d5pkB_XVQWNnD&jf zMYyQAULG&O)t>3;=xUGJJ-tI&CMAFdEWRv|(l8U7m)(K+eVM45ZBd(qF1!cRXcg~M z8G&?uH8OsnG_+7%SdwkRLfoF`05>6hn&}90Z5(EdAyFTJBKf?+n8Q5D>dJKh?zPKE zmwthH!YDnxRJwvm!ZxKgvbSeC5;5`lJS+2wk+dNVh0hk2fIpBGnDJ3%rr2?{C5YE|At8ZD%={K{4#c<<@A*5$Sgk?7o+&z8t0S$HqY4~5^zJhSH|a- zMR>U*rx;Ovzod)xkuJV9&c*Y05BYgv@&!j_e@lQe+zv_|7O+-11K~4`Gm|c-j_B5O z{{A?FVyII#LzaDCazzNisWY7)%RccaK*bWwwP{aB%3vpv1>Ej*{>^a~oSz0rNz*VT zFV6mzfa{}*LOFy?5D&tU4nG`s-5I=7mj#=k`Hx@9??}7)Z=DZ;&P2e5<*_A$?KK>1 z&g&Bgd-%SeaXiZ|i8coX3DRVQ6C{5(g!ME`knwYmD};Wq_6;2yudVx=OK*; zIAM6jq!c{v;-V8U5*~AIP7RC{@d6Md<-*<(lPCLi0u~2}*mE7*Bg)-ylIR}3SS=Eb zTqPd)d#nOQTsf9ynar77E2FyQqkdZp_-5MpCS87VR1q*>a>N5{&DqDk_@|yEq@Di~q z;mdQyboyi5DqV~2;kz`lqVMb{KFLex!*?iZ=Xy@Gf8$dJS8zE1-S%emfa?7t77Ta%6#d@S^6Ccth3kJm$UZP{_<=8(1*M79`Q(EF*1^e z$1*!4vL8@JZR*OyXgnr?Y}2XlxFk?yx!ILFT|;g)HRBFKLmCA(QRNAx6PHwMmqw#X zK$zvYm7{89N=L+11Ra29O-blmHj(#w^`~evvY0j46Uae>BL})b4i2i10BqL^L-{FZ zfEOU+pC1if$Cg88G5mMW2~Edym}9xlbBz75Jht4BAo8^BIPz@fP*3K7u4j{-2Xf5G zZSVOMbA2qQvGjQQnEF8T7zsSf9W+U32aeBZ&_h#Ioe-84jlbD>khtY^&RE`wV^q~s zK|YpQ5Rq5C%QDt03cN=mZcZ@Eo(2mlRr8&}u0z~Wog7+64h>ZGB&!pWWl)_YcXnpf z+|>*kbULNp*}Z1vG#nHFv!?!Hthk0xzH*YH*G8kP#=EG#ovbRnM)%>rB5c21cG6~S zqX=m#u{4#VYI!TcTE2sVjcXDswS0F8Ew%wBo*3OujD)yREESe!7aMH99lXE+l>xF-7d1(vQMo#Fv*0Cv$@+U`6V4VdPUa2=Rxr|7ufQReVkCerkD8h+i zB$z&ja3?uw7p{aPI65IZFNi*TGf_W=WIP4wA*|W~L0XgNSh|2LtJQMKk`_S8u9tfk zsL00_Pf#moLt(Ahu}?}D(LAZuUD%{PdUl>;-&4<|!ygHD^ARasN{w>TK3w-n;Lwp{ zn=E>zc&li$Ui~zUc1{LK@p=i=5Xda`ob&~(;}~L`GRb4@Y!X->RbdA;_c2x}T z3Un+Q9o|VrV^eSJOib4aSyZj z&<{!Qx)ZJ`jFXXHn291EMK%jfAx_?{Z`Bk=%Aq*@1kylN$6^1GgN+3_NzdTUI19`i zipWfsgqBu}&ydw>^Uc?Aw)~!)tKWd@JRx&Luy3$cM~Rzl9oCZ43dKpcV5{HK546sn z**9uN%iQnud##4HtF@ZNbJ7}I(mJ(L8HR923KAiQqp@+ zHuRd-S;mSyz1n^s!8z_BwJqkif5Q?k=vnD~xYKLtTDPe+Omw@9_+2Q?n>Dq5t=<-{ zZoo#Z-A?h@K|#6+H|AljPK?TLH{o*Dpi&t&n>C}huvV*ZQJi(Z#kAG|#E+J)cXdqc zXV_Sv8=hCA+c8?-8D>xKHuoDw-!#7O&0hn$?PJdEmN{pQp6~{r?zauCclxwn%&R}W ztR2G5*>;PqTOr z#1~=;%<6yVpp3*zL|g~q5F3ZlUhao#JhIb|AI3AG>57RV;+7dl?GGQN4}a!Y^p;W6 z+JEIY_r!jwh$TkR#eS(ARR2j22Fd1`uAaDizRYjMAXOD8RgGb)dQcs%VD5~5c0XH2 ZK8_cinternalAddGeneratedFile( - ' -� -*google/cloud/retail/v2/model_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"google/cloud/retail/v2/model.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -CreateModelRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog1 -model ( 2.google.cloud.retail.v2.ModelB�A -dry_run (B�A"} -UpdateModelRequest1 -model ( 2.google.cloud.retail.v2.ModelB�A4 - update_mask ( 2.google.protobuf.FieldMaskB�A"D -GetModelRequest1 -name ( B#�A�A -retail.googleapis.com/Model"F -PauseModelRequest1 -name ( B#�A�A -retail.googleapis.com/Model"\' -ResumeModelRequest -name ( B�A"{ -ListModelsRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog - page_size (B�A - -page_token ( B�A"G -DeleteModelRequest1 -name ( B#�A�A -retail.googleapis.com/Model"\\ -ListModelsResponse- -models ( 2.google.cloud.retail.v2.Model -next_page_token ( "E -TuneModelRequest1 -name ( B#�A�A -retail.googleapis.com/Model"$ -CreateModelMetadata -model ( "" -TuneModelMetadata -model ( " -TuneModelResponse2� - ModelService� - CreateModel*.google.cloud.retail.v2.CreateModelRequest.google.longrunning.Operation"��AJ -google.cloud.retail.v2.Model*google.cloud.retail.v2.CreateModelMetadata�A parent,model���>"5/v2/{parent=projects/*/locations/*/catalogs/*}/models:model� -GetModel\'.google.cloud.retail.v2.GetModelRequest.google.cloud.retail.v2.Model"D�Aname���75/v2/{name=projects/*/locations/*/catalogs/*/models/*}� - -PauseModel).google.cloud.retail.v2.PauseModelRequest.google.cloud.retail.v2.Model"M�Aname���@";/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause:*� - ResumeModel*.google.cloud.retail.v2.ResumeModelRequest.google.cloud.retail.v2.Model"N�Aname���A"internalAddGeneratedFile( - ' -� -/google/cloud/retail/v2/prediction_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/cloud/retail/v2/user_event.protogoogle/protobuf/struct.proto"� -PredictRequest - placement ( B�A: - -user_event ( 2!.google.cloud.retail.v2.UserEventB�A - page_size ( - -page_token ( B -filter (  - validate_only (B -params ( 22.google.cloud.retail.v2.PredictRequest.ParamsEntryB -labels ( 22.google.cloud.retail.v2.PredictRequest.LabelsEntryE - ParamsEntry -key ( % -value ( 2.google.protobuf.Value:8- - LabelsEntry -key (  -value ( :8"� -PredictResponseI -results ( 28.google.cloud.retail.v2.PredictResponse.PredictionResult -attribution_token (  - missing_ids (  - validate_only (� -PredictionResult - -id ( X -metadata ( 2F.google.cloud.retail.v2.PredictResponse.PredictionResult.MetadataEntryG - MetadataEntry -key ( % -value ( 2.google.protobuf.Value:82� -PredictionService� -Predict&.google.cloud.retail.v2.PredictRequest\'.google.cloud.retail.v2.PredictResponse"�����"F/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict:*ZO"J/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BPredictionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Product.php deleted file mode 100644 index 73c316f2f6b3e26e32a93a234465d77b4ff3c3c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3387 zcmb_e&2HO95Uzgg*eltQnV-^5oG^}&I6y+R3fdG*(}I#EmxyBtisB-H0AWR~uHD{T3S1bs(H{!hJfbYg3}J zPvNe{Qi!kU*3A@R=m1b}X>=>a$WMwY?XF2XSQmGxJdl->`$^ZB?+>}8dt<1Nw79;= zz>*@Qx%fe5I^N&;YYm+P;qWG;e2NO>N1q0y$63^pmf0&*w)EIVY!4S+pV#@DkCb~T z$C#sT2-D5COcNzmbAOw8FyBCV-s02@*st=%CFMNI(t(;iU3h@2kIkU2jEaiXw3D5sFepMTwyf zWmEM6Al55)(>x`$HDf;lqdY*$so(D->_R=J>P6xEO2Pz%7dJ_VSLuG`7&{SBOjH_1 z&X79Jn7E(`o}Eh~;oaK_Zc$y0Q-DZP0p+5As+YmrDu{j=WHy4jeJp6U(^xES1qoZh z(SQzf(L8cVogX%K0u+m18eV{+}-3rp zxsrv3v(jqUo9+F2yOdMb&}!AJJ&u3ojbAda&7U)9TfU?5vjIRK(zu;3r_TA3G>xDm)FkH-v+^%;ZrN3t{ABag^ zuklG;Z;MG?Kd$_lY;@%epA7LZ#lOyO#vsEGD8qt~gRaJIWc>4NRz)V1!~Zjx f{bgWd-u>J2aq4b7hrcnlr;hBxG9IjFXok=~Dd;#! diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php deleted file mode 100644 index e080f2bcc9a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ProductService.php +++ /dev/null @@ -1,129 +0,0 @@ -internalAddGeneratedFile( - ' -�/ -,google/cloud/retail/v2/product_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto$google/cloud/retail/v2/product.proto)google/cloud/retail/v2/purge_config.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� -CreateProductRequest4 -parent ( B$�A�A -retail.googleapis.com/Branch5 -product ( 2.google.cloud.retail.v2.ProductB�A - -product_id ( B�A"H -GetProductRequest3 -name ( B%�A�A -retail.googleapis.com/Product"� -UpdateProductRequest5 -product ( 2.google.cloud.retail.v2.ProductB�A/ - update_mask ( 2.google.protobuf.FieldMask - allow_missing ("K -DeleteProductRequest3 -name ( B%�A�A -retail.googleapis.com/Product"� -ListProductsRequest4 -parent ( B$�A�A -retail.googleapis.com/Branch - page_size ( - -page_token (  -filter ( - - read_mask ( 2.google.protobuf.FieldMask"b -ListProductsResponse1 -products ( 2.google.cloud.retail.v2.Product -next_page_token ( "� -SetInventoryRequest7 - inventory ( 2.google.cloud.retail.v2.ProductB�A, -set_mask ( 2.google.protobuf.FieldMask, -set_time ( 2.google.protobuf.Timestamp - allow_missing (" -SetInventoryMetadata" -SetInventoryResponse"� -AddFulfillmentPlacesRequest6 -product ( B%�A�A -retail.googleapis.com/Product -type ( B�A - place_ids ( B�A, -add_time ( 2.google.protobuf.Timestamp - allow_missing (" -AddFulfillmentPlacesMetadata" -AddFulfillmentPlacesResponse"� -AddLocalInventoriesRequest6 -product ( B%�A�A -retail.googleapis.com/ProductF -local_inventories ( 2&.google.cloud.retail.v2.LocalInventoryB�A, -add_mask ( 2.google.protobuf.FieldMask, -add_time ( 2.google.protobuf.Timestamp - allow_missing (" -AddLocalInventoriesMetadata" -AddLocalInventoriesResponse"� -RemoveLocalInventoriesRequest6 -product ( B%�A�A -retail.googleapis.com/Product - place_ids ( B�A/ - remove_time ( 2.google.protobuf.Timestamp - allow_missing (" -RemoveLocalInventoriesMetadata" -RemoveLocalInventoriesResponse"� -RemoveFulfillmentPlacesRequest6 -product ( B%�A�A -retail.googleapis.com/Product -type ( B�A - place_ids ( B�A/ - remove_time ( 2.google.protobuf.Timestamp - allow_missing ("! -RemoveFulfillmentPlacesMetadata"! -RemoveFulfillmentPlacesResponse2� -ProductService� - CreateProduct,.google.cloud.retail.v2.CreateProductRequest.google.cloud.retail.v2.Product"o�Aparent,product,product_id���M"B/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:product� - -GetProduct).google.cloud.retail.v2.GetProductRequest.google.cloud.retail.v2.Product"R�Aname���EC/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}� - ListProducts+.google.cloud.retail.v2.ListProductsRequest,.google.cloud.retail.v2.ListProductsResponse"S�Aparent���DB/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products� - UpdateProduct,.google.cloud.retail.v2.UpdateProductRequest.google.cloud.retail.v2.Product"r�Aproduct,update_mask���V2K/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:product� - DeleteProduct,.google.cloud.retail.v2.DeleteProductRequest.google.protobuf.Empty"R�Aname���E*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}� - PurgeProducts,.google.cloud.retail.v2.PurgeProductsRequest.google.longrunning.Operation"��A\\ -,google.cloud.retail.v2.PurgeProductsResponse,google.cloud.retail.v2.PurgeProductsMetadata���M"H/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge:*� -ImportProducts-.google.cloud.retail.v2.ImportProductsRequest.google.longrunning.Operation"��AV --google.cloud.retail.v2.ImportProductsResponse%google.cloud.retail.v2.ImportMetadata���N"I/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import:*� - SetInventory+.google.cloud.retail.v2.SetInventoryRequest.google.longrunning.Operation"��AZ -+google.cloud.retail.v2.SetInventoryResponse+google.cloud.retail.v2.SetInventoryMetadata�Ainventory,set_mask���_"Z/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory:*� -AddFulfillmentPlaces3.google.cloud.retail.v2.AddFulfillmentPlacesRequest.google.longrunning.Operation"��Aj -3google.cloud.retail.v2.AddFulfillmentPlacesResponse3google.cloud.retail.v2.AddFulfillmentPlacesMetadata�Aproduct���`"[/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces:*� -RemoveFulfillmentPlaces6.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.google.longrunning.Operation"��Ap -6google.cloud.retail.v2.RemoveFulfillmentPlacesResponse6google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata�Aproduct���c"^/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces:*� -AddLocalInventories2.google.cloud.retail.v2.AddLocalInventoriesRequest.google.longrunning.Operation"��Ah -2google.cloud.retail.v2.AddLocalInventoriesResponse2google.cloud.retail.v2.AddLocalInventoriesMetadata�Aproduct���_"Z/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories:*� -RemoveLocalInventories5.google.cloud.retail.v2.RemoveLocalInventoriesRequest.google.longrunning.Operation"��An -5google.cloud.retail.v2.RemoveLocalInventoriesResponse5google.cloud.retail.v2.RemoveLocalInventoriesMetadata�Aproduct���b"]/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BProductServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php deleted file mode 100644 index 223553cd345..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/Promotion.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - ' -� -&google/cloud/retail/v2/promotion.protogoogle.cloud.retail.v2"! - Promotion - promotion_id ( B� -com.google.cloud.retail.v2BPromotionProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php deleted file mode 100644 index aadd07c3e56..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/PurgeConfig.php +++ /dev/null @@ -1,52 +0,0 @@ -internalAddGeneratedFile( - ' -� -)google/cloud/retail/v2/purge_config.protogoogle.cloud.retail.v2google/api/resource.protogoogle/protobuf/timestamp.proto" - PurgeMetadata"� -PurgeProductsMetadata/ - create_time ( 2.google.protobuf.Timestamp/ - update_time ( 2.google.protobuf.Timestamp - success_count ( - failure_count ("p -PurgeProductsRequest4 -parent ( B$�A�A -retail.googleapis.com/Branch -filter ( B�A -force ("f -PurgeProductsResponse - purge_count (8 - purge_sample ( B"�A -retail.googleapis.com/Product"s -PurgeUserEventsRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog -filter ( B�A -force ("6 -PurgeUserEventsResponse -purged_events_count (B� -com.google.cloud.retail.v2BPurgeConfigProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/SearchService.php deleted file mode 100644 index 4af2d655f344f299a75149ce9cf251fda8337465..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8443 zcmcIp&2JmW6*s95laID6ul2FsIPr##6FG^=gbwmS#|cP^mWkMsBFb)>uw5*dLu%{g z?sj)6TQPL$sfVIKP#{5jYI`ZrTMtG5hxFE7dMwZ$iXM6{l0*CE&F=C;q)er$FBW%Z ze)Hyi{N8&r@4oNuxo}0@U^esgfVI@-fg0>F)%BdfF&s;6_S$XcsfN>aO^bOsRbAgw zH@9}x>UwSWd0gr{J9z763v|=U?-%ku(>-HP^O?7A8Z1Y+0Jh#` zzN;Hd-PkVQ!^tf@&>I^B(Wr2U#tuO=9u#f@7?$q)YMr3!0tudgivQeR(=rX!5A*>4 zd%^TI(>4QBx6DuRFt^mUZutxmj?QiOY$GroTjdM3Y=f;`Qw1iU`-1D>;cuytOxs)^ zsEbC;4wz@_R%4y{hG)8g<89;AVzI-5Sd0A2+O=?74rjL2H6dfMctprsYT)(Q;O?r5 z3ha6IO_G}f9L9e&#%QeMnvIfeJ6sEn?H7yvGxZ@REv#53vxAeZxotA5Rc3qozUg=; zTe`zSkC|G?5r1e@oNm{#r{8sSJ=(I>Gfr^g*!Xnpd%FK{`px6Dbu{v%P08D?zh{QN zRcf_jSGtW+w-y_pyTVKG?|0yp6NHT%M@$^xXwW;jBNGX*s#BpTIqE<(uuBLTC!XjEw%R#9v&ou)_PX+jV#SEg`%64t16 z54iMqPDu|yIf^(U;A_)@Mgk-5^Kj8)F4`GA1Q}+ZY0)-jOP=9MD_?-~(YN?8*`FwI zR*?1%`(cmyfwTf?*FxIwB9hR4dFHRBr1Uz>H$B}p_Jj?}&wo{V4laeBDm02t>gUjj z@@1OHt%jK1fe=7i1=u%z6X{q(p=L=ag1!Oi9%diR3vEZ9BgIZM(tVs*!+FwqlvD38 z&Brt%pTKBLZ{3*;wRYe=oR+k9ai*P#nYtpoIJ)6n{8 z@-ps_DZDuy*t%FBW0sS0LaG2X9mf~a$!7^~O5w_UT`1fVnM`AkUETIERncMP1%i8f zI`KZ_Mz2Nyg!>F!*w;N%w*$>{EUV{g57~h)pGOs@(J{`E-3%;mI*w;DUtXnwDrCaq zr0cYpd>MsUC`=5GVTFrd_i&x`9awUi=Q~&vn4ePq6^BykQ1484sO@0{I#mhgExpMs zU(S**ygnV&U0PGM1Mfik9xVGVvnyOTW z&acrHQ#ukS;msHz23J0tfpqNr$kJ&MNa#|;See3<_%VhE&kxvv;5sBO%j}u~QQe$$ z36|Jn!|JtIE2IeFy))#bmtmFJdK1qYg|+J-%VFpc$EB3NB_KsRA-=Q-Gm)5Su^F;o zlmL9(kaNmJ_KO%_x(Mfy>@i~+*b#`7b|oHKJ8^TUFue6_A=YhC>@kz-2vJOPWNyd>3NmLivD z%Z0+t=^SemCC7s}`xeYnFfYO4y{+}Cc7Lho z`aWc+c*APp5mr^a*31-Y(}mF_xpKV9D-odbmn1;{r?d>2fIY@~Tx>_}0oK1hob#E5 z`4inQ9OB|-3LkxIlH}^)212kqr1K99c^iRYLvDvP0}^rMY#@{!NMmqkO)WmyJGU~ zMD`PaffDW+Sglt}JC!@y81i35g4o$wzhBwa!bxEi;K1!trMg>P9~wxOWmw@=*3q&n z`x}YdlwXML;Pn^Y)G%osPDhL;On76`Ifoab!-P1$|Qr4?ef>7naTblsy zj<8(g?G6vJIT4anG@>0aTCvd*85@g(sKet0yl96+_Qo(qo({BuK4~7o(!53{h=IbN z+A-c)WeQKNk%g*q!-<0Wv?Vy>v6jheTdn7r{kALeAf%N5djioVw&Hw7<;DOLFN-ZpW*cIHbJDI_c_vPB(oU}tMq|jIV z6AzKQ7jF4L>`2#uzG$%?!g3@>*n83yj*nLje7n2fWV>*i9qMK2awpsj0}Ne+dQC0t z4Nv1XY2_nOj*)SQ4X+K}c4Z1mBp@1sF4=N)I=bXUrc`!7o+!=`?$u%3l_R)x5YE2J zPm?ewm}dxK1Li~BiALqE2x8>kvQK@&R0JiOEZPIp_}QpiB32~dNGV?=0BEk5buJP( zO7m}={5B7Z18nE|4miVaj(F=r2chex1bxyUho3khCdy}{%O0Ai)J98cA^>cL;;L6L zFqbqX;dKYr#CBW@BbD(0;Msac`OhpU$He-WN=t+y>Wuew998Tk3NQ~Oy(M@uzQPi{ zV5YD$rF|xglf#>CYL;{h@44~bj4Be$Fmc(4viL#N?WQFQ&ilPihib>L6pJG5!~b2H zdIT+sFsX~FE*3DlzvBk{znopsvDO}u;F#i!o9(1`#7YwuM^!F;+j~@CX+m%V&!)UEF;GQ<5k5fUOje9yd)G)q46O^CM>UgRk{jS z#_ur%Dt!PK`x1_VQP55gR$hh+17O|oA+~^RQFw7rdmBvpIsx+{B}!MH7HAZ+%EU4! z&aA}V*w#wg&pTzG2w=g6901G=m|8m}P@cI^Mfd7qu>6X*sf5vn1 z$6?W@iny3~`Qy!O?ZjCApy`J3l-if2<*~N;Qz^F>1g>Aq=N~bk6$O} zcdEOk+TGtKS2pNfJy+rH>bV`^#}5i$MgxuT#XWj*$2a$XCNGLb#UiaL7R9n+5ywi8 zo*oTSJ+|JH@UO!GD?W(~de}GTlhCk-`Myi~`6vA!hs}9}3Y;4+#qXi7il_5|m-dOT O>@-unh9ANqz<&V)VZ$u| diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfig.php deleted file mode 100644 index 77ff7ac9d3ee6060672264dcddcb7498ef5c9abc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2231 zcmb7F-EJF26vj>)(n*shOVT=_z|cghD_||T5)vB%va?QPQ4-5`gIZZyt#`-Hz1!re=oopLR#W!BfIp;g)eCO}m@8gRY?co!`i0~B& zaes={1;Mf4iU&Nx{qbNx1P=HprV$Y~#_kzDJ?r9z+w6W0rjn0EKpZ^ed>D~R5b<$X z5k&bks!XaCNyLP*p%-vAphH{ZBEn*`|(d^6QvLWxK}yIPuT{YY2U_&$-OI`%t^vMb>~uFk87$ZfV(lv?WML1qt$& zNK5z7$La-t0d&YI<7_&TIS4CL;*2a*x~-M=(fyEnj4Kb;4G$u4$u-5_&@O@2G)`bvdLd!ch)Pu|fpo?C32ns?Cx=}} zU&40f%+npP4bs)>H;cnc`a0`?Rvtk&fs589kH#7?NmQ0T0&3Q)`wJmc?IgAO^6Od= zrr<${*77-jigw-Rd86HFcAt6OXRU_!^t97z95s)d4R_-MtAw`NPoFfrdacuNy}9Z} z5xR2Qt#xaj+Xnm7E21Um_rjanZw0iM?gP{HunMFNLte>`>T|elKSPVk%B%EiR*5(i z0H}kv>~mIuCqLptcuT)#*_AZK1c6=)^Q$?l|5HG_;Bf&%bt@N%zE!Ql^Qzfp*{DLm zL!Mn`$N`SCNh|IjWFLPOm)nhQt@-5d;@uN{jcvWE?Y6$g_IdT+Owdd3batrWQokwg q7$e8gR*qxL9Ot~+Uj|YXfBbO1r@u63@5+^2cpxnnalL+C%68Qetx diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php deleted file mode 100644 index 9526ad57524..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/ServingConfigService.php +++ /dev/null @@ -1,76 +0,0 @@ -internalAddGeneratedFile( - ' -� -3google/cloud/retail/v2/serving_config_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto+google/cloud/retail/v2/serving_config.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -CreateServingConfigRequest5 -parent ( B%�A�A -retail.googleapis.com/CatalogB -serving_config ( 2%.google.cloud.retail.v2.ServingConfigB�A -serving_config_id ( B�A"� -UpdateServingConfigRequestB -serving_config ( 2%.google.cloud.retail.v2.ServingConfigB�A/ - update_mask ( 2.google.protobuf.FieldMask"W -DeleteServingConfigRequest9 -name ( B+�A�A% -#retail.googleapis.com/ServingConfig"T -GetServingConfigRequest9 -name ( B+�A�A% -#retail.googleapis.com/ServingConfig"� -ListServingConfigsRequest5 -parent ( B%�A�A -retail.googleapis.com/Catalog - page_size (B�A - -page_token ( B�A"u -ListServingConfigsResponse> -serving_configs ( 2%.google.cloud.retail.v2.ServingConfig -next_page_token ( "q -AddControlRequestC -serving_config ( B+�A�A% -#retail.googleapis.com/ServingConfig - -control_id ( B�A"t -RemoveControlRequestC -serving_config ( B+�A�A% -#retail.googleapis.com/ServingConfig - -control_id ( B�A2� -ServingConfigService� -CreateServingConfig2.google.cloud.retail.v2.CreateServingConfigRequest%.google.cloud.retail.v2.ServingConfig"�A\'parent,serving_config,serving_config_id���O"=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs:serving_config� -DeleteServingConfig2.google.cloud.retail.v2.DeleteServingConfigRequest.google.protobuf.Empty"L�Aname���?*=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}� -UpdateServingConfig2.google.cloud.retail.v2.UpdateServingConfigRequest%.google.cloud.retail.v2.ServingConfig"��Aserving_config,update_mask���^2L/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}:serving_config� -GetServingConfig/.google.cloud.retail.v2.GetServingConfigRequest%.google.cloud.retail.v2.ServingConfig"L�Aname���?=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}� -ListServingConfigs1.google.cloud.retail.v2.ListServingConfigsRequest2.google.cloud.retail.v2.ListServingConfigsResponse"N�Aparent���?=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs� - -AddControl).google.cloud.retail.v2.AddControlRequest%.google.cloud.retail.v2.ServingConfig"n�Aserving_config���W"R/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl:*� - RemoveControl,.google.cloud.retail.v2.RemoveControlRequest%.google.cloud.retail.v2.ServingConfig"q�Aserving_config���Z"U/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl:*I�Aretail.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.retail.v2BServingConfigServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php deleted file mode 100644 index 3bab4092058..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEvent.php +++ /dev/null @@ -1,77 +0,0 @@ -internalAddGeneratedFile( - ' -� -\'google/cloud/retail/v2/user_event.protogoogle.cloud.retail.v2#google/cloud/retail/v2/common.proto$google/cloud/retail/v2/product.protogoogle/protobuf/timestamp.protogoogle/protobuf/wrappers.proto"� - UserEvent - -event_type ( B�A - -visitor_id ( B�A - -session_id ( . - -event_time ( 2.google.protobuf.Timestamp -experiment_ids (  -attribution_token ( > -product_details ( 2%.google.cloud.retail.v2.ProductDetailC -completion_detail ( 2(.google.cloud.retail.v2.CompletionDetailE - -attributes ( 21.google.cloud.retail.v2.UserEvent.AttributesEntry -cart_id ( I -purchase_transaction ( 2+.google.cloud.retail.v2.PurchaseTransaction - search_query - (  -filter (  -order_by (  -offset ( -page_categories ( 3 - user_info ( 2 .google.cloud.retail.v2.UserInfo -uri (  - referrer_uri (  - page_view_id (  -entity ( Z -AttributesEntry -key ( 6 -value ( 2\'.google.cloud.retail.v2.CustomAttribute:8"u - ProductDetail5 -product ( 2.google.cloud.retail.v2.ProductB�A- -quantity ( 2.google.protobuf.Int32Value"p -CompletionDetail$ -completion_attribution_token (  -selected_suggestion (  -selected_position ("n -PurchaseTransaction - -id (  -revenue (B�A -tax ( -cost ( - currency_code ( B�AB� -com.google.cloud.retail.v2BUserEventProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpb�RETAIL�Google.Cloud.Retail.V2�Google\\Cloud\\Retail\\V2�Google::Cloud::Retail::V2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php b/owl-bot-staging/Retail/v2/proto/src/GPBMetadata/Google/Cloud/Retail/V2/UserEventService.php deleted file mode 100644 index f297355c86508920494c66f8ef86b3eebc866335..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3520 zcmb_fO>g5w7~Z5%ZKv98*1O$iBO$!rqJD_lQsCs$UGm{}gLa!JX$wM@EXSFoQ@I{9 zwo{c=FMHs^ksp8rhy#CsBb=PVf2fK1N>h~d$9enH~7ZO#L>rHvLxhEU-#@<8f8sLaH zP?rZ74_v4@E{=K{fuW6DZCKW#01^uhp%+?oG(-+md29eY`xpkk?Lc{_Reeq!dUj}= zJ3Ne8V`0oT4`UvbHvw>5I|$@`8pL4HIwBZ&0c85;M_m^=auC`f{kMz)3wbC+wu`=` zd)kuwwi`eiWZJeLc}|G1Co_kp=fKr9S;Sk$svj0`0BDud5nm+$#Js)XX(higtUr} z%!=n>#sc;NT_5df6e7#9<|0b#^?bGwbbD2JXb%x4*K>UuhJF|KPOsJ1%c^G9Qx9`V-tNQ9;+Lx zCpLI6W^fowmZ(5kG(jKvEqYxvMq;aJGNcRu=QC=FPfSw8MdRM76*M48@i+X zXgJM}FjCII;->_KFwJ`#ei6YSlXxaAYrjgT8!BywSKmH~Ns z<8o+AQ_y0}^I#?-h_5#%(H}4jif_?KGg1NEB=(7Q6kxCTHj7=o0~TmrhL8kQ!hBKX zUy85|k1+C5fI))rQjQ>48gXP1?rH@NWu6muyIjvAEMu7wk;0(EVkrY~F9kIAT{2g| zqy3K2wu}Q~ch71YpEMi0R;Si%8P@)8r)AU{+YO^$xFOvEx7eIf7p9#;jxxKjzkBgx zUU>|P)5rp!7IP>mphWl%Vb2=vI-rt`V&%*zrD^}I5DMHYf|aF{Qb{w^3RngtRZ+Iq`pPFfFml!KwH;b?1(}}$8==7ctAg&@!o-7 z_JPjjtdE@t>4zLBOv+i(vanBDCg|@a4zyIM>`toEJ4tD9z%{Az`haQg#7>&@RURzx z+ajetkkn++iMpvy7$zX!N$khUi<*{y<@?-uAG;!^@DPEmcM^KSV{Y@_eJAB_D;xrBXCR6%b$TW0R96wC$=d7 diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php deleted file mode 100644 index ca8eb927743..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddCatalogAttributeRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.retail.v2.AddCatalogAttributeRequest - */ -class AddCatalogAttributeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $attributes_config = ''; - /** - * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] - * to add. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog_attribute = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $attributes_config - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * @type \Google\Cloud\Retail\V2\CatalogAttribute $catalog_attribute - * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] - * to add. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getAttributesConfig() - { - return $this->attributes_config; - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAttributesConfig($var) - { - GPBUtil::checkString($var, True); - $this->attributes_config = $var; - - return $this; - } - - /** - * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] - * to add. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\CatalogAttribute|null - */ - public function getCatalogAttribute() - { - return $this->catalog_attribute; - } - - public function hasCatalogAttribute() - { - return isset($this->catalog_attribute); - } - - public function clearCatalogAttribute() - { - unset($this->catalog_attribute); - } - - /** - * Required. The [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] - * to add. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\CatalogAttribute $var - * @return $this - */ - public function setCatalogAttribute($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute::class); - $this->catalog_attribute = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php deleted file mode 100644 index fd9a08869a5..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddControlRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.retail.v2.AddControlRequest - */ -class AddControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $serving_config = ''; - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config - if id is not found a NOT_FOUND error is returned. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $control_id = ''; - - /** - * @param string $servingConfig Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\AddControlRequest - * - * @experimental - */ - public static function build(string $servingConfig): self - { - return (new self()) - ->setServingConfig($servingConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $serving_config - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * @type string $control_id - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config - if id is not found a NOT_FOUND error is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getServingConfig() - { - return $this->serving_config; - } - - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServingConfig($var) - { - GPBUtil::checkString($var, True); - $this->serving_config = $var; - - return $this; - } - - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config - if id is not found a NOT_FOUND error is returned. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getControlId() - { - return $this->control_id; - } - - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config - if id is not found a NOT_FOUND error is returned. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setControlId($var) - { - GPBUtil::checkString($var, True); - $this->control_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php deleted file mode 100644 index 7a61c9633e1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesMetadata.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.AddFulfillmentPlacesMetadata - */ -class AddFulfillmentPlacesMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php deleted file mode 100644 index 6d7ec88e6f0..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesRequest.php +++ /dev/null @@ -1,391 +0,0 @@ -google.cloud.retail.v2.AddFulfillmentPlacesRequest - */ -class AddFulfillmentPlacesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $product = ''; - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $type = ''; - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery" to be added for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate - * IDs will be automatically ignored. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * If the total number of place IDs exceeds 2000 for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after - * adding, then the update will be rejected. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $place_ids; - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; - */ - protected $add_time = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - */ - protected $allow_missing = false; - - /** - * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\AddFulfillmentPlacesRequest - * - * @experimental - */ - public static function build(string $product): self - { - return (new self()) - ->setProduct($product); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $product - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * @type string $type - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids - * Required. The IDs for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery" to be added for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate - * IDs will be automatically ignored. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * If the total number of place IDs exceeds 2000 for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after - * adding, then the update will be rejected. - * @type \Google\Protobuf\Timestamp $add_time - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProduct() - { - return $this->product; - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkString($var, True); - $this->product = $var; - - return $this; - } - - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery" to be added for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate - * IDs will be automatically ignored. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * If the total number of place IDs exceeds 2000 for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after - * adding, then the update will be rejected. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPlaceIds() - { - return $this->place_ids; - } - - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery" to be added for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate - * IDs will be automatically ignored. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * If the total number of place IDs exceeds 2000 for this - * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after - * adding, then the update will be rejected. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPlaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->place_ids = $arr; - - return $this; - } - - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getAddTime() - { - return $this->add_time; - } - - public function hasAddTime() - { - return isset($this->add_time); - } - - public function clearAddTime() - { - unset($this->add_time); - } - - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setAddTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->add_time = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php deleted file mode 100644 index 5e6c00aad40..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddFulfillmentPlacesResponse.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.AddFulfillmentPlacesResponse - */ -class AddFulfillmentPlacesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php deleted file mode 100644 index e72fd7926a8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesMetadata.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.AddLocalInventoriesMetadata - */ -class AddLocalInventoriesMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php deleted file mode 100644 index 15b6d1dbb6f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesRequest.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.retail.v2.AddLocalInventoriesRequest - */ -class AddLocalInventoriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $product = ''; - /** - * Required. A list of inventory information at difference places. Each place - * is identified by its place ID. At most 3000 inventories are allowed per - * request. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $local_inventories; - /** - * Indicates which inventory fields in the provided list of - * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The - * field is updated to the provided value. - * If a field is set while the place does not have a previous local inventory, - * the local inventory at that store is created. - * If a field is set while the value of that field is not provided, the - * original field value, if it exists, is deleted. - * If the mask is not set or set with empty paths, all inventory fields will - * be updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; - */ - protected $add_mask = null; - /** - * The time when the inventory updates are issued. Used to prevent - * out-of-order updates on local inventory fields. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; - */ - protected $add_time = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory will still be processed and retained for at most - * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is - * created. If set to false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 6; - */ - protected $allow_missing = false; - - /** - * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\AddLocalInventoriesRequest - * - * @experimental - */ - public static function build(string $product): self - { - return (new self()) - ->setProduct($product); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $product - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * @type array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $local_inventories - * Required. A list of inventory information at difference places. Each place - * is identified by its place ID. At most 3000 inventories are allowed per - * request. - * @type \Google\Protobuf\FieldMask $add_mask - * Indicates which inventory fields in the provided list of - * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The - * field is updated to the provided value. - * If a field is set while the place does not have a previous local inventory, - * the local inventory at that store is created. - * If a field is set while the value of that field is not provided, the - * original field value, if it exists, is deleted. - * If the mask is not set or set with empty paths, all inventory fields will - * be updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * @type \Google\Protobuf\Timestamp $add_time - * The time when the inventory updates are issued. Used to prevent - * out-of-order updates on local inventory fields. If not provided, the - * internal system time will be used. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory will still be processed and retained for at most - * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is - * created. If set to false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProduct() - { - return $this->product; - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkString($var, True); - $this->product = $var; - - return $this; - } - - /** - * Required. A list of inventory information at difference places. Each place - * is identified by its place ID. At most 3000 inventories are allowed per - * request. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLocalInventories() - { - return $this->local_inventories; - } - - /** - * Required. A list of inventory information at difference places. Each place - * is identified by its place ID. At most 3000 inventories are allowed per - * request. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLocalInventories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\LocalInventory::class); - $this->local_inventories = $arr; - - return $this; - } - - /** - * Indicates which inventory fields in the provided list of - * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The - * field is updated to the provided value. - * If a field is set while the place does not have a previous local inventory, - * the local inventory at that store is created. - * If a field is set while the value of that field is not provided, the - * original field value, if it exists, is deleted. - * If the mask is not set or set with empty paths, all inventory fields will - * be updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; - * @return \Google\Protobuf\FieldMask|null - */ - public function getAddMask() - { - return $this->add_mask; - } - - public function hasAddMask() - { - return isset($this->add_mask); - } - - public function clearAddMask() - { - unset($this->add_mask); - } - - /** - * Indicates which inventory fields in the provided list of - * [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The - * field is updated to the provided value. - * If a field is set while the place does not have a previous local inventory, - * the local inventory at that store is created. - * If a field is set while the value of that field is not provided, the - * original field value, if it exists, is deleted. - * If the mask is not set or set with empty paths, all inventory fields will - * be updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask add_mask = 4; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setAddMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->add_mask = $var; - - return $this; - } - - /** - * The time when the inventory updates are issued. Used to prevent - * out-of-order updates on local inventory fields. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getAddTime() - { - return $this->add_time; - } - - public function hasAddTime() - { - return isset($this->add_time); - } - - public function clearAddTime() - { - unset($this->add_time); - } - - /** - * The time when the inventory updates are issued. Used to prevent - * out-of-order updates on local inventory fields. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp add_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setAddTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->add_time = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory will still be processed and retained for at most - * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is - * created. If set to false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 6; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory will still be processed and retained for at most - * 1 day and processed once the [Product][google.cloud.retail.v2.Product] is - * created. If set to false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 6; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php deleted file mode 100644 index 368f468499c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AddLocalInventoriesResponse.php +++ /dev/null @@ -1,38 +0,0 @@ -google.cloud.retail.v2.AddLocalInventoriesResponse - */ -class AddLocalInventoriesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php deleted file mode 100644 index e5ce089effe..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributeConfigLevel.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.AttributeConfigLevel - */ -class AttributeConfigLevel -{ - /** - * Value used when unset. In this case, server behavior defaults to - * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. - * - * Generated from protobuf enum ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; - */ - const ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; - /** - * At this level, we honor the attribute configurations set in - * [Product.attributes][google.cloud.retail.v2.Product.attributes]. - * - * Generated from protobuf enum PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; - */ - const PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; - /** - * At this level, we honor the attribute configurations set in - * [CatalogConfig.attribute_configs][]. - * - * Generated from protobuf enum CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; - */ - const CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; - - private static $valueToName = [ - self::ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED => 'ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED', - self::PRODUCT_LEVEL_ATTRIBUTE_CONFIG => 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', - self::CATALOG_LEVEL_ATTRIBUTE_CONFIG => 'CATALOG_LEVEL_ATTRIBUTE_CONFIG', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php deleted file mode 100644 index f76fa7a1e2f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/AttributesConfig.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.retail.v2.AttributesConfig - */ -class AttributesConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Immutable. The fully qualified resource name of the attribute - * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Enable attribute(s) config at catalog level. - * For example, indexable, dynamic_facetable, or searchable for each - * attribute. - * The key is catalog attribute's name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * The maximum number of catalog attributes allowed in a request is 1000. - * - * Generated from protobuf field map catalog_attributes = 2; - */ - private $catalog_attributes; - /** - * Output only. The - * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used - * for this catalog. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $attribute_config_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Immutable. The fully qualified resource name of the attribute - * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` - * @type array|\Google\Protobuf\Internal\MapField $catalog_attributes - * Enable attribute(s) config at catalog level. - * For example, indexable, dynamic_facetable, or searchable for each - * attribute. - * The key is catalog attribute's name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * The maximum number of catalog attributes allowed in a request is 1000. - * @type int $attribute_config_level - * Output only. The - * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used - * for this catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Immutable. The fully qualified resource name of the attribute - * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Immutable. The fully qualified resource name of the attribute - * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Enable attribute(s) config at catalog level. - * For example, indexable, dynamic_facetable, or searchable for each - * attribute. - * The key is catalog attribute's name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * The maximum number of catalog attributes allowed in a request is 1000. - * - * Generated from protobuf field map catalog_attributes = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getCatalogAttributes() - { - return $this->catalog_attributes; - } - - /** - * Enable attribute(s) config at catalog level. - * For example, indexable, dynamic_facetable, or searchable for each - * attribute. - * The key is catalog attribute's name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * The maximum number of catalog attributes allowed in a request is 1000. - * - * Generated from protobuf field map catalog_attributes = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setCatalogAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute::class); - $this->catalog_attributes = $arr; - - return $this; - } - - /** - * Output only. The - * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used - * for this catalog. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getAttributeConfigLevel() - { - return $this->attribute_config_level; - } - - /** - * Output only. The - * [AttributeConfigLevel][google.cloud.retail.v2.AttributeConfigLevel] used - * for this catalog. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setAttributeConfigLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\AttributeConfigLevel::class); - $this->attribute_config_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php deleted file mode 100644 index d718f9622a0..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Audience.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.retail.v2.Audience - */ -class Audience extends \Google\Protobuf\Internal\Message -{ - /** - * The genders of the audience. Strongly encouraged to use the standard - * values: "male", "female", "unisex". - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [gender](https://support.google.com/merchants/answer/6324479). Schema.org - * property - * [Product.audience.suggestedGender](https://schema.org/suggestedGender). - * - * Generated from protobuf field repeated string genders = 1; - */ - private $genders; - /** - * The age groups of the audience. Strongly encouraged to use the standard - * values: "newborn" (up to 3 months old), "infant" (3–12 months old), - * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically - * teens or older). - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [age_group](https://support.google.com/merchants/answer/6324463). - * Schema.org property - * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and - * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). - * - * Generated from protobuf field repeated string age_groups = 2; - */ - private $age_groups; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $genders - * The genders of the audience. Strongly encouraged to use the standard - * values: "male", "female", "unisex". - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [gender](https://support.google.com/merchants/answer/6324479). Schema.org - * property - * [Product.audience.suggestedGender](https://schema.org/suggestedGender). - * @type array|\Google\Protobuf\Internal\RepeatedField $age_groups - * The age groups of the audience. Strongly encouraged to use the standard - * values: "newborn" (up to 3 months old), "infant" (3–12 months old), - * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically - * teens or older). - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [age_group](https://support.google.com/merchants/answer/6324463). - * Schema.org property - * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and - * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The genders of the audience. Strongly encouraged to use the standard - * values: "male", "female", "unisex". - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [gender](https://support.google.com/merchants/answer/6324479). Schema.org - * property - * [Product.audience.suggestedGender](https://schema.org/suggestedGender). - * - * Generated from protobuf field repeated string genders = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGenders() - { - return $this->genders; - } - - /** - * The genders of the audience. Strongly encouraged to use the standard - * values: "male", "female", "unisex". - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [gender](https://support.google.com/merchants/answer/6324479). Schema.org - * property - * [Product.audience.suggestedGender](https://schema.org/suggestedGender). - * - * Generated from protobuf field repeated string genders = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGenders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->genders = $arr; - - return $this; - } - - /** - * The age groups of the audience. Strongly encouraged to use the standard - * values: "newborn" (up to 3 months old), "infant" (3–12 months old), - * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically - * teens or older). - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [age_group](https://support.google.com/merchants/answer/6324463). - * Schema.org property - * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and - * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). - * - * Generated from protobuf field repeated string age_groups = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAgeGroups() - { - return $this->age_groups; - } - - /** - * The age groups of the audience. Strongly encouraged to use the standard - * values: "newborn" (up to 3 months old), "infant" (3–12 months old), - * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically - * teens or older). - * At most 5 values are allowed. Each value must be a UTF-8 encoded string - * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Google Merchant Center property - * [age_group](https://support.google.com/merchants/answer/6324463). - * Schema.org property - * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and - * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). - * - * Generated from protobuf field repeated string age_groups = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAgeGroups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->age_groups = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php deleted file mode 100644 index a45ef2bbec3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest - */ -class BatchUpdateGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $requests; - - /** - * @param string $parent Optional. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * @param \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest[] $requests Required. The updates question configs. - * - * @return \Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsRequest - * - * @experimental - */ - public static function build(string $parent, array $requests): self - { - return (new self()) - ->setParent($parent) - ->setRequests($requests); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Optional. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * @type array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $requests - * Required. The updates question configs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Optional. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRequests() - { - return $this->requests; - } - - /** - * Required. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRequests($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest::class); - $this->requests = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php deleted file mode 100644 index 3fe2b844ef8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BatchUpdateGenerativeQuestionConfigsResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse - */ -class BatchUpdateGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $generative_question_configs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs - * Optional. The updates question configs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGenerativeQuestionConfigs() - { - return $this->generative_question_configs; - } - - /** - * Optional. The updates question configs. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGenerativeQuestionConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); - $this->generative_question_configs = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php deleted file mode 100644 index 3027d965076..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQueryOutputResult.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.retail.v2.BigQueryOutputResult - */ -class BigQueryOutputResult extends \Google\Protobuf\Internal\Message -{ - /** - * The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1; - */ - protected $dataset_id = ''; - /** - * The ID of a BigQuery Table. - * - * Generated from protobuf field string table_id = 2; - */ - protected $table_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $dataset_id - * The ID of a BigQuery Dataset. - * @type string $table_id - * The ID of a BigQuery Table. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1; - * @return string - */ - public function getDatasetId() - { - return $this->dataset_id; - } - - /** - * The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1; - * @param string $var - * @return $this - */ - public function setDatasetId($var) - { - GPBUtil::checkString($var, True); - $this->dataset_id = $var; - - return $this; - } - - /** - * The ID of a BigQuery Table. - * - * Generated from protobuf field string table_id = 2; - * @return string - */ - public function getTableId() - { - return $this->table_id; - } - - /** - * The ID of a BigQuery Table. - * - * Generated from protobuf field string table_id = 2; - * @param string $var - * @return $this - */ - public function setTableId($var) - { - GPBUtil::checkString($var, True); - $this->table_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php deleted file mode 100644 index d2a7b935faa..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/BigQuerySource.php +++ /dev/null @@ -1,351 +0,0 @@ -google.cloud.retail.v2.BigQuerySource - */ -class BigQuerySource extends \Google\Protobuf\Internal\Message -{ - /** - * The project ID (can be project # or ID) that the BigQuery source is in with - * a length limit of 128 characters. If not specified, inherits the project - * ID from the parent request. - * - * Generated from protobuf field string project_id = 5; - */ - protected $project_id = ''; - /** - * Required. The BigQuery data set to copy the data from with a length limit - * of 1,024 characters. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $dataset_id = ''; - /** - * Required. The BigQuery table to copy the data from with a length limit of - * 1,024 characters. - * - * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $table_id = ''; - /** - * Intermediate Cloud Storage directory used for the import with a length - * limit of 2,000 characters. Can be specified if one wants to have the - * BigQuery export to a specific Cloud Storage directory. - * - * Generated from protobuf field string gcs_staging_dir = 3; - */ - protected $gcs_staging_dir = ''; - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: - * The schema is available here: - * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: - * The schema is available here: - * https://support.google.com/analytics/answer/7029846. - * Supported values for autocomplete imports: - * * `suggestions` (default): One JSON completion suggestion per line. - * * `denylist`: One JSON deny suggestion per line. - * * `allowlist`: One JSON allow suggestion per line. - * - * Generated from protobuf field string data_schema = 4; - */ - protected $data_schema = ''; - protected $partition; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Type\Date $partition_date - * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. - * Only supported in - * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. - * @type string $project_id - * The project ID (can be project # or ID) that the BigQuery source is in with - * a length limit of 128 characters. If not specified, inherits the project - * ID from the parent request. - * @type string $dataset_id - * Required. The BigQuery data set to copy the data from with a length limit - * of 1,024 characters. - * @type string $table_id - * Required. The BigQuery table to copy the data from with a length limit of - * 1,024 characters. - * @type string $gcs_staging_dir - * Intermediate Cloud Storage directory used for the import with a length - * limit of 2,000 characters. Can be specified if one wants to have the - * BigQuery export to a specific Cloud Storage directory. - * @type string $data_schema - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: - * The schema is available here: - * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: - * The schema is available here: - * https://support.google.com/analytics/answer/7029846. - * Supported values for autocomplete imports: - * * `suggestions` (default): One JSON completion suggestion per line. - * * `denylist`: One JSON deny suggestion per line. - * * `allowlist`: One JSON allow suggestion per line. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. - * Only supported in - * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. - * - * Generated from protobuf field .google.type.Date partition_date = 6; - * @return \Google\Type\Date|null - */ - public function getPartitionDate() - { - return $this->readOneof(6); - } - - public function hasPartitionDate() - { - return $this->hasOneof(6); - } - - /** - * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. - * Only supported in - * [ImportProductsRequest][google.cloud.retail.v2.ImportProductsRequest]. - * - * Generated from protobuf field .google.type.Date partition_date = 6; - * @param \Google\Type\Date $var - * @return $this - */ - public function setPartitionDate($var) - { - GPBUtil::checkMessage($var, \Google\Type\Date::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The project ID (can be project # or ID) that the BigQuery source is in with - * a length limit of 128 characters. If not specified, inherits the project - * ID from the parent request. - * - * Generated from protobuf field string project_id = 5; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * The project ID (can be project # or ID) that the BigQuery source is in with - * a length limit of 128 characters. If not specified, inherits the project - * ID from the parent request. - * - * Generated from protobuf field string project_id = 5; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. The BigQuery data set to copy the data from with a length limit - * of 1,024 characters. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatasetId() - { - return $this->dataset_id; - } - - /** - * Required. The BigQuery data set to copy the data from with a length limit - * of 1,024 characters. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatasetId($var) - { - GPBUtil::checkString($var, True); - $this->dataset_id = $var; - - return $this; - } - - /** - * Required. The BigQuery table to copy the data from with a length limit of - * 1,024 characters. - * - * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableId() - { - return $this->table_id; - } - - /** - * Required. The BigQuery table to copy the data from with a length limit of - * 1,024 characters. - * - * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableId($var) - { - GPBUtil::checkString($var, True); - $this->table_id = $var; - - return $this; - } - - /** - * Intermediate Cloud Storage directory used for the import with a length - * limit of 2,000 characters. Can be specified if one wants to have the - * BigQuery export to a specific Cloud Storage directory. - * - * Generated from protobuf field string gcs_staging_dir = 3; - * @return string - */ - public function getGcsStagingDir() - { - return $this->gcs_staging_dir; - } - - /** - * Intermediate Cloud Storage directory used for the import with a length - * limit of 2,000 characters. Can be specified if one wants to have the - * BigQuery export to a specific Cloud Storage directory. - * - * Generated from protobuf field string gcs_staging_dir = 3; - * @param string $var - * @return $this - */ - public function setGcsStagingDir($var) - { - GPBUtil::checkString($var, True); - $this->gcs_staging_dir = $var; - - return $this; - } - - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: - * The schema is available here: - * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: - * The schema is available here: - * https://support.google.com/analytics/answer/7029846. - * Supported values for autocomplete imports: - * * `suggestions` (default): One JSON completion suggestion per line. - * * `denylist`: One JSON deny suggestion per line. - * * `allowlist`: One JSON allow suggestion per line. - * - * Generated from protobuf field string data_schema = 4; - * @return string - */ - public function getDataSchema() - { - return $this->data_schema; - } - - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: - * The schema is available here: - * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: - * The schema is available here: - * https://support.google.com/analytics/answer/7029846. - * Supported values for autocomplete imports: - * * `suggestions` (default): One JSON completion suggestion per line. - * * `denylist`: One JSON deny suggestion per line. - * * `allowlist`: One JSON allow suggestion per line. - * - * Generated from protobuf field string data_schema = 4; - * @param string $var - * @return $this - */ - public function setDataSchema($var) - { - GPBUtil::checkString($var, True); - $this->data_schema = $var; - - return $this; - } - - /** - * @return string - */ - public function getPartition() - { - return $this->whichOneof("partition"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php deleted file mode 100644 index 4c5530a4d35..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Catalog.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.retail.v2.Catalog - */ -class Catalog extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Immutable. The fully qualified resource name of the catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Required. Immutable. The catalog display name. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $display_name = ''; - /** - * Required. The product level configuration. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $product_level_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Immutable. The fully qualified resource name of the catalog. - * @type string $display_name - * Required. Immutable. The catalog display name. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type \Google\Cloud\Retail\V2\ProductLevelConfig $product_level_config - * Required. The product level configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Immutable. The fully qualified resource name of the catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Immutable. The fully qualified resource name of the catalog. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Immutable. The catalog display name. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. Immutable. The catalog display name. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Required. The product level configuration. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\ProductLevelConfig|null - */ - public function getProductLevelConfig() - { - return $this->product_level_config; - } - - public function hasProductLevelConfig() - { - return isset($this->product_level_config); - } - - public function clearProductLevelConfig() - { - unset($this->product_level_config); - } - - /** - * Required. The product level configuration. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\ProductLevelConfig $var - * @return $this - */ - public function setProductLevelConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductLevelConfig::class); - $this->product_level_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php deleted file mode 100644 index 3fda535adc3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute.php +++ /dev/null @@ -1,578 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute - */ -class CatalogAttribute extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Attribute name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * To be indexable, the attribute name can contain only alpha-numeric - * characters and underscores. For example, an attribute named - * `attributes.abc_xyz` can be indexed, but an attribute named - * `attributes.abc-xyz` cannot be indexed. - * If the attribute key starts with `attributes.`, then the attribute is a - * custom attribute. Attributes such as `brands`, `patterns`, and `title` are - * built-in and called system attributes. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key = ''; - /** - * Output only. Indicates whether this attribute has been used by any - * products. `True` if at least one [Product][google.cloud.retail.v2.Product] - * is using this attribute in - * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, - * this field is `False`. - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be - * pre-loaded by using - * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], - * [CatalogService.ImportCatalogAttributes][], or - * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] - * APIs. This field is `False` for pre-loaded - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. - * Only pre-loaded [catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in - * use by products nor predefined can be deleted. [Catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are - * either in use by products or are predefined attributes cannot be deleted; - * however, their configuration properties will reset to default values upon - * removal request. - * After catalog changes, it takes about 10 minutes for this field to update. - * - * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $in_use = false; - /** - * Output only. The type of this attribute. This is derived from the attribute - * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $type = 0; - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values - * are indexed so that it can be filtered, faceted, or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; - */ - protected $indexable_option = 0; - /** - * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic - * facet. Could only be DYNAMIC_FACETABLE_DISABLED if - * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] - * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. - * Must be specified, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; - */ - protected $dynamic_facetable_option = 0; - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values - * are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values - * will not be searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as - * there are no text values associated to numerical attributes. - * Must be specified, when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; - */ - protected $searchable_option = 0; - /** - * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. - * This property only applies to textual custom attributes and requires - * indexable set to enabled to enable exact-searchable. If unset, the server - * behavior defaults to - * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; - */ - protected $exact_searchable_option = 0; - /** - * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search - * results. If unset, the server behavior defaults to - * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; - */ - protected $retrievable_option = 0; - /** - * Contains facet options. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; - */ - protected $facet_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. Attribute name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * To be indexable, the attribute name can contain only alpha-numeric - * characters and underscores. For example, an attribute named - * `attributes.abc_xyz` can be indexed, but an attribute named - * `attributes.abc-xyz` cannot be indexed. - * If the attribute key starts with `attributes.`, then the attribute is a - * custom attribute. Attributes such as `brands`, `patterns`, and `title` are - * built-in and called system attributes. - * @type bool $in_use - * Output only. Indicates whether this attribute has been used by any - * products. `True` if at least one [Product][google.cloud.retail.v2.Product] - * is using this attribute in - * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, - * this field is `False`. - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be - * pre-loaded by using - * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], - * [CatalogService.ImportCatalogAttributes][], or - * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] - * APIs. This field is `False` for pre-loaded - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. - * Only pre-loaded [catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in - * use by products nor predefined can be deleted. [Catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are - * either in use by products or are predefined attributes cannot be deleted; - * however, their configuration properties will reset to default values upon - * removal request. - * After catalog changes, it takes about 10 minutes for this field to update. - * @type int $type - * Output only. The type of this attribute. This is derived from the attribute - * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. - * @type int $indexable_option - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values - * are indexed so that it can be filtered, faceted, or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * @type int $dynamic_facetable_option - * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic - * facet. Could only be DYNAMIC_FACETABLE_DISABLED if - * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] - * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. - * Must be specified, otherwise throws INVALID_FORMAT error. - * @type int $searchable_option - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values - * are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values - * will not be searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as - * there are no text values associated to numerical attributes. - * Must be specified, when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * @type int $exact_searchable_option - * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. - * This property only applies to textual custom attributes and requires - * indexable set to enabled to enable exact-searchable. If unset, the server - * behavior defaults to - * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. - * @type int $retrievable_option - * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search - * results. If unset, the server behavior defaults to - * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. - * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $facet_config - * Contains facet options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Attribute name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * To be indexable, the attribute name can contain only alpha-numeric - * characters and underscores. For example, an attribute named - * `attributes.abc_xyz` can be indexed, but an attribute named - * `attributes.abc-xyz` cannot be indexed. - * If the attribute key starts with `attributes.`, then the attribute is a - * custom attribute. Attributes such as `brands`, `patterns`, and `title` are - * built-in and called system attributes. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. Attribute name. - * For example: `color`, `brands`, `attributes.custom_attribute`, such as - * `attributes.xyz`. - * To be indexable, the attribute name can contain only alpha-numeric - * characters and underscores. For example, an attribute named - * `attributes.abc_xyz` can be indexed, but an attribute named - * `attributes.abc-xyz` cannot be indexed. - * If the attribute key starts with `attributes.`, then the attribute is a - * custom attribute. Attributes such as `brands`, `patterns`, and `title` are - * built-in and called system attributes. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Output only. Indicates whether this attribute has been used by any - * products. `True` if at least one [Product][google.cloud.retail.v2.Product] - * is using this attribute in - * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, - * this field is `False`. - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be - * pre-loaded by using - * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], - * [CatalogService.ImportCatalogAttributes][], or - * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] - * APIs. This field is `False` for pre-loaded - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. - * Only pre-loaded [catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in - * use by products nor predefined can be deleted. [Catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are - * either in use by products or are predefined attributes cannot be deleted; - * however, their configuration properties will reset to default values upon - * removal request. - * After catalog changes, it takes about 10 minutes for this field to update. - * - * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getInUse() - { - return $this->in_use; - } - - /** - * Output only. Indicates whether this attribute has been used by any - * products. `True` if at least one [Product][google.cloud.retail.v2.Product] - * is using this attribute in - * [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, - * this field is `False`. - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be - * pre-loaded by using - * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], - * [CatalogService.ImportCatalogAttributes][], or - * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] - * APIs. This field is `False` for pre-loaded - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s. - * Only pre-loaded [catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in - * use by products nor predefined can be deleted. [Catalog - * attributes][google.cloud.retail.v2.CatalogAttribute] that are - * either in use by products or are predefined attributes cannot be deleted; - * however, their configuration properties will reset to default values upon - * removal request. - * After catalog changes, it takes about 10 minutes for this field to update. - * - * Generated from protobuf field bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setInUse($var) - { - GPBUtil::checkBool($var); - $this->in_use = $var; - - return $this; - } - - /** - * Output only. The type of this attribute. This is derived from the attribute - * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Output only. The type of this attribute. This is derived from the attribute - * in [Product.attributes][google.cloud.retail.v2.Product.attributes]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\AttributeType::class); - $this->type = $var; - - return $this; - } - - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values - * are indexed so that it can be filtered, faceted, or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; - * @return int - */ - public function getIndexableOption() - { - return $this->indexable_option; - } - - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values - * are indexed so that it can be filtered, faceted, or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; - * @param int $var - * @return $this - */ - public function setIndexableOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\IndexableOption::class); - $this->indexable_option = $var; - - return $this; - } - - /** - * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic - * facet. Could only be DYNAMIC_FACETABLE_DISABLED if - * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] - * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. - * Must be specified, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; - * @return int - */ - public function getDynamicFacetableOption() - { - return $this->dynamic_facetable_option; - } - - /** - * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic - * facet. Could only be DYNAMIC_FACETABLE_DISABLED if - * [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] - * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. - * Must be specified, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; - * @param int $var - * @return $this - */ - public function setDynamicFacetableOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\DynamicFacetableOption::class); - $this->dynamic_facetable_option = $var; - - return $this; - } - - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values - * are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values - * will not be searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as - * there are no text values associated to numerical attributes. - * Must be specified, when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; - * @return int - */ - public function getSearchableOption() - { - return $this->searchable_option; - } - - /** - * When - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values - * are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values - * will not be searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as - * there are no text values associated to numerical attributes. - * Must be specified, when - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; - * @param int $var - * @return $this - */ - public function setSearchableOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\SearchableOption::class); - $this->searchable_option = $var; - - return $this; - } - - /** - * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. - * This property only applies to textual custom attributes and requires - * indexable set to enabled to enable exact-searchable. If unset, the server - * behavior defaults to - * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; - * @return int - */ - public function getExactSearchableOption() - { - return $this->exact_searchable_option; - } - - /** - * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. - * This property only applies to textual custom attributes and requires - * indexable set to enabled to enable exact-searchable. If unset, the server - * behavior defaults to - * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; - * @param int $var - * @return $this - */ - public function setExactSearchableOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\ExactSearchableOption::class); - $this->exact_searchable_option = $var; - - return $this; - } - - /** - * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search - * results. If unset, the server behavior defaults to - * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; - * @return int - */ - public function getRetrievableOption() - { - return $this->retrievable_option; - } - - /** - * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search - * results. If unset, the server behavior defaults to - * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; - * @param int $var - * @return $this - */ - public function setRetrievableOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\CatalogAttribute\RetrievableOption::class); - $this->retrievable_option = $var; - - return $this; - } - - /** - * Contains facet options. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; - * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig|null - */ - public function getFacetConfig() - { - return $this->facet_config; - } - - public function hasFacetConfig() - { - return isset($this->facet_config); - } - - public function clearFacetConfig() - { - unset($this->facet_config); - } - - /** - * Contains facet options. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; - * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $var - * @return $this - */ - public function setFacetConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig::class); - $this->facet_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php deleted file mode 100644 index bdc0382cfa8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/AttributeType.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.AttributeType - */ -class AttributeType -{ - /** - * The type of the attribute is unknown. - * Used when type cannot be derived from attribute that is not - * [in_use][google.cloud.retail.v2.CatalogAttribute.in_use]. - * - * Generated from protobuf enum UNKNOWN = 0; - */ - const UNKNOWN = 0; - /** - * Textual attribute. - * - * Generated from protobuf enum TEXTUAL = 1; - */ - const TEXTUAL = 1; - /** - * Numerical attribute. - * - * Generated from protobuf enum NUMERICAL = 2; - */ - const NUMERICAL = 2; - - private static $valueToName = [ - self::UNKNOWN => 'UNKNOWN', - self::TEXTUAL => 'TEXTUAL', - self::NUMERICAL => 'NUMERICAL', - ]; - - 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(AttributeType::class, \Google\Cloud\Retail\V2\CatalogAttribute_AttributeType::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php deleted file mode 100644 index e189b4de7e3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/DynamicFacetableOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption - */ -class DynamicFacetableOption -{ - /** - * Value used when unset. - * - * Generated from protobuf enum DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; - */ - const DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; - /** - * Dynamic facetable option enabled for an attribute. - * - * Generated from protobuf enum DYNAMIC_FACETABLE_ENABLED = 1; - */ - const DYNAMIC_FACETABLE_ENABLED = 1; - /** - * Dynamic facetable option disabled for an attribute. - * - * Generated from protobuf enum DYNAMIC_FACETABLE_DISABLED = 2; - */ - const DYNAMIC_FACETABLE_DISABLED = 2; - - private static $valueToName = [ - self::DYNAMIC_FACETABLE_OPTION_UNSPECIFIED => 'DYNAMIC_FACETABLE_OPTION_UNSPECIFIED', - self::DYNAMIC_FACETABLE_ENABLED => 'DYNAMIC_FACETABLE_ENABLED', - self::DYNAMIC_FACETABLE_DISABLED => 'DYNAMIC_FACETABLE_DISABLED', - ]; - - 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(DynamicFacetableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_DynamicFacetableOption::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php deleted file mode 100644 index 3db1b7dc5d1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/ExactSearchableOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption - */ -class ExactSearchableOption -{ - /** - * Value used when unset. - * - * Generated from protobuf enum EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; - */ - const EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; - /** - * Exact searchable option enabled for an attribute. - * - * Generated from protobuf enum EXACT_SEARCHABLE_ENABLED = 1; - */ - const EXACT_SEARCHABLE_ENABLED = 1; - /** - * Exact searchable option disabled for an attribute. - * - * Generated from protobuf enum EXACT_SEARCHABLE_DISABLED = 2; - */ - const EXACT_SEARCHABLE_DISABLED = 2; - - private static $valueToName = [ - self::EXACT_SEARCHABLE_OPTION_UNSPECIFIED => 'EXACT_SEARCHABLE_OPTION_UNSPECIFIED', - self::EXACT_SEARCHABLE_ENABLED => 'EXACT_SEARCHABLE_ENABLED', - self::EXACT_SEARCHABLE_DISABLED => 'EXACT_SEARCHABLE_DISABLED', - ]; - - 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(ExactSearchableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_ExactSearchableOption::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php deleted file mode 100644 index bb06db0b572..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig.php +++ /dev/null @@ -1,315 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.FacetConfig - */ -class FacetConfig extends \Google\Protobuf\Internal\Message -{ - /** - * If you don't set the facet - * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] - * in the request to a numerical attribute, then we use the computed - * intervals with rounded bounds obtained from all its product numerical - * attribute values. The computed intervals might not be ideal for some - * attributes. Therefore, we give you the option to overwrite them with the - * facet_intervals field. The maximum of facet intervals per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each - * interval must have a lower bound or an upper bound. If both bounds are - * provided, then the lower bound must be smaller or equal than the upper - * bound. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; - */ - private $facet_intervals; - /** - * Each instance represents a list of attribute values to ignore as facet - * values for a specific time range. The maximum number of instances per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; - */ - private $ignored_facet_values; - /** - * Each instance replaces a list of facet values by a merged facet - * value. If a facet value is not in any list, then it will stay the same. - * To avoid conflicts, only paths of length 1 are accepted. In other words, - * if "dark_blue" merged into "BLUE", then the latter can't merge into - * "blues" because this would create a path of length 2. The maximum number - * of instances of MergedFacetValue per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This - * feature is available only for textual custom attributes. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; - */ - private $merged_facet_values; - /** - * Use this field only if you want to merge a facet key into another facet - * key. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; - */ - protected $merged_facet = null; - /** - * Set this field only if you want to rerank based on facet values engaged - * by the user for the current key. This option is only possible for custom - * facetable textual keys. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; - */ - protected $rerank_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $facet_intervals - * If you don't set the facet - * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] - * in the request to a numerical attribute, then we use the computed - * intervals with rounded bounds obtained from all its product numerical - * attribute values. The computed intervals might not be ideal for some - * attributes. Therefore, we give you the option to overwrite them with the - * facet_intervals field. The maximum of facet intervals per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each - * interval must have a lower bound or an upper bound. If both bounds are - * provided, then the lower bound must be smaller or equal than the upper - * bound. - * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $ignored_facet_values - * Each instance represents a list of attribute values to ignore as facet - * values for a specific time range. The maximum number of instances per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. - * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $merged_facet_values - * Each instance replaces a list of facet values by a merged facet - * value. If a facet value is not in any list, then it will stay the same. - * To avoid conflicts, only paths of length 1 are accepted. In other words, - * if "dark_blue" merged into "BLUE", then the latter can't merge into - * "blues" because this would create a path of length 2. The maximum number - * of instances of MergedFacetValue per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This - * feature is available only for textual custom attributes. - * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $merged_facet - * Use this field only if you want to merge a facet key into another facet - * key. - * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $rerank_config - * Set this field only if you want to rerank based on facet values engaged - * by the user for the current key. This option is only possible for custom - * facetable textual keys. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * If you don't set the facet - * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] - * in the request to a numerical attribute, then we use the computed - * intervals with rounded bounds obtained from all its product numerical - * attribute values. The computed intervals might not be ideal for some - * attributes. Therefore, we give you the option to overwrite them with the - * facet_intervals field. The maximum of facet intervals per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each - * interval must have a lower bound or an upper bound. If both bounds are - * provided, then the lower bound must be smaller or equal than the upper - * bound. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacetIntervals() - { - return $this->facet_intervals; - } - - /** - * If you don't set the facet - * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] - * in the request to a numerical attribute, then we use the computed - * intervals with rounded bounds obtained from all its product numerical - * attribute values. The computed intervals might not be ideal for some - * attributes. Therefore, we give you the option to overwrite them with the - * facet_intervals field. The maximum of facet intervals per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each - * interval must have a lower bound or an upper bound. If both bounds are - * provided, then the lower bound must be smaller or equal than the upper - * bound. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; - * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacetIntervals($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Interval::class); - $this->facet_intervals = $arr; - - return $this; - } - - /** - * Each instance represents a list of attribute values to ignore as facet - * values for a specific time range. The maximum number of instances per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoredFacetValues() - { - return $this->ignored_facet_values; - } - - /** - * Each instance represents a list of attribute values to ignore as facet - * values for a specific time range. The maximum number of instances per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; - * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoredFacetValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues::class); - $this->ignored_facet_values = $arr; - - return $this; - } - - /** - * Each instance replaces a list of facet values by a merged facet - * value. If a facet value is not in any list, then it will stay the same. - * To avoid conflicts, only paths of length 1 are accepted. In other words, - * if "dark_blue" merged into "BLUE", then the latter can't merge into - * "blues" because this would create a path of length 2. The maximum number - * of instances of MergedFacetValue per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This - * feature is available only for textual custom attributes. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMergedFacetValues() - { - return $this->merged_facet_values; - } - - /** - * Each instance replaces a list of facet values by a merged facet - * value. If a facet value is not in any list, then it will stay the same. - * To avoid conflicts, only paths of length 1 are accepted. In other words, - * if "dark_blue" merged into "BLUE", then the latter can't merge into - * "blues" because this would create a path of length 2. The maximum number - * of instances of MergedFacetValue per - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This - * feature is available only for textual custom attributes. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; - * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMergedFacetValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue::class); - $this->merged_facet_values = $arr; - - return $this; - } - - /** - * Use this field only if you want to merge a facet key into another facet - * key. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; - * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet|null - */ - public function getMergedFacet() - { - return $this->merged_facet; - } - - public function hasMergedFacet() - { - return isset($this->merged_facet); - } - - public function clearMergedFacet() - { - unset($this->merged_facet); - } - - /** - * Use this field only if you want to merge a facet key into another facet - * key. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; - * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $var - * @return $this - */ - public function setMergedFacet($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet::class); - $this->merged_facet = $var; - - return $this; - } - - /** - * Set this field only if you want to rerank based on facet values engaged - * by the user for the current key. This option is only possible for custom - * facetable textual keys. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; - * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig|null - */ - public function getRerankConfig() - { - return $this->rerank_config; - } - - public function hasRerankConfig() - { - return isset($this->rerank_config); - } - - public function clearRerankConfig() - { - unset($this->rerank_config); - } - - /** - * Set this field only if you want to rerank based on facet values engaged - * by the user for the current key. This option is only possible for custom - * facetable textual keys. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; - * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $var - * @return $this - */ - public function setRerankConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig::class); - $this->rerank_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FacetConfig::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php deleted file mode 100644 index dbc9036dff5..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues - */ -class IgnoredFacetValues extends \Google\Protobuf\Internal\Message -{ - /** - * List of facet values to ignore for the following time range. The facet - * values are the same as the attribute values. There is a limit of 10 - * values per instance of IgnoredFacetValues. Each value can have at most - * 128 characters. - * - * Generated from protobuf field repeated string values = 1; - */ - private $values; - /** - * Time range for the current list of facet values to ignore. - * If multiple time ranges are specified for an facet value for the - * current attribute, consider all of them. If both are empty, ignore - * always. If start time and end time are set, then start time - * must be before end time. - * If start time is not empty and end time is empty, then will ignore - * these facet values after the start time. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - */ - protected $start_time = null; - /** - * If start time is empty and end time is not empty, then ignore these - * facet values before end time. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $values - * List of facet values to ignore for the following time range. The facet - * values are the same as the attribute values. There is a limit of 10 - * values per instance of IgnoredFacetValues. Each value can have at most - * 128 characters. - * @type \Google\Protobuf\Timestamp $start_time - * Time range for the current list of facet values to ignore. - * If multiple time ranges are specified for an facet value for the - * current attribute, consider all of them. If both are empty, ignore - * always. If start time and end time are set, then start time - * must be before end time. - * If start time is not empty and end time is empty, then will ignore - * these facet values after the start time. - * @type \Google\Protobuf\Timestamp $end_time - * If start time is empty and end time is not empty, then ignore these - * facet values before end time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * List of facet values to ignore for the following time range. The facet - * values are the same as the attribute values. There is a limit of 10 - * values per instance of IgnoredFacetValues. Each value can have at most - * 128 characters. - * - * Generated from protobuf field repeated string values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * List of facet values to ignore for the following time range. The facet - * values are the same as the attribute values. There is a limit of 10 - * values per instance of IgnoredFacetValues. Each value can have at most - * 128 characters. - * - * Generated from protobuf field repeated string values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->values = $arr; - - return $this; - } - - /** - * Time range for the current list of facet values to ignore. - * If multiple time ranges are specified for an facet value for the - * current attribute, consider all of them. If both are empty, ignore - * always. If start time and end time are set, then start time - * must be before end time. - * If start time is not empty and end time is empty, then will ignore - * these facet values after the start time. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Time range for the current list of facet values to ignore. - * If multiple time ranges are specified for an facet value for the - * current attribute, consider all of them. If both are empty, ignore - * always. If start time and end time are set, then start time - * must be before end time. - * If start time is not empty and end time is empty, then will ignore - * these facet values after the start time. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * If start time is empty and end time is not empty, then ignore these - * facet values before end time. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * If start time is empty and end time is not empty, then ignore these - * facet values before end time. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IgnoredFacetValues::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_IgnoredFacetValues::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php deleted file mode 100644 index 433268737bd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacet.php +++ /dev/null @@ -1,94 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet - */ -class MergedFacet extends \Google\Protobuf\Internal\Message -{ - /** - * The merged facet key should be a valid facet key that is different than - * the facet key of the current catalog attribute. We refer this is - * merged facet key as the child of the current catalog attribute. This - * merged facet key can't be a parent of another facet key (i.e. no - * directed path of length 2). This merged facet key needs to be either a - * textual custom attribute or a numerical custom attribute. - * - * Generated from protobuf field string merged_facet_key = 1; - */ - protected $merged_facet_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $merged_facet_key - * The merged facet key should be a valid facet key that is different than - * the facet key of the current catalog attribute. We refer this is - * merged facet key as the child of the current catalog attribute. This - * merged facet key can't be a parent of another facet key (i.e. no - * directed path of length 2). This merged facet key needs to be either a - * textual custom attribute or a numerical custom attribute. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * The merged facet key should be a valid facet key that is different than - * the facet key of the current catalog attribute. We refer this is - * merged facet key as the child of the current catalog attribute. This - * merged facet key can't be a parent of another facet key (i.e. no - * directed path of length 2). This merged facet key needs to be either a - * textual custom attribute or a numerical custom attribute. - * - * Generated from protobuf field string merged_facet_key = 1; - * @return string - */ - public function getMergedFacetKey() - { - return $this->merged_facet_key; - } - - /** - * The merged facet key should be a valid facet key that is different than - * the facet key of the current catalog attribute. We refer this is - * merged facet key as the child of the current catalog attribute. This - * merged facet key can't be a parent of another facet key (i.e. no - * directed path of length 2). This merged facet key needs to be either a - * textual custom attribute or a numerical custom attribute. - * - * Generated from protobuf field string merged_facet_key = 1; - * @param string $var - * @return $this - */ - public function setMergedFacetKey($var) - { - GPBUtil::checkString($var, True); - $this->merged_facet_key = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MergedFacet::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_MergedFacet::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php deleted file mode 100644 index ced040a5af1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue - */ -class MergedFacetValue extends \Google\Protobuf\Internal\Message -{ - /** - * All the facet values that are replaces by the same - * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] - * that follows. The maximum number of values per MergedFacetValue is 25. - * Each value can have up to 128 characters. - * - * Generated from protobuf field repeated string values = 1; - */ - private $values; - /** - * All the previous values are replaced by this merged facet value. - * This merged_value must be non-empty and can have up to 128 characters. - * - * Generated from protobuf field string merged_value = 2; - */ - protected $merged_value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $values - * All the facet values that are replaces by the same - * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] - * that follows. The maximum number of values per MergedFacetValue is 25. - * Each value can have up to 128 characters. - * @type string $merged_value - * All the previous values are replaced by this merged facet value. - * This merged_value must be non-empty and can have up to 128 characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * All the facet values that are replaces by the same - * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] - * that follows. The maximum number of values per MergedFacetValue is 25. - * Each value can have up to 128 characters. - * - * Generated from protobuf field repeated string values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * All the facet values that are replaces by the same - * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] - * that follows. The maximum number of values per MergedFacetValue is 25. - * Each value can have up to 128 characters. - * - * Generated from protobuf field repeated string values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->values = $arr; - - return $this; - } - - /** - * All the previous values are replaced by this merged facet value. - * This merged_value must be non-empty and can have up to 128 characters. - * - * Generated from protobuf field string merged_value = 2; - * @return string - */ - public function getMergedValue() - { - return $this->merged_value; - } - - /** - * All the previous values are replaced by this merged facet value. - * This merged_value must be non-empty and can have up to 128 characters. - * - * Generated from protobuf field string merged_value = 2; - * @param string $var - * @return $this - */ - public function setMergedValue($var) - { - GPBUtil::checkString($var, True); - $this->merged_value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MergedFacetValue::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_MergedFacetValue::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php deleted file mode 100644 index d453dd3f306..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/FacetConfig/RerankConfig.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig - */ -class RerankConfig extends \Google\Protobuf\Internal\Message -{ - /** - * If set to true, then we also rerank the dynamic facets based on the - * facet values engaged by the user for the current attribute key during - * serving. - * - * Generated from protobuf field bool rerank_facet = 1; - */ - protected $rerank_facet = false; - /** - * If empty, rerank on all facet values for the current key. Otherwise, - * will rerank on the facet values from this list only. - * - * Generated from protobuf field repeated string facet_values = 2; - */ - private $facet_values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $rerank_facet - * If set to true, then we also rerank the dynamic facets based on the - * facet values engaged by the user for the current attribute key during - * serving. - * @type array|\Google\Protobuf\Internal\RepeatedField $facet_values - * If empty, rerank on all facet values for the current key. Otherwise, - * will rerank on the facet values from this list only. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * If set to true, then we also rerank the dynamic facets based on the - * facet values engaged by the user for the current attribute key during - * serving. - * - * Generated from protobuf field bool rerank_facet = 1; - * @return bool - */ - public function getRerankFacet() - { - return $this->rerank_facet; - } - - /** - * If set to true, then we also rerank the dynamic facets based on the - * facet values engaged by the user for the current attribute key during - * serving. - * - * Generated from protobuf field bool rerank_facet = 1; - * @param bool $var - * @return $this - */ - public function setRerankFacet($var) - { - GPBUtil::checkBool($var); - $this->rerank_facet = $var; - - return $this; - } - - /** - * If empty, rerank on all facet values for the current key. Otherwise, - * will rerank on the facet values from this list only. - * - * Generated from protobuf field repeated string facet_values = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacetValues() - { - return $this->facet_values; - } - - /** - * If empty, rerank on all facet values for the current key. Otherwise, - * will rerank on the facet values from this list only. - * - * Generated from protobuf field repeated string facet_values = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacetValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->facet_values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RerankConfig::class, \Google\Cloud\Retail\V2\CatalogAttribute_FacetConfig_RerankConfig::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php deleted file mode 100644 index bbab5d7c490..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/IndexableOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.IndexableOption - */ -class IndexableOption -{ - /** - * Value used when unset. - * - * Generated from protobuf enum INDEXABLE_OPTION_UNSPECIFIED = 0; - */ - const INDEXABLE_OPTION_UNSPECIFIED = 0; - /** - * Indexable option enabled for an attribute. - * - * Generated from protobuf enum INDEXABLE_ENABLED = 1; - */ - const INDEXABLE_ENABLED = 1; - /** - * Indexable option disabled for an attribute. - * - * Generated from protobuf enum INDEXABLE_DISABLED = 2; - */ - const INDEXABLE_DISABLED = 2; - - private static $valueToName = [ - self::INDEXABLE_OPTION_UNSPECIFIED => 'INDEXABLE_OPTION_UNSPECIFIED', - self::INDEXABLE_ENABLED => 'INDEXABLE_ENABLED', - self::INDEXABLE_DISABLED => 'INDEXABLE_DISABLED', - ]; - - 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(IndexableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_IndexableOption::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php deleted file mode 100644 index 150c5f7d15d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/RetrievableOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.RetrievableOption - */ -class RetrievableOption -{ - /** - * Value used when unset. - * - * Generated from protobuf enum RETRIEVABLE_OPTION_UNSPECIFIED = 0; - */ - const RETRIEVABLE_OPTION_UNSPECIFIED = 0; - /** - * Retrievable option enabled for an attribute. - * - * Generated from protobuf enum RETRIEVABLE_ENABLED = 1; - */ - const RETRIEVABLE_ENABLED = 1; - /** - * Retrievable option disabled for an attribute. - * - * Generated from protobuf enum RETRIEVABLE_DISABLED = 2; - */ - const RETRIEVABLE_DISABLED = 2; - - private static $valueToName = [ - self::RETRIEVABLE_OPTION_UNSPECIFIED => 'RETRIEVABLE_OPTION_UNSPECIFIED', - self::RETRIEVABLE_ENABLED => 'RETRIEVABLE_ENABLED', - self::RETRIEVABLE_DISABLED => 'RETRIEVABLE_DISABLED', - ]; - - 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(RetrievableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_RetrievableOption::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php deleted file mode 100644 index 6bca457f0b3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CatalogAttribute/SearchableOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CatalogAttribute.SearchableOption - */ -class SearchableOption -{ - /** - * Value used when unset. - * - * Generated from protobuf enum SEARCHABLE_OPTION_UNSPECIFIED = 0; - */ - const SEARCHABLE_OPTION_UNSPECIFIED = 0; - /** - * Searchable option enabled for an attribute. - * - * Generated from protobuf enum SEARCHABLE_ENABLED = 1; - */ - const SEARCHABLE_ENABLED = 1; - /** - * Searchable option disabled for an attribute. - * - * Generated from protobuf enum SEARCHABLE_DISABLED = 2; - */ - const SEARCHABLE_DISABLED = 2; - - private static $valueToName = [ - self::SEARCHABLE_OPTION_UNSPECIFIED => 'SEARCHABLE_OPTION_UNSPECIFIED', - self::SEARCHABLE_ENABLED => 'SEARCHABLE_ENABLED', - self::SEARCHABLE_DISABLED => 'SEARCHABLE_DISABLED', - ]; - - 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(SearchableOption::class, \Google\Cloud\Retail\V2\CatalogAttribute_SearchableOption::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php deleted file mode 100644 index f0b77babfc2..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CollectUserEventRequest.php +++ /dev/null @@ -1,288 +0,0 @@ -google.cloud.retail.v2.CollectUserEventRequest - */ -class CollectUserEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. URL encoded UserEvent proto with a length limit of 2,000,000 - * characters. - * - * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = ''; - /** - * The URL including cgi-parameters but excluding the hash fragment with a - * length limit of 5,000 characters. 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; - */ - protected $uri = ''; - /** - * 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; - */ - protected $ets = 0; - /** - * An arbitrary serialized JSON string that contains necessary information - * that can comprise a user event. When this field is specified, the - * user_event field will be ignored. Note: line-delimited JSON is not - * supported, a single JSON only. - * - * Generated from protobuf field string raw_json = 5; - */ - protected $raw_json = ''; - protected $conversion_rule; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $prebuilt_rule - * The prebuilt rule name that can convert a specific type of raw_json. - * For example: "ga4_bq" rule for the GA4 user event schema. - * @type string $parent - * Required. The parent catalog name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * @type string $user_event - * Required. URL encoded UserEvent proto with a length limit of 2,000,000 - * characters. - * @type string $uri - * The URL including cgi-parameters but excluding the hash fragment with a - * length limit of 5,000 characters. This is often more useful than the - * referer URL, because many browsers only send the domain for 3rd party - * requests. - * @type int|string $ets - * The event timestamp in milliseconds. This prevents browser caching of - * otherwise identical get requests. The name is abbreviated to reduce the - * payload bytes. - * @type string $raw_json - * An arbitrary serialized JSON string that contains necessary information - * that can comprise a user event. When this field is specified, the - * user_event field will be ignored. Note: line-delimited JSON is not - * supported, a single JSON only. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * The prebuilt rule name that can convert a specific type of raw_json. - * For example: "ga4_bq" rule for the GA4 user event schema. - * - * Generated from protobuf field string prebuilt_rule = 6; - * @return string - */ - public function getPrebuiltRule() - { - return $this->readOneof(6); - } - - public function hasPrebuiltRule() - { - return $this->hasOneof(6); - } - - /** - * The prebuilt rule name that can convert a specific type of raw_json. - * For example: "ga4_bq" rule for the GA4 user event schema. - * - * Generated from protobuf field string prebuilt_rule = 6; - * @param string $var - * @return $this - */ - public function setPrebuiltRule($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Required. The parent catalog name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent catalog name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. URL encoded UserEvent proto with a length limit of 2,000,000 - * characters. - * - * 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 with a length limit of 2,000,000 - * characters. - * - * 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; - } - - /** - * The URL including cgi-parameters but excluding the hash fragment with a - * length limit of 5,000 characters. 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; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URL including cgi-parameters but excluding the hash fragment with a - * length limit of 5,000 characters. 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; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * 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; - * @return int|string - */ - public function getEts() - { - return $this->ets; - } - - /** - * 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; - * @param int|string $var - * @return $this - */ - public function setEts($var) - { - GPBUtil::checkInt64($var); - $this->ets = $var; - - return $this; - } - - /** - * An arbitrary serialized JSON string that contains necessary information - * that can comprise a user event. When this field is specified, the - * user_event field will be ignored. Note: line-delimited JSON is not - * supported, a single JSON only. - * - * Generated from protobuf field string raw_json = 5; - * @return string - */ - public function getRawJson() - { - return $this->raw_json; - } - - /** - * An arbitrary serialized JSON string that contains necessary information - * that can comprise a user event. When this field is specified, the - * user_event field will be ignored. Note: line-delimited JSON is not - * supported, a single JSON only. - * - * Generated from protobuf field string raw_json = 5; - * @param string $var - * @return $this - */ - public function setRawJson($var) - { - GPBUtil::checkString($var, True); - $this->raw_json = $var; - - return $this; - } - - /** - * @return string - */ - public function getConversionRule() - { - return $this->whichOneof("conversion_rule"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php deleted file mode 100644 index 29cdde8fd03..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ColorInfo.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.retail.v2.ColorInfo - */ -class ColorInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The standard color families. Strongly recommended to use the following - * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", - * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and - * "Mixed". Normally it is expected to have only 1 color family. May consider - * using single "Mixed" instead of multiple values. - * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string color_families = 1; - */ - private $color_families; - /** - * The color display names, which may be different from standard color family - * names, such as the color aliases used in the website frontend. Normally - * it is expected to have only 1 color. May consider using single "Mixed" - * instead of multiple values. - * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string colors = 2; - */ - private $colors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $color_families - * The standard color families. Strongly recommended to use the following - * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", - * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and - * "Mixed". Normally it is expected to have only 1 color family. May consider - * using single "Mixed" instead of multiple values. - * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * @type array|\Google\Protobuf\Internal\RepeatedField $colors - * The color display names, which may be different from standard color family - * names, such as the color aliases used in the website frontend. Normally - * it is expected to have only 1 color. May consider using single "Mixed" - * instead of multiple values. - * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The standard color families. Strongly recommended to use the following - * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", - * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and - * "Mixed". Normally it is expected to have only 1 color family. May consider - * using single "Mixed" instead of multiple values. - * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string color_families = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getColorFamilies() - { - return $this->color_families; - } - - /** - * The standard color families. Strongly recommended to use the following - * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", - * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and - * "Mixed". Normally it is expected to have only 1 color family. May consider - * using single "Mixed" instead of multiple values. - * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string color_families = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setColorFamilies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->color_families = $arr; - - return $this; - } - - /** - * The color display names, which may be different from standard color family - * names, such as the color aliases used in the website frontend. Normally - * it is expected to have only 1 color. May consider using single "Mixed" - * instead of multiple values. - * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string colors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getColors() - { - return $this->colors; - } - - /** - * The color display names, which may be different from standard color family - * names, such as the color aliases used in the website frontend. Normally - * it is expected to have only 1 color. May consider using single "Mixed" - * instead of multiple values. - * A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field repeated string colors = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setColors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->colors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php deleted file mode 100644 index 2118cf1f06f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryRequest.php +++ /dev/null @@ -1,511 +0,0 @@ -google.cloud.retail.v2.CompleteQueryRequest - */ -class CompleteQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Catalog for which the completion is performed. - * Full resource name of catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $catalog = ''; - /** - * Required. The query used to generate suggestions. - * The maximum number of allowed characters is 255. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - /** - * Required field. A unique identifier for tracking visitors. For example, - * this could be implemented with an HTTP cookie, which should be able to - * uniquely identify a visitor on a single device. This unique identifier - * should not change if the visitor logs in or out of the website. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 7; - */ - protected $visitor_id = ''; - /** - * Note that this field applies for `user-data` dataset only. For requests - * with `cloud-retail` dataset, setting this field has no effect. - * The language filters applied to the output suggestions. If set, it should - * contain the language of the query. If not set, suggestions are returned - * without considering language restrictions. This is the BCP-47 language - * code, such as "en-US" or "sr-Latn". For more information, see [Tags for - * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - * number of language codes is 3. - * - * Generated from protobuf field repeated string language_codes = 3; - */ - private $language_codes; - /** - * The device type context for completion suggestions. We recommend that you - * leave this field empty. - * It can apply different suggestions on different device types, e.g. - * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - * types. - * Supported formats: - * * `UNKNOWN_DEVICE_TYPE` - * * `DESKTOP` - * * `MOBILE` - * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - * - * Generated from protobuf field string device_type = 4; - */ - protected $device_type = ''; - /** - * Determines which dataset to use for fetching completion. "user-data" will - * use the imported dataset through - * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. - * "cloud-retail" will use the dataset generated by cloud retail based on user - * events. If leave empty, it will use the "user-data". - * Current supported values: - * * user-data - * * cloud-retail: - * This option requires enabling auto-learning function first. See - * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - * - * Generated from protobuf field string dataset = 6; - */ - protected $dataset = ''; - /** - * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value - * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. - * The maximum allowed max suggestions is 20. If it is set higher, it will be - * capped by 20. - * - * Generated from protobuf field int32 max_suggestions = 5; - */ - protected $max_suggestions = 0; - /** - * If true, attribute suggestions are enabled and provided in the response. - * This field is only available for the "cloud-retail" dataset. - * - * Generated from protobuf field bool enable_attribute_suggestions = 9; - */ - protected $enable_attribute_suggestions = false; - /** - * The entity for customers who run multiple entities, domains, sites, or - * regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it must be an exact match with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get - * per-entity autocomplete results. - * - * Generated from protobuf field string entity = 10; - */ - protected $entity = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Required. Catalog for which the completion is performed. - * Full resource name of catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @type string $query - * Required. The query used to generate suggestions. - * The maximum number of allowed characters is 255. - * @type string $visitor_id - * Required field. A unique identifier for tracking visitors. For example, - * this could be implemented with an HTTP cookie, which should be able to - * uniquely identify a visitor on a single device. This unique identifier - * should not change if the visitor logs in or out of the website. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $language_codes - * Note that this field applies for `user-data` dataset only. For requests - * with `cloud-retail` dataset, setting this field has no effect. - * The language filters applied to the output suggestions. If set, it should - * contain the language of the query. If not set, suggestions are returned - * without considering language restrictions. This is the BCP-47 language - * code, such as "en-US" or "sr-Latn". For more information, see [Tags for - * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - * number of language codes is 3. - * @type string $device_type - * The device type context for completion suggestions. We recommend that you - * leave this field empty. - * It can apply different suggestions on different device types, e.g. - * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - * types. - * Supported formats: - * * `UNKNOWN_DEVICE_TYPE` - * * `DESKTOP` - * * `MOBILE` - * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - * @type string $dataset - * Determines which dataset to use for fetching completion. "user-data" will - * use the imported dataset through - * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. - * "cloud-retail" will use the dataset generated by cloud retail based on user - * events. If leave empty, it will use the "user-data". - * Current supported values: - * * user-data - * * cloud-retail: - * This option requires enabling auto-learning function first. See - * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - * @type int $max_suggestions - * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value - * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. - * The maximum allowed max suggestions is 20. If it is set higher, it will be - * capped by 20. - * @type bool $enable_attribute_suggestions - * If true, attribute suggestions are enabled and provided in the response. - * This field is only available for the "cloud-retail" dataset. - * @type string $entity - * The entity for customers who run multiple entities, domains, sites, or - * regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it must be an exact match with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get - * per-entity autocomplete results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Catalog for which the completion is performed. - * Full resource name of catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Required. Catalog for which the completion is performed. - * Full resource name of catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - - /** - * Required. The query used to generate suggestions. - * The maximum number of allowed characters is 255. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. The query used to generate suggestions. - * The maximum number of allowed characters is 255. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Required field. A unique identifier for tracking visitors. For example, - * this could be implemented with an HTTP cookie, which should be able to - * uniquely identify a visitor on a single device. This unique identifier - * should not change if the visitor logs in or out of the website. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 7; - * @return string - */ - public function getVisitorId() - { - return $this->visitor_id; - } - - /** - * Required field. A unique identifier for tracking visitors. For example, - * this could be implemented with an HTTP cookie, which should be able to - * uniquely identify a visitor on a single device. This unique identifier - * should not change if the visitor logs in or out of the website. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 7; - * @param string $var - * @return $this - */ - public function setVisitorId($var) - { - GPBUtil::checkString($var, True); - $this->visitor_id = $var; - - return $this; - } - - /** - * Note that this field applies for `user-data` dataset only. For requests - * with `cloud-retail` dataset, setting this field has no effect. - * The language filters applied to the output suggestions. If set, it should - * contain the language of the query. If not set, suggestions are returned - * without considering language restrictions. This is the BCP-47 language - * code, such as "en-US" or "sr-Latn". For more information, see [Tags for - * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - * number of language codes is 3. - * - * Generated from protobuf field repeated string language_codes = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLanguageCodes() - { - return $this->language_codes; - } - - /** - * Note that this field applies for `user-data` dataset only. For requests - * with `cloud-retail` dataset, setting this field has no effect. - * The language filters applied to the output suggestions. If set, it should - * contain the language of the query. If not set, suggestions are returned - * without considering language restrictions. This is the BCP-47 language - * code, such as "en-US" or "sr-Latn". For more information, see [Tags for - * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - * number of language codes is 3. - * - * Generated from protobuf field repeated string language_codes = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLanguageCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->language_codes = $arr; - - return $this; - } - - /** - * The device type context for completion suggestions. We recommend that you - * leave this field empty. - * It can apply different suggestions on different device types, e.g. - * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - * types. - * Supported formats: - * * `UNKNOWN_DEVICE_TYPE` - * * `DESKTOP` - * * `MOBILE` - * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - * - * Generated from protobuf field string device_type = 4; - * @return string - */ - public function getDeviceType() - { - return $this->device_type; - } - - /** - * The device type context for completion suggestions. We recommend that you - * leave this field empty. - * It can apply different suggestions on different device types, e.g. - * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - * types. - * Supported formats: - * * `UNKNOWN_DEVICE_TYPE` - * * `DESKTOP` - * * `MOBILE` - * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - * - * Generated from protobuf field string device_type = 4; - * @param string $var - * @return $this - */ - public function setDeviceType($var) - { - GPBUtil::checkString($var, True); - $this->device_type = $var; - - return $this; - } - - /** - * Determines which dataset to use for fetching completion. "user-data" will - * use the imported dataset through - * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. - * "cloud-retail" will use the dataset generated by cloud retail based on user - * events. If leave empty, it will use the "user-data". - * Current supported values: - * * user-data - * * cloud-retail: - * This option requires enabling auto-learning function first. See - * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - * - * Generated from protobuf field string dataset = 6; - * @return string - */ - public function getDataset() - { - return $this->dataset; - } - - /** - * Determines which dataset to use for fetching completion. "user-data" will - * use the imported dataset through - * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData]. - * "cloud-retail" will use the dataset generated by cloud retail based on user - * events. If leave empty, it will use the "user-data". - * Current supported values: - * * user-data - * * cloud-retail: - * This option requires enabling auto-learning function first. See - * [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - * - * Generated from protobuf field string dataset = 6; - * @param string $var - * @return $this - */ - public function setDataset($var) - { - GPBUtil::checkString($var, True); - $this->dataset = $var; - - return $this; - } - - /** - * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value - * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. - * The maximum allowed max suggestions is 20. If it is set higher, it will be - * capped by 20. - * - * Generated from protobuf field int32 max_suggestions = 5; - * @return int - */ - public function getMaxSuggestions() - { - return $this->max_suggestions; - } - - /** - * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value - * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. - * The maximum allowed max suggestions is 20. If it is set higher, it will be - * capped by 20. - * - * Generated from protobuf field int32 max_suggestions = 5; - * @param int $var - * @return $this - */ - public function setMaxSuggestions($var) - { - GPBUtil::checkInt32($var); - $this->max_suggestions = $var; - - return $this; - } - - /** - * If true, attribute suggestions are enabled and provided in the response. - * This field is only available for the "cloud-retail" dataset. - * - * Generated from protobuf field bool enable_attribute_suggestions = 9; - * @return bool - */ - public function getEnableAttributeSuggestions() - { - return $this->enable_attribute_suggestions; - } - - /** - * If true, attribute suggestions are enabled and provided in the response. - * This field is only available for the "cloud-retail" dataset. - * - * Generated from protobuf field bool enable_attribute_suggestions = 9; - * @param bool $var - * @return $this - */ - public function setEnableAttributeSuggestions($var) - { - GPBUtil::checkBool($var); - $this->enable_attribute_suggestions = $var; - - return $this; - } - - /** - * The entity for customers who run multiple entities, domains, sites, or - * regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it must be an exact match with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get - * per-entity autocomplete results. - * - * Generated from protobuf field string entity = 10; - * @return string - */ - public function getEntity() - { - return $this->entity; - } - - /** - * The entity for customers who run multiple entities, domains, sites, or - * regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it must be an exact match with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get - * per-entity autocomplete results. - * - * Generated from protobuf field string entity = 10; - * @param string $var - * @return $this - */ - public function setEntity($var) - { - GPBUtil::checkString($var, True); - $this->entity = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php deleted file mode 100644 index 2aa2c0bf0cd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse.php +++ /dev/null @@ -1,262 +0,0 @@ -google.cloud.retail.v2.CompleteQueryResponse - */ -class CompleteQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Results of the matching suggestions. The result list is ordered and the - * first result is top suggestion. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; - */ - private $completion_results; - /** - * A unique complete token. This should be included in the - * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] - * for search events resulting from this completion, which enables accurate - * attribution of complete model performance. - * - * Generated from protobuf field string attribution_token = 2; - */ - protected $attribution_token = ''; - /** - * Deprecated. Matched recent searches of this user. The maximum number of - * recent searches is 10. This field is a restricted feature. If you want to - * enable it, contact Retail Search support. - * This feature is only available when - * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] - * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. - * The recent searches satisfy the follow rules: - * * They are ordered from latest to oldest. - * * They are matched with - * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] - * case insensitively. - * * They are transformed to lower case. - * * They are UTF-8 safe. - * Recent searches are deduplicated. More recent searches will be reserved - * when duplication happens. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; - * @deprecated - */ - private $recent_search_results; - /** - * A map of matched attribute suggestions. This field is only available for - * "cloud-retail" dataset. - * Current supported keys: - * * `brands` - * * `categories` - * - * Generated from protobuf field map attribute_results = 4; - */ - private $attribute_results; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>|\Google\Protobuf\Internal\RepeatedField $completion_results - * Results of the matching suggestions. The result list is ordered and the - * first result is top suggestion. - * @type string $attribution_token - * A unique complete token. This should be included in the - * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] - * for search events resulting from this completion, which enables accurate - * attribution of complete model performance. - * @type array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $recent_search_results - * Deprecated. Matched recent searches of this user. The maximum number of - * recent searches is 10. This field is a restricted feature. If you want to - * enable it, contact Retail Search support. - * This feature is only available when - * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] - * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. - * The recent searches satisfy the follow rules: - * * They are ordered from latest to oldest. - * * They are matched with - * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] - * case insensitively. - * * They are transformed to lower case. - * * They are UTF-8 safe. - * Recent searches are deduplicated. More recent searches will be reserved - * when duplication happens. - * @type array|\Google\Protobuf\Internal\MapField $attribute_results - * A map of matched attribute suggestions. This field is only available for - * "cloud-retail" dataset. - * Current supported keys: - * * `brands` - * * `categories` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); - parent::__construct($data); - } - - /** - * Results of the matching suggestions. The result list is ordered and the - * first result is top suggestion. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCompletionResults() - { - return $this->completion_results; - } - - /** - * Results of the matching suggestions. The result list is ordered and the - * first result is top suggestion. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; - * @param array<\Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCompletionResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult::class); - $this->completion_results = $arr; - - return $this; - } - - /** - * A unique complete token. This should be included in the - * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] - * for search events resulting from this completion, which enables accurate - * attribution of complete model performance. - * - * Generated from protobuf field string attribution_token = 2; - * @return string - */ - public function getAttributionToken() - { - return $this->attribution_token; - } - - /** - * A unique complete token. This should be included in the - * [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] - * for search events resulting from this completion, which enables accurate - * attribution of complete model performance. - * - * Generated from protobuf field string attribution_token = 2; - * @param string $var - * @return $this - */ - public function setAttributionToken($var) - { - GPBUtil::checkString($var, True); - $this->attribution_token = $var; - - return $this; - } - - /** - * Deprecated. Matched recent searches of this user. The maximum number of - * recent searches is 10. This field is a restricted feature. If you want to - * enable it, contact Retail Search support. - * This feature is only available when - * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] - * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. - * The recent searches satisfy the follow rules: - * * They are ordered from latest to oldest. - * * They are matched with - * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] - * case insensitively. - * * They are transformed to lower case. - * * They are UTF-8 safe. - * Recent searches are deduplicated. More recent searches will be reserved - * when duplication happens. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getRecentSearchResults() - { - @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); - return $this->recent_search_results; - } - - /** - * Deprecated. Matched recent searches of this user. The maximum number of - * recent searches is 10. This field is a restricted feature. If you want to - * enable it, contact Retail Search support. - * This feature is only available when - * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] - * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. - * The recent searches satisfy the follow rules: - * * They are ordered from latest to oldest. - * * They are matched with - * [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query] - * case insensitively. - * * They are transformed to lower case. - * * They are UTF-8 safe. - * Recent searches are deduplicated. More recent searches will be reserved - * when duplication happens. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; - * @param array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setRecentSearchResults($var) - { - @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult::class); - $this->recent_search_results = $arr; - - return $this; - } - - /** - * A map of matched attribute suggestions. This field is only available for - * "cloud-retail" dataset. - * Current supported keys: - * * `brands` - * * `categories` - * - * Generated from protobuf field map attribute_results = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributeResults() - { - return $this->attribute_results; - } - - /** - * A map of matched attribute suggestions. This field is only available for - * "cloud-retail" dataset. - * Current supported keys: - * * `brands` - * * `categories` - * - * Generated from protobuf field map attribute_results = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributeResults($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\AttributeResult::class); - $this->attribute_results = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php deleted file mode 100644 index 5ba02e18561..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/AttributeResult.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.CompleteQueryResponse.AttributeResult - */ -class AttributeResult extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field repeated string suggestions = 1; - */ - private $suggestions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $suggestions - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field repeated string suggestions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSuggestions() - { - return $this->suggestions; - } - - /** - * Generated from protobuf field repeated string suggestions = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSuggestions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->suggestions = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AttributeResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_AttributeResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php deleted file mode 100644 index 2700d24dbe8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/CompletionResult.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.retail.v2.CompleteQueryResponse.CompletionResult - */ -class CompletionResult extends \Google\Protobuf\Internal\Message -{ - /** - * The suggestion for the query. - * - * Generated from protobuf field string suggestion = 1; - */ - protected $suggestion = ''; - /** - * Custom attributes for the suggestion term. - * * For "user-data", the attributes are additional custom attributes - * ingested through BigQuery. - * * For "cloud-retail", the attributes are product attributes generated - * by Cloud Retail. It requires - * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] - * is imported properly. - * - * Generated from protobuf field map attributes = 2; - */ - private $attributes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $suggestion - * The suggestion for the query. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Custom attributes for the suggestion term. - * * For "user-data", the attributes are additional custom attributes - * ingested through BigQuery. - * * For "cloud-retail", the attributes are product attributes generated - * by Cloud Retail. It requires - * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] - * is imported properly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); - parent::__construct($data); - } - - /** - * The suggestion for the query. - * - * Generated from protobuf field string suggestion = 1; - * @return string - */ - public function getSuggestion() - { - return $this->suggestion; - } - - /** - * The suggestion for the query. - * - * Generated from protobuf field string suggestion = 1; - * @param string $var - * @return $this - */ - public function setSuggestion($var) - { - GPBUtil::checkString($var, True); - $this->suggestion = $var; - - return $this; - } - - /** - * Custom attributes for the suggestion term. - * * For "user-data", the attributes are additional custom attributes - * ingested through BigQuery. - * * For "cloud-retail", the attributes are product attributes generated - * by Cloud Retail. It requires - * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] - * is imported properly. - * - * Generated from protobuf field map attributes = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Custom attributes for the suggestion term. - * * For "user-data", the attributes are additional custom attributes - * ingested through BigQuery. - * * For "cloud-retail", the attributes are product attributes generated - * by Cloud Retail. It requires - * [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details] - * is imported properly. - * - * Generated from protobuf field map attributes = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); - $this->attributes = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CompletionResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_CompletionResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php deleted file mode 100644 index 72d46e2a5d9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompleteQueryResponse/RecentSearchResult.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult - */ -class RecentSearchResult extends \Google\Protobuf\Internal\Message -{ - /** - * The recent search query. - * - * Generated from protobuf field string recent_search = 1; - */ - protected $recent_search = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $recent_search - * The recent search query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); - parent::__construct($data); - } - - /** - * The recent search query. - * - * Generated from protobuf field string recent_search = 1; - * @return string - */ - public function getRecentSearch() - { - return $this->recent_search; - } - - /** - * The recent search query. - * - * Generated from protobuf field string recent_search = 1; - * @param string $var - * @return $this - */ - public function setRecentSearch($var) - { - GPBUtil::checkString($var, True); - $this->recent_search = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RecentSearchResult::class, \Google\Cloud\Retail\V2\CompleteQueryResponse_RecentSearchResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php deleted file mode 100644 index 10eb8f210b7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionConfig.php +++ /dev/null @@ -1,546 +0,0 @@ -google.cloud.retail.v2.CompletionConfig - */ -class CompletionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Immutable. Fully qualified name - * `projects/*/locations/*/catalogs/*/completionConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Specifies the matching order for autocomplete suggestions, e.g., a query - * consisting of 'sh' with 'out-of-order' specified would suggest "women's - * shoes", whereas a query of 'red s' with 'exact-prefix' specified would - * suggest "red shoes". Currently supported values: - * * 'out-of-order' - * * 'exact-prefix' - * Default value: 'exact-prefix'. - * - * Generated from protobuf field string matching_order = 2; - */ - protected $matching_order = ''; - /** - * The maximum number of autocomplete suggestions returned per term. Default - * value is 20. If left unset or set to 0, then will fallback to default - * value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 max_suggestions = 3; - */ - protected $max_suggestions = 0; - /** - * The minimum number of characters needed to be typed in order to get - * suggestions. Default value is 2. If left unset or set to 0, then will - * fallback to default value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 min_prefix_length = 4; - */ - protected $min_prefix_length = 0; - /** - * If set to true, the auto learning function is enabled. Auto learning uses - * user data to generate suggestions using ML techniques. Default value is - * false. Only after enabling auto learning can users use `cloud-retail` - * data in - * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. - * - * Generated from protobuf field bool auto_learning = 11; - */ - protected $auto_learning = false; - /** - * Output only. The source data for the latest import of the autocomplete - * suggestion phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $suggestions_input_config = null; - /** - * Output only. Name of the LRO corresponding to the latest suggestion terms - * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API - * method to retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_suggestions_import_operation = ''; - /** - * Output only. The source data for the latest import of the autocomplete - * denylist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $denylist_input_config = null; - /** - * Output only. Name of the LRO corresponding to the latest denylist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_denylist_import_operation = ''; - /** - * Output only. The source data for the latest import of the autocomplete - * allowlist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $allowlist_input_config = null; - /** - * Output only. Name of the LRO corresponding to the latest allowlist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_allowlist_import_operation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Immutable. Fully qualified name - * `projects/*/locations/*/catalogs/*/completionConfig` - * @type string $matching_order - * Specifies the matching order for autocomplete suggestions, e.g., a query - * consisting of 'sh' with 'out-of-order' specified would suggest "women's - * shoes", whereas a query of 'red s' with 'exact-prefix' specified would - * suggest "red shoes". Currently supported values: - * * 'out-of-order' - * * 'exact-prefix' - * Default value: 'exact-prefix'. - * @type int $max_suggestions - * The maximum number of autocomplete suggestions returned per term. Default - * value is 20. If left unset or set to 0, then will fallback to default - * value. - * Value range is 1 to 20. - * @type int $min_prefix_length - * The minimum number of characters needed to be typed in order to get - * suggestions. Default value is 2. If left unset or set to 0, then will - * fallback to default value. - * Value range is 1 to 20. - * @type bool $auto_learning - * If set to true, the auto learning function is enabled. Auto learning uses - * user data to generate suggestions using ML techniques. Default value is - * false. Only after enabling auto learning can users use `cloud-retail` - * data in - * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. - * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $suggestions_input_config - * Output only. The source data for the latest import of the autocomplete - * suggestion phrases. - * @type string $last_suggestions_import_operation - * Output only. Name of the LRO corresponding to the latest suggestion terms - * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API - * method to retrieve the latest state of the Long Running Operation. - * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $denylist_input_config - * Output only. The source data for the latest import of the autocomplete - * denylist phrases. - * @type string $last_denylist_import_operation - * Output only. Name of the LRO corresponding to the latest denylist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $allowlist_input_config - * Output only. The source data for the latest import of the autocomplete - * allowlist phrases. - * @type string $last_allowlist_import_operation - * Output only. Name of the LRO corresponding to the latest allowlist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Immutable. Fully qualified name - * `projects/*/locations/*/catalogs/*/completionConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Immutable. Fully qualified name - * `projects/*/locations/*/catalogs/*/completionConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Specifies the matching order for autocomplete suggestions, e.g., a query - * consisting of 'sh' with 'out-of-order' specified would suggest "women's - * shoes", whereas a query of 'red s' with 'exact-prefix' specified would - * suggest "red shoes". Currently supported values: - * * 'out-of-order' - * * 'exact-prefix' - * Default value: 'exact-prefix'. - * - * Generated from protobuf field string matching_order = 2; - * @return string - */ - public function getMatchingOrder() - { - return $this->matching_order; - } - - /** - * Specifies the matching order for autocomplete suggestions, e.g., a query - * consisting of 'sh' with 'out-of-order' specified would suggest "women's - * shoes", whereas a query of 'red s' with 'exact-prefix' specified would - * suggest "red shoes". Currently supported values: - * * 'out-of-order' - * * 'exact-prefix' - * Default value: 'exact-prefix'. - * - * Generated from protobuf field string matching_order = 2; - * @param string $var - * @return $this - */ - public function setMatchingOrder($var) - { - GPBUtil::checkString($var, True); - $this->matching_order = $var; - - return $this; - } - - /** - * The maximum number of autocomplete suggestions returned per term. Default - * value is 20. If left unset or set to 0, then will fallback to default - * value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 max_suggestions = 3; - * @return int - */ - public function getMaxSuggestions() - { - return $this->max_suggestions; - } - - /** - * The maximum number of autocomplete suggestions returned per term. Default - * value is 20. If left unset or set to 0, then will fallback to default - * value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 max_suggestions = 3; - * @param int $var - * @return $this - */ - public function setMaxSuggestions($var) - { - GPBUtil::checkInt32($var); - $this->max_suggestions = $var; - - return $this; - } - - /** - * The minimum number of characters needed to be typed in order to get - * suggestions. Default value is 2. If left unset or set to 0, then will - * fallback to default value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 min_prefix_length = 4; - * @return int - */ - public function getMinPrefixLength() - { - return $this->min_prefix_length; - } - - /** - * The minimum number of characters needed to be typed in order to get - * suggestions. Default value is 2. If left unset or set to 0, then will - * fallback to default value. - * Value range is 1 to 20. - * - * Generated from protobuf field int32 min_prefix_length = 4; - * @param int $var - * @return $this - */ - public function setMinPrefixLength($var) - { - GPBUtil::checkInt32($var); - $this->min_prefix_length = $var; - - return $this; - } - - /** - * If set to true, the auto learning function is enabled. Auto learning uses - * user data to generate suggestions using ML techniques. Default value is - * false. Only after enabling auto learning can users use `cloud-retail` - * data in - * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. - * - * Generated from protobuf field bool auto_learning = 11; - * @return bool - */ - public function getAutoLearning() - { - return $this->auto_learning; - } - - /** - * If set to true, the auto learning function is enabled. Auto learning uses - * user data to generate suggestions using ML techniques. Default value is - * false. Only after enabling auto learning can users use `cloud-retail` - * data in - * [CompleteQueryRequest][google.cloud.retail.v2.CompleteQueryRequest]. - * - * Generated from protobuf field bool auto_learning = 11; - * @param bool $var - * @return $this - */ - public function setAutoLearning($var) - { - GPBUtil::checkBool($var); - $this->auto_learning = $var; - - return $this; - } - - /** - * Output only. The source data for the latest import of the autocomplete - * suggestion phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null - */ - public function getSuggestionsInputConfig() - { - return $this->suggestions_input_config; - } - - public function hasSuggestionsInputConfig() - { - return isset($this->suggestions_input_config); - } - - public function clearSuggestionsInputConfig() - { - unset($this->suggestions_input_config); - } - - /** - * Output only. The source data for the latest import of the autocomplete - * suggestion phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var - * @return $this - */ - public function setSuggestionsInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); - $this->suggestions_input_config = $var; - - return $this; - } - - /** - * Output only. Name of the LRO corresponding to the latest suggestion terms - * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API - * method to retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLastSuggestionsImportOperation() - { - return $this->last_suggestions_import_operation; - } - - /** - * Output only. Name of the LRO corresponding to the latest suggestion terms - * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API - * method to retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLastSuggestionsImportOperation($var) - { - GPBUtil::checkString($var, True); - $this->last_suggestions_import_operation = $var; - - return $this; - } - - /** - * Output only. The source data for the latest import of the autocomplete - * denylist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null - */ - public function getDenylistInputConfig() - { - return $this->denylist_input_config; - } - - public function hasDenylistInputConfig() - { - return isset($this->denylist_input_config); - } - - public function clearDenylistInputConfig() - { - unset($this->denylist_input_config); - } - - /** - * Output only. The source data for the latest import of the autocomplete - * denylist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var - * @return $this - */ - public function setDenylistInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); - $this->denylist_input_config = $var; - - return $this; - } - - /** - * Output only. Name of the LRO corresponding to the latest denylist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLastDenylistImportOperation() - { - return $this->last_denylist_import_operation; - } - - /** - * Output only. Name of the LRO corresponding to the latest denylist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLastDenylistImportOperation($var) - { - GPBUtil::checkString($var, True); - $this->last_denylist_import_operation = $var; - - return $this; - } - - /** - * Output only. The source data for the latest import of the autocomplete - * allowlist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|null - */ - public function getAllowlistInputConfig() - { - return $this->allowlist_input_config; - } - - public function hasAllowlistInputConfig() - { - return isset($this->allowlist_input_config); - } - - public function clearAllowlistInputConfig() - { - unset($this->allowlist_input_config); - } - - /** - * Output only. The source data for the latest import of the autocomplete - * allowlist phrases. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var - * @return $this - */ - public function setAllowlistInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); - $this->allowlist_input_config = $var; - - return $this; - } - - /** - * Output only. Name of the LRO corresponding to the latest allowlist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLastAllowlistImportOperation() - { - return $this->last_allowlist_import_operation; - } - - /** - * Output only. Name of the LRO corresponding to the latest allowlist import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. - * - * Generated from protobuf field string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLastAllowlistImportOperation($var) - { - GPBUtil::checkString($var, True); - $this->last_allowlist_import_operation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php deleted file mode 100644 index 6c1c6ccf343..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDataInputConfig.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.retail.v2.CompletionDataInputConfig - */ -class CompletionDataInputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source - * Required. BigQuery input source. - * Add the IAM permission "BigQuery Data Viewer" for - * cloud-retail-customer-data-access@system.gserviceaccount.com before - * using this feature otherwise an error is thrown. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. BigQuery input source. - * Add the IAM permission "BigQuery Data Viewer" for - * cloud-retail-customer-data-access@system.gserviceaccount.com before - * using this feature otherwise an error is thrown. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\BigQuerySource|null - */ - public function getBigQuerySource() - { - return $this->readOneof(1); - } - - public function hasBigQuerySource() - { - return $this->hasOneof(1); - } - - /** - * Required. BigQuery input source. - * Add the IAM permission "BigQuery Data Viewer" for - * cloud-retail-customer-data-access@system.gserviceaccount.com before - * using this feature otherwise an error is thrown. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\BigQuerySource $var - * @return $this - */ - public function setBigQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php deleted file mode 100644 index 34e8ffe98e9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CompletionDetail.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.retail.v2.CompletionDetail - */ -class CompletionDetail extends \Google\Protobuf\Internal\Message -{ - /** - * Completion attribution token in - * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. - * - * Generated from protobuf field string completion_attribution_token = 1; - */ - protected $completion_attribution_token = ''; - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. - * - * Generated from protobuf field string selected_suggestion = 2; - */ - protected $selected_suggestion = ''; - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] - * position, starting from 0. - * - * Generated from protobuf field int32 selected_position = 3; - */ - protected $selected_position = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $completion_attribution_token - * Completion attribution token in - * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. - * @type string $selected_suggestion - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. - * @type int $selected_position - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] - * position, starting from 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Completion attribution token in - * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. - * - * Generated from protobuf field string completion_attribution_token = 1; - * @return string - */ - public function getCompletionAttributionToken() - { - return $this->completion_attribution_token; - } - - /** - * Completion attribution token in - * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. - * - * Generated from protobuf field string completion_attribution_token = 1; - * @param string $var - * @return $this - */ - public function setCompletionAttributionToken($var) - { - GPBUtil::checkString($var, True); - $this->completion_attribution_token = $var; - - return $this; - } - - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. - * - * Generated from protobuf field string selected_suggestion = 2; - * @return string - */ - public function getSelectedSuggestion() - { - return $this->selected_suggestion; - } - - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. - * - * Generated from protobuf field string selected_suggestion = 2; - * @param string $var - * @return $this - */ - public function setSelectedSuggestion($var) - { - GPBUtil::checkString($var, True); - $this->selected_suggestion = $var; - - return $this; - } - - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] - * position, starting from 0. - * - * Generated from protobuf field int32 selected_position = 3; - * @return int - */ - public function getSelectedPosition() - { - return $this->selected_position; - } - - /** - * End user selected - * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] - * position, starting from 0. - * - * Generated from protobuf field int32 selected_position = 3; - * @param int $var - * @return $this - */ - public function setSelectedPosition($var) - { - GPBUtil::checkInt32($var); - $this->selected_position = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php deleted file mode 100644 index 7f735eab09e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.retail.v2.Condition - */ -class Condition extends \Google\Protobuf\Internal\Message -{ - /** - * A list (up to 10 entries) of terms to match the query on. If not - * specified, match all queries. - * If many query terms are specified, the condition - * is matched if any of the terms is a match (i.e. using the OR operator). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; - */ - private $query_terms; - /** - * Range of time(s) specifying when Condition is active. - * Condition true if any time range matches. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; - */ - private $active_time_range; - /** - * Used to support browse uses cases. - * A list (up to 10 entries) of categories or departments. - * The format should be the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * - * Generated from protobuf field repeated string page_categories = 4; - */ - private $page_categories; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $query_terms - * A list (up to 10 entries) of terms to match the query on. If not - * specified, match all queries. - * If many query terms are specified, the condition - * is matched if any of the terms is a match (i.e. using the OR operator). - * @type array<\Google\Cloud\Retail\V2\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $active_time_range - * Range of time(s) specifying when Condition is active. - * Condition true if any time range matches. - * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories - * Used to support browse uses cases. - * A list (up to 10 entries) of categories or departments. - * The format should be the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * A list (up to 10 entries) of terms to match the query on. If not - * specified, match all queries. - * If many query terms are specified, the condition - * is matched if any of the terms is a match (i.e. using the OR operator). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueryTerms() - { - return $this->query_terms; - } - - /** - * A list (up to 10 entries) of terms to match the query on. If not - * specified, match all queries. - * If many query terms are specified, the condition - * is matched if any of the terms is a match (i.e. using the OR operator). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1; - * @param array<\Google\Cloud\Retail\V2\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueryTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Condition\QueryTerm::class); - $this->query_terms = $arr; - - return $this; - } - - /** - * Range of time(s) specifying when Condition is active. - * Condition true if any time range matches. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getActiveTimeRange() - { - return $this->active_time_range; - } - - /** - * Range of time(s) specifying when Condition is active. - * Condition true if any time range matches. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; - * @param array<\Google\Cloud\Retail\V2\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setActiveTimeRange($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Condition\TimeRange::class); - $this->active_time_range = $arr; - - return $this; - } - - /** - * Used to support browse uses cases. - * A list (up to 10 entries) of categories or departments. - * The format should be the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * - * Generated from protobuf field repeated string page_categories = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageCategories() - { - return $this->page_categories; - } - - /** - * Used to support browse uses cases. - * A list (up to 10 entries) of categories or departments. - * The format should be the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * - * Generated from protobuf field repeated string page_categories = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageCategories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->page_categories = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php deleted file mode 100644 index 67dabf7388d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/QueryTerm.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.retail.v2.Condition.QueryTerm - */ -class QueryTerm extends \Google\Protobuf\Internal\Message -{ - /** - * The value of the term to match on. - * Value cannot be empty. - * Value can have at most 3 terms if specified as a partial match. Each - * space separated string is considered as one term. - * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms - * and not allowed for a partial match. - * - * Generated from protobuf field string value = 1; - */ - protected $value = ''; - /** - * Whether this is supposed to be a full or partial match. - * - * Generated from protobuf field bool full_match = 2; - */ - protected $full_match = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $value - * The value of the term to match on. - * Value cannot be empty. - * Value can have at most 3 terms if specified as a partial match. Each - * space separated string is considered as one term. - * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms - * and not allowed for a partial match. - * @type bool $full_match - * Whether this is supposed to be a full or partial match. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The value of the term to match on. - * Value cannot be empty. - * Value can have at most 3 terms if specified as a partial match. Each - * space separated string is considered as one term. - * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms - * and not allowed for a partial match. - * - * Generated from protobuf field string value = 1; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value of the term to match on. - * Value cannot be empty. - * Value can have at most 3 terms if specified as a partial match. Each - * space separated string is considered as one term. - * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms - * and not allowed for a partial match. - * - * Generated from protobuf field string value = 1; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - - /** - * Whether this is supposed to be a full or partial match. - * - * Generated from protobuf field bool full_match = 2; - * @return bool - */ - public function getFullMatch() - { - return $this->full_match; - } - - /** - * Whether this is supposed to be a full or partial match. - * - * Generated from protobuf field bool full_match = 2; - * @param bool $var - * @return $this - */ - public function setFullMatch($var) - { - GPBUtil::checkBool($var); - $this->full_match = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryTerm::class, \Google\Cloud\Retail\V2\Condition_QueryTerm::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php deleted file mode 100644 index 0321302ba94..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Condition/TimeRange.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.retail.v2.Condition.TimeRange - */ -class TimeRange extends \Google\Protobuf\Internal\Message -{ - /** - * Start of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * End of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Start of time range. Range is inclusive. - * @type \Google\Protobuf\Timestamp $end_time - * End of time range. Range is inclusive. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Start of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Start of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * End of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * End of time range. Range is inclusive. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TimeRange::class, \Google\Cloud\Retail\V2\Condition_TimeRange::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php deleted file mode 100644 index 95c0064ea00..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Control.php +++ /dev/null @@ -1,325 +0,0 @@ -google.cloud.retail.v2.Control - */ -class Control extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/controls/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Required. The human readable control display name. Used in Retail UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - /** - * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] - * ids that are associated with this control in the same - * [Catalog][google.cloud.retail.v2.Catalog]. - * Note the association is managed via the - * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output - * only denormalized view. - * - * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $associated_serving_config_ids; - /** - * Required. Immutable. The solution types that the control is used for. - * Currently we support setting only one type of solution at creation time. - * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. - * If no solution type is provided at creation time, will default to - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $solution_types; - /** - * Specifies the use case for the control. - * Affects what condition fields can be set. - * Only settable by search controls. - * Will default to - * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] - * if not specified. Currently only allow one search_solution_use_case per - * control. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; - */ - private $search_solution_use_case; - protected $control; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Rule $rule - * A rule control - a condition-action pair. - * Enacts a set action when the condition is triggered. - * For example: Boost "gShoe" when query full matches "Running Shoes". - * @type string $name - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/controls/*` - * @type string $display_name - * Required. The human readable control display name. Used in Retail UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is thrown. - * @type array|\Google\Protobuf\Internal\RepeatedField $associated_serving_config_ids - * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] - * ids that are associated with this control in the same - * [Catalog][google.cloud.retail.v2.Catalog]. - * Note the association is managed via the - * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output - * only denormalized view. - * @type array|\Google\Protobuf\Internal\RepeatedField $solution_types - * Required. Immutable. The solution types that the control is used for. - * Currently we support setting only one type of solution at creation time. - * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. - * If no solution type is provided at creation time, will default to - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $search_solution_use_case - * Specifies the use case for the control. - * Affects what condition fields can be set. - * Only settable by search controls. - * Will default to - * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] - * if not specified. Currently only allow one search_solution_use_case per - * control. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Control::initOnce(); - parent::__construct($data); - } - - /** - * A rule control - a condition-action pair. - * Enacts a set action when the condition is triggered. - * For example: Boost "gShoe" when query full matches "Running Shoes". - * - * Generated from protobuf field .google.cloud.retail.v2.Rule rule = 4; - * @return \Google\Cloud\Retail\V2\Rule|null - */ - public function getRule() - { - return $this->readOneof(4); - } - - public function hasRule() - { - return $this->hasOneof(4); - } - - /** - * A rule control - a condition-action pair. - * Enacts a set action when the condition is triggered. - * For example: Boost "gShoe" when query full matches "Running Shoes". - * - * Generated from protobuf field .google.cloud.retail.v2.Rule rule = 4; - * @param \Google\Cloud\Retail\V2\Rule $var - * @return $this - */ - public function setRule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/controls/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/controls/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The human readable control display name. Used in Retail UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The human readable control display name. Used in Retail UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] - * ids that are associated with this control in the same - * [Catalog][google.cloud.retail.v2.Catalog]. - * Note the association is managed via the - * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output - * only denormalized view. - * - * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssociatedServingConfigIds() - { - return $this->associated_serving_config_ids; - } - - /** - * Output only. List of [serving config][google.cloud.retail.v2.ServingConfig] - * ids that are associated with this control in the same - * [Catalog][google.cloud.retail.v2.Catalog]. - * Note the association is managed via the - * [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output - * only denormalized view. - * - * Generated from protobuf field repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssociatedServingConfigIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->associated_serving_config_ids = $arr; - - return $this; - } - - /** - * Required. Immutable. The solution types that the control is used for. - * Currently we support setting only one type of solution at creation time. - * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. - * If no solution type is provided at creation time, will default to - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSolutionTypes() - { - return $this->solution_types; - } - - /** - * Required. Immutable. The solution types that the control is used for. - * Currently we support setting only one type of solution at creation time. - * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. - * If no solution type is provided at creation time, will default to - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSolutionTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SolutionType::class); - $this->solution_types = $arr; - - return $this; - } - - /** - * Specifies the use case for the control. - * Affects what condition fields can be set. - * Only settable by search controls. - * Will default to - * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] - * if not specified. Currently only allow one search_solution_use_case per - * control. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSearchSolutionUseCase() - { - return $this->search_solution_use_case; - } - - /** - * Specifies the use case for the control. - * Affects what condition fields can be set. - * Only settable by search controls. - * Will default to - * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] - * if not specified. Currently only allow one search_solution_use_case per - * control. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchSolutionUseCase search_solution_use_case = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSearchSolutionUseCase($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SearchSolutionUseCase::class); - $this->search_solution_use_case = $arr; - - return $this; - } - - /** - * @return string - */ - public function getControl() - { - return $this->whichOneof("control"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php deleted file mode 100644 index 46341e8ca69..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateControlRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.retail.v2.CreateControlRequest - */ -class CreateControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of parent catalog. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Control to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $control = null; - /** - * Required. The ID to use for the Control, which will become the final - * component of the Control's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $control_id = ''; - - /** - * @param string $parent Required. Full resource name of parent catalog. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ControlServiceClient::catalogName()} for help formatting this field. - * @param \Google\Cloud\Retail\V2\Control $control Required. The Control to create. - * @param string $controlId Required. The ID to use for the Control, which will become the final - * component of the Control's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * @return \Google\Cloud\Retail\V2\CreateControlRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Retail\V2\Control $control, string $controlId): self - { - return (new self()) - ->setParent($parent) - ->setControl($control) - ->setControlId($controlId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Full resource name of parent catalog. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type \Google\Cloud\Retail\V2\Control $control - * Required. The Control to create. - * @type string $control_id - * Required. The ID to use for the Control, which will become the final - * component of the Control's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of parent catalog. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. Full resource name of parent catalog. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 Control to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Control|null - */ - public function getControl() - { - return $this->control; - } - - public function hasControl() - { - return isset($this->control); - } - - public function clearControl() - { - unset($this->control); - } - - /** - * Required. The Control to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Control $var - * @return $this - */ - public function setControl($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Control::class); - $this->control = $var; - - return $this; - } - - /** - * Required. The ID to use for the Control, which will become the final - * component of the Control's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getControlId() - { - return $this->control_id; - } - - /** - * Required. The ID to use for the Control, which will become the final - * component of the Control's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setControlId($var) - { - GPBUtil::checkString($var, True); - $this->control_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php deleted file mode 100644 index 861be04c86a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.CreateModelMetadata - */ -class CreateModelMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the model that this create applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - */ - protected $model = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $model - * The resource name of the model that this create applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the model that this create applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * The resource name of the model that this create applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php deleted file mode 100644 index cb224299c9c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateModelRequest.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.retail.v2.CreateModelRequest - */ -class CreateModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource under which to create the model. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The payload of the [Model][google.cloud.retail.v2.Model] to - * create. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $model = null; - /** - * Optional. Whether to run a dry run to validate the request (without - * actually creating the model). - * - * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $dry_run = false; - - /** - * @param string $parent Required. The parent resource under which to create the model. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ModelServiceClient::catalogName()} for help formatting this field. - * @param \Google\Cloud\Retail\V2\Model $model Required. The payload of the [Model][google.cloud.retail.v2.Model] to - * create. - * - * @return \Google\Cloud\Retail\V2\CreateModelRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Retail\V2\Model $model): self - { - return (new self()) - ->setParent($parent) - ->setModel($model); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource under which to create the model. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type \Google\Cloud\Retail\V2\Model $model - * Required. The payload of the [Model][google.cloud.retail.v2.Model] to - * create. - * @type bool $dry_run - * Optional. Whether to run a dry run to validate the request (without - * actually creating the model). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource under which to create the model. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 under which to create the model. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 payload of the [Model][google.cloud.retail.v2.Model] to - * create. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Model|null - */ - public function getModel() - { - return $this->model; - } - - public function hasModel() - { - return isset($this->model); - } - - public function clearModel() - { - unset($this->model); - } - - /** - * Required. The payload of the [Model][google.cloud.retail.v2.Model] to - * create. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Model $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model::class); - $this->model = $var; - - return $this; - } - - /** - * Optional. Whether to run a dry run to validate the request (without - * actually creating the model). - * - * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDryRun() - { - return $this->dry_run; - } - - /** - * Optional. Whether to run a dry run to validate the request (without - * actually creating the model). - * - * Generated from protobuf field bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDryRun($var) - { - GPBUtil::checkBool($var); - $this->dry_run = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php deleted file mode 100644 index 5da8a9affe8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateProductRequest.php +++ /dev/null @@ -1,228 +0,0 @@ -google.cloud.retail.v2.CreateProductRequest - */ -class CreateProductRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The [Product][google.cloud.retail.v2.Product] to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $product = null; - /** - * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], - * which will become the final component of the - * [Product.name][google.cloud.retail.v2.Product.name]. - * If the caller does not have permission to create the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * This field must be unique among all - * [Product][google.cloud.retail.v2.Product]s with the same - * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an - * ALREADY_EXISTS error is returned. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $product_id = ''; - - /** - * @param string $parent Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. Please see - * {@see ProductServiceClient::branchName()} for help formatting this field. - * @param \Google\Cloud\Retail\V2\Product $product Required. The [Product][google.cloud.retail.v2.Product] to create. - * @param string $productId Required. The ID to use for the [Product][google.cloud.retail.v2.Product], - * which will become the final component of the - * [Product.name][google.cloud.retail.v2.Product.name]. - * - * If the caller does not have permission to create the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * This field must be unique among all - * [Product][google.cloud.retail.v2.Product]s with the same - * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an - * ALREADY_EXISTS error is returned. - * - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * @return \Google\Cloud\Retail\V2\CreateProductRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Retail\V2\Product $product, string $productId): self - { - return (new self()) - ->setParent($parent) - ->setProduct($product) - ->setProductId($productId); - } - - /** - * 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/branches/default_branch`. - * @type \Google\Cloud\Retail\V2\Product $product - * Required. The [Product][google.cloud.retail.v2.Product] to create. - * @type string $product_id - * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], - * which will become the final component of the - * [Product.name][google.cloud.retail.v2.Product.name]. - * If the caller does not have permission to create the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * This field must be unique among all - * [Product][google.cloud.retail.v2.Product]s with the same - * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an - * ALREADY_EXISTS error is returned. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. - * - * 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/branches/default_branch`. - * - * 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 [Product][google.cloud.retail.v2.Product] to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Product|null - */ - public function getProduct() - { - return $this->product; - } - - public function hasProduct() - { - return isset($this->product); - } - - public function clearProduct() - { - unset($this->product); - } - - /** - * Required. The [Product][google.cloud.retail.v2.Product] to create. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Product $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); - $this->product = $var; - - return $this; - } - - /** - * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], - * which will become the final component of the - * [Product.name][google.cloud.retail.v2.Product.name]. - * If the caller does not have permission to create the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * This field must be unique among all - * [Product][google.cloud.retail.v2.Product]s with the same - * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an - * ALREADY_EXISTS error is returned. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProductId() - { - return $this->product_id; - } - - /** - * Required. The ID to use for the [Product][google.cloud.retail.v2.Product], - * which will become the final component of the - * [Product.name][google.cloud.retail.v2.Product.name]. - * If the caller does not have permission to create the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * This field must be unique among all - * [Product][google.cloud.retail.v2.Product]s with the same - * [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an - * ALREADY_EXISTS error is returned. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProductId($var) - { - GPBUtil::checkString($var, True); - $this->product_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php deleted file mode 100644 index a1dcf87819f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CreateServingConfigRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.retail.v2.CreateServingConfigRequest - */ -class CreateServingConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of parent. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The ServingConfig to create. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $serving_config = null; - /** - * Required. The ID to use for the ServingConfig, which will become the final - * component of the ServingConfig's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $serving_config_id = ''; - - /** - * @param string $parent Required. Full resource name of parent. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ServingConfigServiceClient::catalogName()} for help formatting this field. - * @param \Google\Cloud\Retail\V2\ServingConfig $servingConfig Required. The ServingConfig to create. - * @param string $servingConfigId Required. The ID to use for the ServingConfig, which will become the final - * component of the ServingConfig's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * @return \Google\Cloud\Retail\V2\CreateServingConfigRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Retail\V2\ServingConfig $servingConfig, string $servingConfigId): self - { - return (new self()) - ->setParent($parent) - ->setServingConfig($servingConfig) - ->setServingConfigId($servingConfigId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Full resource name of parent. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type \Google\Cloud\Retail\V2\ServingConfig $serving_config - * Required. The ServingConfig to create. - * @type string $serving_config_id - * Required. The ID to use for the ServingConfig, which will become the final - * component of the ServingConfig's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of parent. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. Full resource name of parent. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 ServingConfig to create. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\ServingConfig|null - */ - public function getServingConfig() - { - return $this->serving_config; - } - - public function hasServingConfig() - { - return isset($this->serving_config); - } - - public function clearServingConfig() - { - unset($this->serving_config); - } - - /** - * Required. The ServingConfig to create. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\ServingConfig $var - * @return $this - */ - public function setServingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ServingConfig::class); - $this->serving_config = $var; - - return $this; - } - - /** - * Required. The ID to use for the ServingConfig, which will become the final - * component of the ServingConfig's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServingConfigId() - { - return $this->serving_config_id; - } - - /** - * Required. The ID to use for the ServingConfig, which will become the final - * component of the ServingConfig's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-_/. - * - * Generated from protobuf field string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServingConfigId($var) - { - GPBUtil::checkString($var, True); - $this->serving_config_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php deleted file mode 100644 index 729f9371c9b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/CustomAttribute.php +++ /dev/null @@ -1,340 +0,0 @@ -google.cloud.retail.v2.CustomAttribute - */ -class CustomAttribute extends \Google\Protobuf\Internal\Message -{ - /** - * The textual values of this custom attribute. For example, `["yellow", - * "green"]` when the key is "color". - * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string text = 1; - */ - private $text; - /** - * The numerical values of this custom attribute. For example, `[2.3, 15.4]` - * when the key is "lengths_cm". - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated double numbers = 2; - */ - private $numbers; - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is - * set. Otherwise, a INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; - * @deprecated - */ - protected $searchable = null; - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are indexed, so that they can be filtered, - * faceted or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * for more details. - * - * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; - * @deprecated - */ - protected $indexable = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $text - * The textual values of this custom attribute. For example, `["yellow", - * "green"]` when the key is "color". - * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $numbers - * The numerical values of this custom attribute. For example, `[2.3, 15.4]` - * when the key is "lengths_cm". - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * @type bool $searchable - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is - * set. Otherwise, a INVALID_ARGUMENT error is returned. - * @type bool $indexable - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are indexed, so that they can be filtered, - * faceted or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * for more details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The textual values of this custom attribute. For example, `["yellow", - * "green"]` when the key is "color". - * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string text = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getText() - { - return $this->text; - } - - /** - * The textual values of this custom attribute. For example, `["yellow", - * "green"]` when the key is "color". - * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string text = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setText($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->text = $arr; - - return $this; - } - - /** - * The numerical values of this custom attribute. For example, `[2.3, 15.4]` - * when the key is "lengths_cm". - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated double numbers = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNumbers() - { - return $this->numbers; - } - - /** - * The numerical values of this custom attribute. For example, `[2.3, 15.4]` - * when the key is "lengths_cm". - * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or - * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated double numbers = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNumbers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); - $this->numbers = $arr; - - return $this; - } - - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is - * set. Otherwise, a INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getSearchable() - { - @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); - return isset($this->searchable) ? $this->searchable : false; - } - - public function hasSearchable() - { - @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); - return isset($this->searchable); - } - - public function clearSearchable() - { - @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); - unset($this->searchable); - } - - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are searchable by text queries in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is - * set. Otherwise, a INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field optional bool searchable = 3 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setSearchable($var) - { - @trigger_error('searchable is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->searchable = $var; - - return $this; - } - - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are indexed, so that they can be filtered, - * faceted or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * for more details. - * - * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getIndexable() - { - @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); - return isset($this->indexable) ? $this->indexable : false; - } - - public function hasIndexable() - { - @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); - return isset($this->indexable); - } - - public function clearIndexable() - { - @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); - unset($this->indexable); - } - - /** - * This field is normally ignored unless - * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] - * of the [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated - * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - * attribute configuration, see [Configuration - * modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - * If true, custom attribute values are indexed, so that they can be filtered, - * faceted or boosted in - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * for more details. - * - * Generated from protobuf field optional bool indexable = 4 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setIndexable($var) - { - @trigger_error('indexable is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->indexable = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php deleted file mode 100644 index 3d0df8b6b5b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteControlRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.DeleteControlRequest - */ -class DeleteControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * Please see {@see ControlServiceClient::controlName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\DeleteControlRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php deleted file mode 100644 index c0d11278c52..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteModelRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.retail.v2.DeleteModelRequest - */ -class DeleteModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * Please see {@see ModelServiceClient::modelName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\DeleteModelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The resource name of the [Model][google.cloud.retail.v2.Model] to - * delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php deleted file mode 100644 index 2108d81c180..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteProductRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.retail.v2.DeleteProductRequest - */ -class DeleteProductRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to delete the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, - * a NOT_FOUND error is returned. - * The [Product][google.cloud.retail.v2.Product] to delete can neither be a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] member nor a - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] with more than one - * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an - * INVALID_ARGUMENT error is returned. - * All inventory information for the named - * [Product][google.cloud.retail.v2.Product] will be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to delete the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, - * a NOT_FOUND error is returned. - * - * The [Product][google.cloud.retail.v2.Product] to delete can neither be a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] member nor a - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] with more than one - * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * All inventory information for the named - * [Product][google.cloud.retail.v2.Product] will be deleted. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\DeleteProductRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to delete the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, - * a NOT_FOUND error is returned. - * The [Product][google.cloud.retail.v2.Product] to delete can neither be a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] member nor a - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] with more than one - * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an - * INVALID_ARGUMENT error is returned. - * All inventory information for the named - * [Product][google.cloud.retail.v2.Product] will be deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to delete the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, - * a NOT_FOUND error is returned. - * The [Product][google.cloud.retail.v2.Product] to delete can neither be a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] member nor a - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] with more than one - * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an - * INVALID_ARGUMENT error is returned. - * All inventory information for the named - * [Product][google.cloud.retail.v2.Product] will be deleted. - * - * 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 [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to delete the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, - * a NOT_FOUND error is returned. - * The [Product][google.cloud.retail.v2.Product] to delete can neither be a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] member nor a - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] with more than one - * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an - * INVALID_ARGUMENT error is returned. - * All inventory information for the named - * [Product][google.cloud.retail.v2.Product] will be deleted. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php deleted file mode 100644 index 4cf751c33d1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/DeleteServingConfigRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.DeleteServingConfigRequest - */ -class DeleteServingConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ServingConfig to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the ServingConfig to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\DeleteServingConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ServingConfig to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ServingConfig to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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. The resource name of the ServingConfig to delete. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php deleted file mode 100644 index bcc68426616..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.retail.v2.ExperimentInfo - */ -class ExperimentInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified resource name of the experiment that provides the - * serving config under test, should an active experiment exist. For example: - * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` - * - * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { - */ - protected $experiment = ''; - protected $experiment_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment $serving_config_experiment - * A/B test between existing Cloud Retail Search - * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. - * @type string $experiment - * The fully qualified resource name of the experiment that provides the - * serving config under test, should an active experiment exist. For example: - * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * A/B test between existing Cloud Retail Search - * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. - * - * Generated from protobuf field .google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment serving_config_experiment = 2; - * @return \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment|null - */ - public function getServingConfigExperiment() - { - return $this->readOneof(2); - } - - public function hasServingConfigExperiment() - { - return $this->hasOneof(2); - } - - /** - * A/B test between existing Cloud Retail Search - * [ServingConfig][google.cloud.retail.v2.ServingConfig]s. - * - * Generated from protobuf field .google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment serving_config_experiment = 2; - * @param \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment $var - * @return $this - */ - public function setServingConfigExperiment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ExperimentInfo\ServingConfigExperiment::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The fully qualified resource name of the experiment that provides the - * serving config under test, should an active experiment exist. For example: - * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` - * - * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getExperiment() - { - return $this->experiment; - } - - /** - * The fully qualified resource name of the experiment that provides the - * serving config under test, should an active experiment exist. For example: - * `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` - * - * Generated from protobuf field string experiment = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setExperiment($var) - { - GPBUtil::checkString($var, True); - $this->experiment = $var; - - return $this; - } - - /** - * @return string - */ - public function getExperimentMetadata() - { - return $this->whichOneof("experiment_metadata"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php deleted file mode 100644 index f4415879967..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExperimentInfo/ServingConfigExperiment.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment - */ -class ServingConfigExperiment extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified resource name of the original - * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] - * in the search request prior to reassignment by experiment API. For - * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { - */ - protected $original_serving_config = ''; - /** - * The fully qualified resource name of the serving config - * [Experiment.VariantArm.serving_config_id][] responsible for generating - * the search response. For example: - * `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { - */ - protected $experiment_serving_config = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $original_serving_config - * The fully qualified resource name of the original - * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] - * in the search request prior to reassignment by experiment API. For - * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * @type string $experiment_serving_config - * The fully qualified resource name of the serving config - * [Experiment.VariantArm.serving_config_id][] responsible for generating - * the search response. For example: - * `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified resource name of the original - * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] - * in the search request prior to reassignment by experiment API. For - * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getOriginalServingConfig() - { - return $this->original_serving_config; - } - - /** - * The fully qualified resource name of the original - * [SearchRequest.placement][google.cloud.retail.v2.SearchRequest.placement] - * in the search request prior to reassignment by experiment API. For - * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string original_serving_config = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setOriginalServingConfig($var) - { - GPBUtil::checkString($var, True); - $this->original_serving_config = $var; - - return $this; - } - - /** - * The fully qualified resource name of the serving config - * [Experiment.VariantArm.serving_config_id][] responsible for generating - * the search response. For example: - * `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getExperimentServingConfig() - { - return $this->experiment_serving_config; - } - - /** - * The fully qualified resource name of the serving config - * [Experiment.VariantArm.serving_config_id][] responsible for generating - * the search response. For example: - * `projects/*/locations/*/catalogs/*/servingConfigs/*`. - * - * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setExperimentServingConfig($var) - { - GPBUtil::checkString($var, True); - $this->experiment_serving_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ServingConfigExperiment::class, \Google\Cloud\Retail\V2\ExperimentInfo_ServingConfigExperiment::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php deleted file mode 100644 index fe27a13b98d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.retail.v2.ExportAnalyticsMetricsRequest - */ -class ExportAnalyticsMetricsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of the parent catalog. - * Expected format: `projects/*/locations/*/catalogs/*` - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog = ''; - /** - * Required. The output location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_config = null; - /** - * A filtering expression to specify restrictions on returned metrics. - * The expression is a sequence of terms. Each term applies a restriction to - * the returned metrics. Use this expression to restrict results to a - * specific time range. - * Currently we expect only one types of fields: - * * `timestamp`: This can be specified twice, once with a - * less than operator and once with a greater than operator. The - * `timestamp` restriction should result in one, contiguous, valid, - * `timestamp` range. - * Some examples of valid filters expressions: - * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - * timestamp < "2012-04-23T18:30:43.511Z"` - * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - * - * Generated from protobuf field string filter = 3; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Required. Full resource name of the parent catalog. - * Expected format: `projects/*/locations/*/catalogs/*` - * @type \Google\Cloud\Retail\V2\OutputConfig $output_config - * Required. The output location of the data. - * @type string $filter - * A filtering expression to specify restrictions on returned metrics. - * The expression is a sequence of terms. Each term applies a restriction to - * the returned metrics. Use this expression to restrict results to a - * specific time range. - * Currently we expect only one types of fields: - * * `timestamp`: This can be specified twice, once with a - * less than operator and once with a greater than operator. The - * `timestamp` restriction should result in one, contiguous, valid, - * `timestamp` range. - * Some examples of valid filters expressions: - * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - * timestamp < "2012-04-23T18:30:43.511Z"` - * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of the parent catalog. - * Expected format: `projects/*/locations/*/catalogs/*` - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Required. Full resource name of the parent catalog. - * Expected format: `projects/*/locations/*/catalogs/*` - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - - /** - * Required. The output location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\OutputConfig|null - */ - public function getOutputConfig() - { - return $this->output_config; - } - - public function hasOutputConfig() - { - return isset($this->output_config); - } - - public function clearOutputConfig() - { - unset($this->output_config); - } - - /** - * Required. The output location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\OutputConfig $var - * @return $this - */ - public function setOutputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig::class); - $this->output_config = $var; - - return $this; - } - - /** - * A filtering expression to specify restrictions on returned metrics. - * The expression is a sequence of terms. Each term applies a restriction to - * the returned metrics. Use this expression to restrict results to a - * specific time range. - * Currently we expect only one types of fields: - * * `timestamp`: This can be specified twice, once with a - * less than operator and once with a greater than operator. The - * `timestamp` restriction should result in one, contiguous, valid, - * `timestamp` range. - * Some examples of valid filters expressions: - * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - * timestamp < "2012-04-23T18:30:43.511Z"` - * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - * - * Generated from protobuf field string filter = 3; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filtering expression to specify restrictions on returned metrics. - * The expression is a sequence of terms. Each term applies a restriction to - * the returned metrics. Use this expression to restrict results to a - * specific time range. - * Currently we expect only one types of fields: - * * `timestamp`: This can be specified twice, once with a - * less than operator and once with a greater than operator. The - * `timestamp` restriction should result in one, contiguous, valid, - * `timestamp` range. - * Some examples of valid filters expressions: - * * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - * timestamp < "2012-04-23T18:30:43.511Z"` - * * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - * - * Generated from protobuf field string filter = 3; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php deleted file mode 100644 index 83a6f850ab7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportAnalyticsMetricsResponse.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.retail.v2.ExportAnalyticsMetricsResponse - */ -class ExportAnalyticsMetricsResponse 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; - /** - * This field is never set. - * - * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; - */ - protected $errors_config = null; - /** - * Output result indicating where the data were exported to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; - */ - protected $output_result = 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\Retail\V2\ExportErrorsConfig $errors_config - * This field is never set. - * @type \Google\Cloud\Retail\V2\OutputResult $output_result - * Output result indicating where the data were exported to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::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; - } - - /** - * This field is never set. - * - * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; - * @return \Google\Cloud\Retail\V2\ExportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * This field is never set. - * - * Generated from protobuf field .google.cloud.retail.v2.ExportErrorsConfig errors_config = 2; - * @param \Google\Cloud\Retail\V2\ExportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ExportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - - /** - * Output result indicating where the data were exported to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; - * @return \Google\Cloud\Retail\V2\OutputResult|null - */ - public function getOutputResult() - { - return $this->output_result; - } - - public function hasOutputResult() - { - return isset($this->output_result); - } - - public function clearOutputResult() - { - unset($this->output_result); - } - - /** - * Output result indicating where the data were exported to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputResult output_result = 3; - * @param \Google\Cloud\Retail\V2\OutputResult $var - * @return $this - */ - public function setOutputResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputResult::class); - $this->output_result = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php deleted file mode 100644 index 157be71516b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportErrorsConfig.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.retail.v2.ExportErrorsConfig - */ -class ExportErrorsConfig 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. Export 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\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage path for import errors. This must be an empty, - * existing Cloud Storage bucket. Export 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. Export 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php deleted file mode 100644 index 2eeb972c6c1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ExportMetadata.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.retail.v2.ExportMetadata - */ -class ExportMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Operation create time. - * @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\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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 = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $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 = 2; - * @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 = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php deleted file mode 100644 index d1aa1982708..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/FulfillmentInfo.php +++ /dev/null @@ -1,190 +0,0 @@ -google.cloud.retail.v2.FulfillmentInfo - */ -class FulfillmentInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The fulfillment type, including commonly used types (such as pickup in - * store and same day delivery), and custom types. Customers have to map - * custom types to their display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string type = 1; - */ - protected $type = ''; - /** - * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such - * as the store IDs for - * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] - * or the region IDs for - * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. - * A maximum of 3000 values are allowed. Each value must be a string with a - * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such - * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string place_ids = 2; - */ - private $place_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $type - * The fulfillment type, including commonly used types (such as pickup in - * store and same day delivery), and custom types. Customers have to map - * custom types to their display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids - * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such - * as the store IDs for - * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] - * or the region IDs for - * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. - * A maximum of 3000 values are allowed. Each value must be a string with a - * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such - * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The fulfillment type, including commonly used types (such as pickup in - * store and same day delivery), and custom types. Customers have to map - * custom types to their display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The fulfillment type, including commonly used types (such as pickup in - * store and same day delivery), and custom types. Customers have to map - * custom types to their display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string type = 1; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such - * as the store IDs for - * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] - * or the region IDs for - * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. - * A maximum of 3000 values are allowed. Each value must be a string with a - * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such - * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string place_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPlaceIds() - { - return $this->place_ids; - } - - /** - * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such - * as the store IDs for - * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type] - * or the region IDs for - * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type]. - * A maximum of 3000 values are allowed. Each value must be a string with a - * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such - * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string place_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPlaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->place_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php deleted file mode 100644 index 98715d2fa04..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsOutputResult.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.retail.v2.GcsOutputResult - */ -class GcsOutputResult extends \Google\Protobuf\Internal\Message -{ - /** - * The uri of Gcs output - * - * Generated from protobuf field string output_uri = 1; - */ - protected $output_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $output_uri - * The uri of Gcs output - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * The uri of Gcs output - * - * Generated from protobuf field string output_uri = 1; - * @return string - */ - public function getOutputUri() - { - return $this->output_uri; - } - - /** - * The uri of Gcs output - * - * Generated from protobuf field string output_uri = 1; - * @param string $var - * @return $this - */ - public function setOutputUri($var) - { - GPBUtil::checkString($var, True); - $this->output_uri = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php deleted file mode 100644 index 54ca3742fb9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GcsSource.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.retail.v2.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 product - * information](https://cloud.google.com/retail/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; - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719. - * Supported values for control imports: - * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] - * per line. - * Supported values for catalog attribute imports: - * * `catalog_attribute` (default): One CSV - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. - * - * Generated from protobuf field string data_schema = 2; - */ - protected $data_schema = ''; - - /** - * 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 product - * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) - * for the expected file format and setup instructions. - * @type string $data_schema - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719. - * Supported values for control imports: - * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] - * per line. - * Supported values for catalog attribute imports: - * * `catalog_attribute` (default): One CSV - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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 product - * information](https://cloud.google.com/retail/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 product - * information](https://cloud.google.com/retail/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; - } - - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719. - * Supported values for control imports: - * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] - * per line. - * Supported values for catalog attribute imports: - * * `catalog_attribute` (default): One CSV - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. - * - * Generated from protobuf field string data_schema = 2; - * @return string - */ - public function getDataSchema() - { - return $this->data_schema; - } - - /** - * The schema to use when parsing the data from the source. - * Supported values for product imports: - * * `product` (default): One JSON [Product][google.cloud.retail.v2.Product] - * per line. Each product must - * have a valid [Product.id][google.cloud.retail.v2.Product.id]. - * * `product_merchant_center`: See [Importing catalog data from Merchant - * Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - * Supported values for user events imports: - * * `user_event` (default): One JSON - * [UserEvent][google.cloud.retail.v2.UserEvent] per line. - * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719. - * Supported values for control imports: - * * `control` (default): One JSON [Control][google.cloud.retail.v2.Control] - * per line. - * Supported values for catalog attribute imports: - * * `catalog_attribute` (default): One CSV - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] per line. - * - * Generated from protobuf field string data_schema = 2; - * @param string $var - * @return $this - */ - public function setDataSchema($var) - { - GPBUtil::checkString($var, True); - $this->data_schema = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php deleted file mode 100644 index 3735bded7aa..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionConfig.php +++ /dev/null @@ -1,283 +0,0 @@ -google.cloud.retail.v2.GenerativeQuestionConfig - */ -class GenerativeQuestionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name of the catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog = ''; - /** - * Required. The facet to which the question is associated. - * - * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $facet = ''; - /** - * Output only. The LLM generated question. - * - * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generated_question = ''; - /** - * Optional. The question that will be used at serving time. - * Question can have a max length of 300 bytes. - * When not populated, generated_question should be used. - * - * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $final_question = ''; - /** - * Output only. Values that can be used to answer the question. - * - * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $example_values; - /** - * Output only. The ratio of how often a question was asked. - * - * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $frequency = 0.0; - /** - * Optional. Whether the question is asked at serving time. - * - * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allowed_in_conversation = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Required. Resource name of the catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * @type string $facet - * Required. The facet to which the question is associated. - * @type string $generated_question - * Output only. The LLM generated question. - * @type string $final_question - * Optional. The question that will be used at serving time. - * Question can have a max length of 300 bytes. - * When not populated, generated_question should be used. - * @type array|\Google\Protobuf\Internal\RepeatedField $example_values - * Output only. Values that can be used to answer the question. - * @type float $frequency - * Output only. The ratio of how often a question was asked. - * @type bool $allowed_in_conversation - * Optional. Whether the question is asked at serving time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Required. Resource name of the catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - - /** - * Required. The facet to which the question is associated. - * - * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFacet() - { - return $this->facet; - } - - /** - * Required. The facet to which the question is associated. - * - * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFacet($var) - { - GPBUtil::checkString($var, True); - $this->facet = $var; - - return $this; - } - - /** - * Output only. The LLM generated question. - * - * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getGeneratedQuestion() - { - return $this->generated_question; - } - - /** - * Output only. The LLM generated question. - * - * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setGeneratedQuestion($var) - { - GPBUtil::checkString($var, True); - $this->generated_question = $var; - - return $this; - } - - /** - * Optional. The question that will be used at serving time. - * Question can have a max length of 300 bytes. - * When not populated, generated_question should be used. - * - * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFinalQuestion() - { - return $this->final_question; - } - - /** - * Optional. The question that will be used at serving time. - * Question can have a max length of 300 bytes. - * When not populated, generated_question should be used. - * - * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFinalQuestion($var) - { - GPBUtil::checkString($var, True); - $this->final_question = $var; - - return $this; - } - - /** - * Output only. Values that can be used to answer the question. - * - * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExampleValues() - { - return $this->example_values; - } - - /** - * Output only. Values that can be used to answer the question. - * - * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExampleValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->example_values = $arr; - - return $this; - } - - /** - * Output only. The ratio of how often a question was asked. - * - * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getFrequency() - { - return $this->frequency; - } - - /** - * Output only. The ratio of how often a question was asked. - * - * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setFrequency($var) - { - GPBUtil::checkFloat($var); - $this->frequency = $var; - - return $this; - } - - /** - * Optional. Whether the question is asked at serving time. - * - * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowedInConversation() - { - return $this->allowed_in_conversation; - } - - /** - * Optional. Whether the question is asked at serving time. - * - * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowedInConversation($var) - { - GPBUtil::checkBool($var); - $this->allowed_in_conversation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php deleted file mode 100644 index a2efd07cd0b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GenerativeQuestionsFeatureConfig.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.retail.v2.GenerativeQuestionsFeatureConfig - */ -class GenerativeQuestionsFeatureConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name of the affected catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog = ''; - /** - * Optional. Determines whether questions will be used at serving time. - * Note: This feature cannot be enabled until initial data requirements are - * satisfied. - * - * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $feature_enabled = false; - /** - * Optional. Minimum number of products in the response to trigger follow-up - * questions. Value must be 0 or positive. - * - * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $minimum_products = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Required. Resource name of the affected catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * @type bool $feature_enabled - * Optional. Determines whether questions will be used at serving time. - * Note: This feature cannot be enabled until initial data requirements are - * satisfied. - * @type int $minimum_products - * Optional. Minimum number of products in the response to trigger follow-up - * questions. Value must be 0 or positive. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the affected catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Required. Resource name of the affected catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - - /** - * Optional. Determines whether questions will be used at serving time. - * Note: This feature cannot be enabled until initial data requirements are - * satisfied. - * - * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getFeatureEnabled() - { - return $this->feature_enabled; - } - - /** - * Optional. Determines whether questions will be used at serving time. - * Note: This feature cannot be enabled until initial data requirements are - * satisfied. - * - * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setFeatureEnabled($var) - { - GPBUtil::checkBool($var); - $this->feature_enabled = $var; - - return $this; - } - - /** - * Optional. Minimum number of products in the response to trigger follow-up - * questions. Value must be 0 or positive. - * - * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMinimumProducts() - { - return $this->minimum_products; - } - - /** - * Optional. Minimum number of products in the response to trigger follow-up - * questions. Value must be 0 or positive. - * - * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMinimumProducts($var) - { - GPBUtil::checkInt32($var); - $this->minimum_products = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php deleted file mode 100644 index a896e48b57d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetAttributesConfigRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.retail.v2.GetAttributesConfigRequest - */ -class GetAttributesConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * Please see {@see CatalogServiceClient::attributesConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetAttributesConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * 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 AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php deleted file mode 100644 index c72abb70dfe..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetCompletionConfigRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.retail.v2.GetCompletionConfigRequest - */ -class GetCompletionConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full CompletionConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Full CompletionConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - * Please see {@see CatalogServiceClient::completionConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetCompletionConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full CompletionConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full CompletionConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - * - * 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 CompletionConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php deleted file mode 100644 index 6cb3a8650e8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetControlRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.GetControlRequest - */ -class GetControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * Please see {@see ControlServiceClient::controlName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetControlRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php deleted file mode 100644 index fcecd2fdd1d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.retail.v2.GetDefaultBranchRequest - */ -class GetDefaultBranchRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - */ - protected $catalog = ''; - - /** - * @param string $catalog The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * @return \Google\Cloud\Retail\V2\GetDefaultBranchRequest - * - * @experimental - */ - public static function build(string $catalog): self - { - return (new self()) - ->setCatalog($catalog); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php deleted file mode 100644 index 0158f17088b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetDefaultBranchResponse.php +++ /dev/null @@ -1,154 +0,0 @@ -google.cloud.retail.v2.GetDefaultBranchResponse - */ -class GetDefaultBranchResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Full resource name of the branch id currently set as default branch. - * - * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { - */ - protected $branch = ''; - /** - * The time when this branch is set to default. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; - */ - protected $set_time = null; - /** - * This corresponds to - * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] - * field, when this branch was set as default. - * - * Generated from protobuf field string note = 3; - */ - protected $note = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $branch - * Full resource name of the branch id currently set as default branch. - * @type \Google\Protobuf\Timestamp $set_time - * The time when this branch is set to default. - * @type string $note - * This corresponds to - * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] - * field, when this branch was set as default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Full resource name of the branch id currently set as default branch. - * - * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getBranch() - { - return $this->branch; - } - - /** - * Full resource name of the branch id currently set as default branch. - * - * Generated from protobuf field string branch = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->branch = $var; - - return $this; - } - - /** - * The time when this branch is set to default. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getSetTime() - { - return $this->set_time; - } - - public function hasSetTime() - { - return isset($this->set_time); - } - - public function clearSetTime() - { - unset($this->set_time); - } - - /** - * The time when this branch is set to default. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSetTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->set_time = $var; - - return $this; - } - - /** - * This corresponds to - * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] - * field, when this branch was set as default. - * - * Generated from protobuf field string note = 3; - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * This corresponds to - * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note] - * field, when this branch was set as default. - * - * Generated from protobuf field string note = 3; - * @param string $var - * @return $this - */ - public function setNote($var) - { - GPBUtil::checkString($var, True); - $this->note = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php deleted file mode 100644 index 3187270c7c1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetGenerativeQuestionsFeatureConfigRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest - */ -class GetGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $catalog = ''; - - /** - * @param string $catalog Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetGenerativeQuestionsFeatureConfigRequest - * - * @experimental - */ - public static function build(string $catalog): self - { - return (new self()) - ->setCatalog($catalog); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php deleted file mode 100644 index fc92f0dfca3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetModelRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.retail.v2.GetModelRequest - */ -class GetModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - * Please see {@see ModelServiceClient::modelName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetModelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [Model][google.cloud.retail.v2.Model] to - * get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_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. The resource name of the [Model][google.cloud.retail.v2.Model] to - * get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php deleted file mode 100644 index 97de4c43c47..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetProductRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.retail.v2.GetProductRequest - */ -class GetProductRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the requested [Product][google.cloud.retail.v2.Product] does not exist, - * a NOT_FOUND error is returned. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * If the requested [Product][google.cloud.retail.v2.Product] does not exist, - * a NOT_FOUND error is returned. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetProductRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the requested [Product][google.cloud.retail.v2.Product] does not exist, - * a NOT_FOUND error is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the requested [Product][google.cloud.retail.v2.Product] does not exist, - * a NOT_FOUND error is returned. - * - * 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 [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the requested [Product][google.cloud.retail.v2.Product] does not exist, - * a NOT_FOUND error is returned. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php deleted file mode 100644 index 907764e94dd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/GetServingConfigRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.GetServingConfigRequest - */ -class GetServingConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ServingConfig to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the ServingConfig to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\GetServingConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ServingConfig to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ServingConfig to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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. The resource name of the ServingConfig to get. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php deleted file mode 100644 index f15550d0855..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Image.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.retail.v2.Image - */ -class Image extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI of the image. - * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - /** - * Height of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 height = 2; - */ - protected $height = 0; - /** - * Width of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 width = 3; - */ - protected $width = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI of the image. - * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * @type int $height - * Height of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * @type int $width - * Width of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI of the image. - * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI of the image. - * This field must be a valid UTF-8 encoded URI with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * 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; - } - - /** - * Height of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 height = 2; - * @return int - */ - public function getHeight() - { - return $this->height; - } - - /** - * Height of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 height = 2; - * @param int $var - * @return $this - */ - public function setHeight($var) - { - GPBUtil::checkInt32($var); - $this->height = $var; - - return $this; - } - - /** - * Width of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 width = 3; - * @return int - */ - public function getWidth() - { - return $this->width; - } - - /** - * Width of the image in number of pixels. - * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 width = 3; - * @param int $var - * @return $this - */ - public function setWidth($var) - { - GPBUtil::checkInt32($var); - $this->width = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php deleted file mode 100644 index c7530e9863e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.retail.v2.ImportCompletionDataRequest - */ -class ImportCompletionDataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The catalog which the suggestions dataset belongs to. - * Format: `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 = ''; - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 3; - */ - protected $notification_pubsub_topic = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The catalog which the suggestions dataset belongs to. - * Format: `projects/1234/locations/global/catalogs/default_catalog`. - * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $input_config - * Required. The desired input location of the data. - * @type string $notification_pubsub_topic - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The catalog which the suggestions dataset belongs to. - * Format: `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. The catalog which the suggestions dataset belongs to. - * Format: `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; - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\CompletionDataInputConfig|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.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\CompletionDataInputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDataInputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 3; - * @return string - */ - public function getNotificationPubsubTopic() - { - return $this->notification_pubsub_topic; - } - - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 3; - * @param string $var - * @return $this - */ - public function setNotificationPubsubTopic($var) - { - GPBUtil::checkString($var, True); - $this->notification_pubsub_topic = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php deleted file mode 100644 index 10a922238dd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportCompletionDataResponse.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.retail.v2.ImportCompletionDataResponse - */ -class ImportCompletionDataResponse 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; - - /** - * 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. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php deleted file mode 100644 index 313d0176838..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportErrorsConfig.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.retail.v2.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 prefix for import errors. This must be an empty, - * existing Cloud Storage directory. Import errors are written to - * sharded files in this directory, one per line, as a JSON-encoded - * `google.rpc.Status` message. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage prefix for import errors. This must be an empty, - * existing Cloud Storage directory. Import errors are written to - * sharded files in this directory, 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 prefix for import errors. This must be an empty, - * existing Cloud Storage directory. Import errors are written to - * sharded files in this directory, 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php deleted file mode 100644 index 292ef3e241a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportMetadata.php +++ /dev/null @@ -1,283 +0,0 @@ -google.cloud.retail.v2.ImportMetadata - */ -class ImportMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; - */ - protected $update_time = null; - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 3; - */ - protected $success_count = 0; - /** - * Count of entries that encountered errors while processing. - * - * Generated from protobuf field int64 failure_count = 4; - */ - protected $failure_count = 0; - /** - * Deprecated. This field is never set. - * - * Generated from protobuf field string request_id = 5 [deprecated = true]; - * @deprecated - */ - protected $request_id = ''; - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 6; - */ - protected $notification_pubsub_topic = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Operation create time. - * @type \Google\Protobuf\Timestamp $update_time - * Operation last update time. If the operation is done, this is also the - * finish 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 string $request_id - * Deprecated. This field is never set. - * @type string $notification_pubsub_topic - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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 = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $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 = 2; - * @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 = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 3; - * @return int|string - */ - public function getSuccessCount() - { - return $this->success_count; - } - - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 3; - * @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 = 4; - * @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 = 4; - * @param int|string $var - * @return $this - */ - public function setFailureCount($var) - { - GPBUtil::checkInt64($var); - $this->failure_count = $var; - - return $this; - } - - /** - * Deprecated. This field is never set. - * - * Generated from protobuf field string request_id = 5 [deprecated = true]; - * @return string - * @deprecated - */ - public function getRequestId() - { - @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); - return $this->request_id; - } - - /** - * Deprecated. This field is never set. - * - * Generated from protobuf field string request_id = 5 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setRequestId($var) - { - @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 6; - * @return string - */ - public function getNotificationPubsubTopic() - { - return $this->notification_pubsub_topic; - } - - /** - * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string notification_pubsub_topic = 6; - * @param string $var - * @return $this - */ - public function setNotificationPubsubTopic($var) - { - GPBUtil::checkString($var, True); - $this->notification_pubsub_topic = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php deleted file mode 100644 index 7347b2709ab..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest.php +++ /dev/null @@ -1,386 +0,0 @@ -google.cloud.retail.v2.ImportProductsRequest - */ -class ImportProductsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - * If no updateMask is specified, requires products.create permission. - * If updateMask is specified, requires products.update permission. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Deprecated. This field has no effect. - * - * Generated from protobuf field string request_id = 6 [deprecated = true]; - * @deprecated - */ - protected $request_id = ''; - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - /** - * The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - */ - protected $errors_config = null; - /** - * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. If provided, only the existing product - * fields are updated. Missing products will not be created. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; - */ - protected $update_mask = null; - /** - * The mode of reconciliation between existing products and the products to be - * imported. Defaults to - * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; - */ - protected $reconciliation_mode = 0; - /** - * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - * to be within the same project as - * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * Only supported when - * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] - * is set to `FULL`. - * - * Generated from protobuf field string notification_pubsub_topic = 7; - */ - protected $notification_pubsub_topic = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - * If no updateMask is specified, requires products.create permission. - * If updateMask is specified, requires products.update permission. - * @type string $request_id - * Deprecated. This field has no effect. - * @type \Google\Cloud\Retail\V2\ProductInputConfig $input_config - * Required. The desired input location of the data. - * @type \Google\Cloud\Retail\V2\ImportErrorsConfig $errors_config - * The desired location of errors incurred during the Import. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. If provided, only the existing product - * fields are updated. Missing products will not be created. - * @type int $reconciliation_mode - * The mode of reconciliation between existing products and the products to be - * imported. Defaults to - * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. - * @type string $notification_pubsub_topic - * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - * to be within the same project as - * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * Only supported when - * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] - * is set to `FULL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - * If no updateMask is specified, requires products.create permission. - * If updateMask is specified, requires products.update permission. - * - * 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/branches/default_branch` - * If no updateMask is specified, requires products.create permission. - * If updateMask is specified, requires products.update permission. - * - * 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; - } - - /** - * Deprecated. This field has no effect. - * - * Generated from protobuf field string request_id = 6 [deprecated = true]; - * @return string - * @deprecated - */ - public function getRequestId() - { - @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); - return $this->request_id; - } - - /** - * Deprecated. This field has no effect. - * - * Generated from protobuf field string request_id = 6 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setRequestId($var) - { - @trigger_error('request_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\ProductInputConfig|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.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\ProductInputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductInputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - * @return \Google\Cloud\Retail\V2\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - - /** - * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. If provided, only the existing product - * fields are updated. Missing products will not be created. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; - * @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); - } - - /** - * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. If provided, only the existing product - * fields are updated. Missing products will not be created. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * The mode of reconciliation between existing products and the products to be - * imported. Defaults to - * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; - * @return int - */ - public function getReconciliationMode() - { - return $this->reconciliation_mode; - } - - /** - * The mode of reconciliation between existing products and the products to be - * imported. Defaults to - * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; - * @param int $var - * @return $this - */ - public function setReconciliationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\ImportProductsRequest\ReconciliationMode::class); - $this->reconciliation_mode = $var; - - return $this; - } - - /** - * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - * to be within the same project as - * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * Only supported when - * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] - * is set to `FULL`. - * - * Generated from protobuf field string notification_pubsub_topic = 7; - * @return string - */ - public function getNotificationPubsubTopic() - { - return $this->notification_pubsub_topic; - } - - /** - * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification is sent to - * specified Pub/Sub topic. The message data is JSON string of a - * [Operation][google.longrunning.Operation]. - * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - * to be within the same project as - * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * Only supported when - * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] - * is set to `FULL`. - * - * Generated from protobuf field string notification_pubsub_topic = 7; - * @param string $var - * @return $this - */ - public function setNotificationPubsubTopic($var) - { - GPBUtil::checkString($var, True); - $this->notification_pubsub_topic = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php deleted file mode 100644 index 818733abb91..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsRequest/ReconciliationMode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode - */ -class ReconciliationMode -{ - /** - * Defaults to INCREMENTAL. - * - * Generated from protobuf enum RECONCILIATION_MODE_UNSPECIFIED = 0; - */ - const RECONCILIATION_MODE_UNSPECIFIED = 0; - /** - * Inserts new products or updates existing products. - * - * Generated from protobuf enum INCREMENTAL = 1; - */ - const INCREMENTAL = 1; - /** - * Calculates diff and replaces the entire product dataset. Existing - * products may be deleted if they are not present in the source location. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::RECONCILIATION_MODE_UNSPECIFIED => 'RECONCILIATION_MODE_UNSPECIFIED', - self::INCREMENTAL => 'INCREMENTAL', - self::FULL => 'FULL', - ]; - - 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(ReconciliationMode::class, \Google\Cloud\Retail\V2\ImportProductsRequest_ReconciliationMode::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php deleted file mode 100644 index c4593b68a24..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportProductsResponse.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.retail.v2.ImportProductsResponse - */ -class ImportProductsResponse 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.retail.v2.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\Retail\V2\ImportErrorsConfig $errors_config - * Echoes the destination for the complete errors in the request if set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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.retail.v2.ImportErrorsConfig errors_config = 2; - * @return \Google\Cloud\Retail\V2\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.retail.v2.ImportErrorsConfig errors_config = 2; - * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php deleted file mode 100644 index ba58a17e1f8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.retail.v2.ImportUserEventsRequest - */ -class ImportUserEventsRequest 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 = ''; - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - /** - * The desired location of errors incurred during the Import. Cannot be set - * for inline user event imports. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - */ - 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 \Google\Cloud\Retail\V2\UserEventInputConfig $input_config - * Required. The desired input location of the data. - * @type \Google\Cloud\Retail\V2\ImportErrorsConfig $errors_config - * The desired location of errors incurred during the Import. Cannot be set - * for inline user event imports. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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; - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\UserEventInputConfig|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.retail.v2.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\UserEventInputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventInputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * The desired location of errors incurred during the Import. Cannot be set - * for inline user event imports. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - * @return \Google\Cloud\Retail\V2\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * The desired location of errors incurred during the Import. Cannot be set - * for inline user event imports. - * - * Generated from protobuf field .google.cloud.retail.v2.ImportErrorsConfig errors_config = 3; - * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php deleted file mode 100644 index 45a281f8a87..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ImportUserEventsResponse.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.retail.v2.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.retail.v2.ImportErrorsConfig errors_config = 2; - */ - protected $errors_config = null; - /** - * Aggregated statistics of user event import status. - * - * Generated from protobuf field .google.cloud.retail.v2.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\Retail\V2\ImportErrorsConfig $errors_config - * Echoes the destination for the complete errors if this field was set in - * the request. - * @type \Google\Cloud\Retail\V2\UserEventImportSummary $import_summary - * Aggregated statistics of user event import status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::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.retail.v2.ImportErrorsConfig errors_config = 2; - * @return \Google\Cloud\Retail\V2\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.retail.v2.ImportErrorsConfig errors_config = 2; - * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - - /** - * Aggregated statistics of user event import status. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEventImportSummary import_summary = 3; - * @return \Google\Cloud\Retail\V2\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.retail.v2.UserEventImportSummary import_summary = 3; - * @param \Google\Cloud\Retail\V2\UserEventImportSummary $var - * @return $this - */ - public function setImportSummary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventImportSummary::class); - $this->import_summary = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php deleted file mode 100644 index b0ec7451168..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Interval.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.retail.v2.Interval - */ -class Interval extends \Google\Protobuf\Internal\Message -{ - protected $min; - protected $max; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $minimum - * Inclusive lower bound. - * @type float $exclusive_minimum - * Exclusive lower bound. - * @type float $maximum - * Inclusive upper bound. - * @type float $exclusive_maximum - * Exclusive upper bound. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Inclusive lower bound. - * - * Generated from protobuf field double minimum = 1; - * @return float - */ - public function getMinimum() - { - return $this->readOneof(1); - } - - public function hasMinimum() - { - return $this->hasOneof(1); - } - - /** - * Inclusive lower bound. - * - * Generated from protobuf field double minimum = 1; - * @param float $var - * @return $this - */ - public function setMinimum($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Exclusive lower bound. - * - * Generated from protobuf field double exclusive_minimum = 2; - * @return float - */ - public function getExclusiveMinimum() - { - return $this->readOneof(2); - } - - public function hasExclusiveMinimum() - { - return $this->hasOneof(2); - } - - /** - * Exclusive lower bound. - * - * Generated from protobuf field double exclusive_minimum = 2; - * @param float $var - * @return $this - */ - public function setExclusiveMinimum($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Inclusive upper bound. - * - * Generated from protobuf field double maximum = 3; - * @return float - */ - public function getMaximum() - { - return $this->readOneof(3); - } - - public function hasMaximum() - { - return $this->hasOneof(3); - } - - /** - * Inclusive upper bound. - * - * Generated from protobuf field double maximum = 3; - * @param float $var - * @return $this - */ - public function setMaximum($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Exclusive upper bound. - * - * Generated from protobuf field double exclusive_maximum = 4; - * @return float - */ - public function getExclusiveMaximum() - { - return $this->readOneof(4); - } - - public function hasExclusiveMaximum() - { - return $this->hasOneof(4); - } - - /** - * Exclusive upper bound. - * - * Generated from protobuf field double exclusive_maximum = 4; - * @param float $var - * @return $this - */ - public function setExclusiveMaximum($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getMin() - { - return $this->whichOneof("min"); - } - - /** - * @return string - */ - public function getMax() - { - return $this->whichOneof("max"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php deleted file mode 100644 index 19d4bfb33c0..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.retail.v2.ListCatalogsRequest - */ -class ListCatalogsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The account resource name with an associated location. - * If the caller does not have permission to list - * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless - * of whether or not this location exists, a PERMISSION_DENIED error is - * returned. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If - * unspecified, defaults to 50. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token - * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], - * received from a previous - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The account resource name with an associated location. - * - * If the caller does not have permission to list - * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless - * of whether or not this location exists, a PERMISSION_DENIED error is - * returned. Please see - * {@see CatalogServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListCatalogsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The account resource name with an associated location. - * If the caller does not have permission to list - * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless - * of whether or not this location exists, a PERMISSION_DENIED error is - * returned. - * @type int $page_size - * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If - * unspecified, defaults to 50. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT is returned. - * @type string $page_token - * A page token - * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], - * received from a previous - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The account resource name with an associated location. - * If the caller does not have permission to list - * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless - * of whether or not this location exists, a PERMISSION_DENIED error is - * returned. - * - * 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 account resource name with an associated location. - * If the caller does not have permission to list - * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless - * of whether or not this location exists, a PERMISSION_DENIED error is - * returned. - * - * 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; - } - - /** - * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If - * unspecified, defaults to 50. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If - * unspecified, defaults to 50. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token - * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], - * received from a previous - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token - * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token], - * received from a previous - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php deleted file mode 100644 index e457e32e976..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListCatalogsResponse.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.retail.v2.ListCatalogsResponse - */ -class ListCatalogsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; - */ - private $catalogs; - /** - * A token that can be sent as - * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * 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\Retail\V2\Catalog>|\Google\Protobuf\Internal\RepeatedField $catalogs - * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. - * @type string $next_page_token - * A token that can be sent as - * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCatalogs() - { - return $this->catalogs; - } - - /** - * All the customer's [Catalog][google.cloud.retail.v2.Catalog]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Catalog catalogs = 1; - * @param array<\Google\Cloud\Retail\V2\Catalog>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCatalogs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Catalog::class); - $this->catalogs = $arr; - - return $this; - } - - /** - * A token that can be sent as - * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as - * [ListCatalogsRequest.page_token][google.cloud.retail.v2.ListCatalogsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php deleted file mode 100644 index b9584106181..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsRequest.php +++ /dev/null @@ -1,212 +0,0 @@ -google.cloud.retail.v2.ListControlsRequest - */ -class ListControlsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous `ListControls` call. - * Provide this to retrieve the subsequent page. - * - * 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. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. - * * List controls that are used in a single ServingConfig: - * 'serving_config = "boosted_home_page_cvr"' - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ControlServiceClient::catalogName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListControlsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type int $page_size - * Optional. Maximum number of results to return. If unspecified, defaults - * to 50. Max allowed value is 1000. - * @type string $page_token - * Optional. A page token, received from a previous `ListControls` call. - * Provide this to retrieve the subsequent page. - * @type string $filter - * Optional. A filter to apply on the list results. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. - * * List controls that are used in a single ServingConfig: - * 'serving_config = "boosted_home_page_cvr"' - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * 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. A page token, received from a previous `ListControls` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous `ListControls` call. - * Provide this to retrieve the subsequent page. - * - * 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. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. - * * List controls that are used in a single ServingConfig: - * 'serving_config = "boosted_home_page_cvr"' - * - * 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. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListControlsRequest.filter] is unset. - * * List controls that are used in a single ServingConfig: - * 'serving_config = "boosted_home_page_cvr"' - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php deleted file mode 100644 index 00eefc66fb7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListControlsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.retail.v2.ListControlsResponse - */ -class ListControlsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * All the Controls for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; - */ - private $controls; - /** - * Pagination token, if not returned indicates the last page. - * - * 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\Retail\V2\Control>|\Google\Protobuf\Internal\RepeatedField $controls - * All the Controls for a given catalog. - * @type string $next_page_token - * Pagination token, if not returned indicates the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * All the Controls for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getControls() - { - return $this->controls; - } - - /** - * All the Controls for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Control controls = 1; - * @param array<\Google\Cloud\Retail\V2\Control>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setControls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Control::class); - $this->controls = $arr; - - return $this; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php deleted file mode 100644 index b68f5f75f2d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest - */ -class ListGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * @param string $parent Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{catalog} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{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. Resource name of the parent catalog. - * Format: projects/{project}/locations/{location}/catalogs/{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; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php deleted file mode 100644 index cbec187cb9c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListGenerativeQuestionConfigsResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse - */ -class ListGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * All the questions for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; - */ - private $generative_question_configs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs - * All the questions for a given catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * All the questions for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGenerativeQuestionConfigs() - { - return $this->generative_question_configs; - } - - /** - * All the questions for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; - * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGenerativeQuestionConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); - $this->generative_question_configs = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php deleted file mode 100644 index b615a76a3cd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.retail.v2.ListModelsRequest - */ -class ListModelsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent for which to list models. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous `ListModels` - * call. Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The parent for which to list models. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ModelServiceClient::catalogName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListModelsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent for which to list models. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type int $page_size - * Optional. Maximum number of results to return. If unspecified, defaults - * to 50. Max allowed value is 1000. - * @type string $page_token - * Optional. A page token, received from a previous `ListModels` - * call. Provide this to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent for which to list models. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 for which to list models. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * 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. If unspecified, defaults - * to 50. Max allowed value is 1000. - * - * 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. A page token, received from a previous `ListModels` - * call. Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous `ListModels` - * call. Provide this to retrieve the subsequent page. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php deleted file mode 100644 index 6ffcc8bc535..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListModelsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.retail.v2.ListModelsResponse - */ -class ListModelsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of Models. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; - */ - private $models; - /** - * Pagination token, if not returned indicates the last page. - * - * 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\Retail\V2\Model>|\Google\Protobuf\Internal\RepeatedField $models - * List of Models. - * @type string $next_page_token - * Pagination token, if not returned indicates the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * List of Models. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getModels() - { - return $this->models; - } - - /** - * List of Models. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model models = 1; - * @param array<\Google\Cloud\Retail\V2\Model>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setModels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Model::class); - $this->models = $arr; - - return $this; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php deleted file mode 100644 index 29c8efc8f7f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsRequest.php +++ /dev/null @@ -1,452 +0,0 @@ -google.cloud.retail.v2.ListProductsRequest - */ -class ListProductsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - * `default_branch` as the branch ID, to list products under the default - * branch. - * If the caller does not have permission to list - * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of - * whether or not this branch exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to 100. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token - * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], - * received from a previous - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * A filter to apply on the list results. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. - * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s sharing the same - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. For example: - * `primary_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s bundled in a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product]. - * For example: - * `collection_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. - * For example: - * `type = "PRIMARY"` - * `type = "VARIANT"` - * `type = "COLLECTION"` - * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - * If the specified - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] or - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error - * is returned. - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * The fields of [Product][google.cloud.retail.v2.Product] to return in the - * responses. If not set or empty, the following fields are returned: - * * [Product.name][google.cloud.retail.v2.Product.name] - * * [Product.id][google.cloud.retail.v2.Product.id] - * * [Product.title][google.cloud.retail.v2.Product.title] - * * [Product.uri][google.cloud.retail.v2.Product.uri] - * * [Product.images][google.cloud.retail.v2.Product.images] - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.brands][google.cloud.retail.v2.Product.brands] - * If "*" is provided, all fields are returned. - * [Product.name][google.cloud.retail.v2.Product.name] is always returned no - * matter what mask is set. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; - */ - protected $read_mask = null; - - /** - * @param string $parent Required. The parent branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - * `default_branch` as the branch ID, to list products under the default - * branch. - * - * If the caller does not have permission to list - * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of - * whether or not this branch exists, a PERMISSION_DENIED error is returned. Please see - * {@see ProductServiceClient::branchName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListProductsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - * `default_branch` as the branch ID, to list products under the default - * branch. - * If the caller does not have permission to list - * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of - * whether or not this branch exists, a PERMISSION_DENIED error is returned. - * @type int $page_size - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to 100. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT error is returned. - * @type string $page_token - * A page token - * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], - * received from a previous - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * @type string $filter - * A filter to apply on the list results. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. - * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s sharing the same - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. For example: - * `primary_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s bundled in a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product]. - * For example: - * `collection_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. - * For example: - * `type = "PRIMARY"` - * `type = "VARIANT"` - * `type = "COLLECTION"` - * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - * If the specified - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] or - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error - * is returned. - * @type \Google\Protobuf\FieldMask $read_mask - * The fields of [Product][google.cloud.retail.v2.Product] to return in the - * responses. If not set or empty, the following fields are returned: - * * [Product.name][google.cloud.retail.v2.Product.name] - * * [Product.id][google.cloud.retail.v2.Product.id] - * * [Product.title][google.cloud.retail.v2.Product.title] - * * [Product.uri][google.cloud.retail.v2.Product.uri] - * * [Product.images][google.cloud.retail.v2.Product.images] - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.brands][google.cloud.retail.v2.Product.brands] - * If "*" is provided, all fields are returned. - * [Product.name][google.cloud.retail.v2.Product.name] is always returned no - * matter what mask is set. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - * `default_branch` as the branch ID, to list products under the default - * branch. - * If the caller does not have permission to list - * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of - * whether or not this branch exists, a PERMISSION_DENIED error is returned. - * - * 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 branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - * `default_branch` as the branch ID, to list products under the default - * branch. - * If the caller does not have permission to list - * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of - * whether or not this branch exists, a PERMISSION_DENIED error is returned. - * - * 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; - } - - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to 100. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to 100. The maximum allowed value is 1000. Values - * above 1000 will be coerced to 1000. - * If this field is negative, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token - * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], - * received from a previous - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token - * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token], - * received from a previous - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * must match the call that provided the page token. Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * A filter to apply on the list results. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. - * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s sharing the same - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. For example: - * `primary_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s bundled in a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product]. - * For example: - * `collection_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. - * For example: - * `type = "PRIMARY"` - * `type = "VARIANT"` - * `type = "COLLECTION"` - * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - * If the specified - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] or - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error - * is returned. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filter to apply on the list results. Supported features: - * * List all the products under the parent branch if - * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset. - * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s sharing the same - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. For example: - * `primary_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s bundled in a - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product]. - * For example: - * `collection_product_id = "some_product_id"` - * * List [Product][google.cloud.retail.v2.Product]s with a partibular type. - * For example: - * `type = "PRIMARY"` - * `type = "VARIANT"` - * `type = "COLLECTION"` - * If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - * If the specified - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] or - * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] - * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error - * is returned. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The fields of [Product][google.cloud.retail.v2.Product] to return in the - * responses. If not set or empty, the following fields are returned: - * * [Product.name][google.cloud.retail.v2.Product.name] - * * [Product.id][google.cloud.retail.v2.Product.id] - * * [Product.title][google.cloud.retail.v2.Product.title] - * * [Product.uri][google.cloud.retail.v2.Product.uri] - * * [Product.images][google.cloud.retail.v2.Product.images] - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.brands][google.cloud.retail.v2.Product.brands] - * If "*" is provided, all fields are returned. - * [Product.name][google.cloud.retail.v2.Product.name] is always returned no - * matter what mask is set. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; - * @return \Google\Protobuf\FieldMask|null - */ - public function getReadMask() - { - return $this->read_mask; - } - - public function hasReadMask() - { - return isset($this->read_mask); - } - - public function clearReadMask() - { - unset($this->read_mask); - } - - /** - * The fields of [Product][google.cloud.retail.v2.Product] to return in the - * responses. If not set or empty, the following fields are returned: - * * [Product.name][google.cloud.retail.v2.Product.name] - * * [Product.id][google.cloud.retail.v2.Product.id] - * * [Product.title][google.cloud.retail.v2.Product.title] - * * [Product.uri][google.cloud.retail.v2.Product.uri] - * * [Product.images][google.cloud.retail.v2.Product.images] - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.brands][google.cloud.retail.v2.Product.brands] - * If "*" is provided, all fields are returned. - * [Product.name][google.cloud.retail.v2.Product.name] is always returned no - * matter what mask is set. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setReadMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->read_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php deleted file mode 100644 index 75ecb23e6e9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListProductsResponse.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.retail.v2.ListProductsResponse - */ -class ListProductsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; - */ - private $products; - /** - * A token that can be sent as - * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * 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\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $products - * The [Product][google.cloud.retail.v2.Product]s. - * @type string $next_page_token - * A token that can be sent as - * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * The [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProducts() - { - return $this->products; - } - - /** - * The [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1; - * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProducts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); - $this->products = $arr; - - return $this; - } - - /** - * A token that can be sent as - * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as - * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php deleted file mode 100644 index e8f5af467cb..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsRequest.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.retail.v2.ListServingConfigsRequest - */ -class ListServingConfigsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 100. If a value greater than 100 is provided, at most 100 results are - * returned. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous `ListServingConfigs` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * Please see {@see ServingConfigServiceClient::catalogName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\ListServingConfigsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * @type int $page_size - * Optional. Maximum number of results to return. If unspecified, defaults - * to 100. If a value greater than 100 is provided, at most 100 results are - * returned. - * @type string $page_token - * Optional. A page token, received from a previous `ListServingConfigs` call. - * Provide this to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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 catalog resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - * - * 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. If unspecified, defaults - * to 100. If a value greater than 100 is provided, at most 100 results are - * returned. - * - * 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. If unspecified, defaults - * to 100. If a value greater than 100 is provided, at most 100 results are - * returned. - * - * 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. A page token, received from a previous `ListServingConfigs` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous `ListServingConfigs` call. - * Provide this to retrieve the subsequent page. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php deleted file mode 100644 index 0d7fd5c2803..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ListServingConfigsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.retail.v2.ListServingConfigsResponse - */ -class ListServingConfigsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * All the ServingConfigs for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; - */ - private $serving_configs; - /** - * Pagination token, if not returned indicates the last page. - * - * 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\Retail\V2\ServingConfig>|\Google\Protobuf\Internal\RepeatedField $serving_configs - * All the ServingConfigs for a given catalog. - * @type string $next_page_token - * Pagination token, if not returned indicates the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * All the ServingConfigs for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServingConfigs() - { - return $this->serving_configs; - } - - /** - * All the ServingConfigs for a given catalog. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ServingConfig serving_configs = 1; - * @param array<\Google\Cloud\Retail\V2\ServingConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServingConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ServingConfig::class); - $this->serving_configs = $arr; - - return $this; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token, if not returned indicates the last page. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php deleted file mode 100644 index 4bc4a6e4383..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/LocalInventory.php +++ /dev/null @@ -1,316 +0,0 @@ -google.cloud.retail.v2.LocalInventory - */ -class LocalInventory extends \Google\Protobuf\Internal\Message -{ - /** - * The place ID for the current set of inventory information. - * - * Generated from protobuf field string place_id = 1; - */ - protected $place_id = ''; - /** - * Product price and cost information. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; - */ - protected $price_info = null; - /** - * Additional local inventory attributes, for example, store name, promotion - * tags, etc. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * At most 30 attributes are allowed. - * * The key must be a UTF-8 encoded string with a length limit of 32 - * characters. - * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, - * key0LikeThis or KEY_1_LIKE_THIS. - * * The attribute values must be of the same type (text or number). - * * Only 1 value is allowed for each attribute. - * * For text values, the length limit is 256 UTF-8 characters. - * * The attribute does not support search. The `searchable` field should be - * unset or set to false. - * * The max summed total bytes of custom attribute keys and values per - * product is 5MiB. - * - * Generated from protobuf field map attributes = 3; - */ - private $attributes; - /** - * Input only. Supported fulfillment types. Valid fulfillment type values - * include commonly used types (such as pickup in store and same day - * delivery), and custom types. Customers have to map custom types to their - * display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $fulfillment_types; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $place_id - * The place ID for the current set of inventory information. - * @type \Google\Cloud\Retail\V2\PriceInfo $price_info - * Product price and cost information. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Additional local inventory attributes, for example, store name, promotion - * tags, etc. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * At most 30 attributes are allowed. - * * The key must be a UTF-8 encoded string with a length limit of 32 - * characters. - * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, - * key0LikeThis or KEY_1_LIKE_THIS. - * * The attribute values must be of the same type (text or number). - * * Only 1 value is allowed for each attribute. - * * For text values, the length limit is 256 UTF-8 characters. - * * The attribute does not support search. The `searchable` field should be - * unset or set to false. - * * The max summed total bytes of custom attribute keys and values per - * product is 5MiB. - * @type array|\Google\Protobuf\Internal\RepeatedField $fulfillment_types - * Input only. Supported fulfillment types. Valid fulfillment type values - * include commonly used types (such as pickup in store and same day - * delivery), and custom types. Customers have to map custom types to their - * display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The place ID for the current set of inventory information. - * - * Generated from protobuf field string place_id = 1; - * @return string - */ - public function getPlaceId() - { - return $this->place_id; - } - - /** - * The place ID for the current set of inventory information. - * - * Generated from protobuf field string place_id = 1; - * @param string $var - * @return $this - */ - public function setPlaceId($var) - { - GPBUtil::checkString($var, True); - $this->place_id = $var; - - return $this; - } - - /** - * Product price and cost information. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; - * @return \Google\Cloud\Retail\V2\PriceInfo|null - */ - public function getPriceInfo() - { - return $this->price_info; - } - - public function hasPriceInfo() - { - return isset($this->price_info); - } - - public function clearPriceInfo() - { - unset($this->price_info); - } - - /** - * Product price and cost information. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 2; - * @param \Google\Cloud\Retail\V2\PriceInfo $var - * @return $this - */ - public function setPriceInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo::class); - $this->price_info = $var; - - return $this; - } - - /** - * Additional local inventory attributes, for example, store name, promotion - * tags, etc. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * At most 30 attributes are allowed. - * * The key must be a UTF-8 encoded string with a length limit of 32 - * characters. - * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, - * key0LikeThis or KEY_1_LIKE_THIS. - * * The attribute values must be of the same type (text or number). - * * Only 1 value is allowed for each attribute. - * * For text values, the length limit is 256 UTF-8 characters. - * * The attribute does not support search. The `searchable` field should be - * unset or set to false. - * * The max summed total bytes of custom attribute keys and values per - * product is 5MiB. - * - * Generated from protobuf field map attributes = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Additional local inventory attributes, for example, store name, promotion - * tags, etc. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * At most 30 attributes are allowed. - * * The key must be a UTF-8 encoded string with a length limit of 32 - * characters. - * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, - * key0LikeThis or KEY_1_LIKE_THIS. - * * The attribute values must be of the same type (text or number). - * * Only 1 value is allowed for each attribute. - * * For text values, the length limit is 256 UTF-8 characters. - * * The attribute does not support search. The `searchable` field should be - * unset or set to false. - * * The max summed total bytes of custom attribute keys and values per - * product is 5MiB. - * - * Generated from protobuf field map attributes = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); - $this->attributes = $arr; - - return $this; - } - - /** - * Input only. Supported fulfillment types. Valid fulfillment type values - * include commonly used types (such as pickup in store and same day - * delivery), and custom types. Customers have to map custom types to their - * display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFulfillmentTypes() - { - return $this->fulfillment_types; - } - - /** - * Input only. Supported fulfillment types. Valid fulfillment type values - * include commonly used types (such as pickup in store and same day - * delivery), and custom types. Customers have to map custom types to their - * display names before rendering UI. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFulfillmentTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->fulfillment_types = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php deleted file mode 100644 index 33ddf82980a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model.php +++ /dev/null @@ -1,811 +0,0 @@ -google.cloud.retail.v2.Model - */ -class Model extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The fully qualified resource name of the model. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * catalog_id has char limit of 50. - * recommendation_model_id has char limit of 40. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The display name of the model. - * Should be human readable, used to display Recommendation Models in the - * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 - * characters. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - /** - * Optional. The training state that the model is in (e.g. - * `TRAINING` or `PAUSED`). - * Since part of the cost of running the service - * is frequency of training - this can be used to determine when to train - * model in order to control cost. If not specified: the default value for - * `CreateModel` method is `TRAINING`. The default value for - * `UpdateModel` method is to keep the state the same as before. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $training_state = 0; - /** - * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $serving_state = 0; - /** - * Output only. Timestamp the Recommendation Model was created at. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Timestamp the Recommendation Model was last updated. E.g. - * if a Recommendation Model was paused - this would be the time the pause was - * initiated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Required. The type of model e.g. `home-page`. - * Currently supported values: `recommended-for-you`, `others-you-may-like`, - * `frequently-bought-together`, `page-optimization`, `similar-items`, - * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $type = ''; - /** - * Optional. The optimization objective e.g. `cvr`. - * Currently supported - * values: `ctr`, `cvr`, `revenue-per-order`. - * If not specified, we choose default based on model type. - * Default depends on type of recommendation: - * `recommended-for-you` => `ctr` - * `others-you-may-like` => `ctr` - * `frequently-bought-together` => `revenue_per_order` - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.type] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $optimization_objective = ''; - /** - * Optional. The state of periodic tuning. - * The period we use is 3 months - to do a - * one-off tune earlier use the `TuneModel` method. Default value - * is `PERIODIC_TUNING_ENABLED`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $periodic_tuning_state = 0; - /** - * Output only. The timestamp when the latest successful tune finished. - * - * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_tune_time = null; - /** - * Output only. The tune operation associated with the model. - * Can be used to determine if there is an ongoing tune for this - * recommendation. Empty field implies no tune is goig on. - * - * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $tuning_operation = ''; - /** - * Output only. The state of data requirements for this model: `DATA_OK` and - * `DATA_ERROR`. - * Recommendation model cannot be trained if the data is in - * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even - * if serving state is `ACTIVE`: models were trained successfully before, but - * cannot be refreshed because model no longer has sufficient - * data for training. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $data_state = 0; - /** - * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering - * by attributes is enabled for the model. - * - * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filtering_option = 0; - /** - * Output only. The list of valid serving configs associated with the - * PageOptimizationConfig. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $serving_config_lists; - /** - * Optional. Additional model features config. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $model_features_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The fully qualified resource name of the model. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * catalog_id has char limit of 50. - * recommendation_model_id has char limit of 40. - * @type string $display_name - * Required. The display name of the model. - * Should be human readable, used to display Recommendation Models in the - * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 - * characters. - * @type int $training_state - * Optional. The training state that the model is in (e.g. - * `TRAINING` or `PAUSED`). - * Since part of the cost of running the service - * is frequency of training - this can be used to determine when to train - * model in order to control cost. If not specified: the default value for - * `CreateModel` method is `TRAINING`. The default value for - * `UpdateModel` method is to keep the state the same as before. - * @type int $serving_state - * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Timestamp the Recommendation Model was created at. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Timestamp the Recommendation Model was last updated. E.g. - * if a Recommendation Model was paused - this would be the time the pause was - * initiated. - * @type string $type - * Required. The type of model e.g. `home-page`. - * Currently supported values: `recommended-for-you`, `others-you-may-like`, - * `frequently-bought-together`, `page-optimization`, `similar-items`, - * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * @type string $optimization_objective - * Optional. The optimization objective e.g. `cvr`. - * Currently supported - * values: `ctr`, `cvr`, `revenue-per-order`. - * If not specified, we choose default based on model type. - * Default depends on type of recommendation: - * `recommended-for-you` => `ctr` - * `others-you-may-like` => `ctr` - * `frequently-bought-together` => `revenue_per_order` - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.type] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * @type int $periodic_tuning_state - * Optional. The state of periodic tuning. - * The period we use is 3 months - to do a - * one-off tune earlier use the `TuneModel` method. Default value - * is `PERIODIC_TUNING_ENABLED`. - * @type \Google\Protobuf\Timestamp $last_tune_time - * Output only. The timestamp when the latest successful tune finished. - * @type string $tuning_operation - * Output only. The tune operation associated with the model. - * Can be used to determine if there is an ongoing tune for this - * recommendation. Empty field implies no tune is goig on. - * @type int $data_state - * Output only. The state of data requirements for this model: `DATA_OK` and - * `DATA_ERROR`. - * Recommendation model cannot be trained if the data is in - * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even - * if serving state is `ACTIVE`: models were trained successfully before, but - * cannot be refreshed because model no longer has sufficient - * data for training. - * @type int $filtering_option - * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering - * by attributes is enabled for the model. - * @type array<\Google\Cloud\Retail\V2\Model\ServingConfigList>|\Google\Protobuf\Internal\RepeatedField $serving_config_lists - * Output only. The list of valid serving configs associated with the - * PageOptimizationConfig. - * @type \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $model_features_config - * Optional. Additional model features config. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); - parent::__construct($data); - } - - /** - * Required. The fully qualified resource name of the model. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * catalog_id has char limit of 50. - * recommendation_model_id has char limit of 40. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The fully qualified resource name of the model. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * catalog_id has char limit of 50. - * recommendation_model_id has char limit of 40. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The display name of the model. - * Should be human readable, used to display Recommendation Models in the - * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 - * characters. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The display name of the model. - * Should be human readable, used to display Recommendation Models in the - * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 - * characters. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The training state that the model is in (e.g. - * `TRAINING` or `PAUSED`). - * Since part of the cost of running the service - * is frequency of training - this can be used to determine when to train - * model in order to control cost. If not specified: the default value for - * `CreateModel` method is `TRAINING`. The default value for - * `UpdateModel` method is to keep the state the same as before. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTrainingState() - { - return $this->training_state; - } - - /** - * Optional. The training state that the model is in (e.g. - * `TRAINING` or `PAUSED`). - * Since part of the cost of running the service - * is frequency of training - this can be used to determine when to train - * model in order to control cost. If not specified: the default value for - * `CreateModel` method is `TRAINING`. The default value for - * `UpdateModel` method is to keep the state the same as before. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTrainingState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\TrainingState::class); - $this->training_state = $var; - - return $this; - } - - /** - * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getServingState() - { - return $this->serving_state; - } - - /** - * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setServingState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\ServingState::class); - $this->serving_state = $var; - - return $this; - } - - /** - * Output only. Timestamp the Recommendation Model was created at. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp the Recommendation Model was created at. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Timestamp the Recommendation Model was last updated. E.g. - * if a Recommendation Model was paused - this would be the time the pause was - * initiated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Timestamp the Recommendation Model was last updated. E.g. - * if a Recommendation Model was paused - this would be the time the pause was - * initiated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Required. The type of model e.g. `home-page`. - * Currently supported values: `recommended-for-you`, `others-you-may-like`, - * `frequently-bought-together`, `page-optimization`, `similar-items`, - * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Required. The type of model e.g. `home-page`. - * Currently supported values: `recommended-for-you`, `others-you-may-like`, - * `frequently-bought-together`, `page-optimization`, `similar-items`, - * `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.optimization_objective] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string type = 7 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Optional. The optimization objective e.g. `cvr`. - * Currently supported - * values: `ctr`, `cvr`, `revenue-per-order`. - * If not specified, we choose default based on model type. - * Default depends on type of recommendation: - * `recommended-for-you` => `ctr` - * `others-you-may-like` => `ctr` - * `frequently-bought-together` => `revenue_per_order` - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.type] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOptimizationObjective() - { - return $this->optimization_objective; - } - - /** - * Optional. The optimization objective e.g. `cvr`. - * Currently supported - * values: `ctr`, `cvr`, `revenue-per-order`. - * If not specified, we choose default based on model type. - * Default depends on type of recommendation: - * `recommended-for-you` => `ctr` - * `others-you-may-like` => `ctr` - * `frequently-bought-together` => `revenue_per_order` - * This field together with - * [optimization_objective][google.cloud.retail.v2.Model.type] - * describe model metadata to use to control model training and serving. - * See https://cloud.google.com/retail/docs/models - * for more details on what the model metadata control and which combination - * of parameters are valid. For invalid combinations of parameters (e.g. type - * = `frequently-bought-together` and optimization_objective = `ctr`), you - * receive an error 400 if you try to create/update a recommendation with - * this set of knobs. - * - * Generated from protobuf field string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOptimizationObjective($var) - { - GPBUtil::checkString($var, True); - $this->optimization_objective = $var; - - return $this; - } - - /** - * Optional. The state of periodic tuning. - * The period we use is 3 months - to do a - * one-off tune earlier use the `TuneModel` method. Default value - * is `PERIODIC_TUNING_ENABLED`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPeriodicTuningState() - { - return $this->periodic_tuning_state; - } - - /** - * Optional. The state of periodic tuning. - * The period we use is 3 months - to do a - * one-off tune earlier use the `TuneModel` method. Default value - * is `PERIODIC_TUNING_ENABLED`. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPeriodicTuningState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\PeriodicTuningState::class); - $this->periodic_tuning_state = $var; - - return $this; - } - - /** - * Output only. The timestamp when the latest successful tune finished. - * - * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastTuneTime() - { - return $this->last_tune_time; - } - - public function hasLastTuneTime() - { - return isset($this->last_tune_time); - } - - public function clearLastTuneTime() - { - unset($this->last_tune_time); - } - - /** - * Output only. The timestamp when the latest successful tune finished. - * - * Generated from protobuf field .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastTuneTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_tune_time = $var; - - return $this; - } - - /** - * Output only. The tune operation associated with the model. - * Can be used to determine if there is an ongoing tune for this - * recommendation. Empty field implies no tune is goig on. - * - * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTuningOperation() - { - return $this->tuning_operation; - } - - /** - * Output only. The tune operation associated with the model. - * Can be used to determine if there is an ongoing tune for this - * recommendation. Empty field implies no tune is goig on. - * - * Generated from protobuf field string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTuningOperation($var) - { - GPBUtil::checkString($var, True); - $this->tuning_operation = $var; - - return $this; - } - - /** - * Output only. The state of data requirements for this model: `DATA_OK` and - * `DATA_ERROR`. - * Recommendation model cannot be trained if the data is in - * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even - * if serving state is `ACTIVE`: models were trained successfully before, but - * cannot be refreshed because model no longer has sufficient - * data for training. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDataState() - { - return $this->data_state; - } - - /** - * Output only. The state of data requirements for this model: `DATA_OK` and - * `DATA_ERROR`. - * Recommendation model cannot be trained if the data is in - * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even - * if serving state is `ACTIVE`: models were trained successfully before, but - * cannot be refreshed because model no longer has sufficient - * data for training. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDataState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\DataState::class); - $this->data_state = $var; - - return $this; - } - - /** - * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering - * by attributes is enabled for the model. - * - * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getFilteringOption() - { - return $this->filtering_option; - } - - /** - * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering - * by attributes is enabled for the model. - * - * Generated from protobuf field .google.cloud.retail.v2.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setFilteringOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\RecommendationsFilteringOption::class); - $this->filtering_option = $var; - - return $this; - } - - /** - * Output only. The list of valid serving configs associated with the - * PageOptimizationConfig. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServingConfigLists() - { - return $this->serving_config_lists; - } - - /** - * Output only. The list of valid serving configs associated with the - * PageOptimizationConfig. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Retail\V2\Model\ServingConfigList>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServingConfigLists($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Model\ServingConfigList::class); - $this->serving_config_lists = $arr; - - return $this; - } - - /** - * Optional. Additional model features config. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig|null - */ - public function getModelFeaturesConfig() - { - return $this->model_features_config; - } - - public function hasModelFeaturesConfig() - { - return isset($this->model_features_config); - } - - public function clearModelFeaturesConfig() - { - unset($this->model_features_config); - } - - /** - * Optional. Additional model features config. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $var - * @return $this - */ - public function setModelFeaturesConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig::class); - $this->model_features_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php deleted file mode 100644 index 8ae561915ce..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ContextProductsType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.retail.v2.Model.ContextProductsType - */ -class ContextProductsType -{ - /** - * Unspecified default value, should never be explicitly set. - * Defaults to - * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. - * - * Generated from protobuf enum CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; - */ - const CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; - /** - * Use only a single product as context for the recommendation. Typically - * used on pages like add-to-cart or product details. - * - * Generated from protobuf enum SINGLE_CONTEXT_PRODUCT = 1; - */ - const SINGLE_CONTEXT_PRODUCT = 1; - /** - * Use one or multiple products as context for the recommendation. Typically - * used on shopping cart pages. - * - * Generated from protobuf enum MULTIPLE_CONTEXT_PRODUCTS = 2; - */ - const MULTIPLE_CONTEXT_PRODUCTS = 2; - - private static $valueToName = [ - self::CONTEXT_PRODUCTS_TYPE_UNSPECIFIED => 'CONTEXT_PRODUCTS_TYPE_UNSPECIFIED', - self::SINGLE_CONTEXT_PRODUCT => 'SINGLE_CONTEXT_PRODUCT', - self::MULTIPLE_CONTEXT_PRODUCTS => 'MULTIPLE_CONTEXT_PRODUCTS', - ]; - - 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(ContextProductsType::class, \Google\Cloud\Retail\V2\Model_ContextProductsType::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php deleted file mode 100644 index 34f169a78c7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/DataState.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.retail.v2.Model.DataState - */ -class DataState -{ - /** - * Unspecified default value, should never be explicitly set. - * - * Generated from protobuf enum DATA_STATE_UNSPECIFIED = 0; - */ - const DATA_STATE_UNSPECIFIED = 0; - /** - * The model has sufficient training data. - * - * Generated from protobuf enum DATA_OK = 1; - */ - const DATA_OK = 1; - /** - * The model does not have sufficient training data. Error - * messages can be queried via Stackdriver. - * - * Generated from protobuf enum DATA_ERROR = 2; - */ - const DATA_ERROR = 2; - - private static $valueToName = [ - self::DATA_STATE_UNSPECIFIED => 'DATA_STATE_UNSPECIFIED', - self::DATA_OK => 'DATA_OK', - self::DATA_ERROR => 'DATA_ERROR', - ]; - - 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(DataState::class, \Google\Cloud\Retail\V2\Model_DataState::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php deleted file mode 100644 index 859d56509a7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig - */ -class FrequentlyBoughtTogetherFeaturesConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Specifies the context of the model when it is used in predict - * requests. Can only be set for the `frequently-bought-together` type. If - * it isn't specified, it defaults to - * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $context_products_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $context_products_type - * Optional. Specifies the context of the model when it is used in predict - * requests. Can only be set for the `frequently-bought-together` type. If - * it isn't specified, it defaults to - * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Specifies the context of the model when it is used in predict - * requests. Can only be set for the `frequently-bought-together` type. If - * it isn't specified, it defaults to - * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getContextProductsType() - { - return $this->context_products_type; - } - - /** - * Optional. Specifies the context of the model when it is used in predict - * requests. Can only be set for the `frequently-bought-together` type. If - * it isn't specified, it defaults to - * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setContextProductsType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\ContextProductsType::class); - $this->context_products_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FrequentlyBoughtTogetherFeaturesConfig::class, \Google\Cloud\Retail\V2\Model_FrequentlyBoughtTogetherFeaturesConfig::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php deleted file mode 100644 index 7755626aca7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ModelFeaturesConfig.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.retail.v2.Model.ModelFeaturesConfig - */ -class ModelFeaturesConfig extends \Google\Protobuf\Internal\Message -{ - protected $type_dedicated_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $frequently_bought_together_config - * Additional configs for frequently-bought-together models. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); - parent::__construct($data); - } - - /** - * Additional configs for frequently-bought-together models. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; - * @return \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig|null - */ - public function getFrequentlyBoughtTogetherConfig() - { - return $this->readOneof(1); - } - - public function hasFrequentlyBoughtTogetherConfig() - { - return $this->hasOneof(1); - } - - /** - * Additional configs for frequently-bought-together models. - * - * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; - * @param \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $var - * @return $this - */ - public function setFrequentlyBoughtTogetherConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getTypeDedicatedConfig() - { - return $this->whichOneof("type_dedicated_config"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ModelFeaturesConfig::class, \Google\Cloud\Retail\V2\Model_ModelFeaturesConfig::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php deleted file mode 100644 index 4dff3ca9028..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/PeriodicTuningState.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.retail.v2.Model.PeriodicTuningState - */ -class PeriodicTuningState -{ - /** - * Unspecified default value, should never be explicitly set. - * - * Generated from protobuf enum PERIODIC_TUNING_STATE_UNSPECIFIED = 0; - */ - const PERIODIC_TUNING_STATE_UNSPECIFIED = 0; - /** - * The model has periodic tuning disabled. Tuning - * can be reenabled by calling the `EnableModelPeriodicTuning` - * method or by calling the `TuneModel` method. - * - * Generated from protobuf enum PERIODIC_TUNING_DISABLED = 1; - */ - const PERIODIC_TUNING_DISABLED = 1; - /** - * The model cannot be tuned with periodic tuning OR the - * `TuneModel` method. Hide the options in customer UI and - * reject any requests through the backend self serve API. - * - * Generated from protobuf enum ALL_TUNING_DISABLED = 3; - */ - const ALL_TUNING_DISABLED = 3; - /** - * The model has periodic tuning enabled. Tuning - * can be disabled by calling the `DisableModelPeriodicTuning` - * method. - * - * Generated from protobuf enum PERIODIC_TUNING_ENABLED = 2; - */ - const PERIODIC_TUNING_ENABLED = 2; - - private static $valueToName = [ - self::PERIODIC_TUNING_STATE_UNSPECIFIED => 'PERIODIC_TUNING_STATE_UNSPECIFIED', - self::PERIODIC_TUNING_DISABLED => 'PERIODIC_TUNING_DISABLED', - self::ALL_TUNING_DISABLED => 'ALL_TUNING_DISABLED', - self::PERIODIC_TUNING_ENABLED => 'PERIODIC_TUNING_ENABLED', - ]; - - 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(PeriodicTuningState::class, \Google\Cloud\Retail\V2\Model_PeriodicTuningState::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php deleted file mode 100644 index 627101be7aa..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingConfigList.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.Model.ServingConfigList - */ -class ServingConfigList extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A set of valid serving configs that may be used for - * `PAGE_OPTIMIZATION`. - * - * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $serving_config_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $serving_config_ids - * Optional. A set of valid serving configs that may be used for - * `PAGE_OPTIMIZATION`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A set of valid serving configs that may be used for - * `PAGE_OPTIMIZATION`. - * - * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServingConfigIds() - { - return $this->serving_config_ids; - } - - /** - * Optional. A set of valid serving configs that may be used for - * `PAGE_OPTIMIZATION`. - * - * Generated from protobuf field repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServingConfigIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->serving_config_ids = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ServingConfigList::class, \Google\Cloud\Retail\V2\Model_ServingConfigList::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php deleted file mode 100644 index 3dd9513c78f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/ServingState.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.retail.v2.Model.ServingState - */ -class ServingState -{ - /** - * Unspecified serving state. - * - * Generated from protobuf enum SERVING_STATE_UNSPECIFIED = 0; - */ - const SERVING_STATE_UNSPECIFIED = 0; - /** - * The model is not serving. - * - * Generated from protobuf enum INACTIVE = 1; - */ - const INACTIVE = 1; - /** - * The model is serving and can be queried. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The model is trained on tuned hyperparameters and can be - * queried. - * - * Generated from protobuf enum TUNED = 3; - */ - const TUNED = 3; - - private static $valueToName = [ - self::SERVING_STATE_UNSPECIFIED => 'SERVING_STATE_UNSPECIFIED', - self::INACTIVE => 'INACTIVE', - self::ACTIVE => 'ACTIVE', - self::TUNED => 'TUNED', - ]; - - 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(ServingState::class, \Google\Cloud\Retail\V2\Model_ServingState::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php deleted file mode 100644 index cbbf2e8206b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Model/TrainingState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.Model.TrainingState - */ -class TrainingState -{ - /** - * Unspecified training state. - * - * Generated from protobuf enum TRAINING_STATE_UNSPECIFIED = 0; - */ - const TRAINING_STATE_UNSPECIFIED = 0; - /** - * The model training is paused. - * - * Generated from protobuf enum PAUSED = 1; - */ - const PAUSED = 1; - /** - * The model is training. - * - * Generated from protobuf enum TRAINING = 2; - */ - const TRAINING = 2; - - private static $valueToName = [ - self::TRAINING_STATE_UNSPECIFIED => 'TRAINING_STATE_UNSPECIFIED', - self::PAUSED => 'PAUSED', - self::TRAINING => 'TRAINING', - ]; - - 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(TrainingState::class, \Google\Cloud\Retail\V2\Model_TrainingState::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php deleted file mode 100644 index bee83402eb8..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.retail.v2.OutputConfig - */ -class OutputConfig extends \Google\Protobuf\Internal\Message -{ - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $gcs_destination - * The Google Cloud Storage location where the output is to be written to. - * @type \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $bigquery_destination - * The BigQuery location where the output is to be written to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * The Google Cloud Storage location where the output is to be written to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1; - * @return \Google\Cloud\Retail\V2\OutputConfig\GcsDestination|null - */ - public function getGcsDestination() - { - return $this->readOneof(1); - } - - public function hasGcsDestination() - { - return $this->hasOneof(1); - } - - /** - * The Google Cloud Storage location where the output is to be written to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1; - * @param \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $var - * @return $this - */ - public function setGcsDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\GcsDestination::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The BigQuery location where the output is to be written to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2; - * @return \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination|null - */ - public function getBigqueryDestination() - { - return $this->readOneof(2); - } - - public function hasBigqueryDestination() - { - return $this->hasOneof(2); - } - - /** - * The BigQuery location where the output is to be written to. - * - * Generated from protobuf field .google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2; - * @param \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $var - * @return $this - */ - public function setBigqueryDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php deleted file mode 100644 index 5a39edd74aa..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/BigQueryDestination.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.retail.v2.OutputConfig.BigQueryDestination - */ -class BigQueryDestination extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $dataset_id = ''; - /** - * Required. The prefix of exported BigQuery tables. - * - * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $table_id_prefix = ''; - /** - * Required. Describes the table type. The following values are supported: - * * `table`: A BigQuery native table. - * * `view`: A virtual table defined by a SQL query. - * - * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $table_type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $dataset_id - * Required. The ID of a BigQuery Dataset. - * @type string $table_id_prefix - * Required. The prefix of exported BigQuery tables. - * @type string $table_type - * Required. Describes the table type. The following values are supported: - * * `table`: A BigQuery native table. - * * `view`: A virtual table defined by a SQL query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatasetId() - { - return $this->dataset_id; - } - - /** - * Required. The ID of a BigQuery Dataset. - * - * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatasetId($var) - { - GPBUtil::checkString($var, True); - $this->dataset_id = $var; - - return $this; - } - - /** - * Required. The prefix of exported BigQuery tables. - * - * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableIdPrefix() - { - return $this->table_id_prefix; - } - - /** - * Required. The prefix of exported BigQuery tables. - * - * Generated from protobuf field string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableIdPrefix($var) - { - GPBUtil::checkString($var, True); - $this->table_id_prefix = $var; - - return $this; - } - - /** - * Required. Describes the table type. The following values are supported: - * * `table`: A BigQuery native table. - * * `view`: A virtual table defined by a SQL query. - * - * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableType() - { - return $this->table_type; - } - - /** - * Required. Describes the table type. The following values are supported: - * * `table`: A BigQuery native table. - * * `view`: A virtual table defined by a SQL query. - * - * Generated from protobuf field string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableType($var) - { - GPBUtil::checkString($var, True); - $this->table_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BigQueryDestination::class, \Google\Cloud\Retail\V2\OutputConfig_BigQueryDestination::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php deleted file mode 100644 index 51297093536..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputConfig/GcsDestination.php +++ /dev/null @@ -1,94 +0,0 @@ -google.cloud.retail.v2.OutputConfig.GcsDestination - */ -class GcsDestination extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The output uri prefix for saving output data to json files. - * Some mapping examples are as follows: - * output_uri_prefix sample output(assuming the object is foo.json) - * ======================== ============================================= - * gs://bucket/ gs://bucket/foo.json - * gs://bucket/folder/ gs://bucket/folder/foo.json - * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json - * - * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_uri_prefix = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $output_uri_prefix - * Required. The output uri prefix for saving output data to json files. - * Some mapping examples are as follows: - * output_uri_prefix sample output(assuming the object is foo.json) - * ======================== ============================================= - * gs://bucket/ gs://bucket/foo.json - * gs://bucket/folder/ gs://bucket/folder/foo.json - * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The output uri prefix for saving output data to json files. - * Some mapping examples are as follows: - * output_uri_prefix sample output(assuming the object is foo.json) - * ======================== ============================================= - * gs://bucket/ gs://bucket/foo.json - * gs://bucket/folder/ gs://bucket/folder/foo.json - * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json - * - * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getOutputUriPrefix() - { - return $this->output_uri_prefix; - } - - /** - * Required. The output uri prefix for saving output data to json files. - * Some mapping examples are as follows: - * output_uri_prefix sample output(assuming the object is foo.json) - * ======================== ============================================= - * gs://bucket/ gs://bucket/foo.json - * gs://bucket/folder/ gs://bucket/folder/foo.json - * gs://bucket/folder/item_ gs://bucket/folder/item_foo.json - * - * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setOutputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_uri_prefix = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GcsDestination::class, \Google\Cloud\Retail\V2\OutputConfig_GcsDestination::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php deleted file mode 100644 index a077308ec8f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/OutputResult.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.retail.v2.OutputResult - */ -class OutputResult extends \Google\Protobuf\Internal\Message -{ - /** - * The BigQuery location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; - */ - private $bigquery_result; - /** - * The Google Cloud Storage location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; - */ - private $gcs_result; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\BigQueryOutputResult>|\Google\Protobuf\Internal\RepeatedField $bigquery_result - * The BigQuery location where the result is stored. - * @type array<\Google\Cloud\Retail\V2\GcsOutputResult>|\Google\Protobuf\Internal\RepeatedField $gcs_result - * The Google Cloud Storage location where the result is stored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce(); - parent::__construct($data); - } - - /** - * The BigQuery location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBigqueryResult() - { - return $this->bigquery_result; - } - - /** - * The BigQuery location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.BigQueryOutputResult bigquery_result = 1; - * @param array<\Google\Cloud\Retail\V2\BigQueryOutputResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBigqueryResult($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\BigQueryOutputResult::class); - $this->bigquery_result = $arr; - - return $this; - } - - /** - * The Google Cloud Storage location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGcsResult() - { - return $this->gcs_result; - } - - /** - * The Google Cloud Storage location where the result is stored. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.GcsOutputResult gcs_result = 2; - * @param array<\Google\Cloud\Retail\V2\GcsOutputResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGcsResult($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GcsOutputResult::class); - $this->gcs_result = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php deleted file mode 100644 index cddd83bb5b6..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PauseModelRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.retail.v2.PauseModelRequest - */ -class PauseModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the model to pause. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the model to pause. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * Please see {@see ModelServiceClient::modelName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\PauseModelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the model to pause. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the model to pause. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The name of the model to pause. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php deleted file mode 100644 index e1587eb62af..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictRequest.php +++ /dev/null @@ -1,708 +0,0 @@ -google.cloud.retail.v2.PredictRequest - */ -class PredictRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of the format: - * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - * or - * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - * We recommend using the `servingConfigs` resource. `placements` is a legacy - * resource. - * The ID of the Recommendations AI serving config or placement. - * Before you can request predictions from your model, you must create at - * least one serving config or placement for it. For more information, see - * [Manage serving configs] - * (https://cloud.google.com/retail/docs/manage-configs). - * The full list of available serving configs can be seen at - * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $placement = ''; - /** - * 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. - * Don't set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same - * fixed ID for different users. If you are trying to receive non-personalized - * recommendations (not recommended; this can negatively impact model - * performance), instead set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a - * random unique ID and leave - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = null; - /** - * Maximum number of results to return. Set this property to the number of - * prediction results needed. If zero, the service will choose a reasonable - * default. The maximum allowed value is 100. Values above 100 will be coerced - * to 100. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * This field is not used; leave it unset. - * - * Generated from protobuf field string page_token = 4 [deprecated = true]; - * @deprecated - */ - protected $page_token = ''; - /** - * Filter for restricting prediction results with a length limit of 5,000 - * characters. Accepts values for tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to products 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,000 characters. - * Note: "Recently viewed" models don't support tag filtering at the - * moment. - * * filterOutOfStockItems. Restricts predictions to products 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 - * If your filter blocks all prediction results, the API will return *no* - * results. If instead you want empty result sets to return generic - * (unfiltered) popular products, set `strictFiltering` to False in - * `PredictRequest.params`. Note that the API will never return items with - * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - * If `filterSyntaxV2` is set to true under the `params` field, then - * attribute-based expressions are expected instead of the above described - * tag-based syntax. Examples: - * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - * * (availability: ANY("IN_STOCK")) AND - * (colors: ANY("Red") OR categories: ANY("Phones")) - * For more information, see - * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - * - * Generated from protobuf field string filter = 5; - */ - protected $filter = ''; - /** - * Use validate only mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary products. - * Note that the validate only mode should only be used for testing the API, - * or if the model is not ready. - * - * Generated from protobuf field bool validate_only = 6; - */ - protected $validate_only = false; - /** - * Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnProduct`: Boolean. If set to true, the associated product - * object will be returned in the `results.metadata` field in the - * prediction response. - * * `returnScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned product will be set in the - * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of a product being clicked/purchased - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular products instead of empty if - * your filter blocks all prediction results. - * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-price-reranking', 'low-price-reranking', - * 'medium-price-reranking', 'high-price-reranking'}. This gives - * request-level control and adjusts prediction results based on product - * price. - * * `diversityLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-diversity', 'low-diversity', - * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - * request-level control and adjusts prediction results based on product - * category. - * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - * field is interpreteted according to the new, attribute-based syntax. - * - * Generated from protobuf field map params = 7; - */ - private $params; - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. - * - * Generated from protobuf field map labels = 8; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $placement - * Required. Full resource name of the format: - * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - * or - * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - * We recommend using the `servingConfigs` resource. `placements` is a legacy - * resource. - * The ID of the Recommendations AI serving config or placement. - * Before you can request predictions from your model, you must create at - * least one serving config or placement for it. For more information, see - * [Manage serving configs] - * (https://cloud.google.com/retail/docs/manage-configs). - * The full list of available serving configs can be seen at - * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - * @type \Google\Cloud\Retail\V2\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. - * Don't set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same - * fixed ID for different users. If you are trying to receive non-personalized - * recommendations (not recommended; this can negatively impact model - * performance), instead set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a - * random unique ID and leave - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. - * @type int $page_size - * Maximum number of results to return. Set this property to the number of - * prediction results needed. If zero, the service will choose a reasonable - * default. The maximum allowed value is 100. Values above 100 will be coerced - * to 100. - * @type string $page_token - * This field is not used; leave it unset. - * @type string $filter - * Filter for restricting prediction results with a length limit of 5,000 - * characters. Accepts values for tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to products 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,000 characters. - * Note: "Recently viewed" models don't support tag filtering at the - * moment. - * * filterOutOfStockItems. Restricts predictions to products 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 - * If your filter blocks all prediction results, the API will return *no* - * results. If instead you want empty result sets to return generic - * (unfiltered) popular products, set `strictFiltering` to False in - * `PredictRequest.params`. Note that the API will never return items with - * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - * If `filterSyntaxV2` is set to true under the `params` field, then - * attribute-based expressions are expected instead of the above described - * tag-based syntax. Examples: - * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - * * (availability: ANY("IN_STOCK")) AND - * (colors: ANY("Red") OR categories: ANY("Phones")) - * For more information, see - * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - * @type bool $validate_only - * Use validate only mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary products. - * Note that the validate only mode should only be used for testing the API, - * or if the model is not ready. - * @type array|\Google\Protobuf\Internal\MapField $params - * Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnProduct`: Boolean. If set to true, the associated product - * object will be returned in the `results.metadata` field in the - * prediction response. - * * `returnScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned product will be set in the - * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of a product being clicked/purchased - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular products instead of empty if - * your filter blocks all prediction results. - * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-price-reranking', 'low-price-reranking', - * 'medium-price-reranking', 'high-price-reranking'}. This gives - * request-level control and adjusts prediction results based on product - * price. - * * `diversityLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-diversity', 'low-diversity', - * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - * request-level control and adjusts prediction results based on product - * category. - * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - * field is interpreteted according to the new, attribute-based syntax. - * @type array|\Google\Protobuf\Internal\MapField $labels - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of the format: - * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - * or - * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - * We recommend using the `servingConfigs` resource. `placements` is a legacy - * resource. - * The ID of the Recommendations AI serving config or placement. - * Before you can request predictions from your model, you must create at - * least one serving config or placement for it. For more information, see - * [Manage serving configs] - * (https://cloud.google.com/retail/docs/manage-configs). - * The full list of available serving configs can be seen at - * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPlacement() - { - return $this->placement; - } - - /** - * Required. Full resource name of the format: - * `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - * or - * `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - * We recommend using the `servingConfigs` resource. `placements` is a legacy - * resource. - * The ID of the Recommendations AI serving config or placement. - * Before you can request predictions from your model, you must create at - * least one serving config or placement for it. For more information, see - * [Manage serving configs] - * (https://cloud.google.com/retail/docs/manage-configs). - * The full list of available serving configs can be seen at - * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPlacement($var) - { - GPBUtil::checkString($var, True); - $this->placement = $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. - * Don't set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same - * fixed ID for different users. If you are trying to receive non-personalized - * recommendations (not recommended; this can negatively impact model - * performance), instead set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a - * random unique ID and leave - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\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. - * Don't set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same - * fixed ID for different users. If you are trying to receive non-personalized - * recommendations (not recommended; this can negatively impact model - * performance), instead set - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a - * random unique ID and leave - * [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\UserEvent $var - * @return $this - */ - public function setUserEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEvent::class); - $this->user_event = $var; - - return $this; - } - - /** - * Maximum number of results to return. Set this property to the number of - * prediction results needed. If zero, the service will choose a reasonable - * default. The maximum allowed value is 100. Values above 100 will be coerced - * to 100. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of results to return. Set this property to the number of - * prediction results needed. If zero, the service will choose a reasonable - * default. The maximum allowed value is 100. Values above 100 will be coerced - * to 100. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * This field is not used; leave it unset. - * - * Generated from protobuf field string page_token = 4 [deprecated = true]; - * @return string - * @deprecated - */ - public function getPageToken() - { - @trigger_error('page_token is deprecated.', E_USER_DEPRECATED); - return $this->page_token; - } - - /** - * This field is not used; leave it unset. - * - * Generated from protobuf field string page_token = 4 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setPageToken($var) - { - @trigger_error('page_token is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filter for restricting prediction results with a length limit of 5,000 - * characters. Accepts values for tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to products 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,000 characters. - * Note: "Recently viewed" models don't support tag filtering at the - * moment. - * * filterOutOfStockItems. Restricts predictions to products 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 - * If your filter blocks all prediction results, the API will return *no* - * results. If instead you want empty result sets to return generic - * (unfiltered) popular products, set `strictFiltering` to False in - * `PredictRequest.params`. Note that the API will never return items with - * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - * If `filterSyntaxV2` is set to true under the `params` field, then - * attribute-based expressions are expected instead of the above described - * tag-based syntax. Examples: - * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - * * (availability: ANY("IN_STOCK")) AND - * (colors: ANY("Red") OR categories: ANY("Phones")) - * For more information, see - * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - * - * Generated from protobuf field string filter = 5; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter for restricting prediction results with a length limit of 5,000 - * characters. Accepts values for tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to products 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,000 characters. - * Note: "Recently viewed" models don't support tag filtering at the - * moment. - * * filterOutOfStockItems. Restricts predictions to products 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 - * If your filter blocks all prediction results, the API will return *no* - * results. If instead you want empty result sets to return generic - * (unfiltered) popular products, set `strictFiltering` to False in - * `PredictRequest.params`. Note that the API will never return items with - * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - * If `filterSyntaxV2` is set to true under the `params` field, then - * attribute-based expressions are expected instead of the above described - * tag-based syntax. Examples: - * * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - * * (availability: ANY("IN_STOCK")) AND - * (colors: ANY("Red") OR categories: ANY("Phones")) - * For more information, see - * [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - * - * Generated from protobuf field string filter = 5; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Use validate only mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary products. - * Note that the validate only mode should only be used for testing the API, - * or if the model is not ready. - * - * Generated from protobuf field bool validate_only = 6; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Use validate only mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary products. - * Note that the validate only mode should only be used for testing the API, - * or if the model is not ready. - * - * Generated from protobuf field bool validate_only = 6; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnProduct`: Boolean. If set to true, the associated product - * object will be returned in the `results.metadata` field in the - * prediction response. - * * `returnScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned product will be set in the - * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of a product being clicked/purchased - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular products instead of empty if - * your filter blocks all prediction results. - * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-price-reranking', 'low-price-reranking', - * 'medium-price-reranking', 'high-price-reranking'}. This gives - * request-level control and adjusts prediction results based on product - * price. - * * `diversityLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-diversity', 'low-diversity', - * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - * request-level control and adjusts prediction results based on product - * category. - * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - * field is interpreteted according to the new, attribute-based syntax. - * - * Generated from protobuf field map params = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getParams() - { - return $this->params; - } - - /** - * Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnProduct`: Boolean. If set to true, the associated product - * object will be returned in the `results.metadata` field in the - * prediction response. - * * `returnScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned product will be set in the - * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of a product being clicked/purchased - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular products instead of empty if - * your filter blocks all prediction results. - * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-price-reranking', 'low-price-reranking', - * 'medium-price-reranking', 'high-price-reranking'}. This gives - * request-level control and adjusts prediction results based on product - * price. - * * `diversityLevel`: String. Default empty. If set to be non-empty, then - * it needs to be one of {'no-diversity', 'low-diversity', - * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - * request-level control and adjusts prediction results based on product - * category. - * * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - * field is interpreteted according to the new, attribute-based syntax. - * - * Generated from protobuf field map params = 7; - * @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; - } - - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. - * - * Generated from protobuf field map labels = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. - * - * Generated from protobuf field map labels = 8; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php deleted file mode 100644 index af070db151c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.retail.v2.PredictResponse - */ -class PredictResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of recommended products. The order represents the ranking (from the - * most relevant product to the least). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; - */ - private $results; - /** - * A unique attribution token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * recommendation, which enables accurate attribution of recommendation model - * performance. - * - * Generated from protobuf field string attribution_token = 2; - */ - protected $attribution_token = ''; - /** - * IDs of products in the request that were missing from the inventory. - * - * Generated from protobuf field repeated string missing_ids = 3; - */ - private $missing_ids; - /** - * True if the validateOnly property was set in the request. - * - * Generated from protobuf field bool validate_only = 4; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $results - * A list of recommended products. The order represents the ranking (from the - * most relevant product to the least). - * @type string $attribution_token - * A unique attribution token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * recommendation, which enables accurate attribution of recommendation model - * performance. - * @type array|\Google\Protobuf\Internal\RepeatedField $missing_ids - * IDs of products in the request that were missing from the inventory. - * @type bool $validate_only - * True if the validateOnly property was set in the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * A list of recommended products. The order represents the ranking (from the - * most relevant product to the least). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResults() - { - return $this->results; - } - - /** - * A list of recommended products. The order represents the ranking (from the - * most relevant product to the least). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1; - * @param array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\PredictResponse\PredictionResult::class); - $this->results = $arr; - - return $this; - } - - /** - * A unique attribution token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * recommendation, which enables accurate attribution of recommendation model - * performance. - * - * Generated from protobuf field string attribution_token = 2; - * @return string - */ - public function getAttributionToken() - { - return $this->attribution_token; - } - - /** - * A unique attribution token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * recommendation, which enables accurate attribution of recommendation model - * performance. - * - * Generated from protobuf field string attribution_token = 2; - * @param string $var - * @return $this - */ - public function setAttributionToken($var) - { - GPBUtil::checkString($var, True); - $this->attribution_token = $var; - - return $this; - } - - /** - * IDs of products in the request that were missing from the inventory. - * - * Generated from protobuf field repeated string missing_ids = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMissingIds() - { - return $this->missing_ids; - } - - /** - * IDs of products in the request that were missing from the inventory. - * - * Generated from protobuf field repeated string missing_ids = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMissingIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->missing_ids = $arr; - - return $this; - } - - /** - * True if the validateOnly property was set in the request. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * True if the validateOnly property was set in the request. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php deleted file mode 100644 index d8ffc3b8276..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PredictResponse/PredictionResult.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.retail.v2.PredictResponse.PredictionResult - */ -class PredictionResult extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the recommended product - * - * Generated from protobuf field string id = 1; - */ - protected $id = ''; - /** - * Additional product metadata / annotations. - * Possible values: - * * `product`: JSON representation of the product. Is set if - * `returnProduct` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Is set if - * `returnScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map metadata = 2; - */ - private $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * ID of the recommended product - * @type array|\Google\Protobuf\Internal\MapField $metadata - * Additional product metadata / annotations. - * Possible values: - * * `product`: JSON representation of the product. Is set if - * `returnProduct` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Is set if - * `returnScore` is set to true in `PredictRequest.params`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * ID of the recommended product - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * ID of the recommended product - * - * 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 product metadata / annotations. - * Possible values: - * * `product`: JSON representation of the product. Is set if - * `returnProduct` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Is set if - * `returnScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Additional product metadata / annotations. - * Possible values: - * * `product`: JSON representation of the product. Is set if - * `returnProduct` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Is set if - * `returnScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map metadata = 2; - * @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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PredictionResult::class, \Google\Cloud\Retail\V2\PredictResponse_PredictionResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php deleted file mode 100644 index 31a7e1a2114..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo.php +++ /dev/null @@ -1,505 +0,0 @@ -google.cloud.retail.v2.PriceInfo - */ -class PriceInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The 3-letter currency code defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html). - * If this field is an unrecognizable currency code, an INVALID_ARGUMENT - * error is returned. - * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s with the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * must share the same - * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, - * a FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string currency_code = 1; - */ - protected $currency_code = ''; - /** - * Price of the product. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). Schema.org - * property [Offer.price](https://schema.org/price). - * - * Generated from protobuf field float price = 2; - */ - protected $price = 0.0; - /** - * Price of the product without any discount. If zero, by default set to be - * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be - * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], - * otherwise an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field float original_price = 3; - */ - protected $original_price = 0.0; - /** - * The costs associated with the sale of a particular product. Used for gross - * profit reporting. - * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - - * [cost][google.cloud.retail.v2.PriceInfo.cost] - * Google Merchant Center property - * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). - * - * Generated from protobuf field float cost = 4; - */ - protected $cost = 0.0; - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * starts to be effective. This can be set as a future timestamp, and the - * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search - * after - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * If so, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used before - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; - */ - protected $price_effective_time = null; - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] - * is used for search before - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If - * this field is set, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used after - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; - */ - protected $price_expire_time = null; - /** - * Output only. The price range of all the child - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s grouped together on the - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Only populated for - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $price_range = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $currency_code - * The 3-letter currency code defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html). - * If this field is an unrecognizable currency code, an INVALID_ARGUMENT - * error is returned. - * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s with the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * must share the same - * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, - * a FAILED_PRECONDITION error is returned. - * @type float $price - * Price of the product. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). Schema.org - * property [Offer.price](https://schema.org/price). - * @type float $original_price - * Price of the product without any discount. If zero, by default set to be - * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be - * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], - * otherwise an INVALID_ARGUMENT error is thrown. - * @type float $cost - * The costs associated with the sale of a particular product. Used for gross - * profit reporting. - * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - - * [cost][google.cloud.retail.v2.PriceInfo.cost] - * Google Merchant Center property - * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). - * @type \Google\Protobuf\Timestamp $price_effective_time - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * starts to be effective. This can be set as a future timestamp, and the - * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search - * after - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * If so, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used before - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * @type \Google\Protobuf\Timestamp $price_expire_time - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] - * is used for search before - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If - * this field is set, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used after - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * @type \Google\Cloud\Retail\V2\PriceInfo\PriceRange $price_range - * Output only. The price range of all the child - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s grouped together on the - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Only populated for - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The 3-letter currency code defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html). - * If this field is an unrecognizable currency code, an INVALID_ARGUMENT - * error is returned. - * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s with the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * must share the same - * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, - * a FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string currency_code = 1; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * The 3-letter currency code defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html). - * If this field is an unrecognizable currency code, an INVALID_ARGUMENT - * error is returned. - * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s with the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * must share the same - * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, - * a FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string currency_code = 1; - * @param string $var - * @return $this - */ - public function setCurrencyCode($var) - { - GPBUtil::checkString($var, True); - $this->currency_code = $var; - - return $this; - } - - /** - * Price of the product. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). Schema.org - * property [Offer.price](https://schema.org/price). - * - * Generated from protobuf field float price = 2; - * @return float - */ - public function getPrice() - { - return $this->price; - } - - /** - * Price of the product. - * Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). Schema.org - * property [Offer.price](https://schema.org/price). - * - * Generated from protobuf field float price = 2; - * @param float $var - * @return $this - */ - public function setPrice($var) - { - GPBUtil::checkFloat($var); - $this->price = $var; - - return $this; - } - - /** - * Price of the product without any discount. If zero, by default set to be - * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be - * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], - * otherwise an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field float original_price = 3; - * @return float - */ - public function getOriginalPrice() - { - return $this->original_price; - } - - /** - * Price of the product without any discount. If zero, by default set to be - * the [price][google.cloud.retail.v2.PriceInfo.price]. If set, - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be - * greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], - * otherwise an INVALID_ARGUMENT error is thrown. - * - * Generated from protobuf field float original_price = 3; - * @param float $var - * @return $this - */ - public function setOriginalPrice($var) - { - GPBUtil::checkFloat($var); - $this->original_price = $var; - - return $this; - } - - /** - * The costs associated with the sale of a particular product. Used for gross - * profit reporting. - * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - - * [cost][google.cloud.retail.v2.PriceInfo.cost] - * Google Merchant Center property - * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). - * - * Generated from protobuf field float cost = 4; - * @return float - */ - public function getCost() - { - return $this->cost; - } - - /** - * The costs associated with the sale of a particular product. Used for gross - * profit reporting. - * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] - - * [cost][google.cloud.retail.v2.PriceInfo.cost] - * Google Merchant Center property - * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). - * - * Generated from protobuf field float cost = 4; - * @param float $var - * @return $this - */ - public function setCost($var) - { - GPBUtil::checkFloat($var); - $this->cost = $var; - - return $this; - } - - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * starts to be effective. This can be set as a future timestamp, and the - * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search - * after - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * If so, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used before - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPriceEffectiveTime() - { - return $this->price_effective_time; - } - - public function hasPriceEffectiveTime() - { - return isset($this->price_effective_time); - } - - public function clearPriceEffectiveTime() - { - unset($this->price_effective_time); - } - - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * starts to be effective. This can be set as a future timestamp, and the - * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search - * after - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * If so, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used before - * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_effective_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPriceEffectiveTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->price_effective_time = $var; - - return $this; - } - - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] - * is used for search before - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If - * this field is set, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used after - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPriceExpireTime() - { - return $this->price_expire_time; - } - - public function hasPriceExpireTime() - { - return isset($this->price_expire_time); - } - - public function clearPriceExpireTime() - { - unset($this->price_expire_time); - } - - /** - * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] - * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] - * is used for search before - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If - * this field is set, the - * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be - * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] - * is used after - * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. - * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always - * effective because it will cause additional latency during search. - * - * Generated from protobuf field .google.protobuf.Timestamp price_expire_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPriceExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->price_expire_time = $var; - - return $this; - } - - /** - * Output only. The price range of all the child - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s grouped together on the - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Only populated for - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Retail\V2\PriceInfo\PriceRange|null - */ - public function getPriceRange() - { - return $this->price_range; - } - - public function hasPriceRange() - { - return isset($this->price_range); - } - - public function clearPriceRange() - { - unset($this->price_range); - } - - /** - * Output only. The price range of all the child - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s grouped together on the - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Only populated for - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Retail\V2\PriceInfo\PriceRange $var - * @return $this - */ - public function setPriceRange($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo\PriceRange::class); - $this->price_range = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php deleted file mode 100644 index bcd10811f24..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PriceInfo/PriceRange.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.retail.v2.PriceInfo.PriceRange - */ -class PriceRange extends \Google\Protobuf\Internal\Message -{ - /** - * The inclusive - * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] - * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; - */ - protected $price = null; - /** - * The inclusive - * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] - * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; - */ - protected $original_price = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Interval $price - * The inclusive - * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] - * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * @type \Google\Cloud\Retail\V2\Interval $original_price - * The inclusive - * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] - * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The inclusive - * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] - * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; - * @return \Google\Cloud\Retail\V2\Interval|null - */ - public function getPrice() - { - return $this->price; - } - - public function hasPrice() - { - return isset($this->price); - } - - public function clearPrice() - { - unset($this->price); - } - - /** - * The inclusive - * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price] - * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval price = 1; - * @param \Google\Cloud\Retail\V2\Interval $var - * @return $this - */ - public function setPrice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); - $this->price = $var; - - return $this; - } - - /** - * The inclusive - * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] - * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; - * @return \Google\Cloud\Retail\V2\Interval|null - */ - public function getOriginalPrice() - { - return $this->original_price; - } - - public function hasOriginalPrice() - { - return isset($this->original_price); - } - - public function clearOriginalPrice() - { - unset($this->original_price); - } - - /** - * The inclusive - * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price] - * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] having the same - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]. - * - * Generated from protobuf field .google.cloud.retail.v2.Interval original_price = 2; - * @param \Google\Cloud\Retail\V2\Interval $var - * @return $this - */ - public function setOriginalPrice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); - $this->original_price = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PriceRange::class, \Google\Cloud\Retail\V2\PriceInfo_PriceRange::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php deleted file mode 100644 index 0d56e63f4e4..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product.php +++ /dev/null @@ -1,2502 +0,0 @@ -google.cloud.retail.v2.Product - */ -class Product extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. Full resource name of the product, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is - * the final component of [name][google.cloud.retail.v2.Product.name]. For - * example, this field is "id_1", if - * [name][google.cloud.retail.v2.Product.name] is - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [id](https://support.google.com/merchants/answer/6324405). Schema.org - * property [Product.sku](https://schema.org/sku). - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $id = ''; - /** - * Immutable. The type of the product. Default to - * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * if unset. - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $type = 0; - /** - * Variant group identifier. Must be an - * [id][google.cloud.retail.v2.Product.id], with the same parent branch with - * this product. Otherwise, an error is thrown. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or - * set to the same value as [id][google.cloud.retail.v2.Product.id]. - * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot - * be empty. A maximum of 2,000 products are allowed to share the same - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT - * error is returned. - * Corresponding properties: Google Merchant Center property - * [item_group_id](https://support.google.com/merchants/answer/6324507). - * Schema.org property - * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - * - * Generated from protobuf field string primary_product_id = 4; - */ - protected $primary_product_id = ''; - /** - * The [id][google.cloud.retail.v2.Product.id] of the collection members when - * [type][google.cloud.retail.v2.Product.type] is - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. - * Non-existent product ids are allowed. - * The [type][google.cloud.retail.v2.Product.type] of the members must be - * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an - * INVALID_ARGUMENT error is thrown. Should not set it for other types. A - * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is - * return. - * - * Generated from protobuf field repeated string collection_member_ids = 5; - */ - private $collection_member_ids; - /** - * The Global Trade Item Number (GTIN) of the product. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponding properties: Google Merchant Center property - * [gtin](https://support.google.com/merchants/answer/6324461). - * Schema.org property - * [Product.isbn](https://schema.org/isbn), - * [Product.gtin8](https://schema.org/gtin8), - * [Product.gtin12](https://schema.org/gtin12), - * [Product.gtin13](https://schema.org/gtin13), or - * [Product.gtin14](https://schema.org/gtin14). - * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string gtin = 6; - */ - protected $gtin = ''; - /** - * Product categories. This field is repeated for supporting one product - * belonging to several parallel categories. Strongly recommended using the - * full path for better search / recommendation quality. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categories": [ - * "Shoes & Accessories > Shoes", - * "Sports & Fitness > Athletic Clothing > Shoes" - * ] - * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT - * error is returned. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product] unless overridden through the - * Google Cloud console. Empty values are not allowed. Each value must be a - * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [google_product_category][mc_google_product_category]. Schema.org property - * [Product.category] (https://schema.org/category). - * [mc_google_product_category]: - * https://support.google.com/merchants/answer/6324436 - * - * Generated from protobuf field repeated string categories = 7; - */ - private $categories; - /** - * Required. Product title. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [title](https://support.google.com/merchants/answer/6324415). Schema.org - * property [Product.name](https://schema.org/name). - * - * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $title = ''; - /** - * The brands of the product. - * A maximum of 30 brands are allowed unless overridden through the Google - * Cloud console. Each - * brand must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [brand](https://support.google.com/merchants/answer/6324351). Schema.org - * property [Product.brand](https://schema.org/brand). - * - * Generated from protobuf field repeated string brands = 9; - */ - private $brands; - /** - * Product description. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [description](https://support.google.com/merchants/answer/6324468). - * Schema.org property [Product.description](https://schema.org/description). - * - * Generated from protobuf field string description = 10; - */ - protected $description = ''; - /** - * Language of the title/description and other string attributes. Use language - * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - * For product prediction, this field is ignored and the model automatically - * detects the text language. The [Product][google.cloud.retail.v2.Product] - * can include text in different languages, but duplicating - * [Product][google.cloud.retail.v2.Product]s to provide text in multiple - * languages can result in degraded model performance. - * For product search this field is in use. It defaults to "en-US" if unset. - * - * Generated from protobuf field string language_code = 11; - */ - protected $language_code = ''; - /** - * Highly encouraged. Extra product attributes to be included. For example, - * for 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 attributes here. - * Features that can take on one of a limited number of possible values. Two - * types of features can be set are: - * Textual features. some examples would be the brand/maker of a product, or - * country of a customer. Numerical features. Some examples would be the - * height/weight of a product, or age of a customer. - * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, - * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} - * }`. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * Max entries count: 200. - * * The key must be a UTF-8 encoded string with a length limit of 128 - * characters. - * * For indexable attribute, the key must match the pattern: - * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or - * `KEY_1_LIKE_THIS`. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a non-empty UTF-8 encoded string with a - * length limit of 256 characters. - * * For number attributes, at most 400 values are allowed. - * - * Generated from protobuf field map attributes = 12; - */ - private $attributes; - /** - * Custom tags associated with the product. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 - * encoded string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the - * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. - * Corresponding properties: Google Merchant Center property - * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). - * - * Generated from protobuf field repeated string tags = 13; - */ - private $tags; - /** - * Product price and cost information. - * Corresponding properties: Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; - */ - protected $price_info = null; - /** - * The rating of this product. - * - * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; - */ - protected $rating = null; - /** - * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * - * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; - */ - protected $available_time = null; - /** - * The online availability of the [Product][google.cloud.retail.v2.Product]. - * Default to - * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. - * For primary products with variants set the availability of the primary as - * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] - * and set the true availability at the variant level. This way the primary - * product will be considered "in stock" as long as it has at least one - * variant in stock. - * For primary products with no variants set the true availability at the - * primary level. - * Corresponding properties: Google Merchant Center property - * [availability](https://support.google.com/merchants/answer/6324448). - * Schema.org property [Offer.availability](https://schema.org/availability). - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; - */ - protected $availability = 0; - /** - * The available quantity of the item. - * - * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; - */ - protected $available_quantity = null; - /** - * Fulfillment information, such as the store IDs for in-store pickup or - * region IDs for different shipping methods. - * All the elements must have distinct - * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; - */ - private $fulfillment_info; - /** - * Canonical URL directly linking to the product detail page. - * It is strongly recommended to provide a valid uri for the product, - * otherwise the service performance could be significantly degraded. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [link](https://support.google.com/merchants/answer/6324416). Schema.org - * property [Offer.url](https://schema.org/url). - * - * Generated from protobuf field string uri = 22; - */ - protected $uri = ''; - /** - * Product images for the product. We highly recommend putting the main - * image first. - * A maximum of 300 images are allowed. - * Corresponding properties: Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; - */ - private $images; - /** - * The target group associated with a given audience (e.g. male, veterans, - * car owners, musicians, etc.) of the product. - * - * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; - */ - protected $audience = null; - /** - * The color of the product. - * Corresponding properties: Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; - */ - protected $color_info = null; - /** - * The size of the product. To represent different size systems or size types, - * consider using this format: [[[size_system:]size_type:]size_value]. - * For example, in "US:MENS:M", "US" represents size system; "MENS" represents - * size type; "M" represents size value. In "GIRLS:27", size system is empty; - * "GIRLS" represents size type; "27" represents size value. In "32 inches", - * both size system and size type are empty, while size value is "32 inches". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [size](https://support.google.com/merchants/answer/6324492), - * [size_type](https://support.google.com/merchants/answer/6324497), and - * [size_system](https://support.google.com/merchants/answer/6324502). - * Schema.org property [Product.size](https://schema.org/size). - * - * Generated from protobuf field repeated string sizes = 26; - */ - private $sizes; - /** - * The material of the product. For example, "leather", "wooden". - * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 200 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [material](https://support.google.com/merchants/answer/6324410). Schema.org - * property [Product.material](https://schema.org/material). - * - * Generated from protobuf field repeated string materials = 27; - */ - private $materials; - /** - * The pattern or graphic print of the product. For example, "striped", "polka - * dot", "paisley". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org - * property [Product.pattern](https://schema.org/pattern). - * - * Generated from protobuf field repeated string patterns = 28; - */ - private $patterns; - /** - * The condition of the product. Strongly encouraged to use the standard - * values: "new", "refurbished", "used". - * A maximum of 1 value is allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [condition](https://support.google.com/merchants/answer/6324469). - * Schema.org property - * [Offer.itemCondition](https://schema.org/itemCondition). - * - * Generated from protobuf field repeated string conditions = 29; - */ - private $conditions; - /** - * The promotions applied to the product. A maximum of 10 values are allowed - * per [Product][google.cloud.retail.v2.Product]. Only - * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] - * will be used, other fields will be ignored if set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; - */ - private $promotions; - /** - * The timestamp when the product is published by the retailer for the first - * time, which indicates the freshness of the products. Note that this field - * is different from - * [available_time][google.cloud.retail.v2.Product.available_time], given it - * purely describes product freshness regardless of when it is available on - * search and recommendation. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; - */ - protected $publish_time = null; - /** - * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s - * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. - * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: - * * [audience][google.cloud.retail.v2.Product.audience] - * * [availability][google.cloud.retail.v2.Product.availability] - * * [brands][google.cloud.retail.v2.Product.brands] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * * [conditions][google.cloud.retail.v2.Product.conditions] - * * [gtin][google.cloud.retail.v2.Product.gtin] - * * [materials][google.cloud.retail.v2.Product.materials] - * * [name][google.cloud.retail.v2.Product.name] - * * [patterns][google.cloud.retail.v2.Product.patterns] - * * [price_info][google.cloud.retail.v2.Product.price_info] - * * [rating][google.cloud.retail.v2.Product.rating] - * * [sizes][google.cloud.retail.v2.Product.sizes] - * * [title][google.cloud.retail.v2.Product.title] - * * [uri][google.cloud.retail.v2.Product.uri] - * Supported fields only for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: - * * [categories][google.cloud.retail.v2.Product.categories] - * * [description][google.cloud.retail.v2.Product.description] - * * [images][google.cloud.retail.v2.Product.images] - * Supported fields only for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: - * * Only the first image in [images][google.cloud.retail.v2.Product.images] - * To mark [attributes][google.cloud.retail.v2.Product.attributes] as - * retrievable, include paths of the form "attributes.key" where "key" is the - * key of a custom attribute, as specified in - * [attributes][google.cloud.retail.v2.Product.attributes]. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the - * following fields are always returned in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: - * * [name][google.cloud.retail.v2.Product.name] - * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the - * following fields are always returned in by default: - * * [name][google.cloud.retail.v2.Product.name] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * Note: Returning more fields in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase - * response payload size and serving latency. - * This field is deprecated. Use the retrievable site-wide control instead. - * - * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; - * @deprecated - */ - protected $retrievable_fields = null; - /** - * Output only. Product variants grouped together on primary product which - * share similar product attributes. It's automatically grouped by - * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for - * all the product variants. Only populated for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $variants; - /** - * Output only. A list of local inventories specific to different places. - * This field can be managed by - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * and - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * APIs if fine-grained, high-volume updates are necessary. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $local_inventories; - protected $expiration; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $expire_time - * Note that this field is applied in the following ways: - * * If the [Product][google.cloud.retail.v2.Product] is already expired - * when it is uploaded, this product - * is not indexed for search. - * * If the [Product][google.cloud.retail.v2.Product] is not expired when it - * is uploaded, only the - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s - * expireTime is respected, and - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s - * expireTime is not used. - * In general, we suggest the users to delete the stale - * products explicitly, instead of using this field to determine staleness. - * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later - * than [available_time][google.cloud.retail.v2.Product.available_time] and - * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an - * INVALID_ARGUMENT error is thrown. - * Corresponding properties: Google Merchant Center property - * [expiration_date](https://support.google.com/merchants/answer/6324499). - * @type \Google\Protobuf\Duration $ttl - * Input only. The TTL (time to live) of the product. Note that this is only - * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], - * and ignored for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, - * we suggest the users to delete the stale products explicitly, instead of - * using this field to determine staleness. - * If it is set, it must be a non-negative value, and - * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The - * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is - * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is - * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. - * If it is set, the product is not available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. - * However, the product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * @type string $name - * Immutable. Full resource name of the product, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. - * @type string $id - * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is - * the final component of [name][google.cloud.retail.v2.Product.name]. For - * example, this field is "id_1", if - * [name][google.cloud.retail.v2.Product.name] is - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [id](https://support.google.com/merchants/answer/6324405). Schema.org - * property [Product.sku](https://schema.org/sku). - * @type int $type - * Immutable. The type of the product. Default to - * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * if unset. - * @type string $primary_product_id - * Variant group identifier. Must be an - * [id][google.cloud.retail.v2.Product.id], with the same parent branch with - * this product. Otherwise, an error is thrown. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or - * set to the same value as [id][google.cloud.retail.v2.Product.id]. - * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot - * be empty. A maximum of 2,000 products are allowed to share the same - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT - * error is returned. - * Corresponding properties: Google Merchant Center property - * [item_group_id](https://support.google.com/merchants/answer/6324507). - * Schema.org property - * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_member_ids - * The [id][google.cloud.retail.v2.Product.id] of the collection members when - * [type][google.cloud.retail.v2.Product.type] is - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. - * Non-existent product ids are allowed. - * The [type][google.cloud.retail.v2.Product.type] of the members must be - * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an - * INVALID_ARGUMENT error is thrown. Should not set it for other types. A - * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is - * return. - * @type string $gtin - * The Global Trade Item Number (GTIN) of the product. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponding properties: Google Merchant Center property - * [gtin](https://support.google.com/merchants/answer/6324461). - * Schema.org property - * [Product.isbn](https://schema.org/isbn), - * [Product.gtin8](https://schema.org/gtin8), - * [Product.gtin12](https://schema.org/gtin12), - * [Product.gtin13](https://schema.org/gtin13), or - * [Product.gtin14](https://schema.org/gtin14). - * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $categories - * Product categories. This field is repeated for supporting one product - * belonging to several parallel categories. Strongly recommended using the - * full path for better search / recommendation quality. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categories": [ - * "Shoes & Accessories > Shoes", - * "Sports & Fitness > Athletic Clothing > Shoes" - * ] - * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT - * error is returned. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product] unless overridden through the - * Google Cloud console. Empty values are not allowed. Each value must be a - * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [google_product_category][mc_google_product_category]. Schema.org property - * [Product.category] (https://schema.org/category). - * [mc_google_product_category]: - * https://support.google.com/merchants/answer/6324436 - * @type string $title - * Required. Product title. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [title](https://support.google.com/merchants/answer/6324415). Schema.org - * property [Product.name](https://schema.org/name). - * @type array|\Google\Protobuf\Internal\RepeatedField $brands - * The brands of the product. - * A maximum of 30 brands are allowed unless overridden through the Google - * Cloud console. Each - * brand must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [brand](https://support.google.com/merchants/answer/6324351). Schema.org - * property [Product.brand](https://schema.org/brand). - * @type string $description - * Product description. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [description](https://support.google.com/merchants/answer/6324468). - * Schema.org property [Product.description](https://schema.org/description). - * @type string $language_code - * Language of the title/description and other string attributes. Use language - * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - * For product prediction, this field is ignored and the model automatically - * detects the text language. The [Product][google.cloud.retail.v2.Product] - * can include text in different languages, but duplicating - * [Product][google.cloud.retail.v2.Product]s to provide text in multiple - * languages can result in degraded model performance. - * For product search this field is in use. It defaults to "en-US" if unset. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Highly encouraged. Extra product attributes to be included. For example, - * for 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 attributes here. - * Features that can take on one of a limited number of possible values. Two - * types of features can be set are: - * Textual features. some examples would be the brand/maker of a product, or - * country of a customer. Numerical features. Some examples would be the - * height/weight of a product, or age of a customer. - * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, - * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} - * }`. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * Max entries count: 200. - * * The key must be a UTF-8 encoded string with a length limit of 128 - * characters. - * * For indexable attribute, the key must match the pattern: - * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or - * `KEY_1_LIKE_THIS`. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a non-empty UTF-8 encoded string with a - * length limit of 256 characters. - * * For number attributes, at most 400 values are allowed. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Custom tags associated with the product. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 - * encoded string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the - * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. - * Corresponding properties: Google Merchant Center property - * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). - * @type \Google\Cloud\Retail\V2\PriceInfo $price_info - * Product price and cost information. - * Corresponding properties: Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * @type \Google\Cloud\Retail\V2\Rating $rating - * The rating of this product. - * @type \Google\Protobuf\Timestamp $available_time - * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * @type int $availability - * The online availability of the [Product][google.cloud.retail.v2.Product]. - * Default to - * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. - * For primary products with variants set the availability of the primary as - * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] - * and set the true availability at the variant level. This way the primary - * product will be considered "in stock" as long as it has at least one - * variant in stock. - * For primary products with no variants set the true availability at the - * primary level. - * Corresponding properties: Google Merchant Center property - * [availability](https://support.google.com/merchants/answer/6324448). - * Schema.org property [Offer.availability](https://schema.org/availability). - * @type \Google\Protobuf\Int32Value $available_quantity - * The available quantity of the item. - * @type array<\Google\Cloud\Retail\V2\FulfillmentInfo>|\Google\Protobuf\Internal\RepeatedField $fulfillment_info - * Fulfillment information, such as the store IDs for in-store pickup or - * region IDs for different shipping methods. - * All the elements must have distinct - * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $uri - * Canonical URL directly linking to the product detail page. - * It is strongly recommended to provide a valid uri for the product, - * otherwise the service performance could be significantly degraded. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [link](https://support.google.com/merchants/answer/6324416). Schema.org - * property [Offer.url](https://schema.org/url). - * @type array<\Google\Cloud\Retail\V2\Image>|\Google\Protobuf\Internal\RepeatedField $images - * Product images for the product. We highly recommend putting the main - * image first. - * A maximum of 300 images are allowed. - * Corresponding properties: Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * @type \Google\Cloud\Retail\V2\Audience $audience - * The target group associated with a given audience (e.g. male, veterans, - * car owners, musicians, etc.) of the product. - * @type \Google\Cloud\Retail\V2\ColorInfo $color_info - * The color of the product. - * Corresponding properties: Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * @type array|\Google\Protobuf\Internal\RepeatedField $sizes - * The size of the product. To represent different size systems or size types, - * consider using this format: [[[size_system:]size_type:]size_value]. - * For example, in "US:MENS:M", "US" represents size system; "MENS" represents - * size type; "M" represents size value. In "GIRLS:27", size system is empty; - * "GIRLS" represents size type; "27" represents size value. In "32 inches", - * both size system and size type are empty, while size value is "32 inches". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [size](https://support.google.com/merchants/answer/6324492), - * [size_type](https://support.google.com/merchants/answer/6324497), and - * [size_system](https://support.google.com/merchants/answer/6324502). - * Schema.org property [Product.size](https://schema.org/size). - * @type array|\Google\Protobuf\Internal\RepeatedField $materials - * The material of the product. For example, "leather", "wooden". - * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 200 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [material](https://support.google.com/merchants/answer/6324410). Schema.org - * property [Product.material](https://schema.org/material). - * @type array|\Google\Protobuf\Internal\RepeatedField $patterns - * The pattern or graphic print of the product. For example, "striped", "polka - * dot", "paisley". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org - * property [Product.pattern](https://schema.org/pattern). - * @type array|\Google\Protobuf\Internal\RepeatedField $conditions - * The condition of the product. Strongly encouraged to use the standard - * values: "new", "refurbished", "used". - * A maximum of 1 value is allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [condition](https://support.google.com/merchants/answer/6324469). - * Schema.org property - * [Offer.itemCondition](https://schema.org/itemCondition). - * @type array<\Google\Cloud\Retail\V2\Promotion>|\Google\Protobuf\Internal\RepeatedField $promotions - * The promotions applied to the product. A maximum of 10 values are allowed - * per [Product][google.cloud.retail.v2.Product]. Only - * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] - * will be used, other fields will be ignored if set. - * @type \Google\Protobuf\Timestamp $publish_time - * The timestamp when the product is published by the retailer for the first - * time, which indicates the freshness of the products. Note that this field - * is different from - * [available_time][google.cloud.retail.v2.Product.available_time], given it - * purely describes product freshness regardless of when it is available on - * search and recommendation. - * @type \Google\Protobuf\FieldMask $retrievable_fields - * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s - * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. - * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: - * * [audience][google.cloud.retail.v2.Product.audience] - * * [availability][google.cloud.retail.v2.Product.availability] - * * [brands][google.cloud.retail.v2.Product.brands] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * * [conditions][google.cloud.retail.v2.Product.conditions] - * * [gtin][google.cloud.retail.v2.Product.gtin] - * * [materials][google.cloud.retail.v2.Product.materials] - * * [name][google.cloud.retail.v2.Product.name] - * * [patterns][google.cloud.retail.v2.Product.patterns] - * * [price_info][google.cloud.retail.v2.Product.price_info] - * * [rating][google.cloud.retail.v2.Product.rating] - * * [sizes][google.cloud.retail.v2.Product.sizes] - * * [title][google.cloud.retail.v2.Product.title] - * * [uri][google.cloud.retail.v2.Product.uri] - * Supported fields only for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: - * * [categories][google.cloud.retail.v2.Product.categories] - * * [description][google.cloud.retail.v2.Product.description] - * * [images][google.cloud.retail.v2.Product.images] - * Supported fields only for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: - * * Only the first image in [images][google.cloud.retail.v2.Product.images] - * To mark [attributes][google.cloud.retail.v2.Product.attributes] as - * retrievable, include paths of the form "attributes.key" where "key" is the - * key of a custom attribute, as specified in - * [attributes][google.cloud.retail.v2.Product.attributes]. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the - * following fields are always returned in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: - * * [name][google.cloud.retail.v2.Product.name] - * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the - * following fields are always returned in by default: - * * [name][google.cloud.retail.v2.Product.name] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * Note: Returning more fields in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase - * response payload size and serving latency. - * This field is deprecated. Use the retrievable site-wide control instead. - * @type array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $variants - * Output only. Product variants grouped together on primary product which - * share similar product attributes. It's automatically grouped by - * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for - * all the product variants. Only populated for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * @type array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $local_inventories - * Output only. A list of local inventories specific to different places. - * This field can be managed by - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * and - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * APIs if fine-grained, high-volume updates are necessary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Product::initOnce(); - parent::__construct($data); - } - - /** - * Note that this field is applied in the following ways: - * * If the [Product][google.cloud.retail.v2.Product] is already expired - * when it is uploaded, this product - * is not indexed for search. - * * If the [Product][google.cloud.retail.v2.Product] is not expired when it - * is uploaded, only the - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s - * expireTime is respected, and - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s - * expireTime is not used. - * In general, we suggest the users to delete the stale - * products explicitly, instead of using this field to determine staleness. - * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later - * than [available_time][google.cloud.retail.v2.Product.available_time] and - * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an - * INVALID_ARGUMENT error is thrown. - * Corresponding properties: Google Merchant Center property - * [expiration_date](https://support.google.com/merchants/answer/6324499). - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 16; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->readOneof(16); - } - - public function hasExpireTime() - { - return $this->hasOneof(16); - } - - /** - * Note that this field is applied in the following ways: - * * If the [Product][google.cloud.retail.v2.Product] is already expired - * when it is uploaded, this product - * is not indexed for search. - * * If the [Product][google.cloud.retail.v2.Product] is not expired when it - * is uploaded, only the - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s - * expireTime is respected, and - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s - * expireTime is not used. - * In general, we suggest the users to delete the stale - * products explicitly, instead of using this field to determine staleness. - * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later - * than [available_time][google.cloud.retail.v2.Product.available_time] and - * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an - * INVALID_ARGUMENT error is thrown. - * Corresponding properties: Google Merchant Center property - * [expiration_date](https://support.google.com/merchants/answer/6324499). - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 16; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(16, $var); - - return $this; - } - - /** - * Input only. The TTL (time to live) of the product. Note that this is only - * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], - * and ignored for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, - * we suggest the users to delete the stale products explicitly, instead of - * using this field to determine staleness. - * If it is set, it must be a non-negative value, and - * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The - * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is - * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is - * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. - * If it is set, the product is not available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. - * However, the product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * Generated from protobuf field .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Duration|null - */ - public function getTtl() - { - return $this->readOneof(17); - } - - public function hasTtl() - { - return $this->hasOneof(17); - } - - /** - * Input only. The TTL (time to live) of the product. Note that this is only - * applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], - * and ignored for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general, - * we suggest the users to delete the stale products explicitly, instead of - * using this field to determine staleness. - * If it is set, it must be a non-negative value, and - * [expire_time][google.cloud.retail.v2.Product.expire_time] is set as - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. The - * derived [expire_time][google.cloud.retail.v2.Product.expire_time] is - * returned in the output and [ttl][google.cloud.retail.v2.Product.ttl] is - * left blank when retrieving the [Product][google.cloud.retail.v2.Product]. - * If it is set, the product is not available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl]. - * However, the product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * Generated from protobuf field .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->writeOneof(17, $var); - - return $this; - } - - /** - * Immutable. Full resource name of the product, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. Full resource name of the product, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is - * the final component of [name][google.cloud.retail.v2.Product.name]. For - * example, this field is "id_1", if - * [name][google.cloud.retail.v2.Product.name] is - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [id](https://support.google.com/merchants/answer/6324405). Schema.org - * property [Product.sku](https://schema.org/sku). - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is - * the final component of [name][google.cloud.retail.v2.Product.name]. For - * example, this field is "id_1", if - * [name][google.cloud.retail.v2.Product.name] is - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [id](https://support.google.com/merchants/answer/6324405). Schema.org - * property [Product.sku](https://schema.org/sku). - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Immutable. The type of the product. Default to - * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * if unset. - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Immutable. The type of the product. Default to - * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * if unset. - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Product\Type::class); - $this->type = $var; - - return $this; - } - - /** - * Variant group identifier. Must be an - * [id][google.cloud.retail.v2.Product.id], with the same parent branch with - * this product. Otherwise, an error is thrown. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or - * set to the same value as [id][google.cloud.retail.v2.Product.id]. - * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot - * be empty. A maximum of 2,000 products are allowed to share the same - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT - * error is returned. - * Corresponding properties: Google Merchant Center property - * [item_group_id](https://support.google.com/merchants/answer/6324507). - * Schema.org property - * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - * - * Generated from protobuf field string primary_product_id = 4; - * @return string - */ - public function getPrimaryProductId() - { - return $this->primary_product_id; - } - - /** - * Variant group identifier. Must be an - * [id][google.cloud.retail.v2.Product.id], with the same parent branch with - * this product. Otherwise, an error is thrown. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or - * set to the same value as [id][google.cloud.retail.v2.Product.id]. - * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot - * be empty. A maximum of 2,000 products are allowed to share the same - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT - * error is returned. - * Corresponding properties: Google Merchant Center property - * [item_group_id](https://support.google.com/merchants/answer/6324507). - * Schema.org property - * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - * - * Generated from protobuf field string primary_product_id = 4; - * @param string $var - * @return $this - */ - public function setPrimaryProductId($var) - { - GPBUtil::checkString($var, True); - $this->primary_product_id = $var; - - return $this; - } - - /** - * The [id][google.cloud.retail.v2.Product.id] of the collection members when - * [type][google.cloud.retail.v2.Product.type] is - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. - * Non-existent product ids are allowed. - * The [type][google.cloud.retail.v2.Product.type] of the members must be - * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an - * INVALID_ARGUMENT error is thrown. Should not set it for other types. A - * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is - * return. - * - * Generated from protobuf field repeated string collection_member_ids = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionMemberIds() - { - return $this->collection_member_ids; - } - - /** - * The [id][google.cloud.retail.v2.Product.id] of the collection members when - * [type][google.cloud.retail.v2.Product.type] is - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. - * Non-existent product ids are allowed. - * The [type][google.cloud.retail.v2.Product.type] of the members must be - * either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise an - * INVALID_ARGUMENT error is thrown. Should not set it for other types. A - * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is - * return. - * - * Generated from protobuf field repeated string collection_member_ids = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionMemberIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_member_ids = $arr; - - return $this; - } - - /** - * The Global Trade Item Number (GTIN) of the product. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponding properties: Google Merchant Center property - * [gtin](https://support.google.com/merchants/answer/6324461). - * Schema.org property - * [Product.isbn](https://schema.org/isbn), - * [Product.gtin8](https://schema.org/gtin8), - * [Product.gtin12](https://schema.org/gtin12), - * [Product.gtin13](https://schema.org/gtin13), or - * [Product.gtin14](https://schema.org/gtin14). - * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string gtin = 6; - * @return string - */ - public function getGtin() - { - return $this->gtin; - } - - /** - * The Global Trade Item Number (GTIN) of the product. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponding properties: Google Merchant Center property - * [gtin](https://support.google.com/merchants/answer/6324461). - * Schema.org property - * [Product.isbn](https://schema.org/isbn), - * [Product.gtin8](https://schema.org/gtin8), - * [Product.gtin12](https://schema.org/gtin12), - * [Product.gtin13](https://schema.org/gtin13), or - * [Product.gtin14](https://schema.org/gtin14). - * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string gtin = 6; - * @param string $var - * @return $this - */ - public function setGtin($var) - { - GPBUtil::checkString($var, True); - $this->gtin = $var; - - return $this; - } - - /** - * Product categories. This field is repeated for supporting one product - * belonging to several parallel categories. Strongly recommended using the - * full path for better search / recommendation quality. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categories": [ - * "Shoes & Accessories > Shoes", - * "Sports & Fitness > Athletic Clothing > Shoes" - * ] - * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT - * error is returned. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product] unless overridden through the - * Google Cloud console. Empty values are not allowed. Each value must be a - * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [google_product_category][mc_google_product_category]. Schema.org property - * [Product.category] (https://schema.org/category). - * [mc_google_product_category]: - * https://support.google.com/merchants/answer/6324436 - * - * Generated from protobuf field repeated string categories = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCategories() - { - return $this->categories; - } - - /** - * Product categories. This field is repeated for supporting one product - * belonging to several parallel categories. Strongly recommended using the - * full path for better search / recommendation quality. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categories": [ - * "Shoes & Accessories > Shoes", - * "Sports & Fitness > Athletic Clothing > Shoes" - * ] - * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT - * error is returned. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product] unless overridden through the - * Google Cloud console. Empty values are not allowed. Each value must be a - * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [google_product_category][mc_google_product_category]. Schema.org property - * [Product.category] (https://schema.org/category). - * [mc_google_product_category]: - * https://support.google.com/merchants/answer/6324436 - * - * Generated from protobuf field repeated string categories = 7; - * @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; - } - - /** - * Required. Product title. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [title](https://support.google.com/merchants/answer/6324415). Schema.org - * property [Product.name](https://schema.org/name). - * - * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Required. Product title. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [title](https://support.google.com/merchants/answer/6324415). Schema.org - * property [Product.name](https://schema.org/name). - * - * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - - /** - * The brands of the product. - * A maximum of 30 brands are allowed unless overridden through the Google - * Cloud console. Each - * brand must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [brand](https://support.google.com/merchants/answer/6324351). Schema.org - * property [Product.brand](https://schema.org/brand). - * - * Generated from protobuf field repeated string brands = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBrands() - { - return $this->brands; - } - - /** - * The brands of the product. - * A maximum of 30 brands are allowed unless overridden through the Google - * Cloud console. Each - * brand must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [brand](https://support.google.com/merchants/answer/6324351). Schema.org - * property [Product.brand](https://schema.org/brand). - * - * Generated from protobuf field repeated string brands = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBrands($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->brands = $arr; - - return $this; - } - - /** - * Product description. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [description](https://support.google.com/merchants/answer/6324468). - * Schema.org property [Product.description](https://schema.org/description). - * - * Generated from protobuf field string description = 10; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Product description. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [description](https://support.google.com/merchants/answer/6324468). - * Schema.org property [Product.description](https://schema.org/description). - * - * Generated from protobuf field string description = 10; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Language of the title/description and other string attributes. Use language - * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - * For product prediction, this field is ignored and the model automatically - * detects the text language. The [Product][google.cloud.retail.v2.Product] - * can include text in different languages, but duplicating - * [Product][google.cloud.retail.v2.Product]s to provide text in multiple - * languages can result in degraded model performance. - * For product search this field is in use. It defaults to "en-US" if unset. - * - * Generated from protobuf field string language_code = 11; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Language of the title/description and other string attributes. Use language - * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - * For product prediction, this field is ignored and the model automatically - * detects the text language. The [Product][google.cloud.retail.v2.Product] - * can include text in different languages, but duplicating - * [Product][google.cloud.retail.v2.Product]s to provide text in multiple - * languages can result in degraded model performance. - * For product search this field is in use. It defaults to "en-US" if unset. - * - * Generated from protobuf field string language_code = 11; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * Highly encouraged. Extra product attributes to be included. For example, - * for 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 attributes here. - * Features that can take on one of a limited number of possible values. Two - * types of features can be set are: - * Textual features. some examples would be the brand/maker of a product, or - * country of a customer. Numerical features. Some examples would be the - * height/weight of a product, or age of a customer. - * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, - * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} - * }`. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * Max entries count: 200. - * * The key must be a UTF-8 encoded string with a length limit of 128 - * characters. - * * For indexable attribute, the key must match the pattern: - * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or - * `KEY_1_LIKE_THIS`. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a non-empty UTF-8 encoded string with a - * length limit of 256 characters. - * * For number attributes, at most 400 values are allowed. - * - * Generated from protobuf field map attributes = 12; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Highly encouraged. Extra product attributes to be included. For example, - * for 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 attributes here. - * Features that can take on one of a limited number of possible values. Two - * types of features can be set are: - * Textual features. some examples would be the brand/maker of a product, or - * country of a customer. Numerical features. Some examples would be the - * height/weight of a product, or age of a customer. - * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, - * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} - * }`. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * Max entries count: 200. - * * The key must be a UTF-8 encoded string with a length limit of 128 - * characters. - * * For indexable attribute, the key must match the pattern: - * `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or - * `KEY_1_LIKE_THIS`. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a non-empty UTF-8 encoded string with a - * length limit of 256 characters. - * * For number attributes, at most 400 values are allowed. - * - * Generated from protobuf field map attributes = 12; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); - $this->attributes = $arr; - - return $this; - } - - /** - * Custom tags associated with the product. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 - * encoded string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the - * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. - * Corresponding properties: Google Merchant Center property - * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). - * - * Generated from protobuf field repeated string tags = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Custom tags associated with the product. - * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8 - * encoded string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the - * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. - * Corresponding properties: Google Merchant Center property - * [custom_label_0–4](https://support.google.com/merchants/answer/6324473). - * - * Generated from protobuf field repeated string tags = 13; - * @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; - } - - /** - * Product price and cost information. - * Corresponding properties: Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; - * @return \Google\Cloud\Retail\V2\PriceInfo|null - */ - public function getPriceInfo() - { - return $this->price_info; - } - - public function hasPriceInfo() - { - return isset($this->price_info); - } - - public function clearPriceInfo() - { - unset($this->price_info); - } - - /** - * Product price and cost information. - * Corresponding properties: Google Merchant Center property - * [price](https://support.google.com/merchants/answer/6324371). - * - * Generated from protobuf field .google.cloud.retail.v2.PriceInfo price_info = 14; - * @param \Google\Cloud\Retail\V2\PriceInfo $var - * @return $this - */ - public function setPriceInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PriceInfo::class); - $this->price_info = $var; - - return $this; - } - - /** - * The rating of this product. - * - * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; - * @return \Google\Cloud\Retail\V2\Rating|null - */ - public function getRating() - { - return $this->rating; - } - - public function hasRating() - { - return isset($this->rating); - } - - public function clearRating() - { - unset($this->rating); - } - - /** - * The rating of this product. - * - * Generated from protobuf field .google.cloud.retail.v2.Rating rating = 15; - * @param \Google\Cloud\Retail\V2\Rating $var - * @return $this - */ - public function setRating($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rating::class); - $this->rating = $var; - - return $this; - } - - /** - * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * - * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; - * @return \Google\Protobuf\Timestamp|null - */ - public function getAvailableTime() - { - return $this->available_time; - } - - public function hasAvailableTime() - { - return isset($this->available_time); - } - - public function clearAvailableTime() - { - unset($this->available_time); - } - - /** - * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * - * Generated from protobuf field .google.protobuf.Timestamp available_time = 18; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setAvailableTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->available_time = $var; - - return $this; - } - - /** - * The online availability of the [Product][google.cloud.retail.v2.Product]. - * Default to - * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. - * For primary products with variants set the availability of the primary as - * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] - * and set the true availability at the variant level. This way the primary - * product will be considered "in stock" as long as it has at least one - * variant in stock. - * For primary products with no variants set the true availability at the - * primary level. - * Corresponding properties: Google Merchant Center property - * [availability](https://support.google.com/merchants/answer/6324448). - * Schema.org property [Offer.availability](https://schema.org/availability). - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; - * @return int - */ - public function getAvailability() - { - return $this->availability; - } - - /** - * The online availability of the [Product][google.cloud.retail.v2.Product]. - * Default to - * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. - * For primary products with variants set the availability of the primary as - * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] - * and set the true availability at the variant level. This way the primary - * product will be considered "in stock" as long as it has at least one - * variant in stock. - * For primary products with no variants set the true availability at the - * primary level. - * Corresponding properties: Google Merchant Center property - * [availability](https://support.google.com/merchants/answer/6324448). - * Schema.org property [Offer.availability](https://schema.org/availability). - * - * Generated from protobuf field .google.cloud.retail.v2.Product.Availability availability = 19; - * @param int $var - * @return $this - */ - public function setAvailability($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Product\Availability::class); - $this->availability = $var; - - return $this; - } - - /** - * The available quantity of the item. - * - * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; - * @return \Google\Protobuf\Int32Value|null - */ - public function getAvailableQuantity() - { - return $this->available_quantity; - } - - public function hasAvailableQuantity() - { - return isset($this->available_quantity); - } - - public function clearAvailableQuantity() - { - unset($this->available_quantity); - } - - /** - * Returns the unboxed value from getAvailableQuantity() - - * The available quantity of the item. - * - * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; - * @return int|null - */ - public function getAvailableQuantityUnwrapped() - { - return $this->readWrapperValue("available_quantity"); - } - - /** - * The available quantity of the item. - * - * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setAvailableQuantity($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->available_quantity = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The available quantity of the item. - * - * Generated from protobuf field .google.protobuf.Int32Value available_quantity = 20; - * @param int|null $var - * @return $this - */ - public function setAvailableQuantityUnwrapped($var) - { - $this->writeWrapperValue("available_quantity", $var); - return $this;} - - /** - * Fulfillment information, such as the store IDs for in-store pickup or - * region IDs for different shipping methods. - * All the elements must have distinct - * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFulfillmentInfo() - { - return $this->fulfillment_info; - } - - /** - * Fulfillment information, such as the store IDs for in-store pickup or - * region IDs for different shipping methods. - * All the elements must have distinct - * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; - * @param array<\Google\Cloud\Retail\V2\FulfillmentInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFulfillmentInfo($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\FulfillmentInfo::class); - $this->fulfillment_info = $arr; - - return $this; - } - - /** - * Canonical URL directly linking to the product detail page. - * It is strongly recommended to provide a valid uri for the product, - * otherwise the service performance could be significantly degraded. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [link](https://support.google.com/merchants/answer/6324416). Schema.org - * property [Offer.url](https://schema.org/url). - * - * Generated from protobuf field string uri = 22; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Canonical URL directly linking to the product detail page. - * It is strongly recommended to provide a valid uri for the product, - * otherwise the service performance could be significantly degraded. - * This field must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [link](https://support.google.com/merchants/answer/6324416). Schema.org - * property [Offer.url](https://schema.org/url). - * - * Generated from protobuf field string uri = 22; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Product images for the product. We highly recommend putting the main - * image first. - * A maximum of 300 images are allowed. - * Corresponding properties: Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * Product images for the product. We highly recommend putting the main - * image first. - * A maximum of 300 images are allowed. - * Corresponding properties: Google Merchant Center property - * [image_link](https://support.google.com/merchants/answer/6324350). - * Schema.org property [Product.image](https://schema.org/image). - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Image images = 23; - * @param array<\Google\Cloud\Retail\V2\Image>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Image::class); - $this->images = $arr; - - return $this; - } - - /** - * The target group associated with a given audience (e.g. male, veterans, - * car owners, musicians, etc.) of the product. - * - * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; - * @return \Google\Cloud\Retail\V2\Audience|null - */ - public function getAudience() - { - return $this->audience; - } - - public function hasAudience() - { - return isset($this->audience); - } - - public function clearAudience() - { - unset($this->audience); - } - - /** - * The target group associated with a given audience (e.g. male, veterans, - * car owners, musicians, etc.) of the product. - * - * Generated from protobuf field .google.cloud.retail.v2.Audience audience = 24; - * @param \Google\Cloud\Retail\V2\Audience $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Audience::class); - $this->audience = $var; - - return $this; - } - - /** - * The color of the product. - * Corresponding properties: Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; - * @return \Google\Cloud\Retail\V2\ColorInfo|null - */ - public function getColorInfo() - { - return $this->color_info; - } - - public function hasColorInfo() - { - return isset($this->color_info); - } - - public function clearColorInfo() - { - unset($this->color_info); - } - - /** - * The color of the product. - * Corresponding properties: Google Merchant Center property - * [color](https://support.google.com/merchants/answer/6324487). Schema.org - * property [Product.color](https://schema.org/color). - * - * Generated from protobuf field .google.cloud.retail.v2.ColorInfo color_info = 25; - * @param \Google\Cloud\Retail\V2\ColorInfo $var - * @return $this - */ - public function setColorInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ColorInfo::class); - $this->color_info = $var; - - return $this; - } - - /** - * The size of the product. To represent different size systems or size types, - * consider using this format: [[[size_system:]size_type:]size_value]. - * For example, in "US:MENS:M", "US" represents size system; "MENS" represents - * size type; "M" represents size value. In "GIRLS:27", size system is empty; - * "GIRLS" represents size type; "27" represents size value. In "32 inches", - * both size system and size type are empty, while size value is "32 inches". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [size](https://support.google.com/merchants/answer/6324492), - * [size_type](https://support.google.com/merchants/answer/6324497), and - * [size_system](https://support.google.com/merchants/answer/6324502). - * Schema.org property [Product.size](https://schema.org/size). - * - * Generated from protobuf field repeated string sizes = 26; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSizes() - { - return $this->sizes; - } - - /** - * The size of the product. To represent different size systems or size types, - * consider using this format: [[[size_system:]size_type:]size_value]. - * For example, in "US:MENS:M", "US" represents size system; "MENS" represents - * size type; "M" represents size value. In "GIRLS:27", size system is empty; - * "GIRLS" represents size type; "27" represents size value. In "32 inches", - * both size system and size type are empty, while size value is "32 inches". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [size](https://support.google.com/merchants/answer/6324492), - * [size_type](https://support.google.com/merchants/answer/6324497), and - * [size_system](https://support.google.com/merchants/answer/6324502). - * Schema.org property [Product.size](https://schema.org/size). - * - * Generated from protobuf field repeated string sizes = 26; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSizes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->sizes = $arr; - - return $this; - } - - /** - * The material of the product. For example, "leather", "wooden". - * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 200 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [material](https://support.google.com/merchants/answer/6324410). Schema.org - * property [Product.material](https://schema.org/material). - * - * Generated from protobuf field repeated string materials = 27; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMaterials() - { - return $this->materials; - } - - /** - * The material of the product. For example, "leather", "wooden". - * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - * string with a length limit of 200 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [material](https://support.google.com/merchants/answer/6324410). Schema.org - * property [Product.material](https://schema.org/material). - * - * Generated from protobuf field repeated string materials = 27; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMaterials($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->materials = $arr; - - return $this; - } - - /** - * The pattern or graphic print of the product. For example, "striped", "polka - * dot", "paisley". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org - * property [Product.pattern](https://schema.org/pattern). - * - * Generated from protobuf field repeated string patterns = 28; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPatterns() - { - return $this->patterns; - } - - /** - * The pattern or graphic print of the product. For example, "striped", "polka - * dot", "paisley". - * A maximum of 20 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org - * property [Product.pattern](https://schema.org/pattern). - * - * Generated from protobuf field repeated string patterns = 28; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->patterns = $arr; - - return $this; - } - - /** - * The condition of the product. Strongly encouraged to use the standard - * values: "new", "refurbished", "used". - * A maximum of 1 value is allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [condition](https://support.google.com/merchants/answer/6324469). - * Schema.org property - * [Offer.itemCondition](https://schema.org/itemCondition). - * - * Generated from protobuf field repeated string conditions = 29; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * The condition of the product. Strongly encouraged to use the standard - * values: "new", "refurbished", "used". - * A maximum of 1 value is allowed per - * [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 - * encoded string with a length limit of 128 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. - * Corresponding properties: Google Merchant Center property - * [condition](https://support.google.com/merchants/answer/6324469). - * Schema.org property - * [Offer.itemCondition](https://schema.org/itemCondition). - * - * Generated from protobuf field repeated string conditions = 29; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->conditions = $arr; - - return $this; - } - - /** - * The promotions applied to the product. A maximum of 10 values are allowed - * per [Product][google.cloud.retail.v2.Product]. Only - * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] - * will be used, other fields will be ignored if set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPromotions() - { - return $this->promotions; - } - - /** - * The promotions applied to the product. A maximum of 10 values are allowed - * per [Product][google.cloud.retail.v2.Product]. Only - * [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] - * will be used, other fields will be ignored if set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Promotion promotions = 34; - * @param array<\Google\Cloud\Retail\V2\Promotion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPromotions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Promotion::class); - $this->promotions = $arr; - - return $this; - } - - /** - * The timestamp when the product is published by the retailer for the first - * time, which indicates the freshness of the products. Note that this field - * is different from - * [available_time][google.cloud.retail.v2.Product.available_time], given it - * purely describes product freshness regardless of when it is available on - * search and recommendation. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPublishTime() - { - return $this->publish_time; - } - - public function hasPublishTime() - { - return isset($this->publish_time); - } - - public function clearPublishTime() - { - unset($this->publish_time); - } - - /** - * The timestamp when the product is published by the retailer for the first - * time, which indicates the freshness of the products. Note that this field - * is different from - * [available_time][google.cloud.retail.v2.Product.available_time], given it - * purely describes product freshness regardless of when it is available on - * search and recommendation. - * - * Generated from protobuf field .google.protobuf.Timestamp publish_time = 33; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPublishTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->publish_time = $var; - - return $this; - } - - /** - * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s - * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. - * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: - * * [audience][google.cloud.retail.v2.Product.audience] - * * [availability][google.cloud.retail.v2.Product.availability] - * * [brands][google.cloud.retail.v2.Product.brands] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * * [conditions][google.cloud.retail.v2.Product.conditions] - * * [gtin][google.cloud.retail.v2.Product.gtin] - * * [materials][google.cloud.retail.v2.Product.materials] - * * [name][google.cloud.retail.v2.Product.name] - * * [patterns][google.cloud.retail.v2.Product.patterns] - * * [price_info][google.cloud.retail.v2.Product.price_info] - * * [rating][google.cloud.retail.v2.Product.rating] - * * [sizes][google.cloud.retail.v2.Product.sizes] - * * [title][google.cloud.retail.v2.Product.title] - * * [uri][google.cloud.retail.v2.Product.uri] - * Supported fields only for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: - * * [categories][google.cloud.retail.v2.Product.categories] - * * [description][google.cloud.retail.v2.Product.description] - * * [images][google.cloud.retail.v2.Product.images] - * Supported fields only for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: - * * Only the first image in [images][google.cloud.retail.v2.Product.images] - * To mark [attributes][google.cloud.retail.v2.Product.attributes] as - * retrievable, include paths of the form "attributes.key" where "key" is the - * key of a custom attribute, as specified in - * [attributes][google.cloud.retail.v2.Product.attributes]. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the - * following fields are always returned in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: - * * [name][google.cloud.retail.v2.Product.name] - * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the - * following fields are always returned in by default: - * * [name][google.cloud.retail.v2.Product.name] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * Note: Returning more fields in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase - * response payload size and serving latency. - * This field is deprecated. Use the retrievable site-wide control instead. - * - * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; - * @return \Google\Protobuf\FieldMask|null - * @deprecated - */ - public function getRetrievableFields() - { - @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); - return $this->retrievable_fields; - } - - public function hasRetrievableFields() - { - @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); - return isset($this->retrievable_fields); - } - - public function clearRetrievableFields() - { - @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); - unset($this->retrievable_fields); - } - - /** - * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s - * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. - * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: - * * [audience][google.cloud.retail.v2.Product.audience] - * * [availability][google.cloud.retail.v2.Product.availability] - * * [brands][google.cloud.retail.v2.Product.brands] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * * [conditions][google.cloud.retail.v2.Product.conditions] - * * [gtin][google.cloud.retail.v2.Product.gtin] - * * [materials][google.cloud.retail.v2.Product.materials] - * * [name][google.cloud.retail.v2.Product.name] - * * [patterns][google.cloud.retail.v2.Product.patterns] - * * [price_info][google.cloud.retail.v2.Product.price_info] - * * [rating][google.cloud.retail.v2.Product.rating] - * * [sizes][google.cloud.retail.v2.Product.sizes] - * * [title][google.cloud.retail.v2.Product.title] - * * [uri][google.cloud.retail.v2.Product.uri] - * Supported fields only for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: - * * [categories][google.cloud.retail.v2.Product.categories] - * * [description][google.cloud.retail.v2.Product.description] - * * [images][google.cloud.retail.v2.Product.images] - * Supported fields only for - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: - * * Only the first image in [images][google.cloud.retail.v2.Product.images] - * To mark [attributes][google.cloud.retail.v2.Product.attributes] as - * retrievable, include paths of the form "attributes.key" where "key" is the - * key of a custom attribute, as specified in - * [attributes][google.cloud.retail.v2.Product.attributes]. - * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the - * following fields are always returned in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: - * * [name][google.cloud.retail.v2.Product.name] - * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the - * following fields are always returned in by default: - * * [name][google.cloud.retail.v2.Product.name] - * * [color_info][google.cloud.retail.v2.Product.color_info] - * Note: Returning more fields in - * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase - * response payload size and serving latency. - * This field is deprecated. Use the retrievable site-wide control instead. - * - * Generated from protobuf field .google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - * @deprecated - */ - public function setRetrievableFields($var) - { - @trigger_error('retrievable_fields is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->retrievable_fields = $var; - - return $this; - } - - /** - * Output only. Product variants grouped together on primary product which - * share similar product attributes. It's automatically grouped by - * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for - * all the product variants. Only populated for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVariants() - { - return $this->variants; - } - - /** - * Output only. Product variants grouped together on primary product which - * share similar product attributes. It's automatically grouped by - * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for - * all the product variants. Only populated for - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s. - * Note: This field is OUTPUT_ONLY for - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. - * Do not set this field in API requests. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVariants($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); - $this->variants = $arr; - - return $this; - } - - /** - * Output only. A list of local inventories specific to different places. - * This field can be managed by - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * and - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * APIs if fine-grained, high-volume updates are necessary. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLocalInventories() - { - return $this->local_inventories; - } - - /** - * Output only. A list of local inventories specific to different places. - * This field can be managed by - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * and - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * APIs if fine-grained, high-volume updates are necessary. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Retail\V2\LocalInventory>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLocalInventories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\LocalInventory::class); - $this->local_inventories = $arr; - - return $this; - } - - /** - * @return string - */ - public function getExpiration() - { - return $this->whichOneof("expiration"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php deleted file mode 100644 index 8030fad5f09..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Availability.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.retail.v2.Product.Availability - */ -class Availability -{ - /** - * Default product availability. Default to - * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK] - * if unset. - * - * Generated from protobuf enum AVAILABILITY_UNSPECIFIED = 0; - */ - const AVAILABILITY_UNSPECIFIED = 0; - /** - * Product in stock. - * - * Generated from protobuf enum IN_STOCK = 1; - */ - const IN_STOCK = 1; - /** - * Product out of stock. - * - * Generated from protobuf enum OUT_OF_STOCK = 2; - */ - const OUT_OF_STOCK = 2; - /** - * Product that is in pre-order state. - * - * Generated from protobuf enum PREORDER = 3; - */ - const PREORDER = 3; - /** - * Product that is back-ordered (i.e. temporarily out of stock). - * - * Generated from protobuf enum BACKORDER = 4; - */ - const BACKORDER = 4; - - private static $valueToName = [ - self::AVAILABILITY_UNSPECIFIED => 'AVAILABILITY_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(Availability::class, \Google\Cloud\Retail\V2\Product_Availability::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php deleted file mode 100644 index 472fd58e920..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Product/Type.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.retail.v2.Product.Type - */ -class Type -{ - /** - * Default value. Default to - * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * if unset. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * The primary type. - * As the primary unit for predicting, indexing and search serving, a - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product] is grouped with multiple - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * The variant type. - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s usually share some common - * attributes on the same - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s, but they have variant - * attributes like different colors, sizes and prices, etc. - * - * Generated from protobuf enum VARIANT = 2; - */ - const VARIANT = 2; - /** - * The collection type. Collection products are bundled - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] - * [Product][google.cloud.retail.v2.Product]s or - * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s that are sold together, such - * as a jewelry set with necklaces, earrings and rings, etc. - * - * Generated from protobuf enum COLLECTION = 3; - */ - const COLLECTION = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::VARIANT => 'VARIANT', - self::COLLECTION => 'COLLECTION', - ]; - - 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(Type::class, \Google\Cloud\Retail\V2\Product_Type::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php deleted file mode 100644 index d077bbd3ea7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeInterval.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.retail.v2.ProductAttributeInterval - */ -class ProductAttributeInterval extends \Google\Protobuf\Internal\Message -{ - /** - * The attribute name (e.g. "length") - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The numeric interval (e.g. [10, 20)) - * - * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; - */ - protected $interval = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The attribute name (e.g. "length") - * @type \Google\Cloud\Retail\V2\Interval $interval - * The numeric interval (e.g. [10, 20)) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The attribute name (e.g. "length") - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The attribute name (e.g. "length") - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The numeric interval (e.g. [10, 20)) - * - * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; - * @return \Google\Cloud\Retail\V2\Interval|null - */ - public function getInterval() - { - return $this->interval; - } - - public function hasInterval() - { - return isset($this->interval); - } - - public function clearInterval() - { - unset($this->interval); - } - - /** - * The numeric interval (e.g. [10, 20)) - * - * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; - * @param \Google\Cloud\Retail\V2\Interval $var - * @return $this - */ - public function setInterval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); - $this->interval = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php deleted file mode 100644 index 0e258e59b22..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductAttributeValue.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.retail.v2.ProductAttributeValue - */ -class ProductAttributeValue extends \Google\Protobuf\Internal\Message -{ - /** - * The attribute name. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The attribute value. - * - * Generated from protobuf field string value = 2; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The attribute name. - * @type string $value - * The attribute value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The attribute name. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The attribute name. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The attribute value. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The attribute value. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php deleted file mode 100644 index 0722a467084..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductDetail.php +++ /dev/null @@ -1,206 +0,0 @@ -google.cloud.retail.v2.ProductDetail - */ -class ProductDetail extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [Product][google.cloud.retail.v2.Product] information. - * Required field(s): - * * [Product.id][google.cloud.retail.v2.Product.id] - * Optional override field(s): - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * If any supported optional fields are provided, we will treat them as a full - * override when looking up product information from the catalog. Thus, it is - * important to ensure that the overriding fields are accurate and - * complete. - * All other product fields are ignored and instead populated via catalog - * lookup after event ingestion. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $product = null; - /** - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * - * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; - */ - protected $quantity = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Product $product - * Required. [Product][google.cloud.retail.v2.Product] information. - * Required field(s): - * * [Product.id][google.cloud.retail.v2.Product.id] - * Optional override field(s): - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * If any supported optional fields are provided, we will treat them as a full - * override when looking up product information from the catalog. Thus, it is - * important to ensure that the overriding fields are accurate and - * complete. - * All other product fields are ignored and instead populated via catalog - * lookup after event ingestion. - * @type \Google\Protobuf\Int32Value $quantity - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required. [Product][google.cloud.retail.v2.Product] information. - * Required field(s): - * * [Product.id][google.cloud.retail.v2.Product.id] - * Optional override field(s): - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * If any supported optional fields are provided, we will treat them as a full - * override when looking up product information from the catalog. Thus, it is - * important to ensure that the overriding fields are accurate and - * complete. - * All other product fields are ignored and instead populated via catalog - * lookup after event ingestion. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Product|null - */ - public function getProduct() - { - return $this->product; - } - - public function hasProduct() - { - return isset($this->product); - } - - public function clearProduct() - { - unset($this->product); - } - - /** - * Required. [Product][google.cloud.retail.v2.Product] information. - * Required field(s): - * * [Product.id][google.cloud.retail.v2.Product.id] - * Optional override field(s): - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * If any supported optional fields are provided, we will treat them as a full - * override when looking up product information from the catalog. Thus, it is - * important to ensure that the overriding fields are accurate and - * complete. - * All other product fields are ignored and instead populated via catalog - * lookup after event ingestion. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Product $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); - $this->product = $var; - - return $this; - } - - /** - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * - * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; - * @return \Google\Protobuf\Int32Value|null - */ - public function getQuantity() - { - return $this->quantity; - } - - public function hasQuantity() - { - return isset($this->quantity); - } - - public function clearQuantity() - { - unset($this->quantity); - } - - /** - * Returns the unboxed value from getQuantity() - - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * - * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; - * @return int|null - */ - public function getQuantityUnwrapped() - { - return $this->readWrapperValue("quantity"); - } - - /** - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * - * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setQuantity($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->quantity = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * 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 `purchase-complete` event. Required for `add-to-cart` and - * `purchase-complete` event types. - * - * Generated from protobuf field .google.protobuf.Int32Value quantity = 2; - * @param int|null $var - * @return $this - */ - public function setQuantityUnwrapped($var) - { - $this->writeWrapperValue("quantity", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php deleted file mode 100644 index c09dcf1518a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInlineSource.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.ProductInlineSource - */ -class ProductInlineSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A list of products to update/create. Each product must have a - * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of - * 100 items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $products; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $products - * Required. A list of products to update/create. Each product must have a - * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of - * 100 items. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. A list of products to update/create. Each product must have a - * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of - * 100 items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProducts() - { - return $this->products; - } - - /** - * Required. A list of products to update/create. Each product must have a - * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of - * 100 items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Retail\V2\Product>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProducts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Product::class); - $this->products = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php deleted file mode 100644 index 11ca3288d35..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductInputConfig.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.retail.v2.ProductInputConfig - */ -class ProductInputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ProductInlineSource $product_inline_source - * The Inline source for the input content for products. - * @type \Google\Cloud\Retail\V2\GcsSource $gcs_source - * Google Cloud Storage location for the input content. - * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source - * BigQuery input source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * The Inline source for the input content for products. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductInlineSource product_inline_source = 1; - * @return \Google\Cloud\Retail\V2\ProductInlineSource|null - */ - public function getProductInlineSource() - { - return $this->readOneof(1); - } - - public function hasProductInlineSource() - { - return $this->hasOneof(1); - } - - /** - * The Inline source for the input content for products. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductInlineSource product_inline_source = 1; - * @param \Google\Cloud\Retail\V2\ProductInlineSource $var - * @return $this - */ - public function setProductInlineSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductInlineSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Google Cloud Storage location for the input content. - * - * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2; - * @return \Google\Cloud\Retail\V2\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.retail.v2.GcsSource gcs_source = 2; - * @param \Google\Cloud\Retail\V2\GcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * BigQuery input source. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3; - * @return \Google\Cloud\Retail\V2\BigQuerySource|null - */ - public function getBigQuerySource() - { - return $this->readOneof(3); - } - - public function hasBigQuerySource() - { - return $this->hasOneof(3); - } - - /** - * BigQuery input source. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3; - * @param \Google\Cloud\Retail\V2\BigQuerySource $var - * @return $this - */ - public function setBigQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php deleted file mode 100644 index 11b7d4524c3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ProductLevelConfig.php +++ /dev/null @@ -1,246 +0,0 @@ -google.cloud.retail.v2.ProductLevelConfig - */ -class ProductLevelConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The type of [Product][google.cloud.retail.v2.Product]s allowed to be - * ingested into the catalog. Acceptable values are: - * * `primary` (default): You can ingest - * [Product][google.cloud.retail.v2.Product]s of all types. When - * ingesting a [Product][google.cloud.retail.v2.Product], its type will - * default to - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if - * unset. - * * `variant` (incompatible with Retail Search): You can only - * ingest - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. This means - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * cannot be empty. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `variant` and - * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] - * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string ingestion_product_type = 1; - */ - protected $ingestion_product_type = ''; - /** - * Which field of [Merchant Center - * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be - * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable - * values are: - * * `offerId` (default): Import `offerId` as the product ID. - * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail - * API will choose one item from the ones with the same `itemGroupId`, and - * use it to represent the item group. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `itemGroupId` and - * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string merchant_center_product_id_field = 2; - */ - protected $merchant_center_product_id_field = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $ingestion_product_type - * The type of [Product][google.cloud.retail.v2.Product]s allowed to be - * ingested into the catalog. Acceptable values are: - * * `primary` (default): You can ingest - * [Product][google.cloud.retail.v2.Product]s of all types. When - * ingesting a [Product][google.cloud.retail.v2.Product], its type will - * default to - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if - * unset. - * * `variant` (incompatible with Retail Search): You can only - * ingest - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. This means - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * cannot be empty. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `variant` and - * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] - * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * @type string $merchant_center_product_id_field - * Which field of [Merchant Center - * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be - * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable - * values are: - * * `offerId` (default): Import `offerId` as the product ID. - * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail - * API will choose one item from the ones with the same `itemGroupId`, and - * use it to represent the item group. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `itemGroupId` and - * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * The type of [Product][google.cloud.retail.v2.Product]s allowed to be - * ingested into the catalog. Acceptable values are: - * * `primary` (default): You can ingest - * [Product][google.cloud.retail.v2.Product]s of all types. When - * ingesting a [Product][google.cloud.retail.v2.Product], its type will - * default to - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if - * unset. - * * `variant` (incompatible with Retail Search): You can only - * ingest - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. This means - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * cannot be empty. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `variant` and - * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] - * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string ingestion_product_type = 1; - * @return string - */ - public function getIngestionProductType() - { - return $this->ingestion_product_type; - } - - /** - * The type of [Product][google.cloud.retail.v2.Product]s allowed to be - * ingested into the catalog. Acceptable values are: - * * `primary` (default): You can ingest - * [Product][google.cloud.retail.v2.Product]s of all types. When - * ingesting a [Product][google.cloud.retail.v2.Product], its type will - * default to - * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if - * unset. - * * `variant` (incompatible with Retail Search): You can only - * ingest - * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. This means - * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] - * cannot be empty. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `variant` and - * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] - * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string ingestion_product_type = 1; - * @param string $var - * @return $this - */ - public function setIngestionProductType($var) - { - GPBUtil::checkString($var, True); - $this->ingestion_product_type = $var; - - return $this; - } - - /** - * Which field of [Merchant Center - * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be - * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable - * values are: - * * `offerId` (default): Import `offerId` as the product ID. - * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail - * API will choose one item from the ones with the same `itemGroupId`, and - * use it to represent the item group. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `itemGroupId` and - * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string merchant_center_product_id_field = 2; - * @return string - */ - public function getMerchantCenterProductIdField() - { - return $this->merchant_center_product_id_field; - } - - /** - * Which field of [Merchant Center - * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be - * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable - * values are: - * * `offerId` (default): Import `offerId` as the product ID. - * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail - * API will choose one item from the ones with the same `itemGroupId`, and - * use it to represent the item group. - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * If this field is `itemGroupId` and - * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] - * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Product - * levels](https://cloud.google.com/retail/docs/catalog#product-levels) - * for more details. - * - * Generated from protobuf field string merchant_center_product_id_field = 2; - * @param string $var - * @return $this - */ - public function setMerchantCenterProductIdField($var) - { - GPBUtil::checkString($var, True); - $this->merchant_center_product_id_field = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php deleted file mode 100644 index dc46522a58e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Promotion.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.retail.v2.Promotion - */ -class Promotion extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the promotion. For example, "free gift". - * The value must be a UTF-8 encoded string with a length limit of 128 - * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponds to Google Merchant Center property - * [promotion_id](https://support.google.com/merchants/answer/7050148). - * - * Generated from protobuf field string promotion_id = 1; - */ - protected $promotion_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $promotion_id - * ID of the promotion. For example, "free gift". - * The value must be a UTF-8 encoded string with a length limit of 128 - * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponds to Google Merchant Center property - * [promotion_id](https://support.google.com/merchants/answer/7050148). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Promotion::initOnce(); - parent::__construct($data); - } - - /** - * ID of the promotion. For example, "free gift". - * The value must be a UTF-8 encoded string with a length limit of 128 - * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponds to Google Merchant Center property - * [promotion_id](https://support.google.com/merchants/answer/7050148). - * - * Generated from protobuf field string promotion_id = 1; - * @return string - */ - public function getPromotionId() - { - return $this->promotion_id; - } - - /** - * ID of the promotion. For example, "free gift". - * The value must be a UTF-8 encoded string with a length limit of 128 - * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - * returned. - * Corresponds to Google Merchant Center property - * [promotion_id](https://support.google.com/merchants/answer/7050148). - * - * Generated from protobuf field string promotion_id = 1; - * @param string $var - * @return $this - */ - public function setPromotionId($var) - { - GPBUtil::checkString($var, True); - $this->promotion_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php deleted file mode 100644 index d3671555baa..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurchaseTransaction.php +++ /dev/null @@ -1,235 +0,0 @@ -google.cloud.retail.v2.PurchaseTransaction - */ -class PurchaseTransaction extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction ID with a length limit of 128 characters. - * - * Generated from protobuf field string id = 1; - */ - protected $id = ''; - /** - * Required. Total non-zero 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. - * - * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $revenue = 0.0; - /** - * All the taxes associated with the transaction. - * - * Generated from protobuf field float tax = 3; - */ - protected $tax = 0.0; - /** - * All the costs associated with the products. These can be manufacturing - * costs, shipping expenses not borne by the end user, or any other costs, - * such that: - * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - - * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - - * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] - * - * Generated from protobuf field float cost = 4; - */ - protected $cost = 0.0; - /** - * Required. Currency code. Use three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $currency_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * The transaction ID with a length limit of 128 characters. - * @type float $revenue - * Required. Total non-zero 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. - * @type float $tax - * All the taxes associated with the transaction. - * @type float $cost - * All the costs associated with the products. These can be manufacturing - * costs, shipping expenses not borne by the end user, or any other costs, - * such that: - * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - - * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - - * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] - * @type string $currency_code - * Required. Currency code. Use three-character ISO-4217 code. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * The transaction ID with a length limit of 128 characters. - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The transaction ID with a length limit of 128 characters. - * - * 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; - } - - /** - * Required. Total non-zero 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. - * - * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return float - */ - public function getRevenue() - { - return $this->revenue; - } - - /** - * Required. Total non-zero 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. - * - * 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; - } - - /** - * All the taxes associated with the transaction. - * - * Generated from protobuf field float tax = 3; - * @return float - */ - public function getTax() - { - return $this->tax; - } - - /** - * All the taxes associated with the transaction. - * - * Generated from protobuf field float tax = 3; - * @param float $var - * @return $this - */ - public function setTax($var) - { - GPBUtil::checkFloat($var); - $this->tax = $var; - - return $this; - } - - /** - * All the costs associated with the products. These can be manufacturing - * costs, shipping expenses not borne by the end user, or any other costs, - * such that: - * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - - * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - - * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] - * - * Generated from protobuf field float cost = 4; - * @return float - */ - public function getCost() - { - return $this->cost; - } - - /** - * All the costs associated with the products. These can be manufacturing - * costs, shipping expenses not borne by the end user, or any other costs, - * such that: - * * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] - - * [tax][google.cloud.retail.v2.PurchaseTransaction.tax] - - * [cost][google.cloud.retail.v2.PurchaseTransaction.cost] - * - * Generated from protobuf field float cost = 4; - * @param float $var - * @return $this - */ - public function setCost($var) - { - GPBUtil::checkFloat($var); - $this->cost = $var; - - return $this; - } - - /** - * Required. Currency code. Use three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * Required. Currency code. Use three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 5 [(.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/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php deleted file mode 100644 index 643f7812322..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.retail.v2.PurgeMetadata - */ -class PurgeMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php deleted file mode 100644 index c2f32b10018..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsMetadata.php +++ /dev/null @@ -1,194 +0,0 @@ -google.cloud.retail.v2.PurgeProductsMetadata - */ -class PurgeProductsMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; - */ - protected $update_time = null; - /** - * Count of entries that were deleted successfully. - * - * Generated from protobuf field int64 success_count = 3; - */ - protected $success_count = 0; - /** - * Count of entries that encountered errors while processing. - * - * Generated from protobuf field int64 failure_count = 4; - */ - protected $failure_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Operation create time. - * @type \Google\Protobuf\Timestamp $update_time - * Operation last update time. If the operation is done, this is also the - * finish time. - * @type int|string $success_count - * Count of entries that were deleted successfully. - * @type int|string $failure_count - * Count of entries that encountered errors while processing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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 = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $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 = 2; - * @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 = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Count of entries that were deleted successfully. - * - * Generated from protobuf field int64 success_count = 3; - * @return int|string - */ - public function getSuccessCount() - { - return $this->success_count; - } - - /** - * Count of entries that were deleted successfully. - * - * Generated from protobuf field int64 success_count = 3; - * @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 = 4; - * @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 = 4; - * @param int|string $var - * @return $this - */ - public function setFailureCount($var) - { - GPBUtil::checkInt64($var); - $this->failure_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php deleted file mode 100644 index 40a07712926..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsRequest.php +++ /dev/null @@ -1,263 +0,0 @@ -google.cloud.retail.v2.PurgeProductsRequest - */ -class PurgeProductsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the branch under which the products are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - * - * 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 products to be deleted with a - * length limit of 5,000 characters. - * Empty string filter is not allowed. "*" implies delete all items in a - * branch. - * The eligible fields for filtering are: - * * `availability`: Double quoted - * [Product.availability][google.cloud.retail.v2.Product.availability] string. - * * `create_time` : in ISO 8601 "zulu" format. - * Supported syntax: - * * Comparators (">", "<", ">=", "<=", "="). - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" - * * availability = "IN_STOCK" - * * Conjunctions ("AND") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - * * Disjunctions ("OR") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - * * Can support nested queries. - * Examples: - * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - * * Filter Limits: - * * Filter should not contain more than 6 conditions. - * * Max nesting depth should not exceed 2 levels. - * Examples queries: - * * Delete back order products created before a timestamp. - * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $filter = ''; - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any products. - * - * Generated from protobuf field bool force = 3; - */ - protected $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the branch under which the products are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - * @type string $filter - * Required. The filter string to specify the products to be deleted with a - * length limit of 5,000 characters. - * Empty string filter is not allowed. "*" implies delete all items in a - * branch. - * The eligible fields for filtering are: - * * `availability`: Double quoted - * [Product.availability][google.cloud.retail.v2.Product.availability] string. - * * `create_time` : in ISO 8601 "zulu" format. - * Supported syntax: - * * Comparators (">", "<", ">=", "<=", "="). - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" - * * availability = "IN_STOCK" - * * Conjunctions ("AND") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - * * Disjunctions ("OR") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - * * Can support nested queries. - * Examples: - * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - * * Filter Limits: - * * Filter should not contain more than 6 conditions. - * * Max nesting depth should not exceed 2 levels. - * Examples queries: - * * Delete back order products created before a timestamp. - * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - * @type bool $force - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any products. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the branch under which the products are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - * - * 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 branch under which the products are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - * - * 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 products to be deleted with a - * length limit of 5,000 characters. - * Empty string filter is not allowed. "*" implies delete all items in a - * branch. - * The eligible fields for filtering are: - * * `availability`: Double quoted - * [Product.availability][google.cloud.retail.v2.Product.availability] string. - * * `create_time` : in ISO 8601 "zulu" format. - * Supported syntax: - * * Comparators (">", "<", ">=", "<=", "="). - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" - * * availability = "IN_STOCK" - * * Conjunctions ("AND") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - * * Disjunctions ("OR") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - * * Can support nested queries. - * Examples: - * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - * * Filter Limits: - * * Filter should not contain more than 6 conditions. - * * Max nesting depth should not exceed 2 levels. - * Examples queries: - * * Delete back order products created before a timestamp. - * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - * - * 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 products to be deleted with a - * length limit of 5,000 characters. - * Empty string filter is not allowed. "*" implies delete all items in a - * branch. - * The eligible fields for filtering are: - * * `availability`: Double quoted - * [Product.availability][google.cloud.retail.v2.Product.availability] string. - * * `create_time` : in ISO 8601 "zulu" format. - * Supported syntax: - * * Comparators (">", "<", ">=", "<=", "="). - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" - * * availability = "IN_STOCK" - * * Conjunctions ("AND") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - * * Disjunctions ("OR") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - * * Can support nested queries. - * Examples: - * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - * * Filter Limits: - * * Filter should not contain more than 6 conditions. - * * Max nesting depth should not exceed 2 levels. - * Examples queries: - * * Delete back order products created before a timestamp. - * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - * - * 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; - } - - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any products. - * - * Generated from protobuf field bool force = 3; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any products. - * - * Generated from protobuf field bool force = 3; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php deleted file mode 100644 index d7d761c4980..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeProductsResponse.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.retail.v2.PurgeProductsResponse - */ -class PurgeProductsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The total count of products purged as a result of the operation. - * - * Generated from protobuf field int64 purge_count = 1; - */ - protected $purge_count = 0; - /** - * A sample of the product names that will be deleted. - * Only populated if `force` is set to false. A max of 100 names will be - * returned and the names are chosen at random. - * - * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { - */ - private $purge_sample; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $purge_count - * The total count of products purged as a result of the operation. - * @type array|\Google\Protobuf\Internal\RepeatedField $purge_sample - * A sample of the product names that will be deleted. - * Only populated if `force` is set to false. A max of 100 names will be - * returned and the names are chosen at random. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); - parent::__construct($data); - } - - /** - * The total count of products purged as a result of the operation. - * - * Generated from protobuf field int64 purge_count = 1; - * @return int|string - */ - public function getPurgeCount() - { - return $this->purge_count; - } - - /** - * The total count of products purged as a result of the operation. - * - * Generated from protobuf field int64 purge_count = 1; - * @param int|string $var - * @return $this - */ - public function setPurgeCount($var) - { - GPBUtil::checkInt64($var); - $this->purge_count = $var; - - return $this; - } - - /** - * A sample of the product names that will be deleted. - * Only populated if `force` is set to false. A max of 100 names will be - * returned and the names are chosen at random. - * - * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPurgeSample() - { - return $this->purge_sample; - } - - /** - * A sample of the product names that will be deleted. - * Only populated if `force` is set to false. A max of 100 names will be - * returned and the names are chosen at random. - * - * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPurgeSample($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->purge_sample = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php deleted file mode 100644 index 64add727fa3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsRequest.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.retail.v2.PurgeUserEventsRequest - */ -class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the catalog under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}` - * - * 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 with a - * length limit of 5,000 characters. Empty string filter is not allowed. The - * eligible fields for filtering are: - * * `eventType`: Double quoted - * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. - * * `eventTime`: in ISO 8601 "zulu" format. - * * `visitorId`: Double quoted string. Specifying this will delete all - * events associated with a visitor. - * * `userId`: Double quoted string. Specifying this will delete all events - * associated with a user. - * Examples: - * * Deleting all events in a time range: - * `eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z"` - * * Deleting specific eventType in time range: - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * * 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 = ''; - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any user events. - * - * Generated from protobuf field bool force = 3; - */ - protected $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the catalog under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}` - * @type string $filter - * Required. The filter string to specify the events to be deleted with a - * length limit of 5,000 characters. Empty string filter is not allowed. The - * eligible fields for filtering are: - * * `eventType`: Double quoted - * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. - * * `eventTime`: in ISO 8601 "zulu" format. - * * `visitorId`: Double quoted string. Specifying this will delete all - * events associated with a visitor. - * * `userId`: Double quoted string. Specifying this will delete all events - * associated with a user. - * Examples: - * * Deleting all events in a time range: - * `eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z"` - * * Deleting specific eventType in time range: - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * * Deleting all events for a specific visitor: - * `visitorId = "visitor1024"` - * The filtering fields are assumed to have an implicit AND. - * @type bool $force - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any user events. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the catalog under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}` - * - * 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 catalog under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}` - * - * 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 with a - * length limit of 5,000 characters. Empty string filter is not allowed. The - * eligible fields for filtering are: - * * `eventType`: Double quoted - * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. - * * `eventTime`: in ISO 8601 "zulu" format. - * * `visitorId`: Double quoted string. Specifying this will delete all - * events associated with a visitor. - * * `userId`: Double quoted string. Specifying this will delete all events - * associated with a user. - * Examples: - * * Deleting all events in a time range: - * `eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z"` - * * Deleting specific eventType in time range: - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * * 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 with a - * length limit of 5,000 characters. Empty string filter is not allowed. The - * eligible fields for filtering are: - * * `eventType`: Double quoted - * [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string. - * * `eventTime`: in ISO 8601 "zulu" format. - * * `visitorId`: Double quoted string. Specifying this will delete all - * events associated with a visitor. - * * `userId`: Double quoted string. Specifying this will delete all events - * associated with a user. - * Examples: - * * Deleting all events in a time range: - * `eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z"` - * * Deleting specific eventType in time range: - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * * 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; - } - - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any user events. - * - * Generated from protobuf field bool force = 3; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Actually perform the purge. - * If `force` is set to false, the method will return the expected purge count - * without deleting any user events. - * - * Generated from protobuf field bool force = 3; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php deleted file mode 100644 index 4e26e6a1be9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/PurgeUserEventsResponse.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.retail.v2.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; - - /** - * 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. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::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; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php deleted file mode 100644 index 4819a03e5ec..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rating.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.retail.v2.Rating - */ -class Rating extends \Google\Protobuf\Internal\Message -{ - /** - * The total number of ratings. This value is independent of the value of - * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. - * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 rating_count = 1; - */ - protected $rating_count = 0; - /** - * The average rating of the [Product][google.cloud.retail.v2.Product]. - * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field float average_rating = 2; - */ - protected $average_rating = 0.0; - /** - * List of rating counts per rating value (index = rating - 1). The list is - * empty if there is no rating. If the list is non-empty, its size is - * always 5. Otherwise, an INVALID_ARGUMENT error is returned. - * For example, [41, 14, 13, 47, 303]. It means that the - * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 - * ratings with 2 star, and so on. - * - * Generated from protobuf field repeated int32 rating_histogram = 3; - */ - private $rating_histogram; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $rating_count - * The total number of ratings. This value is independent of the value of - * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. - * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * @type float $average_rating - * The average rating of the [Product][google.cloud.retail.v2.Product]. - * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is - * returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $rating_histogram - * List of rating counts per rating value (index = rating - 1). The list is - * empty if there is no rating. If the list is non-empty, its size is - * always 5. Otherwise, an INVALID_ARGUMENT error is returned. - * For example, [41, 14, 13, 47, 303]. It means that the - * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 - * ratings with 2 star, and so on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The total number of ratings. This value is independent of the value of - * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. - * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 rating_count = 1; - * @return int - */ - public function getRatingCount() - { - return $this->rating_count; - } - - /** - * The total number of ratings. This value is independent of the value of - * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. - * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field int32 rating_count = 1; - * @param int $var - * @return $this - */ - public function setRatingCount($var) - { - GPBUtil::checkInt32($var); - $this->rating_count = $var; - - return $this; - } - - /** - * The average rating of the [Product][google.cloud.retail.v2.Product]. - * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field float average_rating = 2; - * @return float - */ - public function getAverageRating() - { - return $this->average_rating; - } - - /** - * The average rating of the [Product][google.cloud.retail.v2.Product]. - * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is - * returned. - * - * Generated from protobuf field float average_rating = 2; - * @param float $var - * @return $this - */ - public function setAverageRating($var) - { - GPBUtil::checkFloat($var); - $this->average_rating = $var; - - return $this; - } - - /** - * List of rating counts per rating value (index = rating - 1). The list is - * empty if there is no rating. If the list is non-empty, its size is - * always 5. Otherwise, an INVALID_ARGUMENT error is returned. - * For example, [41, 14, 13, 47, 303]. It means that the - * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 - * ratings with 2 star, and so on. - * - * Generated from protobuf field repeated int32 rating_histogram = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRatingHistogram() - { - return $this->rating_histogram; - } - - /** - * List of rating counts per rating value (index = rating - 1). The list is - * empty if there is no rating. If the list is non-empty, its size is - * always 5. Otherwise, an INVALID_ARGUMENT error is returned. - * For example, [41, 14, 13, 47, 303]. It means that the - * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 - * ratings with 2 star, and so on. - * - * Generated from protobuf field repeated int32 rating_histogram = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRatingHistogram($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->rating_histogram = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php deleted file mode 100644 index 980a1dd6324..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RecommendationsFilteringOption.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.retail.v2.RecommendationsFilteringOption - */ -class RecommendationsFilteringOption -{ - /** - * Value used when unset. - * In this case, server behavior defaults to - * [RECOMMENDATIONS_FILTERING_DISABLED][google.cloud.retail.v2.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED]. - * - * Generated from protobuf enum RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0; - */ - const RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0; - /** - * Recommendation filtering is disabled. - * - * Generated from protobuf enum RECOMMENDATIONS_FILTERING_DISABLED = 1; - */ - const RECOMMENDATIONS_FILTERING_DISABLED = 1; - /** - * Recommendation filtering is enabled. - * - * Generated from protobuf enum RECOMMENDATIONS_FILTERING_ENABLED = 3; - */ - const RECOMMENDATIONS_FILTERING_ENABLED = 3; - - private static $valueToName = [ - self::RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED => 'RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED', - self::RECOMMENDATIONS_FILTERING_DISABLED => 'RECOMMENDATIONS_FILTERING_DISABLED', - self::RECOMMENDATIONS_FILTERING_ENABLED => 'RECOMMENDATIONS_FILTERING_ENABLED', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php deleted file mode 100644 index b5215c1b658..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.retail.v2.RejoinUserEventsMetadata - */ -class RejoinUserEventsMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php deleted file mode 100644 index fd983b92ea2..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.retail.v2.RejoinUserEventsRequest - */ -class RejoinUserEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * The type of the user event rejoin to define the scope and range of the user - * events to be rejoined with the latest product catalog. Defaults to - * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - * an invalid integer value. - * - * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; - */ - protected $user_event_rejoin_scope = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * @type int $user_event_rejoin_scope - * The type of the user event rejoin to define the scope and range of the user - * events to be rejoined with the latest product catalog. Defaults to - * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - * an invalid integer value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The type of the user event rejoin to define the scope and range of the user - * events to be rejoined with the latest product catalog. Defaults to - * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - * an invalid integer value. - * - * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; - * @return int - */ - public function getUserEventRejoinScope() - { - return $this->user_event_rejoin_scope; - } - - /** - * The type of the user event rejoin to define the scope and range of the user - * events to be rejoined with the latest product catalog. Defaults to - * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - * an invalid integer value. - * - * Generated from protobuf field .google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; - * @param int $var - * @return $this - */ - public function setUserEventRejoinScope($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\RejoinUserEventsRequest\UserEventRejoinScope::class); - $this->user_event_rejoin_scope = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php deleted file mode 100644 index 395f58b437e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsRequest/UserEventRejoinScope.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope - */ -class UserEventRejoinScope -{ - /** - * Rejoin all events with the latest product catalog, including both joined - * events and unjoined events. - * - * Generated from protobuf enum USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; - */ - const USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; - /** - * Only rejoin joined events with the latest product catalog. - * - * Generated from protobuf enum JOINED_EVENTS = 1; - */ - const JOINED_EVENTS = 1; - /** - * Only rejoin unjoined events with the latest product catalog. - * - * Generated from protobuf enum UNJOINED_EVENTS = 2; - */ - const UNJOINED_EVENTS = 2; - - private static $valueToName = [ - self::USER_EVENT_REJOIN_SCOPE_UNSPECIFIED => 'USER_EVENT_REJOIN_SCOPE_UNSPECIFIED', - self::JOINED_EVENTS => 'JOINED_EVENTS', - self::UNJOINED_EVENTS => 'UNJOINED_EVENTS', - ]; - - 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(UserEventRejoinScope::class, \Google\Cloud\Retail\V2\RejoinUserEventsRequest_UserEventRejoinScope::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php deleted file mode 100644 index f3922ffe771..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RejoinUserEventsResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.retail.v2.RejoinUserEventsResponse - */ -class RejoinUserEventsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Number of user events that were joined with latest product catalog. - * - * Generated from protobuf field int64 rejoined_user_events_count = 1; - */ - protected $rejoined_user_events_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $rejoined_user_events_count - * Number of user events that were joined with latest product catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Number of user events that were joined with latest product catalog. - * - * Generated from protobuf field int64 rejoined_user_events_count = 1; - * @return int|string - */ - public function getRejoinedUserEventsCount() - { - return $this->rejoined_user_events_count; - } - - /** - * Number of user events that were joined with latest product catalog. - * - * Generated from protobuf field int64 rejoined_user_events_count = 1; - * @param int|string $var - * @return $this - */ - public function setRejoinedUserEventsCount($var) - { - GPBUtil::checkInt64($var); - $this->rejoined_user_events_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php deleted file mode 100644 index 0ecb718cdfe..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveCatalogAttributeRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.retail.v2.RemoveCatalogAttributeRequest - */ -class RemoveCatalogAttributeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $attributes_config = ''; - /** - * Required. The attribute name key of the - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $attributes_config - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * @type string $key - * Required. The attribute name key of the - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getAttributesConfig() - { - return $this->attributes_config; - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAttributesConfig($var) - { - GPBUtil::checkString($var, True); - $this->attributes_config = $var; - - return $this; - } - - /** - * Required. The attribute name key of the - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The attribute name key of the - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php deleted file mode 100644 index 0a68f06ee4e..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveControlRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.retail.v2.RemoveControlRequest - */ -class RemoveControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $serving_config = ''; - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $control_id = ''; - - /** - * @param string $servingConfig Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * Please see {@see ServingConfigServiceClient::servingConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\RemoveControlRequest - * - * @experimental - */ - public static function build(string $servingConfig): self - { - return (new self()) - ->setServingConfig($servingConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $serving_config - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * @type string $control_id - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getServingConfig() - { - return $this->serving_config; - } - - /** - * Required. The source ServingConfig resource name . Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - * - * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServingConfig($var) - { - GPBUtil::checkString($var, True); - $this->serving_config = $var; - - return $this; - } - - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getControlId() - { - return $this->control_id; - } - - /** - * Required. The id of the control to apply. Assumed to be in the same catalog - * as the serving config. - * - * Generated from protobuf field string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setControlId($var) - { - GPBUtil::checkString($var, True); - $this->control_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php deleted file mode 100644 index 11b8e831145..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesMetadata.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata - */ -class RemoveFulfillmentPlacesMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php deleted file mode 100644 index 250f884eae9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesRequest.php +++ /dev/null @@ -1,375 +0,0 @@ -google.cloud.retail.v2.RemoveFulfillmentPlacesRequest - */ -class RemoveFulfillmentPlacesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $product = ''; - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $type = ''; - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery", to be removed for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $place_ids; - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; - */ - protected $remove_time = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - */ - protected $allow_missing = false; - - /** - * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\RemoveFulfillmentPlacesRequest - * - * @experimental - */ - public static function build(string $product): self - { - return (new self()) - ->setProduct($product); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $product - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * @type string $type - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids - * Required. The IDs for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery", to be removed for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * @type \Google\Protobuf\Timestamp $remove_time - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProduct() - { - return $this->product; - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkString($var, True); - $this->product = $var; - - return $this; - } - - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Required. The fulfillment type, including commonly used types (such as - * pickup in store and same day delivery), and custom types. - * Supported values: - * * "pickup-in-store" - * * "ship-to-store" - * * "same-day-delivery" - * * "next-day-delivery" - * * "custom-type-1" - * * "custom-type-2" - * * "custom-type-3" - * * "custom-type-4" - * * "custom-type-5" - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * This field directly corresponds to - * [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type]. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery", to be removed for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPlaceIds() - { - return $this->place_ids; - } - - /** - * Required. The IDs for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as - * the store IDs for "pickup-in-store" or the region IDs for - * "same-day-delivery", to be removed for this - * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type]. - * At least 1 value is required, and a maximum of 2000 values are allowed. - * Each value must be a string with a length limit of 10 characters, matching - * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPlaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->place_ids = $arr; - - return $this; - } - - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRemoveTime() - { - return $this->remove_time; - } - - public function hasRemoveTime() - { - return isset($this->remove_time); - } - - public function clearRemoveTime() - { - unset($this->remove_time); - } - - /** - * The time when the fulfillment updates are issued, used to prevent - * out-of-order updates on fulfillment information. If not provided, the - * internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRemoveTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->remove_time = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the fulfillment information will still be processed and retained for - * at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 5; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php deleted file mode 100644 index 2b5bb6e073c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveFulfillmentPlacesResponse.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.RemoveFulfillmentPlacesResponse - */ -class RemoveFulfillmentPlacesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php deleted file mode 100644 index 4af167b6dea..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesMetadata.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.RemoveLocalInventoriesMetadata - */ -class RemoveLocalInventoriesMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php deleted file mode 100644 index b8620880c08..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesRequest.php +++ /dev/null @@ -1,253 +0,0 @@ -google.cloud.retail.v2.RemoveLocalInventoriesRequest - */ -class RemoveLocalInventoriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $product = ''; - /** - * Required. A list of place IDs to have their inventory deleted. - * At most 3000 place IDs are allowed per request. - * - * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $place_ids; - /** - * The time when the inventory deletions are issued. Used to prevent - * out-of-order updates and deletions on local inventory fields. If not - * provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; - */ - protected $remove_time = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory removal request will still be processed and - * retained for at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - - /** - * @param string $product Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. Please see - * {@see ProductServiceClient::productName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\RemoveLocalInventoriesRequest - * - * @experimental - */ - public static function build(string $product): self - { - return (new self()) - ->setProduct($product); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $product - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $place_ids - * Required. A list of place IDs to have their inventory deleted. - * At most 3000 place IDs are allowed per request. - * @type \Google\Protobuf\Timestamp $remove_time - * The time when the inventory deletions are issued. Used to prevent - * out-of-order updates and deletions on local inventory fields. If not - * provided, the internal system time will be used. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory removal request will still be processed and - * retained for at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProduct() - { - return $this->product; - } - - /** - * Required. Full resource name of [Product][google.cloud.retail.v2.Product], - * such as - * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - * If the caller does not have permission to access the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * Generated from protobuf field string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkString($var, True); - $this->product = $var; - - return $this; - } - - /** - * Required. A list of place IDs to have their inventory deleted. - * At most 3000 place IDs are allowed per request. - * - * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPlaceIds() - { - return $this->place_ids; - } - - /** - * Required. A list of place IDs to have their inventory deleted. - * At most 3000 place IDs are allowed per request. - * - * Generated from protobuf field repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPlaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->place_ids = $arr; - - return $this; - } - - /** - * The time when the inventory deletions are issued. Used to prevent - * out-of-order updates and deletions on local inventory fields. If not - * provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRemoveTime() - { - return $this->remove_time; - } - - public function hasRemoveTime() - { - return isset($this->remove_time); - } - - public function clearRemoveTime() - { - unset($this->remove_time); - } - - /** - * The time when the inventory deletions are issued. Used to prevent - * out-of-order updates and deletions on local inventory fields. If not - * provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp remove_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRemoveTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->remove_time = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory removal request will still be processed and - * retained for at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, the local inventory removal request will still be processed and - * retained for at most 1 day and processed once the - * [Product][google.cloud.retail.v2.Product] is created. If set to false, a - * NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php deleted file mode 100644 index 6d1aaa395e9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/RemoveLocalInventoriesResponse.php +++ /dev/null @@ -1,38 +0,0 @@ -google.cloud.retail.v2.RemoveLocalInventoriesResponse - */ -class RemoveLocalInventoriesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php deleted file mode 100644 index d550c9f47f3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ReplaceCatalogAttributeRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.retail.v2.ReplaceCatalogAttributeRequest - */ -class ReplaceCatalogAttributeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $attributes_config = ''; - /** - * Required. The updated - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog_attribute = null; - /** - * Indicates which fields in the provided - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The - * following are NOT supported: - * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] - * If not set, all supported fields are updated. - * - * 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 $attributes_config - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * @type \Google\Cloud\Retail\V2\CatalogAttribute $catalog_attribute - * Required. The updated - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The - * following are NOT supported: - * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] - * If not set, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getAttributesConfig() - { - return $this->attributes_config; - } - - /** - * Required. Full AttributesConfig resource name. Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - * - * Generated from protobuf field string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAttributesConfig($var) - { - GPBUtil::checkString($var, True); - $this->attributes_config = $var; - - return $this; - } - - /** - * Required. The updated - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\CatalogAttribute|null - */ - public function getCatalogAttribute() - { - return $this->catalog_attribute; - } - - public function hasCatalogAttribute() - { - return isset($this->catalog_attribute); - } - - public function clearCatalogAttribute() - { - unset($this->catalog_attribute); - } - - /** - * Required. The updated - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. - * - * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\CatalogAttribute $var - * @return $this - */ - public function setCatalogAttribute($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute::class); - $this->catalog_attribute = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The - * following are NOT supported: - * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] - * If not set, all supported fields are updated. - * - * 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); - } - - /** - * Indicates which fields in the provided - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to update. The - * following are NOT supported: - * * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key] - * If not set, all supported fields are updated. - * - * 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/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php deleted file mode 100644 index 2636dc2775a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ResumeModelRequest.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.retail.v2.ResumeModelRequest - */ -class ResumeModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the model to resume. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the model to resume. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * @return \Google\Cloud\Retail\V2\ResumeModelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the model to resume. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the model to resume. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the model to resume. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php deleted file mode 100644 index b5cc2af929b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule.php +++ /dev/null @@ -1,427 +0,0 @@ -google.cloud.retail.v2.Rule - */ -class Rule extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The condition that triggers the rule. - * If the condition is empty, the rule will always apply. - * - * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $condition = null; - protected $action; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Rule\BoostAction $boost_action - * A boost action. - * @type \Google\Cloud\Retail\V2\Rule\RedirectAction $redirect_action - * Redirects a shopper to a specific page. - * @type \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction $oneway_synonyms_action - * Treats specific term as a synonym with a group of terms. - * Group of terms will not be treated as synonyms with the specific term. - * @type \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction $do_not_associate_action - * Prevents term from being associated with other terms. - * @type \Google\Cloud\Retail\V2\Rule\ReplacementAction $replacement_action - * Replaces specific terms in the query. - * @type \Google\Cloud\Retail\V2\Rule\IgnoreAction $ignore_action - * Ignores specific terms from query during search. - * @type \Google\Cloud\Retail\V2\Rule\FilterAction $filter_action - * Filters results. - * @type \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction $twoway_synonyms_action - * Treats a set of terms as synonyms of one another. - * @type \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $force_return_facet_action - * Force returns an attribute as a facet in the request. - * @type \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $remove_facet_action - * Remove an attribute as a facet in the request (if present). - * @type \Google\Cloud\Retail\V2\Condition $condition - * Required. The condition that triggers the rule. - * If the condition is empty, the rule will always apply. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * A boost action. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2; - * @return \Google\Cloud\Retail\V2\Rule\BoostAction|null - */ - public function getBoostAction() - { - return $this->readOneof(2); - } - - public function hasBoostAction() - { - return $this->hasOneof(2); - } - - /** - * A boost action. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2; - * @param \Google\Cloud\Retail\V2\Rule\BoostAction $var - * @return $this - */ - public function setBoostAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\BoostAction::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Redirects a shopper to a specific page. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3; - * @return \Google\Cloud\Retail\V2\Rule\RedirectAction|null - */ - public function getRedirectAction() - { - return $this->readOneof(3); - } - - public function hasRedirectAction() - { - return $this->hasOneof(3); - } - - /** - * Redirects a shopper to a specific page. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3; - * @param \Google\Cloud\Retail\V2\Rule\RedirectAction $var - * @return $this - */ - public function setRedirectAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\RedirectAction::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Treats specific term as a synonym with a group of terms. - * Group of terms will not be treated as synonyms with the specific term. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; - * @return \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction|null - */ - public function getOnewaySynonymsAction() - { - return $this->readOneof(6); - } - - public function hasOnewaySynonymsAction() - { - return $this->hasOneof(6); - } - - /** - * Treats specific term as a synonym with a group of terms. - * Group of terms will not be treated as synonyms with the specific term. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; - * @param \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction $var - * @return $this - */ - public function setOnewaySynonymsAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Prevents term from being associated with other terms. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7; - * @return \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction|null - */ - public function getDoNotAssociateAction() - { - return $this->readOneof(7); - } - - public function hasDoNotAssociateAction() - { - return $this->hasOneof(7); - } - - /** - * Prevents term from being associated with other terms. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7; - * @param \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction $var - * @return $this - */ - public function setDoNotAssociateAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\DoNotAssociateAction::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Replaces specific terms in the query. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8; - * @return \Google\Cloud\Retail\V2\Rule\ReplacementAction|null - */ - public function getReplacementAction() - { - return $this->readOneof(8); - } - - public function hasReplacementAction() - { - return $this->hasOneof(8); - } - - /** - * Replaces specific terms in the query. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8; - * @param \Google\Cloud\Retail\V2\Rule\ReplacementAction $var - * @return $this - */ - public function setReplacementAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\ReplacementAction::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Ignores specific terms from query during search. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9; - * @return \Google\Cloud\Retail\V2\Rule\IgnoreAction|null - */ - public function getIgnoreAction() - { - return $this->readOneof(9); - } - - public function hasIgnoreAction() - { - return $this->hasOneof(9); - } - - /** - * Ignores specific terms from query during search. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9; - * @param \Google\Cloud\Retail\V2\Rule\IgnoreAction $var - * @return $this - */ - public function setIgnoreAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\IgnoreAction::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Filters results. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10; - * @return \Google\Cloud\Retail\V2\Rule\FilterAction|null - */ - public function getFilterAction() - { - return $this->readOneof(10); - } - - public function hasFilterAction() - { - return $this->hasOneof(10); - } - - /** - * Filters results. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10; - * @param \Google\Cloud\Retail\V2\Rule\FilterAction $var - * @return $this - */ - public function setFilterAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\FilterAction::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Treats a set of terms as synonyms of one another. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; - * @return \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction|null - */ - public function getTwowaySynonymsAction() - { - return $this->readOneof(11); - } - - public function hasTwowaySynonymsAction() - { - return $this->hasOneof(11); - } - - /** - * Treats a set of terms as synonyms of one another. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; - * @param \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction $var - * @return $this - */ - public function setTwowaySynonymsAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Force returns an attribute as a facet in the request. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; - * @return \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction|null - */ - public function getForceReturnFacetAction() - { - return $this->readOneof(12); - } - - public function hasForceReturnFacetAction() - { - return $this->hasOneof(12); - } - - /** - * Force returns an attribute as a facet in the request. - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; - * @param \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $var - * @return $this - */ - public function setForceReturnFacetAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Remove an attribute as a facet in the request (if present). - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; - * @return \Google\Cloud\Retail\V2\Rule\RemoveFacetAction|null - */ - public function getRemoveFacetAction() - { - return $this->readOneof(13); - } - - public function hasRemoveFacetAction() - { - return $this->hasOneof(13); - } - - /** - * Remove an attribute as a facet in the request (if present). - * - * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; - * @param \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $var - * @return $this - */ - public function setRemoveFacetAction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\RemoveFacetAction::class); - $this->writeOneof(13, $var); - - return $this; - } - - /** - * Required. The condition that triggers the rule. - * If the condition is empty, the rule will always apply. - * - * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Condition|null - */ - public function getCondition() - { - return $this->condition; - } - - public function hasCondition() - { - return isset($this->condition); - } - - public function clearCondition() - { - unset($this->condition); - } - - /** - * Required. The condition that triggers the rule. - * If the condition is empty, the rule will always apply. - * - * Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Condition $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Condition::class); - $this->condition = $var; - - return $this; - } - - /** - * @return string - */ - public function getAction() - { - return $this->whichOneof("action"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php deleted file mode 100644 index d94136c84c9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/BoostAction.php +++ /dev/null @@ -1,200 +0,0 @@ -google.cloud.retail.v2.Rule.BoostAction - */ -class BoostAction extends \Google\Protobuf\Internal\Message -{ - /** - * Strength of the condition boost, which must be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 1; - */ - protected $boost = 0.0; - /** - * The filter can have a max size of 5000 characters. - * An expression which specifies which products to apply an action to. - * The syntax and supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string products_filter = 2; - */ - protected $products_filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $boost - * Strength of the condition boost, which must be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * @type string $products_filter - * The filter can have a max size of 5000 characters. - * An expression which specifies which products to apply an action to. - * The syntax and supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Strength of the condition boost, which must be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 1; - * @return float - */ - public function getBoost() - { - return $this->boost; - } - - /** - * Strength of the condition boost, which must be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 1; - * @param float $var - * @return $this - */ - public function setBoost($var) - { - GPBUtil::checkFloat($var); - $this->boost = $var; - - return $this; - } - - /** - * The filter can have a max size of 5000 characters. - * An expression which specifies which products to apply an action to. - * The syntax and supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string products_filter = 2; - * @return string - */ - public function getProductsFilter() - { - return $this->products_filter; - } - - /** - * The filter can have a max size of 5000 characters. - * An expression which specifies which products to apply an action to. - * The syntax and supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string products_filter = 2; - * @param string $var - * @return $this - */ - public function setProductsFilter($var) - { - GPBUtil::checkString($var, True); - $this->products_filter = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BoostAction::class, \Google\Cloud\Retail\V2\Rule_BoostAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php deleted file mode 100644 index 875b17a8bb1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/DoNotAssociateAction.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.retail.v2.Rule.DoNotAssociateAction - */ -class DoNotAssociateAction extends \Google\Protobuf\Internal\Message -{ - /** - * Terms from the search query. - * Will not consider do_not_associate_terms for search if in search query. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - */ - private $query_terms; - /** - * Cannot contain duplicates or the query term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string do_not_associate_terms = 3; - */ - private $do_not_associate_terms; - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string terms = 1; - */ - private $terms; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms - * Terms from the search query. - * Will not consider do_not_associate_terms for search if in search query. - * Can specify up to 100 terms. - * @type array|\Google\Protobuf\Internal\RepeatedField $do_not_associate_terms - * Cannot contain duplicates or the query term. - * Can specify up to 100 terms. - * @type array|\Google\Protobuf\Internal\RepeatedField $terms - * Will be [deprecated = true] post migration; - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Terms from the search query. - * Will not consider do_not_associate_terms for search if in search query. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueryTerms() - { - return $this->query_terms; - } - - /** - * Terms from the search query. - * Will not consider do_not_associate_terms for search if in search query. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueryTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->query_terms = $arr; - - return $this; - } - - /** - * Cannot contain duplicates or the query term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string do_not_associate_terms = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDoNotAssociateTerms() - { - return $this->do_not_associate_terms; - } - - /** - * Cannot contain duplicates or the query term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string do_not_associate_terms = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDoNotAssociateTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->do_not_associate_terms = $arr; - - return $this; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string terms = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTerms() - { - return $this->terms; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string terms = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->terms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DoNotAssociateAction::class, \Google\Cloud\Retail\V2\Rule_DoNotAssociateAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php deleted file mode 100644 index 2900427a372..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/FilterAction.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.retail.v2.Rule.FilterAction - */ -class FilterAction extends \Google\Protobuf\Internal\Message -{ - /** - * A filter to apply on the matching condition results. Supported features: - * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. - * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For - * more - * information, see [Filter](/retail/docs/filter-and-order#filter). - * * To filter products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string filter = 1; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $filter - * A filter to apply on the matching condition results. Supported features: - * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. - * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For - * more - * information, see [Filter](/retail/docs/filter-and-order#filter). - * * To filter products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * A filter to apply on the matching condition results. Supported features: - * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. - * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For - * more - * information, see [Filter](/retail/docs/filter-and-order#filter). - * * To filter products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string filter = 1; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filter to apply on the matching condition results. Supported features: - * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. - * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For - * more - * information, see [Filter](/retail/docs/filter-and-order#filter). - * * To filter products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue":
- * *(id: ANY("product_1", "product_2"))
* - * *AND
* - * *(colorFamilies: ANY("Red", "Blue"))
* - * - * Generated from protobuf field string filter = 1; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FilterAction::class, \Google\Cloud\Retail\V2\Rule_FilterAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php deleted file mode 100644 index 9582a3a8633..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction.php +++ /dev/null @@ -1,95 +0,0 @@ -google.cloud.retail.v2.Rule.ForceReturnFacetAction - */ -class ForceReturnFacetAction extends \Google\Protobuf\Internal\Message -{ - /** - * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 15 instances here. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; - */ - private $facet_position_adjustments; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $facet_position_adjustments - * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 15 instances here. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 15 instances here. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacetPositionAdjustments() - { - return $this->facet_position_adjustments; - } - - /** - * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 15 instances here. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; - * @param array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacetPositionAdjustments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment::class); - $this->facet_position_adjustments = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ForceReturnFacetAction::class, \Google\Cloud\Retail\V2\Rule_ForceReturnFacetAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php deleted file mode 100644 index 1c867f55610..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment - */ -class FacetPositionAdjustment extends \Google\Protobuf\Internal\Message -{ - /** - * The attribute name to force return as a facet. Each attribute name - * should be a valid attribute name, be non-empty and contain at most 80 - * characters long. - * - * Generated from protobuf field string attribute_name = 1; - */ - protected $attribute_name = ''; - /** - * This is the position in the request as explained above. It should be - * strictly positive be at most 100. - * - * Generated from protobuf field int32 position = 2; - */ - protected $position = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $attribute_name - * The attribute name to force return as a facet. Each attribute name - * should be a valid attribute name, be non-empty and contain at most 80 - * characters long. - * @type int $position - * This is the position in the request as explained above. It should be - * strictly positive be at most 100. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The attribute name to force return as a facet. Each attribute name - * should be a valid attribute name, be non-empty and contain at most 80 - * characters long. - * - * Generated from protobuf field string attribute_name = 1; - * @return string - */ - public function getAttributeName() - { - return $this->attribute_name; - } - - /** - * The attribute name to force return as a facet. Each attribute name - * should be a valid attribute name, be non-empty and contain at most 80 - * characters long. - * - * Generated from protobuf field string attribute_name = 1; - * @param string $var - * @return $this - */ - public function setAttributeName($var) - { - GPBUtil::checkString($var, True); - $this->attribute_name = $var; - - return $this; - } - - /** - * This is the position in the request as explained above. It should be - * strictly positive be at most 100. - * - * Generated from protobuf field int32 position = 2; - * @return int - */ - public function getPosition() - { - return $this->position; - } - - /** - * This is the position in the request as explained above. It should be - * strictly positive be at most 100. - * - * Generated from protobuf field int32 position = 2; - * @param int $var - * @return $this - */ - public function setPosition($var) - { - GPBUtil::checkInt32($var); - $this->position = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FacetPositionAdjustment::class, \Google\Cloud\Retail\V2\Rule_ForceReturnFacetAction_FacetPositionAdjustment::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php deleted file mode 100644 index 4c478207402..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/IgnoreAction.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.retail.v2.Rule.IgnoreAction - */ -class IgnoreAction extends \Google\Protobuf\Internal\Message -{ - /** - * Terms to ignore in the search query. - * - * Generated from protobuf field repeated string ignore_terms = 1; - */ - private $ignore_terms; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_terms - * Terms to ignore in the search query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Terms to ignore in the search query. - * - * Generated from protobuf field repeated string ignore_terms = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoreTerms() - { - return $this->ignore_terms; - } - - /** - * Terms to ignore in the search query. - * - * Generated from protobuf field repeated string ignore_terms = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoreTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ignore_terms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IgnoreAction::class, \Google\Cloud\Retail\V2\Rule_IgnoreAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php deleted file mode 100644 index 551f236d7e5..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/OnewaySynonymsAction.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.retail.v2.Rule.OnewaySynonymsAction - */ -class OnewaySynonymsAction extends \Google\Protobuf\Internal\Message -{ - /** - * Terms from the search query. - * Will treat synonyms as their synonyms. - * Not themselves synonyms of the synonyms. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 3; - */ - private $query_terms; - /** - * Defines a set of synonyms. - * Cannot contain duplicates. - * Can specify up to 100 synonyms. - * - * Generated from protobuf field repeated string synonyms = 4; - */ - private $synonyms; - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string oneway_terms = 2; - */ - private $oneway_terms; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms - * Terms from the search query. - * Will treat synonyms as their synonyms. - * Not themselves synonyms of the synonyms. - * Can specify up to 100 terms. - * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms - * Defines a set of synonyms. - * Cannot contain duplicates. - * Can specify up to 100 synonyms. - * @type array|\Google\Protobuf\Internal\RepeatedField $oneway_terms - * Will be [deprecated = true] post migration; - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Terms from the search query. - * Will treat synonyms as their synonyms. - * Not themselves synonyms of the synonyms. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueryTerms() - { - return $this->query_terms; - } - - /** - * Terms from the search query. - * Will treat synonyms as their synonyms. - * Not themselves synonyms of the synonyms. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueryTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->query_terms = $arr; - - return $this; - } - - /** - * Defines a set of synonyms. - * Cannot contain duplicates. - * Can specify up to 100 synonyms. - * - * Generated from protobuf field repeated string synonyms = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSynonyms() - { - return $this->synonyms; - } - - /** - * Defines a set of synonyms. - * Cannot contain duplicates. - * Can specify up to 100 synonyms. - * - * Generated from protobuf field repeated string synonyms = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSynonyms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->synonyms = $arr; - - return $this; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string oneway_terms = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOnewayTerms() - { - return $this->oneway_terms; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field repeated string oneway_terms = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOnewayTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->oneway_terms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OnewaySynonymsAction::class, \Google\Cloud\Retail\V2\Rule_OnewaySynonymsAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php deleted file mode 100644 index 96e2d381638..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RedirectAction.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.Rule.RedirectAction - */ -class RedirectAction extends \Google\Protobuf\Internal\Message -{ - /** - * URL must have length equal or less than 2000 characters. - * - * Generated from protobuf field string redirect_uri = 1; - */ - protected $redirect_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $redirect_uri - * URL must have length equal or less than 2000 characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * URL must have length equal or less than 2000 characters. - * - * Generated from protobuf field string redirect_uri = 1; - * @return string - */ - public function getRedirectUri() - { - return $this->redirect_uri; - } - - /** - * URL must have length equal or less than 2000 characters. - * - * Generated from protobuf field string redirect_uri = 1; - * @param string $var - * @return $this - */ - public function setRedirectUri($var) - { - GPBUtil::checkString($var, True); - $this->redirect_uri = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectAction::class, \Google\Cloud\Retail\V2\Rule_RedirectAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php deleted file mode 100644 index e92ba5dc554..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/RemoveFacetAction.php +++ /dev/null @@ -1,95 +0,0 @@ -google.cloud.retail.v2.Rule.RemoveFacetAction - */ -class RemoveFacetAction extends \Google\Protobuf\Internal\Message -{ - /** - * The attribute names (i.e. facet keys) to remove from the dynamic facets - * (if present in the request). There can't be more 3 attribute names. - * Each attribute name should be a valid attribute name, be non-empty and - * contain at most 80 characters. - * - * Generated from protobuf field repeated string attribute_names = 1; - */ - private $attribute_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $attribute_names - * The attribute names (i.e. facet keys) to remove from the dynamic facets - * (if present in the request). There can't be more 3 attribute names. - * Each attribute name should be a valid attribute name, be non-empty and - * contain at most 80 characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * The attribute names (i.e. facet keys) to remove from the dynamic facets - * (if present in the request). There can't be more 3 attribute names. - * Each attribute name should be a valid attribute name, be non-empty and - * contain at most 80 characters. - * - * Generated from protobuf field repeated string attribute_names = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAttributeNames() - { - return $this->attribute_names; - } - - /** - * The attribute names (i.e. facet keys) to remove from the dynamic facets - * (if present in the request). There can't be more 3 attribute names. - * Each attribute name should be a valid attribute name, be non-empty and - * contain at most 80 characters. - * - * Generated from protobuf field repeated string attribute_names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAttributeNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->attribute_names = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RemoveFacetAction::class, \Google\Cloud\Retail\V2\Rule_RemoveFacetAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php deleted file mode 100644 index cbbeca753a3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/ReplacementAction.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.retail.v2.Rule.ReplacementAction - */ -class ReplacementAction extends \Google\Protobuf\Internal\Message -{ - /** - * Terms from the search query. - * Will be replaced by replacement term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - */ - private $query_terms; - /** - * Term that will be used for replacement. - * - * Generated from protobuf field string replacement_term = 3; - */ - protected $replacement_term = ''; - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field string term = 1; - */ - protected $term = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $query_terms - * Terms from the search query. - * Will be replaced by replacement term. - * Can specify up to 100 terms. - * @type string $replacement_term - * Term that will be used for replacement. - * @type string $term - * Will be [deprecated = true] post migration; - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Terms from the search query. - * Will be replaced by replacement term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueryTerms() - { - return $this->query_terms; - } - - /** - * Terms from the search query. - * Will be replaced by replacement term. - * Can specify up to 100 terms. - * - * Generated from protobuf field repeated string query_terms = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueryTerms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->query_terms = $arr; - - return $this; - } - - /** - * Term that will be used for replacement. - * - * Generated from protobuf field string replacement_term = 3; - * @return string - */ - public function getReplacementTerm() - { - return $this->replacement_term; - } - - /** - * Term that will be used for replacement. - * - * Generated from protobuf field string replacement_term = 3; - * @param string $var - * @return $this - */ - public function setReplacementTerm($var) - { - GPBUtil::checkString($var, True); - $this->replacement_term = $var; - - return $this; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field string term = 1; - * @return string - */ - public function getTerm() - { - return $this->term; - } - - /** - * Will be [deprecated = true] post migration; - * - * Generated from protobuf field string term = 1; - * @param string $var - * @return $this - */ - public function setTerm($var) - { - GPBUtil::checkString($var, True); - $this->term = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReplacementAction::class, \Google\Cloud\Retail\V2\Rule_ReplacementAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php deleted file mode 100644 index 6d6f51438ae..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Rule/TwowaySynonymsAction.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.retail.v2.Rule.TwowaySynonymsAction - */ -class TwowaySynonymsAction extends \Google\Protobuf\Internal\Message -{ - /** - * Defines a set of synonyms. - * Can specify up to 100 synonyms. - * Must specify at least 2 synonyms. - * - * Generated from protobuf field repeated string synonyms = 1; - */ - private $synonyms; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms - * Defines a set of synonyms. - * Can specify up to 100 synonyms. - * Must specify at least 2 synonyms. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Defines a set of synonyms. - * Can specify up to 100 synonyms. - * Must specify at least 2 synonyms. - * - * Generated from protobuf field repeated string synonyms = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSynonyms() - { - return $this->synonyms; - } - - /** - * Defines a set of synonyms. - * Can specify up to 100 synonyms. - * Must specify at least 2 synonyms. - * - * Generated from protobuf field repeated string synonyms = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSynonyms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->synonyms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TwowaySynonymsAction::class, \Google\Cloud\Retail\V2\Rule_TwowaySynonymsAction::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php deleted file mode 100644 index b948fc40243..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest.php +++ /dev/null @@ -1,1625 +0,0 @@ -google.cloud.retail.v2.SearchRequest - */ -class SearchRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Retail Search serving config, such as - * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - * or the name of the legacy placement resource, such as - * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving config name and the set - * of models that are used to make the search. - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $placement = ''; - /** - * The branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. - * Use "default_branch" as the branch ID or leave this field empty, to search - * products under the default branch. - * - * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { - */ - protected $branch = ''; - /** - * Raw search query. - * If this field is empty, the request is considered a category browsing - * request and returned results are based on - * [filter][google.cloud.retail.v2.SearchRequest.filter] and - * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. - * - * Generated from protobuf field string query = 3; - */ - protected $query = ''; - /** - * Required. A unique identifier for tracking visitors. For example, this - * could be implemented with an HTTP cookie, which should be able to uniquely - * identify a visitor on a single device. This unique identifier should not - * change if the visitor logs in or out of the website. - * This should be the same identifier as - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $visitor_id = ''; - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; - */ - protected $user_info = null; - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 120. Values above 120 will be coerced to 120. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 7; - */ - protected $page_size = 0; - /** - * A page token - * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], - * received from a previous - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must - * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - * error is returned. - * - * Generated from protobuf field string page_token = 8; - */ - protected $page_token = ''; - /** - * A 0-indexed integer that specifies the current offset (that is, starting - * result location, amongst the [Product][google.cloud.retail.v2.Product]s - * deemed by the API as relevant) in search results. This field is only - * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] - * is unset. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 offset = 9; - */ - protected $offset = 0; - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. For more information, see - * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string filter = 10; - */ - protected $filter = ''; - /** - * The default filter that is applied when a user performs a search without - * checking any filters on the search page. - * The filter applied to every search request when quality improvement such as - * query expansion is needed. In the case a query does not have a sufficient - * amount of results this filter will be used to determine whether or not to - * enable the query expansion flow. The original filter will still be used for - * the query expanded search. - * This field is strongly recommended to achieve high search quality. - * For more information about filter syntax, see - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field string canonical_filter = 28; - */ - protected $canonical_filter = ''; - /** - * The order in which products are returned. Products can be ordered by - * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. For - * more information, see - * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string order_by = 11; - */ - protected $order_by = ''; - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; - */ - private $facet_specs; - /** - * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - * to enable dynamic facets. Do not set this field. - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - * @deprecated - */ - protected $dynamic_facet_spec = null; - /** - * Boost specification to boost certain products. For more information, see - * [Boost results](https://cloud.google.com/retail/docs/boosting). - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; - */ - protected $boost_spec = null; - /** - * The query expansion specification that specifies the conditions under which - * query expansion occurs. For more information, see [Query - * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; - */ - protected $query_expansion_spec = null; - /** - * The keys to fetch and rollup the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s attributes, - * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The - * attributes from all the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and - * de-duplicated. Notice that rollup attributes will lead to extra query - * latency. Maximum number of keys is 30. - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a - * fulfillment type and a fulfillment ID must be provided in the format of - * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - * "pickupInStore" is fulfillment type and "store123" is the store ID. - * Supported keys are: - * * colorFamilies - * * price - * * originalPrice - * * discount - * * variantId - * * inventory(place_id,price) - * * inventory(place_id,original_price) - * * inventory(place_id,attributes.key), where key is any key in the - * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] - * map. - * * attributes.key, where key is any key in the - * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. - * * pickupInStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "pickup-in-store". - * * shipToStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "ship-to-store". - * * sameDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "same-day-delivery". - * * nextDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "next-day-delivery". - * * customFulfillment1.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-1". - * * customFulfillment2.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-2". - * * customFulfillment3.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-3". - * * customFulfillment4.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-4". - * * customFulfillment5.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-5". - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string variant_rollup_keys = 17; - */ - private $variant_rollup_keys; - /** - * The categories associated with a category page. Must be set for category - * navigation queries to achieve good search quality. The format should be - * the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated string page_categories = 23; - */ - private $page_categories; - /** - * The search mode of the search request. If not specified, a single search - * request triggers both product search and faceted search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; - */ - protected $search_mode = 0; - /** - * The specification for personalization. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; - */ - protected $personalization_spec = null; - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * For more information, see [Requirements for - * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * in the Resource Manager documentation. - * - * Generated from protobuf field map labels = 34; - */ - private $labels; - /** - * The spell correction specification that specifies the mode under - * which spell correction will take effect. - * - * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; - */ - protected $spell_correction_spec = null; - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search - * results boosted by entity. - * - * Generated from protobuf field string entity = 38; - */ - protected $entity = ''; - /** - * Optional. This field specifies all conversational related parameters - * addition to traditional retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $conversational_search_spec = null; - /** - * Optional. This field specifies tile navigation related parameters. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $tile_navigation_spec = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $placement - * Required. The resource name of the Retail Search serving config, such as - * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - * or the name of the legacy placement resource, such as - * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving config name and the set - * of models that are used to make the search. - * @type string $branch - * The branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. - * Use "default_branch" as the branch ID or leave this field empty, to search - * products under the default branch. - * @type string $query - * Raw search query. - * If this field is empty, the request is considered a category browsing - * request and returned results are based on - * [filter][google.cloud.retail.v2.SearchRequest.filter] and - * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. - * @type string $visitor_id - * Required. A unique identifier for tracking visitors. For example, this - * could be implemented with an HTTP cookie, which should be able to uniquely - * identify a visitor on a single device. This unique identifier should not - * change if the visitor logs in or out of the website. - * This should be the same identifier as - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type \Google\Cloud\Retail\V2\UserInfo $user_info - * User information. - * @type int $page_size - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 120. Values above 120 will be coerced to 120. - * If this field is negative, an INVALID_ARGUMENT is returned. - * @type string $page_token - * A page token - * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], - * received from a previous - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must - * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - * error is returned. - * @type int $offset - * A 0-indexed integer that specifies the current offset (that is, starting - * result location, amongst the [Product][google.cloud.retail.v2.Product]s - * deemed by the API as relevant) in search results. This field is only - * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] - * is unset. - * If this field is negative, an INVALID_ARGUMENT is returned. - * @type string $filter - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. For more information, see - * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * @type string $canonical_filter - * The default filter that is applied when a user performs a search without - * checking any filters on the search page. - * The filter applied to every search request when quality improvement such as - * query expansion is needed. In the case a query does not have a sufficient - * amount of results this filter will be used to determine whether or not to - * enable the query expansion flow. The original filter will still be used for - * the query expanded search. - * This field is strongly recommended to achieve high search quality. - * For more information about filter syntax, see - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * @type string $order_by - * The order in which products are returned. Products can be ordered by - * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. For - * more information, see - * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * @type array<\Google\Cloud\Retail\V2\SearchRequest\FacetSpec>|\Google\Protobuf\Internal\RepeatedField $facet_specs - * Facet specifications for faceted search. If empty, no facets are returned. - * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * @type \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $dynamic_facet_spec - * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - * to enable dynamic facets. Do not set this field. - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * @type \Google\Cloud\Retail\V2\SearchRequest\BoostSpec $boost_spec - * Boost specification to boost certain products. For more information, see - * [Boost results](https://cloud.google.com/retail/docs/boosting). - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * @type \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $query_expansion_spec - * The query expansion specification that specifies the conditions under which - * query expansion occurs. For more information, see [Query - * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - * @type array|\Google\Protobuf\Internal\RepeatedField $variant_rollup_keys - * The keys to fetch and rollup the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s attributes, - * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The - * attributes from all the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and - * de-duplicated. Notice that rollup attributes will lead to extra query - * latency. Maximum number of keys is 30. - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a - * fulfillment type and a fulfillment ID must be provided in the format of - * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - * "pickupInStore" is fulfillment type and "store123" is the store ID. - * Supported keys are: - * * colorFamilies - * * price - * * originalPrice - * * discount - * * variantId - * * inventory(place_id,price) - * * inventory(place_id,original_price) - * * inventory(place_id,attributes.key), where key is any key in the - * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] - * map. - * * attributes.key, where key is any key in the - * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. - * * pickupInStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "pickup-in-store". - * * shipToStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "ship-to-store". - * * sameDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "same-day-delivery". - * * nextDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "next-day-delivery". - * * customFulfillment1.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-1". - * * customFulfillment2.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-2". - * * customFulfillment3.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-3". - * * customFulfillment4.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-4". - * * customFulfillment5.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-5". - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories - * The categories associated with a category page. Must be set for category - * navigation queries to achieve good search quality. The format should be - * the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * @type int $search_mode - * The search mode of the search request. If not specified, a single search - * request triggers both product search and faceted search. - * @type \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $personalization_spec - * The specification for personalization. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * @type array|\Google\Protobuf\Internal\MapField $labels - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * For more information, see [Requirements for - * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * in the Resource Manager documentation. - * @type \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec $spell_correction_spec - * The spell correction specification that specifies the mode under - * which spell correction will take effect. - * @type string $entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search - * results boosted by entity. - * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $conversational_search_spec - * Optional. This field specifies all conversational related parameters - * addition to traditional retail search. - * @type \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $tile_navigation_spec - * Optional. This field specifies tile navigation related parameters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Retail Search serving config, such as - * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - * or the name of the legacy placement resource, such as - * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving config name and the set - * of models that are used to make the search. - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPlacement() - { - return $this->placement; - } - - /** - * Required. The resource name of the Retail Search serving config, such as - * `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - * or the name of the legacy placement resource, such as - * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving config name and the set - * of models that are used to make the search. - * - * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPlacement($var) - { - GPBUtil::checkString($var, True); - $this->placement = $var; - - return $this; - } - - /** - * The branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. - * Use "default_branch" as the branch ID or leave this field empty, to search - * products under the default branch. - * - * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getBranch() - { - return $this->branch; - } - - /** - * The branch resource name, such as - * `projects/*/locations/global/catalogs/default_catalog/branches/0`. - * Use "default_branch" as the branch ID or leave this field empty, to search - * products under the default branch. - * - * Generated from protobuf field string branch = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->branch = $var; - - return $this; - } - - /** - * Raw search query. - * If this field is empty, the request is considered a category browsing - * request and returned results are based on - * [filter][google.cloud.retail.v2.SearchRequest.filter] and - * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. - * - * Generated from protobuf field string query = 3; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Raw search query. - * If this field is empty, the request is considered a category browsing - * request and returned results are based on - * [filter][google.cloud.retail.v2.SearchRequest.filter] and - * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories]. - * - * Generated from protobuf field string query = 3; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Required. A unique identifier for tracking visitors. For example, this - * could be implemented with an HTTP cookie, which should be able to uniquely - * identify a visitor on a single device. This unique identifier should not - * change if the visitor logs in or out of the website. - * This should be the same identifier as - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVisitorId() - { - return $this->visitor_id; - } - - /** - * Required. A unique identifier for tracking visitors. For example, this - * could be implemented with an HTTP cookie, which should be able to uniquely - * identify a visitor on a single device. This unique identifier should not - * change if the visitor logs in or out of the website. - * This should be the same identifier as - * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVisitorId($var) - { - GPBUtil::checkString($var, True); - $this->visitor_id = $var; - - return $this; - } - - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; - * @return \Google\Cloud\Retail\V2\UserInfo|null - */ - public function getUserInfo() - { - return $this->user_info; - } - - public function hasUserInfo() - { - return isset($this->user_info); - } - - public function clearUserInfo() - { - unset($this->user_info); - } - - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 5; - * @param \Google\Cloud\Retail\V2\UserInfo $var - * @return $this - */ - public function setUserInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserInfo::class); - $this->user_info = $var; - - return $this; - } - - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 120. Values above 120 will be coerced to 120. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 7; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 120. Values above 120 will be coerced to 120. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 page_size = 7; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token - * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], - * received from a previous - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must - * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - * error is returned. - * - * Generated from protobuf field string page_token = 8; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token - * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], - * received from a previous - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must - * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - * error is returned. - * - * Generated from protobuf field string page_token = 8; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * A 0-indexed integer that specifies the current offset (that is, starting - * result location, amongst the [Product][google.cloud.retail.v2.Product]s - * deemed by the API as relevant) in search results. This field is only - * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] - * is unset. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 offset = 9; - * @return int - */ - public function getOffset() - { - return $this->offset; - } - - /** - * A 0-indexed integer that specifies the current offset (that is, starting - * result location, amongst the [Product][google.cloud.retail.v2.Product]s - * deemed by the API as relevant) in search results. This field is only - * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] - * is unset. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 offset = 9; - * @param int $var - * @return $this - */ - public function setOffset($var) - { - GPBUtil::checkInt32($var); - $this->offset = $var; - - return $this; - } - - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. For more information, see - * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string filter = 10; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. For more information, see - * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string filter = 10; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The default filter that is applied when a user performs a search without - * checking any filters on the search page. - * The filter applied to every search request when quality improvement such as - * query expansion is needed. In the case a query does not have a sufficient - * amount of results this filter will be used to determine whether or not to - * enable the query expansion flow. The original filter will still be used for - * the query expanded search. - * This field is strongly recommended to achieve high search quality. - * For more information about filter syntax, see - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field string canonical_filter = 28; - * @return string - */ - public function getCanonicalFilter() - { - return $this->canonical_filter; - } - - /** - * The default filter that is applied when a user performs a search without - * checking any filters on the search page. - * The filter applied to every search request when quality improvement such as - * query expansion is needed. In the case a query does not have a sufficient - * amount of results this filter will be used to determine whether or not to - * enable the query expansion flow. The original filter will still be used for - * the query expanded search. - * This field is strongly recommended to achieve high search quality. - * For more information about filter syntax, see - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field string canonical_filter = 28; - * @param string $var - * @return $this - */ - public function setCanonicalFilter($var) - { - GPBUtil::checkString($var, True); - $this->canonical_filter = $var; - - return $this; - } - - /** - * The order in which products are returned. Products can be ordered by - * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. For - * more information, see - * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string order_by = 11; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The order in which products are returned. Products can be ordered by - * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. For - * more information, see - * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - * If this field is unrecognizable, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field string order_by = 11; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacetSpecs() - { - return $this->facet_specs; - } - - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; - * @param array<\Google\Cloud\Retail\V2\SearchRequest\FacetSpec>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacetSpecs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\FacetSpec::class); - $this->facet_specs = $arr; - - return $this; - } - - /** - * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - * to enable dynamic facets. Do not set this field. - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - * @return \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec|null - * @deprecated - */ - public function getDynamicFacetSpec() - { - @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); - return $this->dynamic_facet_spec; - } - - public function hasDynamicFacetSpec() - { - @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); - return isset($this->dynamic_facet_spec); - } - - public function clearDynamicFacetSpec() - { - @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); - unset($this->dynamic_facet_spec); - } - - /** - * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - * to enable dynamic facets. Do not set this field. - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - * @param \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $var - * @return $this - * @deprecated - */ - public function setDynamicFacetSpec($var) - { - @trigger_error('dynamic_facet_spec is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec::class); - $this->dynamic_facet_spec = $var; - - return $this; - } - - /** - * Boost specification to boost certain products. For more information, see - * [Boost results](https://cloud.google.com/retail/docs/boosting). - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; - * @return \Google\Cloud\Retail\V2\SearchRequest\BoostSpec|null - */ - public function getBoostSpec() - { - return $this->boost_spec; - } - - public function hasBoostSpec() - { - return isset($this->boost_spec); - } - - public function clearBoostSpec() - { - unset($this->boost_spec); - } - - /** - * Boost specification to boost certain products. For more information, see - * [Boost results](https://cloud.google.com/retail/docs/boosting). - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; - * @param \Google\Cloud\Retail\V2\SearchRequest\BoostSpec $var - * @return $this - */ - public function setBoostSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec::class); - $this->boost_spec = $var; - - return $this; - } - - /** - * The query expansion specification that specifies the conditions under which - * query expansion occurs. For more information, see [Query - * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; - * @return \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec|null - */ - public function getQueryExpansionSpec() - { - return $this->query_expansion_spec; - } - - public function hasQueryExpansionSpec() - { - return isset($this->query_expansion_spec); - } - - public function clearQueryExpansionSpec() - { - unset($this->query_expansion_spec); - } - - /** - * The query expansion specification that specifies the conditions under which - * query expansion occurs. For more information, see [Query - * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; - * @param \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $var - * @return $this - */ - public function setQueryExpansionSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec::class); - $this->query_expansion_spec = $var; - - return $this; - } - - /** - * The keys to fetch and rollup the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s attributes, - * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The - * attributes from all the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and - * de-duplicated. Notice that rollup attributes will lead to extra query - * latency. Maximum number of keys is 30. - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a - * fulfillment type and a fulfillment ID must be provided in the format of - * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - * "pickupInStore" is fulfillment type and "store123" is the store ID. - * Supported keys are: - * * colorFamilies - * * price - * * originalPrice - * * discount - * * variantId - * * inventory(place_id,price) - * * inventory(place_id,original_price) - * * inventory(place_id,attributes.key), where key is any key in the - * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] - * map. - * * attributes.key, where key is any key in the - * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. - * * pickupInStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "pickup-in-store". - * * shipToStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "ship-to-store". - * * sameDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "same-day-delivery". - * * nextDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "next-day-delivery". - * * customFulfillment1.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-1". - * * customFulfillment2.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-2". - * * customFulfillment3.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-3". - * * customFulfillment4.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-4". - * * customFulfillment5.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-5". - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string variant_rollup_keys = 17; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVariantRollupKeys() - { - return $this->variant_rollup_keys; - } - - /** - * The keys to fetch and rollup the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s attributes, - * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The - * attributes from all the matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s or - * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and - * de-duplicated. Notice that rollup attributes will lead to extra query - * latency. Maximum number of keys is 30. - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a - * fulfillment type and a fulfillment ID must be provided in the format of - * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - * "pickupInStore" is fulfillment type and "store123" is the store ID. - * Supported keys are: - * * colorFamilies - * * price - * * originalPrice - * * discount - * * variantId - * * inventory(place_id,price) - * * inventory(place_id,original_price) - * * inventory(place_id,attributes.key), where key is any key in the - * [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes] - * map. - * * attributes.key, where key is any key in the - * [Product.attributes][google.cloud.retail.v2.Product.attributes] map. - * * pickupInStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "pickup-in-store". - * * shipToStore.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "ship-to-store". - * * sameDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "same-day-delivery". - * * nextDayDelivery.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "next-day-delivery". - * * customFulfillment1.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-1". - * * customFulfillment2.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-2". - * * customFulfillment3.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-3". - * * customFulfillment4.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-4". - * * customFulfillment5.id, where id is any - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type] - * "custom-type-5". - * If this field is set to an invalid value other than these, an - * INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string variant_rollup_keys = 17; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVariantRollupKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->variant_rollup_keys = $arr; - - return $this; - } - - /** - * The categories associated with a category page. Must be set for category - * navigation queries to achieve good search quality. The format should be - * the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated string page_categories = 23; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageCategories() - { - return $this->page_categories; - } - - /** - * The categories associated with a category page. Must be set for category - * navigation queries to achieve good search quality. The format should be - * the same as - * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated string page_categories = 23; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageCategories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->page_categories = $arr; - - return $this; - } - - /** - * The search mode of the search request. If not specified, a single search - * request triggers both product search and faceted search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; - * @return int - */ - public function getSearchMode() - { - return $this->search_mode; - } - - /** - * The search mode of the search request. If not specified, a single search - * request triggers both product search and faceted search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31; - * @param int $var - * @return $this - */ - public function setSearchMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\SearchMode::class); - $this->search_mode = $var; - - return $this; - } - - /** - * The specification for personalization. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; - * @return \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec|null - */ - public function getPersonalizationSpec() - { - return $this->personalization_spec; - } - - public function hasPersonalizationSpec() - { - return isset($this->personalization_spec); - } - - public function clearPersonalizationSpec() - { - unset($this->personalization_spec); - } - - /** - * The specification for personalization. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32; - * @param \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $var - * @return $this - */ - public function setPersonalizationSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec::class); - $this->personalization_spec = $var; - - return $this; - } - - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * For more information, see [Requirements for - * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * in the Resource Manager documentation. - * - * Generated from protobuf field map labels = 34; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The labels applied to a resource must meet the following requirements: - * * Each resource can have multiple labels, up to a maximum of 64. - * * Each label must be a key-value pair. - * * Keys have a minimum length of 1 character and a maximum length of 63 - * characters and cannot be empty. Values can be empty and have a maximum - * length of 63 characters. - * * Keys and values can contain only lowercase letters, numeric characters, - * underscores, and dashes. All characters must use UTF-8 encoding, and - * international characters are allowed. - * * The key portion of a label must be unique. However, you can use the same - * key with multiple resources. - * * Keys must start with a lowercase letter or international character. - * For more information, see [Requirements for - * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * in the Resource Manager documentation. - * - * Generated from protobuf field map labels = 34; - * @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; - } - - /** - * The spell correction specification that specifies the mode under - * which spell correction will take effect. - * - * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; - * @return \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec|null - */ - public function getSpellCorrectionSpec() - { - return $this->spell_correction_spec; - } - - public function hasSpellCorrectionSpec() - { - return isset($this->spell_correction_spec); - } - - public function clearSpellCorrectionSpec() - { - unset($this->spell_correction_spec); - } - - /** - * The spell correction specification that specifies the mode under - * which spell correction will take effect. - * - * Generated from protobuf field optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35; - * @param \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec $var - * @return $this - */ - public function setSpellCorrectionSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec::class); - $this->spell_correction_spec = $var; - - return $this; - } - - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search - * results boosted by entity. - * - * Generated from protobuf field string entity = 38; - * @return string - */ - public function getEntity() - { - return $this->entity; - } - - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with - * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search - * results boosted by entity. - * - * Generated from protobuf field string entity = 38; - * @param string $var - * @return $this - */ - public function setEntity($var) - { - GPBUtil::checkString($var, True); - $this->entity = $var; - - return $this; - } - - /** - * Optional. This field specifies all conversational related parameters - * addition to traditional retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec|null - */ - public function getConversationalSearchSpec() - { - return $this->conversational_search_spec; - } - - public function hasConversationalSearchSpec() - { - return isset($this->conversational_search_spec); - } - - public function clearConversationalSearchSpec() - { - unset($this->conversational_search_spec); - } - - /** - * Optional. This field specifies all conversational related parameters - * addition to traditional retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $var - * @return $this - */ - public function setConversationalSearchSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec::class); - $this->conversational_search_spec = $var; - - return $this; - } - - /** - * Optional. This field specifies tile navigation related parameters. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec|null - */ - public function getTileNavigationSpec() - { - return $this->tile_navigation_spec; - } - - public function hasTileNavigationSpec() - { - return isset($this->tile_navigation_spec); - } - - public function clearTileNavigationSpec() - { - unset($this->tile_navigation_spec); - } - - /** - * Optional. This field specifies tile navigation related parameters. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $var - * @return $this - */ - public function setTileNavigationSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec::class); - $this->tile_navigation_spec = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php deleted file mode 100644 index c4a2c1c4db2..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.retail.v2.SearchRequest.BoostSpec - */ -class BoostSpec extends \Google\Protobuf\Internal\Message -{ - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifictions, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 20. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; - */ - private $condition_boost_specs; - /** - * Whether to skip boostspec validation. If this field is set to true, - * invalid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will be ignored and valid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will still be applied. - * - * Generated from protobuf field optional bool skip_boost_spec_validation = 2; - */ - protected $skip_boost_spec_validation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $condition_boost_specs - * Condition boost specifications. If a product matches multiple conditions - * in the specifictions, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 20. - * @type bool $skip_boost_spec_validation - * Whether to skip boostspec validation. If this field is set to true, - * invalid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will be ignored and valid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will still be applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifictions, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 20. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditionBoostSpecs() - { - return $this->condition_boost_specs; - } - - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifictions, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 20. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; - * @param array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditionBoostSpecs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec::class); - $this->condition_boost_specs = $arr; - - return $this; - } - - /** - * Whether to skip boostspec validation. If this field is set to true, - * invalid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will be ignored and valid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will still be applied. - * - * Generated from protobuf field optional bool skip_boost_spec_validation = 2; - * @return bool - */ - public function getSkipBoostSpecValidation() - { - return isset($this->skip_boost_spec_validation) ? $this->skip_boost_spec_validation : false; - } - - public function hasSkipBoostSpecValidation() - { - return isset($this->skip_boost_spec_validation); - } - - public function clearSkipBoostSpecValidation() - { - unset($this->skip_boost_spec_validation); - } - - /** - * Whether to skip boostspec validation. If this field is set to true, - * invalid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will be ignored and valid - * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * will still be applied. - * - * Generated from protobuf field optional bool skip_boost_spec_validation = 2; - * @param bool $var - * @return $this - */ - public function setSkipBoostSpecValidation($var) - { - GPBUtil::checkBool($var); - $this->skip_boost_spec_validation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BoostSpec::class, \Google\Cloud\Retail\V2\SearchRequest_BoostSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php deleted file mode 100644 index 2515f738bad..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/BoostSpec/ConditionBoostSpec.php +++ /dev/null @@ -1,192 +0,0 @@ -google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - */ -class ConditionBoostSpec extends \Google\Protobuf\Internal\Message -{ - /** - * An expression which specifies a boost condition. The syntax and - * supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue": - * * (id: ANY("product_1", "product_2")) AND (colorFamilies: - * ANY("Red","Blue")) - * - * Generated from protobuf field string condition = 1; - */ - protected $condition = ''; - /** - * Strength of the condition boost, which should be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 2; - */ - protected $boost = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $condition - * An expression which specifies a boost condition. The syntax and - * supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue": - * * (id: ANY("product_1", "product_2")) AND (colorFamilies: - * ANY("Red","Blue")) - * @type float $boost - * Strength of the condition boost, which should be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * An expression which specifies a boost condition. The syntax and - * supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue": - * * (id: ANY("product_1", "product_2")) AND (colorFamilies: - * ANY("Red","Blue")) - * - * Generated from protobuf field string condition = 1; - * @return string - */ - public function getCondition() - { - return $this->condition; - } - - /** - * An expression which specifies a boost condition. The syntax and - * supported fields are the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. - * Examples: - * * To boost products with product ID "product_1" or "product_2", and - * color - * "Red" or "Blue": - * * (id: ANY("product_1", "product_2")) AND (colorFamilies: - * ANY("Red","Blue")) - * - * Generated from protobuf field string condition = 1; - * @param string $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkString($var, True); - $this->condition = $var; - - return $this; - } - - /** - * Strength of the condition boost, which should be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 2; - * @return float - */ - public function getBoost() - { - return $this->boost; - } - - /** - * Strength of the condition boost, which should be in [-1, 1]. Negative - * boost means demotion. Default is 0.0. - * Setting to 1.0 gives the item a big promotion. However, it does not - * necessarily mean that the boosted item will be the top result at all - * times, nor that other items will be excluded. Results could still be - * shown even when none of them matches the condition. And results that - * are significantly more relevant to the search query can still trump - * your heavily favored but irrelevant items. - * Setting to -1.0 gives the item a big demotion. However, results that - * are deeply relevant might still be shown. The item will have an - * upstream battle to get a fairly high ranking, but it is not blocked out - * completely. - * Setting to 0.0 means no boost applied. The boosting condition is - * ignored. - * - * Generated from protobuf field float boost = 2; - * @param float $var - * @return $this - */ - public function setBoost($var) - { - GPBUtil::checkFloat($var); - $this->boost = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConditionBoostSpec::class, \Google\Cloud\Retail\V2\SearchRequest_BoostSpec_ConditionBoostSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php deleted file mode 100644 index 0c4780029c7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec - */ -class ConversationalSearchSpec extends \Google\Protobuf\Internal\Message -{ - /** - * This field specifies whether the customer would like to do conversational - * search. If this field is set to true, conversational related extra - * information will be returned from server side, including follow-up - * question, answer options, etc. - * - * Generated from protobuf field bool followup_conversation_requested = 1; - */ - protected $followup_conversation_requested = false; - /** - * This field specifies the conversation id, which maintains the state of - * the conversation between client side and server side. Use the value from - * the previous [ConversationalSearchResult.conversation_id][]. For the - * initial request, this should be empty. - * - * Generated from protobuf field string conversation_id = 2; - */ - protected $conversation_id = ''; - /** - * This field specifies the current user answer during the conversational - * search. This can be either user selected from suggested answers or user - * input plain text. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; - */ - protected $user_answer = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $followup_conversation_requested - * This field specifies whether the customer would like to do conversational - * search. If this field is set to true, conversational related extra - * information will be returned from server side, including follow-up - * question, answer options, etc. - * @type string $conversation_id - * This field specifies the conversation id, which maintains the state of - * the conversation between client side and server side. Use the value from - * the previous [ConversationalSearchResult.conversation_id][]. For the - * initial request, this should be empty. - * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $user_answer - * This field specifies the current user answer during the conversational - * search. This can be either user selected from suggested answers or user - * input plain text. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * This field specifies whether the customer would like to do conversational - * search. If this field is set to true, conversational related extra - * information will be returned from server side, including follow-up - * question, answer options, etc. - * - * Generated from protobuf field bool followup_conversation_requested = 1; - * @return bool - */ - public function getFollowupConversationRequested() - { - return $this->followup_conversation_requested; - } - - /** - * This field specifies whether the customer would like to do conversational - * search. If this field is set to true, conversational related extra - * information will be returned from server side, including follow-up - * question, answer options, etc. - * - * Generated from protobuf field bool followup_conversation_requested = 1; - * @param bool $var - * @return $this - */ - public function setFollowupConversationRequested($var) - { - GPBUtil::checkBool($var); - $this->followup_conversation_requested = $var; - - return $this; - } - - /** - * This field specifies the conversation id, which maintains the state of - * the conversation between client side and server side. Use the value from - * the previous [ConversationalSearchResult.conversation_id][]. For the - * initial request, this should be empty. - * - * Generated from protobuf field string conversation_id = 2; - * @return string - */ - public function getConversationId() - { - return $this->conversation_id; - } - - /** - * This field specifies the conversation id, which maintains the state of - * the conversation between client side and server side. Use the value from - * the previous [ConversationalSearchResult.conversation_id][]. For the - * initial request, this should be empty. - * - * Generated from protobuf field string conversation_id = 2; - * @param string $var - * @return $this - */ - public function setConversationId($var) - { - GPBUtil::checkString($var, True); - $this->conversation_id = $var; - - return $this; - } - - /** - * This field specifies the current user answer during the conversational - * search. This can be either user selected from suggested answers or user - * input plain text. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; - * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer|null - */ - public function getUserAnswer() - { - return $this->user_answer; - } - - public function hasUserAnswer() - { - return isset($this->user_answer); - } - - public function clearUserAnswer() - { - unset($this->user_answer); - } - - /** - * This field specifies the current user answer during the conversational - * search. This can be either user selected from suggested answers or user - * input plain text. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; - * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $var - * @return $this - */ - public function setUserAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer::class); - $this->user_answer = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConversationalSearchSpec::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php deleted file mode 100644 index 9d204d2f005..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer - */ -class UserAnswer extends \Google\Protobuf\Internal\Message -{ - protected $type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text_answer - * This field specifies the incremental input text from the user during - * the conversational search. - * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $selected_answer - * This field specifies the selected attributes during the - * conversational search. This should be a subset of - * [ConversationalSearchResult.suggested_answers][]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * This field specifies the incremental input text from the user during - * the conversational search. - * - * Generated from protobuf field string text_answer = 1; - * @return string - */ - public function getTextAnswer() - { - return $this->readOneof(1); - } - - public function hasTextAnswer() - { - return $this->hasOneof(1); - } - - /** - * This field specifies the incremental input text from the user during - * the conversational search. - * - * Generated from protobuf field string text_answer = 1; - * @param string $var - * @return $this - */ - public function setTextAnswer($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * This field specifies the selected attributes during the - * conversational search. This should be a subset of - * [ConversationalSearchResult.suggested_answers][]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; - * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer|null - */ - public function getSelectedAnswer() - { - return $this->readOneof(2); - } - - public function hasSelectedAnswer() - { - return $this->hasOneof(2); - } - - /** - * This field specifies the selected attributes during the - * conversational search. This should be a subset of - * [ConversationalSearchResult.suggested_answers][]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; - * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $var - * @return $this - */ - public function setSelectedAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getType() - { - return $this->whichOneof("type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UserAnswer::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec_UserAnswer::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php deleted file mode 100644 index eec8e71a48b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer - */ -class SelectedAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * This field is deprecated and should not be set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; - * @deprecated - */ - private $product_attribute_values; - /** - * This field specifies the selected answer which is a attribute - * key-value. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; - */ - protected $product_attribute_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $product_attribute_values - * This field is deprecated and should not be set. - * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value - * This field specifies the selected answer which is a attribute - * key-value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * This field is deprecated and should not be set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getProductAttributeValues() - { - @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); - return $this->product_attribute_values; - } - - /** - * This field is deprecated and should not be set. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; - * @param array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setProductAttributeValues($var) - { - @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ProductAttributeValue::class); - $this->product_attribute_values = $arr; - - return $this; - } - - /** - * This field specifies the selected answer which is a attribute - * key-value. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; - * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null - */ - public function getProductAttributeValue() - { - return $this->product_attribute_value; - } - - public function hasProductAttributeValue() - { - return isset($this->product_attribute_value); - } - - public function clearProductAttributeValue() - { - unset($this->product_attribute_value); - } - - /** - * This field specifies the selected answer which is a attribute - * key-value. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; - * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var - * @return $this - */ - public function setProductAttributeValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); - $this->product_attribute_value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SelectedAnswer::class, \Google\Cloud\Retail\V2\SearchRequest_ConversationalSearchSpec_UserAnswer_SelectedAnswer::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php deleted file mode 100644 index fbbef52607b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - */ -class DynamicFacetSpec extends \Google\Protobuf\Internal\Message -{ - /** - * Mode of the DynamicFacet feature. - * Defaults to - * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] - * if it's unset. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Mode of the DynamicFacet feature. - * Defaults to - * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] - * if it's unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Mode of the DynamicFacet feature. - * Defaults to - * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] - * if it's unset. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Mode of the DynamicFacet feature. - * Defaults to - * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] - * if it's unset. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec\Mode::class); - $this->mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DynamicFacetSpec::class, \Google\Cloud\Retail\V2\SearchRequest_DynamicFacetSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php deleted file mode 100644 index c96db6f622c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/DynamicFacetSpec/Mode.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode - */ -class Mode -{ - /** - * Default value. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Disable Dynamic Facet. - * - * Generated from protobuf enum DISABLED = 1; - */ - const DISABLED = 1; - /** - * Automatic mode built by Google Retail Search. - * - * Generated from protobuf enum ENABLED = 2; - */ - const ENABLED = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::DISABLED => 'DISABLED', - self::ENABLED => 'ENABLED', - ]; - - 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_DynamicFacetSpec_Mode::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php deleted file mode 100644 index 9a3b56e9a3a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec.php +++ /dev/null @@ -1,362 +0,0 @@ -google.cloud.retail.v2.SearchRequest.FacetSpec - */ -class FacetSpec extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The facet key specification. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $facet_key = null; - /** - * Maximum of facet values that should be returned for this facet. If - * unspecified, defaults to 50. The maximum allowed value is 300. Values - * above 300 will be coerced to 300. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 limit = 2; - */ - protected $limit = 0; - /** - * List of keys to exclude when faceting. - * By default, - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is not excluded from the filter unless it is listed in this field. - * Listing a facet key in this field allows its values to appear as facet - * results, even when they are filtered out of search results. Using this - * field does not affect what search results are returned. - * For example, suppose there are 100 products with the color facet "Red" - * and 200 products with the color facet "Blue". A query containing the - * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * would by default return only "Red" products in the search results, and - * also return "Red" with count 100 as the only color facet. Although there - * are also blue products available, "Blue" would not be shown as an - * available facet value. - * If "colorFamilies" is listed in "excludedFilterKeys", then the query - * returns the facet values "Red" with count 100 and "Blue" with count - * 200, because the "colorFamilies" key is now excluded from the filter. - * Because this field doesn't affect search results, the search results - * are still correctly filtered to return only "Red" products. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated string excluded_filter_keys = 3; - */ - private $excluded_filter_keys; - /** - * Enables dynamic position for this facet. If set to true, the position of - * this facet among all facets in the response is determined by Google - * Retail Search. It is ordered together with dynamic facets if dynamic - * facets is enabled. If set to false, the position of this facet in the - * response is the same as in the request, and it is ranked before - * the facets with dynamic position enable and all dynamic facets. - * For example, you may always want to have rating facet returned in - * the response, but it's not necessarily to always display the rating facet - * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response is determined by - * Google Retail Search. - * Another example, assuming you have the following facets in the request: - * * "rating", enable_dynamic_position = true - * * "price", enable_dynamic_position = false - * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which generates a facet - * "gender". Then, the final order of the facets in the response can be - * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", - * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" are always - * ranked at first and second position because their enable_dynamic_position - * values are false. - * - * Generated from protobuf field bool enable_dynamic_position = 4; - */ - protected $enable_dynamic_position = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey $facet_key - * Required. The facet key specification. - * @type int $limit - * Maximum of facet values that should be returned for this facet. If - * unspecified, defaults to 50. The maximum allowed value is 300. Values - * above 300 will be coerced to 300. - * If this field is negative, an INVALID_ARGUMENT is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $excluded_filter_keys - * List of keys to exclude when faceting. - * By default, - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is not excluded from the filter unless it is listed in this field. - * Listing a facet key in this field allows its values to appear as facet - * results, even when they are filtered out of search results. Using this - * field does not affect what search results are returned. - * For example, suppose there are 100 products with the color facet "Red" - * and 200 products with the color facet "Blue". A query containing the - * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * would by default return only "Red" products in the search results, and - * also return "Red" with count 100 as the only color facet. Although there - * are also blue products available, "Blue" would not be shown as an - * available facet value. - * If "colorFamilies" is listed in "excludedFilterKeys", then the query - * returns the facet values "Red" with count 100 and "Blue" with count - * 200, because the "colorFamilies" key is now excluded from the filter. - * Because this field doesn't affect search results, the search results - * are still correctly filtered to return only "Red" products. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * @type bool $enable_dynamic_position - * Enables dynamic position for this facet. If set to true, the position of - * this facet among all facets in the response is determined by Google - * Retail Search. It is ordered together with dynamic facets if dynamic - * facets is enabled. If set to false, the position of this facet in the - * response is the same as in the request, and it is ranked before - * the facets with dynamic position enable and all dynamic facets. - * For example, you may always want to have rating facet returned in - * the response, but it's not necessarily to always display the rating facet - * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response is determined by - * Google Retail Search. - * Another example, assuming you have the following facets in the request: - * * "rating", enable_dynamic_position = true - * * "price", enable_dynamic_position = false - * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which generates a facet - * "gender". Then, the final order of the facets in the response can be - * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", - * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" are always - * ranked at first and second position because their enable_dynamic_position - * values are false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The facet key specification. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey|null - */ - public function getFacetKey() - { - return $this->facet_key; - } - - public function hasFacetKey() - { - return isset($this->facet_key); - } - - public function clearFacetKey() - { - unset($this->facet_key); - } - - /** - * Required. The facet key specification. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey $var - * @return $this - */ - public function setFacetKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\FacetSpec\FacetKey::class); - $this->facet_key = $var; - - return $this; - } - - /** - * Maximum of facet values that should be returned for this facet. If - * unspecified, defaults to 50. The maximum allowed value is 300. Values - * above 300 will be coerced to 300. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 limit = 2; - * @return int - */ - public function getLimit() - { - return $this->limit; - } - - /** - * Maximum of facet values that should be returned for this facet. If - * unspecified, defaults to 50. The maximum allowed value is 300. Values - * above 300 will be coerced to 300. - * If this field is negative, an INVALID_ARGUMENT is returned. - * - * Generated from protobuf field int32 limit = 2; - * @param int $var - * @return $this - */ - public function setLimit($var) - { - GPBUtil::checkInt32($var); - $this->limit = $var; - - return $this; - } - - /** - * List of keys to exclude when faceting. - * By default, - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is not excluded from the filter unless it is listed in this field. - * Listing a facet key in this field allows its values to appear as facet - * results, even when they are filtered out of search results. Using this - * field does not affect what search results are returned. - * For example, suppose there are 100 products with the color facet "Red" - * and 200 products with the color facet "Blue". A query containing the - * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * would by default return only "Red" products in the search results, and - * also return "Red" with count 100 as the only color facet. Although there - * are also blue products available, "Blue" would not be shown as an - * available facet value. - * If "colorFamilies" is listed in "excludedFilterKeys", then the query - * returns the facet values "Red" with count 100 and "Blue" with count - * 200, because the "colorFamilies" key is now excluded from the filter. - * Because this field doesn't affect search results, the search results - * are still correctly filtered to return only "Red" products. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated string excluded_filter_keys = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExcludedFilterKeys() - { - return $this->excluded_filter_keys; - } - - /** - * List of keys to exclude when faceting. - * By default, - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is not excluded from the filter unless it is listed in this field. - * Listing a facet key in this field allows its values to appear as facet - * results, even when they are filtered out of search results. Using this - * field does not affect what search results are returned. - * For example, suppose there are 100 products with the color facet "Red" - * and 200 products with the color facet "Blue". A query containing the - * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * would by default return only "Red" products in the search results, and - * also return "Red" with count 100 as the only color facet. Although there - * are also blue products available, "Blue" would not be shown as an - * available facet value. - * If "colorFamilies" is listed in "excludedFilterKeys", then the query - * returns the facet values "Red" with count 100 and "Blue" with count - * 200, because the "colorFamilies" key is now excluded from the filter. - * Because this field doesn't affect search results, the search results - * are still correctly filtered to return only "Red" products. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field repeated string excluded_filter_keys = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExcludedFilterKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->excluded_filter_keys = $arr; - - return $this; - } - - /** - * Enables dynamic position for this facet. If set to true, the position of - * this facet among all facets in the response is determined by Google - * Retail Search. It is ordered together with dynamic facets if dynamic - * facets is enabled. If set to false, the position of this facet in the - * response is the same as in the request, and it is ranked before - * the facets with dynamic position enable and all dynamic facets. - * For example, you may always want to have rating facet returned in - * the response, but it's not necessarily to always display the rating facet - * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response is determined by - * Google Retail Search. - * Another example, assuming you have the following facets in the request: - * * "rating", enable_dynamic_position = true - * * "price", enable_dynamic_position = false - * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which generates a facet - * "gender". Then, the final order of the facets in the response can be - * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", - * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" are always - * ranked at first and second position because their enable_dynamic_position - * values are false. - * - * Generated from protobuf field bool enable_dynamic_position = 4; - * @return bool - */ - public function getEnableDynamicPosition() - { - return $this->enable_dynamic_position; - } - - /** - * Enables dynamic position for this facet. If set to true, the position of - * this facet among all facets in the response is determined by Google - * Retail Search. It is ordered together with dynamic facets if dynamic - * facets is enabled. If set to false, the position of this facet in the - * response is the same as in the request, and it is ranked before - * the facets with dynamic position enable and all dynamic facets. - * For example, you may always want to have rating facet returned in - * the response, but it's not necessarily to always display the rating facet - * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response is determined by - * Google Retail Search. - * Another example, assuming you have the following facets in the request: - * * "rating", enable_dynamic_position = true - * * "price", enable_dynamic_position = false - * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which generates a facet - * "gender". Then, the final order of the facets in the response can be - * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", - * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" are always - * ranked at first and second position because their enable_dynamic_position - * values are false. - * - * Generated from protobuf field bool enable_dynamic_position = 4; - * @param bool $var - * @return $this - */ - public function setEnableDynamicPosition($var) - { - GPBUtil::checkBool($var); - $this->enable_dynamic_position = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FacetSpec::class, \Google\Cloud\Retail\V2\SearchRequest_FacetSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php deleted file mode 100644 index cd776ccb742..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/FacetSpec/FacetKey.php +++ /dev/null @@ -1,770 +0,0 @@ -google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - */ -class FacetKey extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Supported textual and numerical facet keys in - * [Product][google.cloud.retail.v2.Product] object, over which the facet - * values are computed. Facet key is case-sensitive. - * Allowed facet keys when - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is not specified: - * * textual_field = - * * "brands" - * * "categories" - * * "genders" - * * "ageGroups" - * * "availability" - * * "colorFamilies" - * * "colors" - * * "sizes" - * * "materials" - * * "patterns" - * * "conditions" - * * "attributes.key" - * * "pickupInStore" - * * "shipToStore" - * * "sameDayDelivery" - * * "nextDayDelivery" - * * "customFulfillment1" - * * "customFulfillment2" - * * "customFulfillment3" - * * "customFulfillment4" - * * "customFulfillment5" - * * "inventory(place_id,attributes.key)" - * * numerical_field = - * * "price" - * * "discount" - * * "rating" - * * "ratingCount" - * * "attributes.key" - * * "inventory(place_id,price)" - * * "inventory(place_id,original_price)" - * * "inventory(place_id,attributes.key)" - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key = ''; - /** - * Set only if values should be bucketized into intervals. Must be set - * for facets with numerical values. Must not be set for facet with text - * values. Maximum number of intervals is 40. - * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are - * computed from their distribution weekly. If the model assigns a high - * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles become the bounds - * for its intervals and are returned in the response. If the - * facet key intervals are specified in the request, then the specified - * intervals are returned instead. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; - */ - private $intervals; - /** - * Only get facet for the given restricted values. For example, when using - * "pickupInStore" as key and set restricted values to - * ["store123", "store456"], only facets for "store123" and "store456" are - * returned. Only supported on predefined textual fields, custom textual - * attributes and fulfillments. Maximum is 20. - * Must be set for the fulfillment facet keys: - * * pickupInStore - * * shipToStore - * * sameDayDelivery - * * nextDayDelivery - * * customFulfillment1 - * * customFulfillment2 - * * customFulfillment3 - * * customFulfillment4 - * * customFulfillment5 - * - * Generated from protobuf field repeated string restricted_values = 3; - */ - private $restricted_values; - /** - * Only get facet values that start with the given string prefix. For - * example, suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet gives only "Women > Shoe" and "Women > Dress". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string prefixes = 8; - */ - private $prefixes; - /** - * Only get facet values that contains the given strings. For example, - * suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet gives only "Women > Shoe" and "Men > Shoe". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string contains = 9; - */ - private $contains; - /** - * True to make facet keys case insensitive when getting faceting - * values with prefixes or contains; false otherwise. - * - * Generated from protobuf field bool case_insensitive = 10; - */ - protected $case_insensitive = false; - /** - * The order in which - * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] - * are returned. - * Allowed values are: - * * "count desc", which means order by - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * descending. - * * "value desc", which means order by - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * descending. - * Only applies to textual facets. - * If not set, textual values are sorted in [natural - * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical - * intervals are sorted in the order given by - * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * are sorted in the order given by - * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. - * - * Generated from protobuf field string order_by = 4; - */ - protected $order_by = ''; - /** - * The query that is used to compute facet for the given facet key. - * When provided, it overrides the default behavior of facet - * computation. The query syntax is the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. Notice that there is no limitation on - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * when query is specified. - * In the response, - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * is always "1" and - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * is the number of results that match the query. - * For example, you can set a customized facet for "shipToStore", - * where - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is "customizedShipToStore", and - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet counts the products that are both in stock and ship - * to store "123". - * - * Generated from protobuf field string query = 5; - */ - protected $query = ''; - /** - * Returns the min and max value for each numerical facet intervals. - * Ignored for textual facets. - * - * Generated from protobuf field bool return_min_max = 11; - */ - protected $return_min_max = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. Supported textual and numerical facet keys in - * [Product][google.cloud.retail.v2.Product] object, over which the facet - * values are computed. Facet key is case-sensitive. - * Allowed facet keys when - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is not specified: - * * textual_field = - * * "brands" - * * "categories" - * * "genders" - * * "ageGroups" - * * "availability" - * * "colorFamilies" - * * "colors" - * * "sizes" - * * "materials" - * * "patterns" - * * "conditions" - * * "attributes.key" - * * "pickupInStore" - * * "shipToStore" - * * "sameDayDelivery" - * * "nextDayDelivery" - * * "customFulfillment1" - * * "customFulfillment2" - * * "customFulfillment3" - * * "customFulfillment4" - * * "customFulfillment5" - * * "inventory(place_id,attributes.key)" - * * numerical_field = - * * "price" - * * "discount" - * * "rating" - * * "ratingCount" - * * "attributes.key" - * * "inventory(place_id,price)" - * * "inventory(place_id,original_price)" - * * "inventory(place_id,attributes.key)" - * @type array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $intervals - * Set only if values should be bucketized into intervals. Must be set - * for facets with numerical values. Must not be set for facet with text - * values. Maximum number of intervals is 40. - * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are - * computed from their distribution weekly. If the model assigns a high - * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles become the bounds - * for its intervals and are returned in the response. If the - * facet key intervals are specified in the request, then the specified - * intervals are returned instead. - * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_values - * Only get facet for the given restricted values. For example, when using - * "pickupInStore" as key and set restricted values to - * ["store123", "store456"], only facets for "store123" and "store456" are - * returned. Only supported on predefined textual fields, custom textual - * attributes and fulfillments. Maximum is 20. - * Must be set for the fulfillment facet keys: - * * pickupInStore - * * shipToStore - * * sameDayDelivery - * * nextDayDelivery - * * customFulfillment1 - * * customFulfillment2 - * * customFulfillment3 - * * customFulfillment4 - * * customFulfillment5 - * @type array|\Google\Protobuf\Internal\RepeatedField $prefixes - * Only get facet values that start with the given string prefix. For - * example, suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet gives only "Women > Shoe" and "Women > Dress". - * Only supported on textual fields. Maximum is 10. - * @type array|\Google\Protobuf\Internal\RepeatedField $contains - * Only get facet values that contains the given strings. For example, - * suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet gives only "Women > Shoe" and "Men > Shoe". - * Only supported on textual fields. Maximum is 10. - * @type bool $case_insensitive - * True to make facet keys case insensitive when getting faceting - * values with prefixes or contains; false otherwise. - * @type string $order_by - * The order in which - * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] - * are returned. - * Allowed values are: - * * "count desc", which means order by - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * descending. - * * "value desc", which means order by - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * descending. - * Only applies to textual facets. - * If not set, textual values are sorted in [natural - * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical - * intervals are sorted in the order given by - * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * are sorted in the order given by - * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. - * @type string $query - * The query that is used to compute facet for the given facet key. - * When provided, it overrides the default behavior of facet - * computation. The query syntax is the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. Notice that there is no limitation on - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * when query is specified. - * In the response, - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * is always "1" and - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * is the number of results that match the query. - * For example, you can set a customized facet for "shipToStore", - * where - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is "customizedShipToStore", and - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet counts the products that are both in stock and ship - * to store "123". - * @type bool $return_min_max - * Returns the min and max value for each numerical facet intervals. - * Ignored for textual facets. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Supported textual and numerical facet keys in - * [Product][google.cloud.retail.v2.Product] object, over which the facet - * values are computed. Facet key is case-sensitive. - * Allowed facet keys when - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is not specified: - * * textual_field = - * * "brands" - * * "categories" - * * "genders" - * * "ageGroups" - * * "availability" - * * "colorFamilies" - * * "colors" - * * "sizes" - * * "materials" - * * "patterns" - * * "conditions" - * * "attributes.key" - * * "pickupInStore" - * * "shipToStore" - * * "sameDayDelivery" - * * "nextDayDelivery" - * * "customFulfillment1" - * * "customFulfillment2" - * * "customFulfillment3" - * * "customFulfillment4" - * * "customFulfillment5" - * * "inventory(place_id,attributes.key)" - * * numerical_field = - * * "price" - * * "discount" - * * "rating" - * * "ratingCount" - * * "attributes.key" - * * "inventory(place_id,price)" - * * "inventory(place_id,original_price)" - * * "inventory(place_id,attributes.key)" - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. Supported textual and numerical facet keys in - * [Product][google.cloud.retail.v2.Product] object, over which the facet - * values are computed. Facet key is case-sensitive. - * Allowed facet keys when - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is not specified: - * * textual_field = - * * "brands" - * * "categories" - * * "genders" - * * "ageGroups" - * * "availability" - * * "colorFamilies" - * * "colors" - * * "sizes" - * * "materials" - * * "patterns" - * * "conditions" - * * "attributes.key" - * * "pickupInStore" - * * "shipToStore" - * * "sameDayDelivery" - * * "nextDayDelivery" - * * "customFulfillment1" - * * "customFulfillment2" - * * "customFulfillment3" - * * "customFulfillment4" - * * "customFulfillment5" - * * "inventory(place_id,attributes.key)" - * * numerical_field = - * * "price" - * * "discount" - * * "rating" - * * "ratingCount" - * * "attributes.key" - * * "inventory(place_id,price)" - * * "inventory(place_id,original_price)" - * * "inventory(place_id,attributes.key)" - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Set only if values should be bucketized into intervals. Must be set - * for facets with numerical values. Must not be set for facet with text - * values. Maximum number of intervals is 40. - * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are - * computed from their distribution weekly. If the model assigns a high - * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles become the bounds - * for its intervals and are returned in the response. If the - * facet key intervals are specified in the request, then the specified - * intervals are returned instead. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIntervals() - { - return $this->intervals; - } - - /** - * Set only if values should be bucketized into intervals. Must be set - * for facets with numerical values. Must not be set for facet with text - * values. Maximum number of intervals is 40. - * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are - * computed from their distribution weekly. If the model assigns a high - * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles become the bounds - * for its intervals and are returned in the response. If the - * facet key intervals are specified in the request, then the specified - * intervals are returned instead. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; - * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIntervals($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Interval::class); - $this->intervals = $arr; - - return $this; - } - - /** - * Only get facet for the given restricted values. For example, when using - * "pickupInStore" as key and set restricted values to - * ["store123", "store456"], only facets for "store123" and "store456" are - * returned. Only supported on predefined textual fields, custom textual - * attributes and fulfillments. Maximum is 20. - * Must be set for the fulfillment facet keys: - * * pickupInStore - * * shipToStore - * * sameDayDelivery - * * nextDayDelivery - * * customFulfillment1 - * * customFulfillment2 - * * customFulfillment3 - * * customFulfillment4 - * * customFulfillment5 - * - * Generated from protobuf field repeated string restricted_values = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestrictedValues() - { - return $this->restricted_values; - } - - /** - * Only get facet for the given restricted values. For example, when using - * "pickupInStore" as key and set restricted values to - * ["store123", "store456"], only facets for "store123" and "store456" are - * returned. Only supported on predefined textual fields, custom textual - * attributes and fulfillments. Maximum is 20. - * Must be set for the fulfillment facet keys: - * * pickupInStore - * * shipToStore - * * sameDayDelivery - * * nextDayDelivery - * * customFulfillment1 - * * customFulfillment2 - * * customFulfillment3 - * * customFulfillment4 - * * customFulfillment5 - * - * Generated from protobuf field repeated string restricted_values = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestrictedValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restricted_values = $arr; - - return $this; - } - - /** - * Only get facet values that start with the given string prefix. For - * example, suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet gives only "Women > Shoe" and "Women > Dress". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string prefixes = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPrefixes() - { - return $this->prefixes; - } - - /** - * Only get facet values that start with the given string prefix. For - * example, suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet gives only "Women > Shoe" and "Women > Dress". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string prefixes = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPrefixes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->prefixes = $arr; - - return $this; - } - - /** - * Only get facet values that contains the given strings. For example, - * suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet gives only "Women > Shoe" and "Men > Shoe". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string contains = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContains() - { - return $this->contains; - } - - /** - * Only get facet values that contains the given strings. For example, - * suppose "categories" has three values "Women > Shoe", - * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet gives only "Women > Shoe" and "Men > Shoe". - * Only supported on textual fields. Maximum is 10. - * - * Generated from protobuf field repeated string contains = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContains($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->contains = $arr; - - return $this; - } - - /** - * True to make facet keys case insensitive when getting faceting - * values with prefixes or contains; false otherwise. - * - * Generated from protobuf field bool case_insensitive = 10; - * @return bool - */ - public function getCaseInsensitive() - { - return $this->case_insensitive; - } - - /** - * True to make facet keys case insensitive when getting faceting - * values with prefixes or contains; false otherwise. - * - * Generated from protobuf field bool case_insensitive = 10; - * @param bool $var - * @return $this - */ - public function setCaseInsensitive($var) - { - GPBUtil::checkBool($var); - $this->case_insensitive = $var; - - return $this; - } - - /** - * The order in which - * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] - * are returned. - * Allowed values are: - * * "count desc", which means order by - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * descending. - * * "value desc", which means order by - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * descending. - * Only applies to textual facets. - * If not set, textual values are sorted in [natural - * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical - * intervals are sorted in the order given by - * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * are sorted in the order given by - * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. - * - * Generated from protobuf field string order_by = 4; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The order in which - * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values] - * are returned. - * Allowed values are: - * * "count desc", which means order by - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * descending. - * * "value desc", which means order by - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * descending. - * Only applies to textual facets. - * If not set, textual values are sorted in [natural - * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical - * intervals are sorted in the order given by - * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; - * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * are sorted in the order given by - * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. - * - * Generated from protobuf field string order_by = 4; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - - /** - * The query that is used to compute facet for the given facet key. - * When provided, it overrides the default behavior of facet - * computation. The query syntax is the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. Notice that there is no limitation on - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * when query is specified. - * In the response, - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * is always "1" and - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * is the number of results that match the query. - * For example, you can set a customized facet for "shipToStore", - * where - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is "customizedShipToStore", and - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet counts the products that are both in stock and ship - * to store "123". - * - * Generated from protobuf field string query = 5; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * The query that is used to compute facet for the given facet key. - * When provided, it overrides the default behavior of facet - * computation. The query syntax is the same as a filter expression. See - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * detail syntax and limitations. Notice that there is no limitation on - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * when query is specified. - * In the response, - * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * is always "1" and - * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * is the number of results that match the query. - * For example, you can set a customized facet for "shipToStore", - * where - * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] - * is "customizedShipToStore", and - * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] - * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet counts the products that are both in stock and ship - * to store "123". - * - * Generated from protobuf field string query = 5; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Returns the min and max value for each numerical facet intervals. - * Ignored for textual facets. - * - * Generated from protobuf field bool return_min_max = 11; - * @return bool - */ - public function getReturnMinMax() - { - return $this->return_min_max; - } - - /** - * Returns the min and max value for each numerical facet intervals. - * Ignored for textual facets. - * - * Generated from protobuf field bool return_min_max = 11; - * @param bool $var - * @return $this - */ - public function setReturnMinMax($var) - { - GPBUtil::checkBool($var); - $this->return_min_max = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FacetKey::class, \Google\Cloud\Retail\V2\SearchRequest_FacetSpec_FacetKey::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php deleted file mode 100644 index 1d2699d2148..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.retail.v2.SearchRequest.PersonalizationSpec - */ -class PersonalizationSpec extends \Google\Protobuf\Internal\Message -{ - /** - * Defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec\Mode::class); - $this->mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PersonalizationSpec::class, \Google\Cloud\Retail\V2\SearchRequest_PersonalizationSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php deleted file mode 100644 index 7b794c8e00c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/PersonalizationSpec/Mode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode - */ -class Mode -{ - /** - * Default value. In this case, server behavior defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Let CRS decide whether to use personalization based on quality of user - * event data. - * - * Generated from protobuf enum AUTO = 1; - */ - const AUTO = 1; - /** - * Disable personalization. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::AUTO => 'AUTO', - self::DISABLED => 'DISABLED', - ]; - - 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_PersonalizationSpec_Mode::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php deleted file mode 100644 index 27eeb0c4593..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - */ -class QueryExpansionSpec extends \Google\Protobuf\Internal\Message -{ - /** - * The condition under which query expansion should occur. Default to - * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; - */ - protected $condition = 0; - /** - * Whether to pin unexpanded results. If this field is set to true, - * unexpanded products are always at the top of the search results, followed - * by the expanded results. - * - * Generated from protobuf field bool pin_unexpanded_results = 2; - */ - protected $pin_unexpanded_results = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $condition - * The condition under which query expansion should occur. Default to - * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. - * @type bool $pin_unexpanded_results - * Whether to pin unexpanded results. If this field is set to true, - * unexpanded products are always at the top of the search results, followed - * by the expanded results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The condition under which query expansion should occur. Default to - * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * @return int - */ - public function getCondition() - { - return $this->condition; - } - - /** - * The condition under which query expansion should occur. Default to - * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * @param int $var - * @return $this - */ - public function setCondition($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec\Condition::class); - $this->condition = $var; - - return $this; - } - - /** - * Whether to pin unexpanded results. If this field is set to true, - * unexpanded products are always at the top of the search results, followed - * by the expanded results. - * - * Generated from protobuf field bool pin_unexpanded_results = 2; - * @return bool - */ - public function getPinUnexpandedResults() - { - return $this->pin_unexpanded_results; - } - - /** - * Whether to pin unexpanded results. If this field is set to true, - * unexpanded products are always at the top of the search results, followed - * by the expanded results. - * - * Generated from protobuf field bool pin_unexpanded_results = 2; - * @param bool $var - * @return $this - */ - public function setPinUnexpandedResults($var) - { - GPBUtil::checkBool($var); - $this->pin_unexpanded_results = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryExpansionSpec::class, \Google\Cloud\Retail\V2\SearchRequest_QueryExpansionSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php deleted file mode 100644 index ae6898a2bcd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/QueryExpansionSpec/Condition.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition - */ -class Condition -{ - /** - * Unspecified query expansion condition. In this case, server behavior - * defaults to - * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. - * - * Generated from protobuf enum CONDITION_UNSPECIFIED = 0; - */ - const CONDITION_UNSPECIFIED = 0; - /** - * Disabled query expansion. Only the exact search query is used, even if - * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size] - * is zero. - * - * Generated from protobuf enum DISABLED = 1; - */ - const DISABLED = 1; - /** - * Automatic query expansion built by Google Retail Search. - * - * Generated from protobuf enum AUTO = 3; - */ - const AUTO = 3; - - private static $valueToName = [ - self::CONDITION_UNSPECIFIED => 'CONDITION_UNSPECIFIED', - self::DISABLED => 'DISABLED', - self::AUTO => 'AUTO', - ]; - - 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(Condition::class, \Google\Cloud\Retail\V2\SearchRequest_QueryExpansionSpec_Condition::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php deleted file mode 100644 index 57c56dd2e48..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SearchMode.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.retail.v2.SearchRequest.SearchMode - */ -class SearchMode -{ - /** - * Default value. In this case both product search and faceted search will - * be performed. Both - * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] - * and [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] - * will be returned. - * - * Generated from protobuf enum SEARCH_MODE_UNSPECIFIED = 0; - */ - const SEARCH_MODE_UNSPECIFIED = 0; - /** - * Only product search will be performed. The faceted search will be - * disabled. - * Only - * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] - * will be returned. - * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will - * not be returned, even if - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * or - * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec] - * is set. - * - * Generated from protobuf enum PRODUCT_SEARCH_ONLY = 1; - */ - const PRODUCT_SEARCH_ONLY = 1; - /** - * Only faceted search will be performed. The product search will be - * disabled. - * When in this mode, one or both of - * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs] - * and - * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec] - * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will - * be returned. - * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult] - * will not be returned. - * - * Generated from protobuf enum FACETED_SEARCH_ONLY = 2; - */ - const FACETED_SEARCH_ONLY = 2; - - private static $valueToName = [ - self::SEARCH_MODE_UNSPECIFIED => 'SEARCH_MODE_UNSPECIFIED', - self::PRODUCT_SEARCH_ONLY => 'PRODUCT_SEARCH_ONLY', - self::FACETED_SEARCH_ONLY => 'FACETED_SEARCH_ONLY', - ]; - - 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(SearchMode::class, \Google\Cloud\Retail\V2\SearchRequest_SearchMode::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php deleted file mode 100644 index 088213a9edf..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec - */ -class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message -{ - /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * The mode under which spell correction should take effect to - * replace the original search query. Default to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec\Mode::class); - $this->mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SpellCorrectionSpec::class, \Google\Cloud\Retail\V2\SearchRequest_SpellCorrectionSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php deleted file mode 100644 index 901386a58db..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/SpellCorrectionSpec/Mode.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode - */ -class Mode -{ - /** - * Unspecified spell correction mode. In this case, server behavior - * defaults to - * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Google Retail Search will try to find a spell suggestion if there - * is any and put in the - * [SearchResponse.corrected_query][google.cloud.retail.v2.SearchResponse.corrected_query]. - * The spell suggestion will not be used as the search query. - * - * Generated from protobuf enum SUGGESTION_ONLY = 1; - */ - const SUGGESTION_ONLY = 1; - /** - * Automatic spell correction built by Google Retail Search. Search will - * be based on the corrected query if found. - * - * Generated from protobuf enum AUTO = 2; - */ - const AUTO = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::SUGGESTION_ONLY => 'SUGGESTION_ONLY', - self::AUTO => 'AUTO', - ]; - - 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(Mode::class, \Google\Cloud\Retail\V2\SearchRequest_SpellCorrectionSpec_Mode::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php deleted file mode 100644 index 5609a305800..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchRequest/TileNavigationSpec.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.retail.v2.SearchRequest.TileNavigationSpec - */ -class TileNavigationSpec extends \Google\Protobuf\Internal\Message -{ - /** - * This field specifies whether the customer would like to request tile - * navigation. - * - * Generated from protobuf field bool tile_navigation_requested = 1; - */ - protected $tile_navigation_requested = false; - /** - * This field specifies the tiles which are already clicked in client side. - * NOTE: This field is not being used for filtering search products. Client - * side should also put all the applied tiles in - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; - */ - private $applied_tiles; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $tile_navigation_requested - * This field specifies whether the customer would like to request tile - * navigation. - * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $applied_tiles - * This field specifies the tiles which are already clicked in client side. - * NOTE: This field is not being used for filtering search products. Client - * side should also put all the applied tiles in - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * This field specifies whether the customer would like to request tile - * navigation. - * - * Generated from protobuf field bool tile_navigation_requested = 1; - * @return bool - */ - public function getTileNavigationRequested() - { - return $this->tile_navigation_requested; - } - - /** - * This field specifies whether the customer would like to request tile - * navigation. - * - * Generated from protobuf field bool tile_navigation_requested = 1; - * @param bool $var - * @return $this - */ - public function setTileNavigationRequested($var) - { - GPBUtil::checkBool($var); - $this->tile_navigation_requested = $var; - - return $this; - } - - /** - * This field specifies the tiles which are already clicked in client side. - * NOTE: This field is not being used for filtering search products. Client - * side should also put all the applied tiles in - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAppliedTiles() - { - return $this->applied_tiles; - } - - /** - * This field specifies the tiles which are already clicked in client side. - * NOTE: This field is not being used for filtering search products. Client - * side should also put all the applied tiles in - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; - * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAppliedTiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); - $this->applied_tiles = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TileNavigationSpec::class, \Google\Cloud\Retail\V2\SearchRequest_TileNavigationSpec::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php deleted file mode 100644 index f8508be2ccc..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse.php +++ /dev/null @@ -1,590 +0,0 @@ -google.cloud.retail.v2.SearchResponse - */ -class SearchResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of matched items. The order represents the ranking. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; - */ - private $results; - /** - * Results of facets requested by user. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; - */ - private $facets; - /** - * The estimated total count of matched items irrespective of pagination. The - * count of [results][google.cloud.retail.v2.SearchResponse.results] returned - * by pagination may be less than the - * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that - * matches. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - /** - * Contains the spell corrected query, if found. If the spell correction type - * is AUTOMATIC, then the search results are based on corrected_query. - * Otherwise the original query is used for search. - * - * Generated from protobuf field string corrected_query = 4; - */ - protected $corrected_query = ''; - /** - * A unique search token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * search, which enables accurate attribution of search model performance. - * - * Generated from protobuf field string attribution_token = 5; - */ - protected $attribution_token = ''; - /** - * A token that can be sent as - * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * Generated from protobuf field string next_page_token = 6; - */ - protected $next_page_token = ''; - /** - * Query expansion information for the returned results. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; - */ - protected $query_expansion_info = null; - /** - * The URI of a customer-defined redirect page. If redirect action is - * triggered, no search is performed, and only - * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and - * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * are set in the response. - * - * Generated from protobuf field string redirect_uri = 10; - */ - protected $redirect_uri = ''; - /** - * The fully qualified resource name of applied - * [controls](https://cloud.google.com/retail/docs/serving-control-rules). - * - * Generated from protobuf field repeated string applied_controls = 12; - */ - private $applied_controls; - /** - * The invalid - * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * that are not applied during serving. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; - */ - private $invalid_condition_boost_specs; - /** - * Metadata related to A/B testing [Experiment][] associated with this - * response. Only exists when an experiment is triggered. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; - */ - private $experiment_info; - /** - * This field specifies all related information that is needed on client - * side for UI rendering of conversational retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; - */ - protected $conversational_search_result = null; - /** - * This field specifies all related information for tile navigation that will - * be used in client side. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; - */ - protected $tile_navigation_result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\SearchResponse\SearchResult>|\Google\Protobuf\Internal\RepeatedField $results - * A list of matched items. The order represents the ranking. - * @type array<\Google\Cloud\Retail\V2\SearchResponse\Facet>|\Google\Protobuf\Internal\RepeatedField $facets - * Results of facets requested by user. - * @type int $total_size - * The estimated total count of matched items irrespective of pagination. The - * count of [results][google.cloud.retail.v2.SearchResponse.results] returned - * by pagination may be less than the - * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that - * matches. - * @type string $corrected_query - * Contains the spell corrected query, if found. If the spell correction type - * is AUTOMATIC, then the search results are based on corrected_query. - * Otherwise the original query is used for search. - * @type string $attribution_token - * A unique search token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * search, which enables accurate attribution of search model performance. - * @type string $next_page_token - * A token that can be sent as - * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * @type \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo $query_expansion_info - * Query expansion information for the returned results. - * @type string $redirect_uri - * The URI of a customer-defined redirect page. If redirect action is - * triggered, no search is performed, and only - * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and - * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * are set in the response. - * @type array|\Google\Protobuf\Internal\RepeatedField $applied_controls - * The fully qualified resource name of applied - * [controls](https://cloud.google.com/retail/docs/serving-control-rules). - * @type array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $invalid_condition_boost_specs - * The invalid - * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * that are not applied during serving. - * @type array<\Google\Cloud\Retail\V2\ExperimentInfo>|\Google\Protobuf\Internal\RepeatedField $experiment_info - * Metadata related to A/B testing [Experiment][] associated with this - * response. Only exists when an experiment is triggered. - * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $conversational_search_result - * This field specifies all related information that is needed on client - * side for UI rendering of conversational retail search. - * @type \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $tile_navigation_result - * This field specifies all related information for tile navigation that will - * be used in client side. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * A list of matched items. The order represents the ranking. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResults() - { - return $this->results; - } - - /** - * A list of matched items. The order represents the ranking. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; - * @param array<\Google\Cloud\Retail\V2\SearchResponse\SearchResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\SearchResult::class); - $this->results = $arr; - - return $this; - } - - /** - * Results of facets requested by user. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacets() - { - return $this->facets; - } - - /** - * Results of facets requested by user. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; - * @param array<\Google\Cloud\Retail\V2\SearchResponse\Facet>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\Facet::class); - $this->facets = $arr; - - return $this; - } - - /** - * The estimated total count of matched items irrespective of pagination. The - * count of [results][google.cloud.retail.v2.SearchResponse.results] returned - * by pagination may be less than the - * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that - * matches. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The estimated total count of matched items irrespective of pagination. The - * count of [results][google.cloud.retail.v2.SearchResponse.results] returned - * by pagination may be less than the - * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that - * matches. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - - /** - * Contains the spell corrected query, if found. If the spell correction type - * is AUTOMATIC, then the search results are based on corrected_query. - * Otherwise the original query is used for search. - * - * Generated from protobuf field string corrected_query = 4; - * @return string - */ - public function getCorrectedQuery() - { - return $this->corrected_query; - } - - /** - * Contains the spell corrected query, if found. If the spell correction type - * is AUTOMATIC, then the search results are based on corrected_query. - * Otherwise the original query is used for search. - * - * Generated from protobuf field string corrected_query = 4; - * @param string $var - * @return $this - */ - public function setCorrectedQuery($var) - { - GPBUtil::checkString($var, True); - $this->corrected_query = $var; - - return $this; - } - - /** - * A unique search token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * search, which enables accurate attribution of search model performance. - * - * Generated from protobuf field string attribution_token = 5; - * @return string - */ - public function getAttributionToken() - { - return $this->attribution_token; - } - - /** - * A unique search token. This should be included in the - * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this - * search, which enables accurate attribution of search model performance. - * - * Generated from protobuf field string attribution_token = 5; - * @param string $var - * @return $this - */ - public function setAttributionToken($var) - { - GPBUtil::checkString($var, True); - $this->attribution_token = $var; - - return $this; - } - - /** - * A token that can be sent as - * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * Generated from protobuf field string next_page_token = 6; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as - * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] - * to retrieve the next page. If this field is omitted, there are no - * subsequent pages. - * - * 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; - } - - /** - * Query expansion information for the returned results. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; - * @return \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo|null - */ - public function getQueryExpansionInfo() - { - return $this->query_expansion_info; - } - - public function hasQueryExpansionInfo() - { - return isset($this->query_expansion_info); - } - - public function clearQueryExpansionInfo() - { - unset($this->query_expansion_info); - } - - /** - * Query expansion information for the returned results. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; - * @param \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo $var - * @return $this - */ - public function setQueryExpansionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo::class); - $this->query_expansion_info = $var; - - return $this; - } - - /** - * The URI of a customer-defined redirect page. If redirect action is - * triggered, no search is performed, and only - * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and - * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * are set in the response. - * - * Generated from protobuf field string redirect_uri = 10; - * @return string - */ - public function getRedirectUri() - { - return $this->redirect_uri; - } - - /** - * The URI of a customer-defined redirect page. If redirect action is - * triggered, no search is performed, and only - * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and - * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * are set in the response. - * - * Generated from protobuf field string redirect_uri = 10; - * @param string $var - * @return $this - */ - public function setRedirectUri($var) - { - GPBUtil::checkString($var, True); - $this->redirect_uri = $var; - - return $this; - } - - /** - * The fully qualified resource name of applied - * [controls](https://cloud.google.com/retail/docs/serving-control-rules). - * - * Generated from protobuf field repeated string applied_controls = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAppliedControls() - { - return $this->applied_controls; - } - - /** - * The fully qualified resource name of applied - * [controls](https://cloud.google.com/retail/docs/serving-control-rules). - * - * Generated from protobuf field repeated string applied_controls = 12; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAppliedControls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->applied_controls = $arr; - - return $this; - } - - /** - * The invalid - * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * that are not applied during serving. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInvalidConditionBoostSpecs() - { - return $this->invalid_condition_boost_specs; - } - - /** - * The invalid - * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] - * that are not applied during serving. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; - * @param array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInvalidConditionBoostSpecs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec::class); - $this->invalid_condition_boost_specs = $arr; - - return $this; - } - - /** - * Metadata related to A/B testing [Experiment][] associated with this - * response. Only exists when an experiment is triggered. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExperimentInfo() - { - return $this->experiment_info; - } - - /** - * Metadata related to A/B testing [Experiment][] associated with this - * response. Only exists when an experiment is triggered. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; - * @param array<\Google\Cloud\Retail\V2\ExperimentInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExperimentInfo($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ExperimentInfo::class); - $this->experiment_info = $arr; - - return $this; - } - - /** - * This field specifies all related information that is needed on client - * side for UI rendering of conversational retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; - * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult|null - */ - public function getConversationalSearchResult() - { - return $this->conversational_search_result; - } - - public function hasConversationalSearchResult() - { - return isset($this->conversational_search_result); - } - - public function clearConversationalSearchResult() - { - unset($this->conversational_search_result); - } - - /** - * This field specifies all related information that is needed on client - * side for UI rendering of conversational retail search. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; - * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $var - * @return $this - */ - public function setConversationalSearchResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult::class); - $this->conversational_search_result = $var; - - return $this; - } - - /** - * This field specifies all related information for tile navigation that will - * be used in client side. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; - * @return \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult|null - */ - public function getTileNavigationResult() - { - return $this->tile_navigation_result; - } - - public function hasTileNavigationResult() - { - return isset($this->tile_navigation_result); - } - - public function clearTileNavigationResult() - { - unset($this->tile_navigation_result); - } - - /** - * This field specifies all related information for tile navigation that will - * be used in client side. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; - * @param \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $var - * @return $this - */ - public function setTileNavigationResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult::class); - $this->tile_navigation_result = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php deleted file mode 100644 index 1b759d0c5b1..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult.php +++ /dev/null @@ -1,324 +0,0 @@ -google.cloud.retail.v2.SearchResponse.ConversationalSearchResult - */ -class ConversationalSearchResult extends \Google\Protobuf\Internal\Message -{ - /** - * Conversation UUID. This field will be stored in client side storage to - * maintain the conversation session with server and will be used for next - * search request's - * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] - * to restore conversation state in server. - * - * Generated from protobuf field string conversation_id = 1; - */ - protected $conversation_id = ''; - /** - * The current refined query for the conversational search. This field - * will be used in customer UI that the query in the search bar should be - * replaced with the refined query. For example, if - * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is - * `dress` and next - * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] - * is `red color`, which does not match any product attribute value filters, - * the refined query will be `dress, red color`. - * - * Generated from protobuf field string refined_query = 2; - */ - protected $refined_query = ''; - /** - * This field is deprecated but will be kept for backward compatibility. - * There is expected to have only one additional filter and the value will - * be the same to the same as field `additional_filter`. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; - * @deprecated - */ - private $additional_filters; - /** - * The follow-up question. e.g., `What is the color?` - * - * Generated from protobuf field string followup_question = 4; - */ - protected $followup_question = ''; - /** - * The answer options provided to client for the follow-up question. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; - */ - private $suggested_answers; - /** - * This is the incremental additional filters implied from the current - * user answer. User should add the suggested addition filters to the - * previous - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and - * use the merged filter in the follow up search request. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; - */ - protected $additional_filter = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $conversation_id - * Conversation UUID. This field will be stored in client side storage to - * maintain the conversation session with server and will be used for next - * search request's - * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] - * to restore conversation state in server. - * @type string $refined_query - * The current refined query for the conversational search. This field - * will be used in customer UI that the query in the search bar should be - * replaced with the refined query. For example, if - * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is - * `dress` and next - * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] - * is `red color`, which does not match any product attribute value filters, - * the refined query will be `dress, red color`. - * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $additional_filters - * This field is deprecated but will be kept for backward compatibility. - * There is expected to have only one additional filter and the value will - * be the same to the same as field `additional_filter`. - * @type string $followup_question - * The follow-up question. e.g., `What is the color?` - * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $suggested_answers - * The answer options provided to client for the follow-up question. - * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $additional_filter - * This is the incremental additional filters implied from the current - * user answer. User should add the suggested addition filters to the - * previous - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and - * use the merged filter in the follow up search request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Conversation UUID. This field will be stored in client side storage to - * maintain the conversation session with server and will be used for next - * search request's - * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] - * to restore conversation state in server. - * - * Generated from protobuf field string conversation_id = 1; - * @return string - */ - public function getConversationId() - { - return $this->conversation_id; - } - - /** - * Conversation UUID. This field will be stored in client side storage to - * maintain the conversation session with server and will be used for next - * search request's - * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] - * to restore conversation state in server. - * - * Generated from protobuf field string conversation_id = 1; - * @param string $var - * @return $this - */ - public function setConversationId($var) - { - GPBUtil::checkString($var, True); - $this->conversation_id = $var; - - return $this; - } - - /** - * The current refined query for the conversational search. This field - * will be used in customer UI that the query in the search bar should be - * replaced with the refined query. For example, if - * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is - * `dress` and next - * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] - * is `red color`, which does not match any product attribute value filters, - * the refined query will be `dress, red color`. - * - * Generated from protobuf field string refined_query = 2; - * @return string - */ - public function getRefinedQuery() - { - return $this->refined_query; - } - - /** - * The current refined query for the conversational search. This field - * will be used in customer UI that the query in the search bar should be - * replaced with the refined query. For example, if - * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is - * `dress` and next - * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] - * is `red color`, which does not match any product attribute value filters, - * the refined query will be `dress, red color`. - * - * Generated from protobuf field string refined_query = 2; - * @param string $var - * @return $this - */ - public function setRefinedQuery($var) - { - GPBUtil::checkString($var, True); - $this->refined_query = $var; - - return $this; - } - - /** - * This field is deprecated but will be kept for backward compatibility. - * There is expected to have only one additional filter and the value will - * be the same to the same as field `additional_filter`. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getAdditionalFilters() - { - @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); - return $this->additional_filters; - } - - /** - * This field is deprecated but will be kept for backward compatibility. - * There is expected to have only one additional filter and the value will - * be the same to the same as field `additional_filter`. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; - * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setAdditionalFilters($var) - { - @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); - $this->additional_filters = $arr; - - return $this; - } - - /** - * The follow-up question. e.g., `What is the color?` - * - * Generated from protobuf field string followup_question = 4; - * @return string - */ - public function getFollowupQuestion() - { - return $this->followup_question; - } - - /** - * The follow-up question. e.g., `What is the color?` - * - * Generated from protobuf field string followup_question = 4; - * @param string $var - * @return $this - */ - public function setFollowupQuestion($var) - { - GPBUtil::checkString($var, True); - $this->followup_question = $var; - - return $this; - } - - /** - * The answer options provided to client for the follow-up question. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSuggestedAnswers() - { - return $this->suggested_answers; - } - - /** - * The answer options provided to client for the follow-up question. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; - * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSuggestedAnswers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer::class); - $this->suggested_answers = $arr; - - return $this; - } - - /** - * This is the incremental additional filters implied from the current - * user answer. User should add the suggested addition filters to the - * previous - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and - * use the merged filter in the follow up search request. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; - * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter|null - */ - public function getAdditionalFilter() - { - return $this->additional_filter; - } - - public function hasAdditionalFilter() - { - return isset($this->additional_filter); - } - - public function clearAdditionalFilter() - { - unset($this->additional_filter); - } - - /** - * This is the incremental additional filters implied from the current - * user answer. User should add the suggested addition filters to the - * previous - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and - * use the merged filter in the follow up search request. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; - * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $var - * @return $this - */ - public function setAdditionalFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); - $this->additional_filter = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConversationalSearchResult::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php deleted file mode 100644 index 41e844d6766..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter - */ -class AdditionalFilter extends \Google\Protobuf\Internal\Message -{ - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - */ - protected $product_attribute_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null - */ - public function getProductAttributeValue() - { - return $this->product_attribute_value; - } - - public function hasProductAttributeValue() - { - return isset($this->product_attribute_value); - } - - public function clearProductAttributeValue() - { - unset($this->product_attribute_value); - } - - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var - * @return $this - */ - public function setProductAttributeValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); - $this->product_attribute_value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AdditionalFilter::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult_AdditionalFilter::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php deleted file mode 100644 index 85e543b644b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer - */ -class SuggestedAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - */ - protected $product_attribute_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null - */ - public function getProductAttributeValue() - { - return $this->product_attribute_value; - } - - public function hasProductAttributeValue() - { - return isset($this->product_attribute_value); - } - - public function clearProductAttributeValue() - { - unset($this->product_attribute_value); - } - - /** - * Product attribute value, including an attribute key and an - * attribute value. Other types can be added here in the future. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var - * @return $this - */ - public function setProductAttributeValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); - $this->product_attribute_value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestedAnswer::class, \Google\Cloud\Retail\V2\SearchResponse_ConversationalSearchResult_SuggestedAnswer::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php deleted file mode 100644 index 071e7e64fe5..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.retail.v2.SearchResponse.Facet - */ -class Facet extends \Google\Protobuf\Internal\Message -{ - /** - * The key for this facet. E.g., "colorFamilies" or "price" or - * "attributes.attr1". - * - * Generated from protobuf field string key = 1; - */ - protected $key = ''; - /** - * The facet values for this field. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; - */ - private $values; - /** - * Whether the facet is dynamically generated. - * - * Generated from protobuf field bool dynamic_facet = 3; - */ - protected $dynamic_facet = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * The key for this facet. E.g., "colorFamilies" or "price" or - * "attributes.attr1". - * @type array<\Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $values - * The facet values for this field. - * @type bool $dynamic_facet - * Whether the facet is dynamically generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The key for this facet. E.g., "colorFamilies" or "price" or - * "attributes.attr1". - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * The key for this facet. E.g., "colorFamilies" or "price" or - * "attributes.attr1". - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * The facet values for this field. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * The facet values for this field. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; - * @param array<\Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\Facet\FacetValue::class); - $this->values = $arr; - - return $this; - } - - /** - * Whether the facet is dynamically generated. - * - * Generated from protobuf field bool dynamic_facet = 3; - * @return bool - */ - public function getDynamicFacet() - { - return $this->dynamic_facet; - } - - /** - * Whether the facet is dynamically generated. - * - * Generated from protobuf field bool dynamic_facet = 3; - * @param bool $var - * @return $this - */ - public function setDynamicFacet($var) - { - GPBUtil::checkBool($var); - $this->dynamic_facet = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Facet::class, \Google\Cloud\Retail\V2\SearchResponse_Facet::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php deleted file mode 100644 index a958a437a91..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/Facet/FacetValue.php +++ /dev/null @@ -1,245 +0,0 @@ -google.cloud.retail.v2.SearchResponse.Facet.FacetValue - */ -class FacetValue extends \Google\Protobuf\Internal\Message -{ - /** - * Number of items that have this facet value. - * - * Generated from protobuf field int64 count = 3; - */ - protected $count = 0; - /** - * The minimum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double min_value = 5; - */ - protected $min_value = 0.0; - /** - * The maximum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double max_value = 6; - */ - protected $max_value = 0.0; - protected $facet_value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $value - * Text value of a facet, such as "Black" for facet "colorFamilies". - * @type \Google\Cloud\Retail\V2\Interval $interval - * Interval value for a facet, such as [10, 20) for facet "price". - * @type int|string $count - * Number of items that have this facet value. - * @type float $min_value - * The minimum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * @type float $max_value - * The maximum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Text value of a facet, such as "Black" for facet "colorFamilies". - * - * Generated from protobuf field string value = 1; - * @return string - */ - public function getValue() - { - return $this->readOneof(1); - } - - public function hasValue() - { - return $this->hasOneof(1); - } - - /** - * Text value of a facet, such as "Black" for facet "colorFamilies". - * - * Generated from protobuf field string value = 1; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Interval value for a facet, such as [10, 20) for facet "price". - * - * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; - * @return \Google\Cloud\Retail\V2\Interval|null - */ - public function getInterval() - { - return $this->readOneof(2); - } - - public function hasInterval() - { - return $this->hasOneof(2); - } - - /** - * Interval value for a facet, such as [10, 20) for facet "price". - * - * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; - * @param \Google\Cloud\Retail\V2\Interval $var - * @return $this - */ - public function setInterval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Number of items that have this facet value. - * - * Generated from protobuf field int64 count = 3; - * @return int|string - */ - public function getCount() - { - return $this->count; - } - - /** - * Number of items that have this facet value. - * - * Generated from protobuf field int64 count = 3; - * @param int|string $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt64($var); - $this->count = $var; - - return $this; - } - - /** - * The minimum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double min_value = 5; - * @return float - */ - public function getMinValue() - { - return $this->min_value; - } - - /** - * The minimum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double min_value = 5; - * @param float $var - * @return $this - */ - public function setMinValue($var) - { - GPBUtil::checkDouble($var); - $this->min_value = $var; - - return $this; - } - - /** - * The maximum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double max_value = 6; - * @return float - */ - public function getMaxValue() - { - return $this->max_value; - } - - /** - * The maximum value in the - * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. - * Only supported on numerical facets and returned if - * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] - * is true. - * - * Generated from protobuf field double max_value = 6; - * @param float $var - * @return $this - */ - public function setMaxValue($var) - { - GPBUtil::checkDouble($var); - $this->max_value = $var; - - return $this; - } - - /** - * @return string - */ - public function getFacetValue() - { - return $this->whichOneof("facet_value"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FacetValue::class, \Google\Cloud\Retail\V2\SearchResponse_Facet_FacetValue::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php deleted file mode 100644 index dd4c806bd4d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/QueryExpansionInfo.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.retail.v2.SearchResponse.QueryExpansionInfo - */ -class QueryExpansionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Bool describing whether query expansion has occurred. - * - * Generated from protobuf field bool expanded_query = 1; - */ - protected $expanded_query = false; - /** - * Number of pinned results. This field will only be set when expansion - * happens and - * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] - * is set to true. - * - * Generated from protobuf field int64 pinned_result_count = 2; - */ - protected $pinned_result_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $expanded_query - * Bool describing whether query expansion has occurred. - * @type int|string $pinned_result_count - * Number of pinned results. This field will only be set when expansion - * happens and - * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] - * is set to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * Bool describing whether query expansion has occurred. - * - * Generated from protobuf field bool expanded_query = 1; - * @return bool - */ - public function getExpandedQuery() - { - return $this->expanded_query; - } - - /** - * Bool describing whether query expansion has occurred. - * - * Generated from protobuf field bool expanded_query = 1; - * @param bool $var - * @return $this - */ - public function setExpandedQuery($var) - { - GPBUtil::checkBool($var); - $this->expanded_query = $var; - - return $this; - } - - /** - * Number of pinned results. This field will only be set when expansion - * happens and - * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] - * is set to true. - * - * Generated from protobuf field int64 pinned_result_count = 2; - * @return int|string - */ - public function getPinnedResultCount() - { - return $this->pinned_result_count; - } - - /** - * Number of pinned results. This field will only be set when expansion - * happens and - * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] - * is set to true. - * - * Generated from protobuf field int64 pinned_result_count = 2; - * @param int|string $var - * @return $this - */ - public function setPinnedResultCount($var) - { - GPBUtil::checkInt64($var); - $this->pinned_result_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryExpansionInfo::class, \Google\Cloud\Retail\V2\SearchResponse_QueryExpansionInfo::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php deleted file mode 100644 index ecb713bf269..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/SearchResult.php +++ /dev/null @@ -1,486 +0,0 @@ -google.cloud.retail.v2.SearchResponse.SearchResult - */ -class SearchResult extends \Google\Protobuf\Internal\Message -{ - /** - * [Product.id][google.cloud.retail.v2.Product.id] of the searched - * [Product][google.cloud.retail.v2.Product]. - * - * Generated from protobuf field string id = 1; - */ - protected $id = ''; - /** - * The product data snippet in the search response. Only - * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be - * populated. - * [Product.variants][google.cloud.retail.v2.Product.variants] contains the - * product variants that match the search query. If there are multiple - * product variants matching the query, top 5 most relevant product variants - * are returned and ordered by relevancy. - * If relevancy can be deternmined, use - * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] - * to look up matched product variants fields. If relevancy cannot be - * determined, e.g. when searching "shoe" all products in a shoe product can - * be a match, 5 product variants are returned but order is meaningless. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; - */ - protected $product = null; - /** - * The count of matched - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field int32 matching_variant_count = 3; - */ - protected $matching_variant_count = 0; - /** - * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] matches the search query, this - * map indicates which [Product][google.cloud.retail.v2.Product] fields are - * matched. The key is the - * [Product.name][google.cloud.retail.v2.Product.name], the value is a field - * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If - * matched attributes cannot be determined, this map will be empty. - * For example, a key "sku1" with field mask - * "products.color_info" indicates there is a match between - * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. - * - * Generated from protobuf field map matching_variant_fields = 4; - */ - private $matching_variant_fields; - /** - * The rollup matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] attributes. The key is one of - * the - * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. - * The values are the merged and de-duplicated - * [Product][google.cloud.retail.v2.Product] attributes. Notice that the - * rollup values are respect filter. For example, when filtering by - * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is - * returned. - * For textual and numerical attributes, the rollup values is a list of - * string or double values with type - * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if - * there are two variants with colors "red" and "blue", the rollup values - * are - * { key: "colorFamilies" - * value { - * list_value { - * values { string_value: "red" } - * values { string_value: "blue" } - * } - * } - * } - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup - * values is a double value with type - * [google.protobuf.Value][google.protobuf.Value]. For example, - * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there - * are 10 variants in this product are available in the store "store1". - * - * Generated from protobuf field map variant_rollup_values = 5; - */ - private $variant_rollup_values; - /** - * Specifies previous events related to this product for this user based on - * [UserEvent][google.cloud.retail.v2.UserEvent] with same - * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] - * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. - * This is set only when - * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] - * is - * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * Possible values: - * * `purchased`: Indicates that this product has been purchased before. - * - * Generated from protobuf field repeated string personal_labels = 7; - */ - private $personal_labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * [Product.id][google.cloud.retail.v2.Product.id] of the searched - * [Product][google.cloud.retail.v2.Product]. - * @type \Google\Cloud\Retail\V2\Product $product - * The product data snippet in the search response. Only - * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be - * populated. - * [Product.variants][google.cloud.retail.v2.Product.variants] contains the - * product variants that match the search query. If there are multiple - * product variants matching the query, top 5 most relevant product variants - * are returned and ordered by relevancy. - * If relevancy can be deternmined, use - * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] - * to look up matched product variants fields. If relevancy cannot be - * determined, e.g. when searching "shoe" all products in a shoe product can - * be a match, 5 product variants are returned but order is meaningless. - * @type int $matching_variant_count - * The count of matched - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. - * @type array|\Google\Protobuf\Internal\MapField $matching_variant_fields - * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] matches the search query, this - * map indicates which [Product][google.cloud.retail.v2.Product] fields are - * matched. The key is the - * [Product.name][google.cloud.retail.v2.Product.name], the value is a field - * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If - * matched attributes cannot be determined, this map will be empty. - * For example, a key "sku1" with field mask - * "products.color_info" indicates there is a match between - * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. - * @type array|\Google\Protobuf\Internal\MapField $variant_rollup_values - * The rollup matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] attributes. The key is one of - * the - * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. - * The values are the merged and de-duplicated - * [Product][google.cloud.retail.v2.Product] attributes. Notice that the - * rollup values are respect filter. For example, when filtering by - * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is - * returned. - * For textual and numerical attributes, the rollup values is a list of - * string or double values with type - * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if - * there are two variants with colors "red" and "blue", the rollup values - * are - * { key: "colorFamilies" - * value { - * list_value { - * values { string_value: "red" } - * values { string_value: "blue" } - * } - * } - * } - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup - * values is a double value with type - * [google.protobuf.Value][google.protobuf.Value]. For example, - * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there - * are 10 variants in this product are available in the store "store1". - * @type array|\Google\Protobuf\Internal\RepeatedField $personal_labels - * Specifies previous events related to this product for this user based on - * [UserEvent][google.cloud.retail.v2.UserEvent] with same - * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] - * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. - * This is set only when - * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] - * is - * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * Possible values: - * * `purchased`: Indicates that this product has been purchased before. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * [Product.id][google.cloud.retail.v2.Product.id] of the searched - * [Product][google.cloud.retail.v2.Product]. - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * [Product.id][google.cloud.retail.v2.Product.id] of the searched - * [Product][google.cloud.retail.v2.Product]. - * - * 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; - } - - /** - * The product data snippet in the search response. Only - * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be - * populated. - * [Product.variants][google.cloud.retail.v2.Product.variants] contains the - * product variants that match the search query. If there are multiple - * product variants matching the query, top 5 most relevant product variants - * are returned and ordered by relevancy. - * If relevancy can be deternmined, use - * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] - * to look up matched product variants fields. If relevancy cannot be - * determined, e.g. when searching "shoe" all products in a shoe product can - * be a match, 5 product variants are returned but order is meaningless. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; - * @return \Google\Cloud\Retail\V2\Product|null - */ - public function getProduct() - { - return $this->product; - } - - public function hasProduct() - { - return isset($this->product); - } - - public function clearProduct() - { - unset($this->product); - } - - /** - * The product data snippet in the search response. Only - * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be - * populated. - * [Product.variants][google.cloud.retail.v2.Product.variants] contains the - * product variants that match the search query. If there are multiple - * product variants matching the query, top 5 most relevant product variants - * are returned and ordered by relevancy. - * If relevancy can be deternmined, use - * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] - * to look up matched product variants fields. If relevancy cannot be - * determined, e.g. when searching "shoe" all products in a shoe product can - * be a match, 5 product variants are returned but order is meaningless. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 2; - * @param \Google\Cloud\Retail\V2\Product $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); - $this->product = $var; - - return $this; - } - - /** - * The count of matched - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field int32 matching_variant_count = 3; - * @return int - */ - public function getMatchingVariantCount() - { - return $this->matching_variant_count; - } - - /** - * The count of matched - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product]s. - * - * Generated from protobuf field int32 matching_variant_count = 3; - * @param int $var - * @return $this - */ - public function setMatchingVariantCount($var) - { - GPBUtil::checkInt32($var); - $this->matching_variant_count = $var; - - return $this; - } - - /** - * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] matches the search query, this - * map indicates which [Product][google.cloud.retail.v2.Product] fields are - * matched. The key is the - * [Product.name][google.cloud.retail.v2.Product.name], the value is a field - * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If - * matched attributes cannot be determined, this map will be empty. - * For example, a key "sku1" with field mask - * "products.color_info" indicates there is a match between - * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. - * - * Generated from protobuf field map matching_variant_fields = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMatchingVariantFields() - { - return $this->matching_variant_fields; - } - - /** - * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] matches the search query, this - * map indicates which [Product][google.cloud.retail.v2.Product] fields are - * matched. The key is the - * [Product.name][google.cloud.retail.v2.Product.name], the value is a field - * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If - * matched attributes cannot be determined, this map will be empty. - * For example, a key "sku1" with field mask - * "products.color_info" indicates there is a match between - * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. - * - * Generated from protobuf field map matching_variant_fields = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMatchingVariantFields($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\FieldMask::class); - $this->matching_variant_fields = $arr; - - return $this; - } - - /** - * The rollup matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] attributes. The key is one of - * the - * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. - * The values are the merged and de-duplicated - * [Product][google.cloud.retail.v2.Product] attributes. Notice that the - * rollup values are respect filter. For example, when filtering by - * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is - * returned. - * For textual and numerical attributes, the rollup values is a list of - * string or double values with type - * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if - * there are two variants with colors "red" and "blue", the rollup values - * are - * { key: "colorFamilies" - * value { - * list_value { - * values { string_value: "red" } - * values { string_value: "blue" } - * } - * } - * } - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup - * values is a double value with type - * [google.protobuf.Value][google.protobuf.Value]. For example, - * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there - * are 10 variants in this product are available in the store "store1". - * - * Generated from protobuf field map variant_rollup_values = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getVariantRollupValues() - { - return $this->variant_rollup_values; - } - - /** - * The rollup matching - * [variant][google.cloud.retail.v2.Product.Type.VARIANT] - * [Product][google.cloud.retail.v2.Product] attributes. The key is one of - * the - * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. - * The values are the merged and de-duplicated - * [Product][google.cloud.retail.v2.Product] attributes. Notice that the - * rollup values are respect filter. For example, when filtering by - * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is - * returned. - * For textual and numerical attributes, the rollup values is a list of - * string or double values with type - * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if - * there are two variants with colors "red" and "blue", the rollup values - * are - * { key: "colorFamilies" - * value { - * list_value { - * values { string_value: "red" } - * values { string_value: "blue" } - * } - * } - * } - * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup - * values is a double value with type - * [google.protobuf.Value][google.protobuf.Value]. For example, - * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there - * are 10 variants in this product are available in the store "store1". - * - * Generated from protobuf field map variant_rollup_values = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setVariantRollupValues($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->variant_rollup_values = $arr; - - return $this; - } - - /** - * Specifies previous events related to this product for this user based on - * [UserEvent][google.cloud.retail.v2.UserEvent] with same - * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] - * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. - * This is set only when - * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] - * is - * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * Possible values: - * * `purchased`: Indicates that this product has been purchased before. - * - * Generated from protobuf field repeated string personal_labels = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPersonalLabels() - { - return $this->personal_labels; - } - - /** - * Specifies previous events related to this product for this user based on - * [UserEvent][google.cloud.retail.v2.UserEvent] with same - * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] - * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. - * This is set only when - * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] - * is - * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. - * Possible values: - * * `purchased`: Indicates that this product has been purchased before. - * - * Generated from protobuf field repeated string personal_labels = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPersonalLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->personal_labels = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SearchResult::class, \Google\Cloud\Retail\V2\SearchResponse_SearchResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php deleted file mode 100644 index a60faf38281..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchResponse/TileNavigationResult.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.SearchResponse.TileNavigationResult - */ -class TileNavigationResult extends \Google\Protobuf\Internal\Message -{ - /** - * The current tiles that are used for tile navigation, sorted by - * engagement. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; - */ - private $tiles; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $tiles - * The current tiles that are used for tile navigation, sorted by - * engagement. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The current tiles that are used for tile navigation, sorted by - * engagement. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTiles() - { - return $this->tiles; - } - - /** - * The current tiles that are used for tile navigation, sorted by - * engagement. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; - * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); - $this->tiles = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TileNavigationResult::class, \Google\Cloud\Retail\V2\SearchResponse_TileNavigationResult::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php deleted file mode 100644 index 8c9ecd07a29..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SearchSolutionUseCase.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.SearchSolutionUseCase - */ -class SearchSolutionUseCase -{ - /** - * The value when it's unspecified. In this case, server behavior defaults to - * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]. - * - * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; - */ - const SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; - /** - * Search use case. Expects the traffic has a non-empty - * [query][google.cloud.retail.v2.SearchRequest.query]. - * - * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_SEARCH = 1; - */ - const SEARCH_SOLUTION_USE_CASE_SEARCH = 1; - /** - * Browse use case. Expects the traffic has an empty - * [query][google.cloud.retail.v2.SearchRequest.query]. - * - * Generated from protobuf enum SEARCH_SOLUTION_USE_CASE_BROWSE = 2; - */ - const SEARCH_SOLUTION_USE_CASE_BROWSE = 2; - - private static $valueToName = [ - self::SEARCH_SOLUTION_USE_CASE_UNSPECIFIED => 'SEARCH_SOLUTION_USE_CASE_UNSPECIFIED', - self::SEARCH_SOLUTION_USE_CASE_SEARCH => 'SEARCH_SOLUTION_USE_CASE_SEARCH', - self::SEARCH_SOLUTION_USE_CASE_BROWSE => 'SEARCH_SOLUTION_USE_CASE_BROWSE', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php deleted file mode 100644 index b533b8d2bdb..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig.php +++ /dev/null @@ -1,1258 +0,0 @@ -google.cloud.retail.v2.ServingConfig - */ -class ServingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/servingConfig/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Required. The human readable serving config display name. Used in Retail - * UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - /** - * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] - * to use at serving time. Currently only RecommendationModels are supported: - * https://cloud.google.com/retail/recommendations-ai/docs/create-models - * Can be changed but only to a compatible model (e.g. - * others-you-may-like CTR to others-you-may-like CVR). - * Required when - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string model_id = 3; - */ - protected $model_id = ''; - /** - * How much price ranking we want in serving results. - * Price reranking causes product items with a similar - * recommendation probability to be ordered by price, with the - * highest-priced items first. This setting could result in a decrease in - * click-through and conversion rates. - * Allowed values are: - * * `no-price-reranking` - * * `low-price-reranking` - * * `medium-price-reranking` - * * `high-price-reranking` - * If not specified, we choose default based on model type. Default value: - * `no-price-reranking`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string price_reranking_level = 4; - */ - protected $price_reranking_level = ''; - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] - * resources with only the Facet control set. These controls are assumed to be - * in the same [Catalog][google.cloud.retail.v2.Catalog] as the - * [ServingConfig][google.cloud.retail.v2.ServingConfig]. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string facet_control_ids = 5; - */ - private $facet_control_ids; - /** - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; - */ - protected $dynamic_facet_spec = null; - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifications, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 100. - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string boost_control_ids = 7; - */ - private $boost_control_ids; - /** - * Condition filter specifications. If a product matches multiple conditions - * in the specifications, filters from these specifications are all - * applied and combined via the AND operator. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string filter_control_ids = 9; - */ - private $filter_control_ids; - /** - * Condition redirect specifications. Only the first triggered redirect action - * is applied, even if multiple apply. Maximum number of specifications is - * 1000. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string redirect_control_ids = 10; - */ - private $redirect_control_ids; - /** - * Condition synonyms specifications. If multiple syonyms conditions match, - * all matching synonyms control in the list will execute. Order of controls - * in the list will not matter. Maximum number of specifications is - * 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; - */ - private $twoway_synonyms_control_ids; - /** - * Condition oneway synonyms specifications. If multiple oneway synonyms - * conditions match, all matching oneway synonyms controls in the list will - * execute. Order of controls in the list will not matter. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; - */ - private $oneway_synonyms_control_ids; - /** - * Condition do not associate specifications. If multiple do not associate - * conditions match, all matching do not associate controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string do_not_associate_control_ids = 13; - */ - private $do_not_associate_control_ids; - /** - * Condition replacement specifications. - * - Applied according to the order in the list. - * - A previously replaced term can not be re-replaced. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string replacement_control_ids = 14; - */ - private $replacement_control_ids; - /** - * Condition ignore specifications. If multiple ignore - * conditions match, all matching ignore controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string ignore_control_ids = 15; - */ - private $ignore_control_ids; - /** - * How much diversity to use in recommendation model results e.g. - * `medium-diversity` or `high-diversity`. Currently supported values: - * * `no-diversity` - * * `low-diversity` - * * `medium-diversity` - * * `high-diversity` - * * `auto-diversity` - * If not specified, we choose default based on recommendation model - * type. Default value: `no-diversity`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string diversity_level = 8; - */ - protected $diversity_level = ''; - /** - * What kind of diversity to use - data driven or rule based. If unset, the - * server behavior defaults to - * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; - */ - protected $diversity_type = 0; - /** - * Whether to add additional category filters on the `similar-items` model. - * If not specified, we enable it by default. - * Allowed values are: - * * `no-category-match`: No additional filtering of original results from - * the model and the customer's filters. - * * `relaxed-category-match`: Only keep results with categories that match - * at least one item categories in the PredictRequests's context item. - * * If customer also sends filters in the PredictRequest, then the results - * will satisfy both conditions (user given and category match). - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string enable_category_filter_level = 16; - */ - protected $enable_category_filter_level = ''; - /** - * When the flag is enabled, the products in the denylist will not be filtered - * out in the recommendation filtering results. - * - * Generated from protobuf field bool ignore_recs_denylist = 24; - */ - protected $ignore_recs_denylist = false; - /** - * The specification for personalization spec. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; - */ - protected $personalization_spec = null; - /** - * Required. Immutable. Specifies the solution types that a serving config can - * be associated with. Currently we support setting only one type of solution. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $solution_types; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/servingConfig/*` - * @type string $display_name - * Required. The human readable serving config display name. Used in Retail - * UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $model_id - * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] - * to use at serving time. Currently only RecommendationModels are supported: - * https://cloud.google.com/retail/recommendations-ai/docs/create-models - * Can be changed but only to a compatible model (e.g. - * others-you-may-like CTR to others-you-may-like CVR). - * Required when - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * @type string $price_reranking_level - * How much price ranking we want in serving results. - * Price reranking causes product items with a similar - * recommendation probability to be ordered by price, with the - * highest-priced items first. This setting could result in a decrease in - * click-through and conversion rates. - * Allowed values are: - * * `no-price-reranking` - * * `low-price-reranking` - * * `medium-price-reranking` - * * `high-price-reranking` - * If not specified, we choose default based on model type. Default value: - * `no-price-reranking`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * @type array|\Google\Protobuf\Internal\RepeatedField $facet_control_ids - * Facet specifications for faceted search. If empty, no facets are returned. - * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] - * resources with only the Facet control set. These controls are assumed to be - * in the same [Catalog][google.cloud.retail.v2.Catalog] as the - * [ServingConfig][google.cloud.retail.v2.ServingConfig]. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $dynamic_facet_spec - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $boost_control_ids - * Condition boost specifications. If a product matches multiple conditions - * in the specifications, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 100. - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $filter_control_ids - * Condition filter specifications. If a product matches multiple conditions - * in the specifications, filters from these specifications are all - * applied and combined via the AND operator. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $redirect_control_ids - * Condition redirect specifications. Only the first triggered redirect action - * is applied, even if multiple apply. Maximum number of specifications is - * 1000. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $twoway_synonyms_control_ids - * Condition synonyms specifications. If multiple syonyms conditions match, - * all matching synonyms control in the list will execute. Order of controls - * in the list will not matter. Maximum number of specifications is - * 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $oneway_synonyms_control_ids - * Condition oneway synonyms specifications. If multiple oneway synonyms - * conditions match, all matching oneway synonyms controls in the list will - * execute. Order of controls in the list will not matter. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $do_not_associate_control_ids - * Condition do not associate specifications. If multiple do not associate - * conditions match, all matching do not associate controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $replacement_control_ids - * Condition replacement specifications. - * - Applied according to the order in the list. - * - A previously replaced term can not be re-replaced. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type array|\Google\Protobuf\Internal\RepeatedField $ignore_control_ids - * Condition ignore specifications. If multiple ignore - * conditions match, all matching ignore controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * @type string $diversity_level - * How much diversity to use in recommendation model results e.g. - * `medium-diversity` or `high-diversity`. Currently supported values: - * * `no-diversity` - * * `low-diversity` - * * `medium-diversity` - * * `high-diversity` - * * `auto-diversity` - * If not specified, we choose default based on recommendation model - * type. Default value: `no-diversity`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * @type int $diversity_type - * What kind of diversity to use - data driven or rule based. If unset, the - * server behavior defaults to - * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. - * @type string $enable_category_filter_level - * Whether to add additional category filters on the `similar-items` model. - * If not specified, we enable it by default. - * Allowed values are: - * * `no-category-match`: No additional filtering of original results from - * the model and the customer's filters. - * * `relaxed-category-match`: Only keep results with categories that match - * at least one item categories in the PredictRequests's context item. - * * If customer also sends filters in the PredictRequest, then the results - * will satisfy both conditions (user given and category match). - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * @type bool $ignore_recs_denylist - * When the flag is enabled, the products in the denylist will not be filtered - * out in the recommendation filtering results. - * @type \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $personalization_spec - * The specification for personalization spec. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * @type array|\Google\Protobuf\Internal\RepeatedField $solution_types - * Required. Immutable. Specifies the solution types that a serving config can - * be associated with. Currently we support setting only one type of solution. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/servingConfig/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. Fully qualified name - * `projects/*/locations/global/catalogs/*/servingConfig/*` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The human readable serving config display name. Used in Retail - * UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The human readable serving config display name. Used in Retail - * UI. - * This field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] - * to use at serving time. Currently only RecommendationModels are supported: - * https://cloud.google.com/retail/recommendations-ai/docs/create-models - * Can be changed but only to a compatible model (e.g. - * others-you-may-like CTR to others-you-may-like CVR). - * Required when - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string model_id = 3; - * @return string - */ - public function getModelId() - { - return $this->model_id; - } - - /** - * The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog] - * to use at serving time. Currently only RecommendationModels are supported: - * https://cloud.google.com/retail/recommendations-ai/docs/create-models - * Can be changed but only to a compatible model (e.g. - * others-you-may-like CTR to others-you-may-like CVR). - * Required when - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string model_id = 3; - * @param string $var - * @return $this - */ - public function setModelId($var) - { - GPBUtil::checkString($var, True); - $this->model_id = $var; - - return $this; - } - - /** - * How much price ranking we want in serving results. - * Price reranking causes product items with a similar - * recommendation probability to be ordered by price, with the - * highest-priced items first. This setting could result in a decrease in - * click-through and conversion rates. - * Allowed values are: - * * `no-price-reranking` - * * `low-price-reranking` - * * `medium-price-reranking` - * * `high-price-reranking` - * If not specified, we choose default based on model type. Default value: - * `no-price-reranking`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string price_reranking_level = 4; - * @return string - */ - public function getPriceRerankingLevel() - { - return $this->price_reranking_level; - } - - /** - * How much price ranking we want in serving results. - * Price reranking causes product items with a similar - * recommendation probability to be ordered by price, with the - * highest-priced items first. This setting could result in a decrease in - * click-through and conversion rates. - * Allowed values are: - * * `no-price-reranking` - * * `low-price-reranking` - * * `medium-price-reranking` - * * `high-price-reranking` - * If not specified, we choose default based on model type. Default value: - * `no-price-reranking`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string price_reranking_level = 4; - * @param string $var - * @return $this - */ - public function setPriceRerankingLevel($var) - { - GPBUtil::checkString($var, True); - $this->price_reranking_level = $var; - - return $this; - } - - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] - * resources with only the Facet control set. These controls are assumed to be - * in the same [Catalog][google.cloud.retail.v2.Catalog] as the - * [ServingConfig][google.cloud.retail.v2.ServingConfig]. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string facet_control_ids = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFacetControlIds() - { - return $this->facet_control_ids; - } - - /** - * Facet specifications for faceted search. If empty, no facets are returned. - * The ids refer to the ids of [Control][google.cloud.retail.v2.Control] - * resources with only the Facet control set. These controls are assumed to be - * in the same [Catalog][google.cloud.retail.v2.Catalog] as the - * [ServingConfig][google.cloud.retail.v2.ServingConfig]. - * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - * is returned. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string facet_control_ids = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFacetControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->facet_control_ids = $arr; - - return $this; - } - - /** - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; - * @return \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec|null - */ - public function getDynamicFacetSpec() - { - return $this->dynamic_facet_spec; - } - - public function hasDynamicFacetSpec() - { - return isset($this->dynamic_facet_spec); - } - - public function clearDynamicFacetSpec() - { - unset($this->dynamic_facet_spec); - } - - /** - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; - * @param \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec $var - * @return $this - */ - public function setDynamicFacetSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\DynamicFacetSpec::class); - $this->dynamic_facet_spec = $var; - - return $this; - } - - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifications, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 100. - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string boost_control_ids = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBoostControlIds() - { - return $this->boost_control_ids; - } - - /** - * Condition boost specifications. If a product matches multiple conditions - * in the specifications, boost scores from these specifications are all - * applied and combined in a non-linear way. Maximum number of - * specifications is 100. - * Notice that if both - * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] - * and - * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec] - * are set, the boost conditions from both places are evaluated. If a search - * request matches multiple boost conditions, the final boost score is equal - * to the sum of the boost scores from all matched boost conditions. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string boost_control_ids = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBoostControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->boost_control_ids = $arr; - - return $this; - } - - /** - * Condition filter specifications. If a product matches multiple conditions - * in the specifications, filters from these specifications are all - * applied and combined via the AND operator. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string filter_control_ids = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFilterControlIds() - { - return $this->filter_control_ids; - } - - /** - * Condition filter specifications. If a product matches multiple conditions - * in the specifications, filters from these specifications are all - * applied and combined via the AND operator. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string filter_control_ids = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilterControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->filter_control_ids = $arr; - - return $this; - } - - /** - * Condition redirect specifications. Only the first triggered redirect action - * is applied, even if multiple apply. Maximum number of specifications is - * 1000. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string redirect_control_ids = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRedirectControlIds() - { - return $this->redirect_control_ids; - } - - /** - * Condition redirect specifications. Only the first triggered redirect action - * is applied, even if multiple apply. Maximum number of specifications is - * 1000. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string redirect_control_ids = 10; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRedirectControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->redirect_control_ids = $arr; - - return $this; - } - - /** - * Condition synonyms specifications. If multiple syonyms conditions match, - * all matching synonyms control in the list will execute. Order of controls - * in the list will not matter. Maximum number of specifications is - * 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTwowaySynonymsControlIds() - { - return $this->twoway_synonyms_control_ids; - } - - /** - * Condition synonyms specifications. If multiple syonyms conditions match, - * all matching synonyms control in the list will execute. Order of controls - * in the list will not matter. Maximum number of specifications is - * 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string twoway_synonyms_control_ids = 18; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTwowaySynonymsControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->twoway_synonyms_control_ids = $arr; - - return $this; - } - - /** - * Condition oneway synonyms specifications. If multiple oneway synonyms - * conditions match, all matching oneway synonyms controls in the list will - * execute. Order of controls in the list will not matter. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOnewaySynonymsControlIds() - { - return $this->oneway_synonyms_control_ids; - } - - /** - * Condition oneway synonyms specifications. If multiple oneway synonyms - * conditions match, all matching oneway synonyms controls in the list will - * execute. Order of controls in the list will not matter. Maximum number of - * specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string oneway_synonyms_control_ids = 12; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOnewaySynonymsControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->oneway_synonyms_control_ids = $arr; - - return $this; - } - - /** - * Condition do not associate specifications. If multiple do not associate - * conditions match, all matching do not associate controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string do_not_associate_control_ids = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDoNotAssociateControlIds() - { - return $this->do_not_associate_control_ids; - } - - /** - * Condition do not associate specifications. If multiple do not associate - * conditions match, all matching do not associate controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string do_not_associate_control_ids = 13; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDoNotAssociateControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->do_not_associate_control_ids = $arr; - - return $this; - } - - /** - * Condition replacement specifications. - * - Applied according to the order in the list. - * - A previously replaced term can not be re-replaced. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string replacement_control_ids = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getReplacementControlIds() - { - return $this->replacement_control_ids; - } - - /** - * Condition replacement specifications. - * - Applied according to the order in the list. - * - A previously replaced term can not be re-replaced. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string replacement_control_ids = 14; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setReplacementControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->replacement_control_ids = $arr; - - return $this; - } - - /** - * Condition ignore specifications. If multiple ignore - * conditions match, all matching ignore controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string ignore_control_ids = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoreControlIds() - { - return $this->ignore_control_ids; - } - - /** - * Condition ignore specifications. If multiple ignore - * conditions match, all matching ignore controls in the list will - * execute. - * - Order does not matter. - * - Maximum number of specifications is 100. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * - * Generated from protobuf field repeated string ignore_control_ids = 15; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoreControlIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ignore_control_ids = $arr; - - return $this; - } - - /** - * How much diversity to use in recommendation model results e.g. - * `medium-diversity` or `high-diversity`. Currently supported values: - * * `no-diversity` - * * `low-diversity` - * * `medium-diversity` - * * `high-diversity` - * * `auto-diversity` - * If not specified, we choose default based on recommendation model - * type. Default value: `no-diversity`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string diversity_level = 8; - * @return string - */ - public function getDiversityLevel() - { - return $this->diversity_level; - } - - /** - * How much diversity to use in recommendation model results e.g. - * `medium-diversity` or `high-diversity`. Currently supported values: - * * `no-diversity` - * * `low-diversity` - * * `medium-diversity` - * * `high-diversity` - * * `auto-diversity` - * If not specified, we choose default based on recommendation model - * type. Default value: `no-diversity`. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string diversity_level = 8; - * @param string $var - * @return $this - */ - public function setDiversityLevel($var) - { - GPBUtil::checkString($var, True); - $this->diversity_level = $var; - - return $this; - } - - /** - * What kind of diversity to use - data driven or rule based. If unset, the - * server behavior defaults to - * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; - * @return int - */ - public function getDiversityType() - { - return $this->diversity_type; - } - - /** - * What kind of diversity to use - data driven or rule based. If unset, the - * server behavior defaults to - * [RULE_BASED_DIVERSITY][google.cloud.retail.v2.ServingConfig.DiversityType.RULE_BASED_DIVERSITY]. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20; - * @param int $var - * @return $this - */ - public function setDiversityType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\ServingConfig\DiversityType::class); - $this->diversity_type = $var; - - return $this; - } - - /** - * Whether to add additional category filters on the `similar-items` model. - * If not specified, we enable it by default. - * Allowed values are: - * * `no-category-match`: No additional filtering of original results from - * the model and the customer's filters. - * * `relaxed-category-match`: Only keep results with categories that match - * at least one item categories in the PredictRequests's context item. - * * If customer also sends filters in the PredictRequest, then the results - * will satisfy both conditions (user given and category match). - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string enable_category_filter_level = 16; - * @return string - */ - public function getEnableCategoryFilterLevel() - { - return $this->enable_category_filter_level; - } - - /** - * Whether to add additional category filters on the `similar-items` model. - * If not specified, we enable it by default. - * Allowed values are: - * * `no-category-match`: No additional filtering of original results from - * the model and the customer's filters. - * * `relaxed-category-match`: Only keep results with categories that match - * at least one item categories in the PredictRequests's context item. - * * If customer also sends filters in the PredictRequest, then the results - * will satisfy both conditions (user given and category match). - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. - * - * Generated from protobuf field string enable_category_filter_level = 16; - * @param string $var - * @return $this - */ - public function setEnableCategoryFilterLevel($var) - { - GPBUtil::checkString($var, True); - $this->enable_category_filter_level = $var; - - return $this; - } - - /** - * When the flag is enabled, the products in the denylist will not be filtered - * out in the recommendation filtering results. - * - * Generated from protobuf field bool ignore_recs_denylist = 24; - * @return bool - */ - public function getIgnoreRecsDenylist() - { - return $this->ignore_recs_denylist; - } - - /** - * When the flag is enabled, the products in the denylist will not be filtered - * out in the recommendation filtering results. - * - * Generated from protobuf field bool ignore_recs_denylist = 24; - * @param bool $var - * @return $this - */ - public function setIgnoreRecsDenylist($var) - { - GPBUtil::checkBool($var); - $this->ignore_recs_denylist = $var; - - return $this; - } - - /** - * The specification for personalization spec. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; - * @return \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec|null - */ - public function getPersonalizationSpec() - { - return $this->personalization_spec; - } - - public function hasPersonalizationSpec() - { - return isset($this->personalization_spec); - } - - public function clearPersonalizationSpec() - { - unset($this->personalization_spec); - } - - /** - * The specification for personalization spec. - * Can only be set if - * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is - * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. - * Notice that if both - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec] - * and - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * are set. - * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec] - * will override - * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]. - * - * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21; - * @param \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $var - * @return $this - */ - public function setPersonalizationSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec::class); - $this->personalization_spec = $var; - - return $this; - } - - /** - * Required. Immutable. Specifies the solution types that a serving config can - * be associated with. Currently we support setting only one type of solution. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSolutionTypes() - { - return $this->solution_types; - } - - /** - * Required. Immutable. Specifies the solution types that a serving config can - * be associated with. Currently we support setting only one type of solution. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSolutionTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Retail\V2\SolutionType::class); - $this->solution_types = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php deleted file mode 100644 index dd7183c45df..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/ServingConfig/DiversityType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.retail.v2.ServingConfig.DiversityType - */ -class DiversityType -{ - /** - * Default value. - * - * Generated from protobuf enum DIVERSITY_TYPE_UNSPECIFIED = 0; - */ - const DIVERSITY_TYPE_UNSPECIFIED = 0; - /** - * Rule based diversity. - * - * Generated from protobuf enum RULE_BASED_DIVERSITY = 2; - */ - const RULE_BASED_DIVERSITY = 2; - /** - * Data driven diversity. - * - * Generated from protobuf enum DATA_DRIVEN_DIVERSITY = 3; - */ - const DATA_DRIVEN_DIVERSITY = 3; - - private static $valueToName = [ - self::DIVERSITY_TYPE_UNSPECIFIED => 'DIVERSITY_TYPE_UNSPECIFIED', - self::RULE_BASED_DIVERSITY => 'RULE_BASED_DIVERSITY', - self::DATA_DRIVEN_DIVERSITY => 'DATA_DRIVEN_DIVERSITY', - ]; - - 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(DiversityType::class, \Google\Cloud\Retail\V2\ServingConfig_DiversityType::class); - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php deleted file mode 100644 index 34c283f0ae3..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetDefaultBranchRequest.php +++ /dev/null @@ -1,231 +0,0 @@ -google.cloud.retail.v2.SetDefaultBranchRequest - */ -class SetDefaultBranchRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Full resource name of the catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - */ - protected $catalog = ''; - /** - * The final component of the resource name of a branch. - * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - * error is returned. - * If there are no sufficient active products in the targeted branch and - * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a - * FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { - */ - protected $branch_id = ''; - /** - * Some note on this request, this can be retrieved by - * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] - * before next valid default branch set occurs. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string note = 3; - */ - protected $note = ''; - /** - * If set to true, it permits switching to a branch with - * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even - * if it has no sufficient active products. - * - * Generated from protobuf field bool force = 4; - */ - protected $force = false; - - /** - * @param string $catalog Full resource name of the catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * @return \Google\Cloud\Retail\V2\SetDefaultBranchRequest - * - * @experimental - */ - public static function build(string $catalog): self - { - return (new self()) - ->setCatalog($catalog); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $catalog - * Full resource name of the catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @type string $branch_id - * The final component of the resource name of a branch. - * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - * error is returned. - * If there are no sufficient active products in the targeted branch and - * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a - * FAILED_PRECONDITION error is returned. - * @type string $note - * Some note on this request, this can be retrieved by - * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] - * before next valid default branch set occurs. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type bool $force - * If set to true, it permits switching to a branch with - * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even - * if it has no sufficient active products. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Full resource name of the catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getCatalog() - { - return $this->catalog; - } - - /** - * Full resource name of the catalog, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string catalog = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkString($var, True); - $this->catalog = $var; - - return $this; - } - - /** - * The final component of the resource name of a branch. - * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - * error is returned. - * If there are no sufficient active products in the targeted branch and - * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a - * FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getBranchId() - { - return $this->branch_id; - } - - /** - * The final component of the resource name of a branch. - * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - * error is returned. - * If there are no sufficient active products in the targeted branch and - * [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a - * FAILED_PRECONDITION error is returned. - * - * Generated from protobuf field string branch_id = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBranchId($var) - { - GPBUtil::checkString($var, True); - $this->branch_id = $var; - - return $this; - } - - /** - * Some note on this request, this can be retrieved by - * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] - * before next valid default branch set occurs. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string note = 3; - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * Some note on this request, this can be retrieved by - * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch] - * before next valid default branch set occurs. - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string note = 3; - * @param string $var - * @return $this - */ - public function setNote($var) - { - GPBUtil::checkString($var, True); - $this->note = $var; - - return $this; - } - - /** - * If set to true, it permits switching to a branch with - * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even - * if it has no sufficient active products. - * - * Generated from protobuf field bool force = 4; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * If set to true, it permits switching to a branch with - * [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even - * if it has no sufficient active products. - * - * Generated from protobuf field bool force = 4; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php deleted file mode 100644 index 5aa2ae4985f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryMetadata.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.SetInventoryMetadata - */ -class SetInventoryMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php deleted file mode 100644 index 80cbe2a78bd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryRequest.php +++ /dev/null @@ -1,507 +0,0 @@ -google.cloud.retail.v2.SetInventoryRequest - */ -class SetInventoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The inventory information to update. The allowable fields to - * update are: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The updated inventory fields must be specified in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. - * If - * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] - * is empty or invalid, an INVALID_ARGUMENT error is returned. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product] named in - * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether - * or not it exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not have - * existing inventory information, the provided inventory information will be - * inserted. - * If the [Product][google.cloud.retail.v2.Product] to update has existing - * inventory information, the provided inventory information will be merged - * while respecting the last update time for each inventory field, using the - * provided or default value for - * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. - * The caller can replace place IDs for a subset of fulfillment types in the - * following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types and corresponding place IDs - * to update in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The caller can clear all place IDs from a subset of fulfillment types in - * the following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types to clear in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * * Checks that only the desired fulfillment info types have empty - * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * The last update time is recorded for the following inventory fields: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * If a full overwrite of inventory information while ignoring timestamps is - * needed, - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * should be invoked instead. - * - * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $inventory = null; - /** - * Indicates which inventory fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. - * At least one field must be provided. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; - */ - protected $set_mask = null; - /** - * The time when the request is issued, used to prevent - * out-of-order updates on inventory fields with the last update time - * recorded. If not provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; - */ - protected $set_time = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] with name - * [Product.name][google.cloud.retail.v2.Product.name] is not found, the - * inventory update will still be processed and retained for at most 1 day - * until the [Product][google.cloud.retail.v2.Product] is created. If set to - * false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 4; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\Retail\V2\Product $inventory Required. The inventory information to update. The allowable fields to - * update are: - * - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The updated inventory fields must be specified in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. - * - * If - * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] - * is empty or invalid, an INVALID_ARGUMENT error is returned. - * - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product] named in - * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether - * or not it exists, a PERMISSION_DENIED error is returned. - * - * If the [Product][google.cloud.retail.v2.Product] to update does not have - * existing inventory information, the provided inventory information will be - * inserted. - * - * If the [Product][google.cloud.retail.v2.Product] to update has existing - * inventory information, the provided inventory information will be merged - * while respecting the last update time for each inventory field, using the - * provided or default value for - * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. - * - * The caller can replace place IDs for a subset of fulfillment types in the - * following ways: - * - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types and corresponding place IDs - * to update in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * - * The caller can clear all place IDs from a subset of fulfillment types in - * the following ways: - * - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types to clear in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * * Checks that only the desired fulfillment info types have empty - * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * - * The last update time is recorded for the following inventory fields: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * - * If a full overwrite of inventory information while ignoring timestamps is - * needed, - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * should be invoked instead. - * @param \Google\Protobuf\FieldMask $setMask Indicates which inventory fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. - * - * At least one field must be provided. - * - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * @return \Google\Cloud\Retail\V2\SetInventoryRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\Product $inventory, \Google\Protobuf\FieldMask $setMask): self - { - return (new self()) - ->setInventory($inventory) - ->setSetMask($setMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Product $inventory - * Required. The inventory information to update. The allowable fields to - * update are: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The updated inventory fields must be specified in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. - * If - * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] - * is empty or invalid, an INVALID_ARGUMENT error is returned. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product] named in - * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether - * or not it exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not have - * existing inventory information, the provided inventory information will be - * inserted. - * If the [Product][google.cloud.retail.v2.Product] to update has existing - * inventory information, the provided inventory information will be merged - * while respecting the last update time for each inventory field, using the - * provided or default value for - * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. - * The caller can replace place IDs for a subset of fulfillment types in the - * following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types and corresponding place IDs - * to update in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The caller can clear all place IDs from a subset of fulfillment types in - * the following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types to clear in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * * Checks that only the desired fulfillment info types have empty - * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * The last update time is recorded for the following inventory fields: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * If a full overwrite of inventory information while ignoring timestamps is - * needed, - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * should be invoked instead. - * @type \Google\Protobuf\FieldMask $set_mask - * Indicates which inventory fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. - * At least one field must be provided. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * @type \Google\Protobuf\Timestamp $set_time - * The time when the request is issued, used to prevent - * out-of-order updates on inventory fields with the last update time - * recorded. If not provided, the internal system time will be used. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] with name - * [Product.name][google.cloud.retail.v2.Product.name] is not found, the - * inventory update will still be processed and retained for at most 1 day - * until the [Product][google.cloud.retail.v2.Product] is created. If set to - * false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The inventory information to update. The allowable fields to - * update are: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The updated inventory fields must be specified in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. - * If - * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] - * is empty or invalid, an INVALID_ARGUMENT error is returned. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product] named in - * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether - * or not it exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not have - * existing inventory information, the provided inventory information will be - * inserted. - * If the [Product][google.cloud.retail.v2.Product] to update has existing - * inventory information, the provided inventory information will be merged - * while respecting the last update time for each inventory field, using the - * provided or default value for - * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. - * The caller can replace place IDs for a subset of fulfillment types in the - * following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types and corresponding place IDs - * to update in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The caller can clear all place IDs from a subset of fulfillment types in - * the following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types to clear in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * * Checks that only the desired fulfillment info types have empty - * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * The last update time is recorded for the following inventory fields: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * If a full overwrite of inventory information while ignoring timestamps is - * needed, - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * should be invoked instead. - * - * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Product|null - */ - public function getInventory() - { - return $this->inventory; - } - - public function hasInventory() - { - return isset($this->inventory); - } - - public function clearInventory() - { - unset($this->inventory); - } - - /** - * Required. The inventory information to update. The allowable fields to - * update are: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The updated inventory fields must be specified in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. - * If - * [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] - * is empty or invalid, an INVALID_ARGUMENT error is returned. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product] named in - * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether - * or not it exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not have - * existing inventory information, the provided inventory information will be - * inserted. - * If the [Product][google.cloud.retail.v2.Product] to update has existing - * inventory information, the provided inventory information will be merged - * while respecting the last update time for each inventory field, using the - * provided or default value for - * [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. - * The caller can replace place IDs for a subset of fulfillment types in the - * following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types and corresponding place IDs - * to update in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * The caller can clear all place IDs from a subset of fulfillment types in - * the following ways: - * * Adds "fulfillment_info" in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] - * * Specifies only the desired fulfillment types to clear in - * [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * * Checks that only the desired fulfillment info types have empty - * [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids] - * The last update time is recorded for the following inventory fields: - * * [Product.price_info][google.cloud.retail.v2.Product.price_info] - * * [Product.availability][google.cloud.retail.v2.Product.availability] - * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] - * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] - * If a full overwrite of inventory information while ignoring timestamps is - * needed, - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * should be invoked instead. - * - * Generated from protobuf field .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Product $var - * @return $this - */ - public function setInventory($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); - $this->inventory = $var; - - return $this; - } - - /** - * Indicates which inventory fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. - * At least one field must be provided. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getSetMask() - { - return $this->set_mask; - } - - public function hasSetMask() - { - return isset($this->set_mask); - } - - public function clearSetMask() - { - unset($this->set_mask); - } - - /** - * Indicates which inventory fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. - * At least one field must be provided. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned and the entire update will be ignored. - * - * Generated from protobuf field .google.protobuf.FieldMask set_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setSetMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->set_mask = $var; - - return $this; - } - - /** - * The time when the request is issued, used to prevent - * out-of-order updates on inventory fields with the last update time - * recorded. If not provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getSetTime() - { - return $this->set_time; - } - - public function hasSetTime() - { - return isset($this->set_time); - } - - public function clearSetTime() - { - unset($this->set_time); - } - - /** - * The time when the request is issued, used to prevent - * out-of-order updates on inventory fields with the last update time - * recorded. If not provided, the internal system time will be used. - * - * Generated from protobuf field .google.protobuf.Timestamp set_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSetTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->set_time = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] with name - * [Product.name][google.cloud.retail.v2.Product.name] is not found, the - * inventory update will still be processed and retained for at most 1 day - * until the [Product][google.cloud.retail.v2.Product] is created. If set to - * false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 4; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] with name - * [Product.name][google.cloud.retail.v2.Product.name] is not found, the - * inventory update will still be processed and retained for at most 1 day - * until the [Product][google.cloud.retail.v2.Product] is created. If set to - * false, a NOT_FOUND error is returned if the - * [Product][google.cloud.retail.v2.Product] is not found. - * - * Generated from protobuf field bool allow_missing = 4; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php deleted file mode 100644 index b0f2e450044..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SetInventoryResponse.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.retail.v2.SetInventoryResponse - */ -class SetInventoryResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php deleted file mode 100644 index dd4badd652a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/SolutionType.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.retail.v2.SolutionType - */ -class SolutionType -{ - /** - * Default value. - * - * Generated from protobuf enum SOLUTION_TYPE_UNSPECIFIED = 0; - */ - const SOLUTION_TYPE_UNSPECIFIED = 0; - /** - * Used for Recommendations AI. - * - * Generated from protobuf enum SOLUTION_TYPE_RECOMMENDATION = 1; - */ - const SOLUTION_TYPE_RECOMMENDATION = 1; - /** - * Used for Retail Search. - * - * Generated from protobuf enum SOLUTION_TYPE_SEARCH = 2; - */ - const SOLUTION_TYPE_SEARCH = 2; - - private static $valueToName = [ - self::SOLUTION_TYPE_UNSPECIFIED => 'SOLUTION_TYPE_UNSPECIFIED', - self::SOLUTION_TYPE_RECOMMENDATION => 'SOLUTION_TYPE_RECOMMENDATION', - self::SOLUTION_TYPE_SEARCH => 'SOLUTION_TYPE_SEARCH', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php deleted file mode 100644 index cd96719b01d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/Tile.php +++ /dev/null @@ -1,144 +0,0 @@ -google.cloud.retail.v2.Tile - */ -class Tile extends \Google\Protobuf\Internal\Message -{ - /** - * The representative product id for this tile. - * - * Generated from protobuf field string representative_product_id = 3; - */ - protected $representative_product_id = ''; - protected $product_attribute; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value - * The product attribute key-value. - * @type \Google\Cloud\Retail\V2\ProductAttributeInterval $product_attribute_interval - * The product attribute key-numeric interval. - * @type string $representative_product_id - * The representative product id for this tile. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); - parent::__construct($data); - } - - /** - * The product attribute key-value. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null - */ - public function getProductAttributeValue() - { - return $this->readOneof(1); - } - - public function hasProductAttributeValue() - { - return $this->hasOneof(1); - } - - /** - * The product attribute key-value. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; - * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var - * @return $this - */ - public function setProductAttributeValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The product attribute key-numeric interval. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; - * @return \Google\Cloud\Retail\V2\ProductAttributeInterval|null - */ - public function getProductAttributeInterval() - { - return $this->readOneof(2); - } - - public function hasProductAttributeInterval() - { - return $this->hasOneof(2); - } - - /** - * The product attribute key-numeric interval. - * - * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; - * @param \Google\Cloud\Retail\V2\ProductAttributeInterval $var - * @return $this - */ - public function setProductAttributeInterval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeInterval::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The representative product id for this tile. - * - * Generated from protobuf field string representative_product_id = 3; - * @return string - */ - public function getRepresentativeProductId() - { - return $this->representative_product_id; - } - - /** - * The representative product id for this tile. - * - * Generated from protobuf field string representative_product_id = 3; - * @param string $var - * @return $this - */ - public function setRepresentativeProductId($var) - { - GPBUtil::checkString($var, True); - $this->representative_product_id = $var; - - return $this; - } - - /** - * @return string - */ - public function getProductAttribute() - { - return $this->whichOneof("product_attribute"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php deleted file mode 100644 index 05da2dddcdf..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.retail.v2.TuneModelMetadata - */ -class TuneModelMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the model that this tune applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - */ - protected $model = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $model - * The resource name of the model that this tune applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the model that this tune applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * The resource name of the model that this tune applies to. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string model = 1; - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php deleted file mode 100644 index 6c1ca5e1a04..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.retail.v2.TuneModelRequest - */ -class TuneModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the model to tune. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the model to tune. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * Please see {@see ModelServiceClient::modelName()} for help formatting this field. - * - * @return \Google\Cloud\Retail\V2\TuneModelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the model to tune. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the model to tune. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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. The resource name of the model to tune. - * Format: - * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_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/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php deleted file mode 100644 index 64f5b9a65e7..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/TuneModelResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.retail.v2.TuneModelResponse - */ -class TuneModelResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php deleted file mode 100644 index 777010a2401..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateAttributesConfigRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.retail.v2.UpdateAttributesConfigRequest - */ -class UpdateAttributesConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] - * to update. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $attributes_config = null; - /** - * Indicates which fields in the provided - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The - * following is the only supported field: - * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\AttributesConfig $attributesConfig Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] - * to update. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The - * following is the only supported field: - * - * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] - * - * If not set, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateAttributesConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\AttributesConfig $attributesConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setAttributesConfig($attributesConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\AttributesConfig $attributes_config - * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] - * to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The - * following is the only supported field: - * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] - * If not set, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] - * to update. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\AttributesConfig|null - */ - public function getAttributesConfig() - { - return $this->attributes_config; - } - - public function hasAttributesConfig() - { - return isset($this->attributes_config); - } - - public function clearAttributesConfig() - { - unset($this->attributes_config); - } - - /** - * Required. The [AttributesConfig][google.cloud.retail.v2.AttributesConfig] - * to update. - * - * Generated from protobuf field .google.cloud.retail.v2.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\AttributesConfig $var - * @return $this - */ - public function setAttributesConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\AttributesConfig::class); - $this->attributes_config = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The - * following is the only supported field: - * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] to update. The - * following is the only supported field: - * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2.AttributesConfig.catalog_attributes] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php deleted file mode 100644 index 413fc68b109..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCatalogRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.retail.v2.UpdateCatalogRequest - */ -class UpdateCatalogRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. - * If the caller does not have permission to update the - * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, - * a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog = null; - /** - * Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\Catalog $catalog Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. - * - * If the caller does not have permission to update the - * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, - * a NOT_FOUND error is returned. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. - * - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * @return \Google\Cloud\Retail\V2\UpdateCatalogRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\Catalog $catalog, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCatalog($catalog) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Catalog $catalog - * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. - * If the caller does not have permission to update the - * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, - * a NOT_FOUND error is returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. - * If the caller does not have permission to update the - * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, - * a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Catalog|null - */ - public function getCatalog() - { - return $this->catalog; - } - - public function hasCatalog() - { - return isset($this->catalog); - } - - public function clearCatalog() - { - unset($this->catalog); - } - - /** - * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. - * If the caller does not have permission to update the - * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, - * a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Catalog $var - * @return $this - */ - public function setCatalog($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Catalog::class); - $this->catalog = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php deleted file mode 100644 index 103bc34a0cd..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateCompletionConfigRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.retail.v2.UpdateCompletionConfigRequest - */ -class UpdateCompletionConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] - * to update. - * If the caller does not have permission to update the - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a - * PERMISSION_DENIED error is returned. - * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to - * update does not exist, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $completion_config = null; - /** - * Indicates which fields in the provided - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The - * following are the only supported fields: - * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] - * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] - * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] - * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\CompletionConfig $completionConfig Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] - * to update. - * - * If the caller does not have permission to update the - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a - * PERMISSION_DENIED error is returned. - * - * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to - * update does not exist, a NOT_FOUND error is returned. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The - * following are the only supported fields: - * - * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] - * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] - * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] - * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] - * - * If not set, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateCompletionConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\CompletionConfig $completionConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCompletionConfig($completionConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\CompletionConfig $completion_config - * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] - * to update. - * If the caller does not have permission to update the - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a - * PERMISSION_DENIED error is returned. - * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to - * update does not exist, a NOT_FOUND error is returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The - * following are the only supported fields: - * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] - * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] - * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] - * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] - * If not set, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] - * to update. - * If the caller does not have permission to update the - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a - * PERMISSION_DENIED error is returned. - * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to - * update does not exist, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\CompletionConfig|null - */ - public function getCompletionConfig() - { - return $this->completion_config; - } - - public function hasCompletionConfig() - { - return isset($this->completion_config); - } - - public function clearCompletionConfig() - { - unset($this->completion_config); - } - - /** - * Required. The [CompletionConfig][google.cloud.retail.v2.CompletionConfig] - * to update. - * If the caller does not have permission to update the - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a - * PERMISSION_DENIED error is returned. - * If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to - * update does not exist, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\CompletionConfig $var - * @return $this - */ - public function setCompletionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionConfig::class); - $this->completion_config = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The - * following are the only supported fields: - * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] - * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] - * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] - * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update. The - * following are the only supported fields: - * * [CompletionConfig.matching_order][google.cloud.retail.v2.CompletionConfig.matching_order] - * * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions] - * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2.CompletionConfig.min_prefix_length] - * * [CompletionConfig.auto_learning][google.cloud.retail.v2.CompletionConfig.auto_learning] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php deleted file mode 100644 index 9d1a0a5f155..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateControlRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.retail.v2.UpdateControlRequest - */ -class UpdateControlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Control to update. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $control = null; - /** - * Indicates which fields in the provided - * [Control][google.cloud.retail.v2.Control] to update. The following are NOT - * supported: - * * [Control.name][google.cloud.retail.v2.Control.name] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\Control $control Required. The Control to update. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [Control][google.cloud.retail.v2.Control] to update. The following are NOT - * supported: - * - * * [Control.name][google.cloud.retail.v2.Control.name] - * - * If not set or empty, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateControlRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\Control $control, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setControl($control) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Control $control - * Required. The Control to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [Control][google.cloud.retail.v2.Control] to update. The following are NOT - * supported: - * * [Control.name][google.cloud.retail.v2.Control.name] - * If not set or empty, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ControlService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Control to update. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Control|null - */ - public function getControl() - { - return $this->control; - } - - public function hasControl() - { - return isset($this->control); - } - - public function clearControl() - { - unset($this->control); - } - - /** - * Required. The Control to update. - * - * Generated from protobuf field .google.cloud.retail.v2.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Control $var - * @return $this - */ - public function setControl($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Control::class); - $this->control = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [Control][google.cloud.retail.v2.Control] to update. The following are NOT - * supported: - * * [Control.name][google.cloud.retail.v2.Control.name] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [Control][google.cloud.retail.v2.Control] to update. The following are NOT - * supported: - * * [Control.name][google.cloud.retail.v2.Control.name] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php deleted file mode 100644 index 63d052fd032..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionConfigRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest - */ -class UpdateGenerativeQuestionConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The question to update. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $generative_question_config = null; - /** - * Optional. Indicates which fields in the provided - * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] - * to update. The following are NOT supported: - * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig Required. The question to update. - * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided - * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] - * to update. The following are NOT supported: - * - * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] - * - * If not set or empty, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setGenerativeQuestionConfig($generativeQuestionConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generative_question_config - * Required. The question to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Indicates which fields in the provided - * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] - * to update. The following are NOT supported: - * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] - * If not set or empty, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The question to update. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\GenerativeQuestionConfig|null - */ - public function getGenerativeQuestionConfig() - { - return $this->generative_question_config; - } - - public function hasGenerativeQuestionConfig() - { - return isset($this->generative_question_config); - } - - public function clearGenerativeQuestionConfig() - { - unset($this->generative_question_config); - } - - /** - * Required. The question to update. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $var - * @return $this - */ - public function setGenerativeQuestionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); - $this->generative_question_config = $var; - - return $this; - } - - /** - * Optional. Indicates which fields in the provided - * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] - * to update. The following are NOT supported: - * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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 - * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] - * to update. The following are NOT supported: - * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] - * If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php deleted file mode 100644 index 29dfb439aa9..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest - */ -class UpdateGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The configuration managing the feature state. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $generative_questions_feature_config = null; - /** - * Optional. Indicates which fields in the provided - * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] - * to update. If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig Required. The configuration managing the feature state. - * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided - * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] - * to update. If not set or empty, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionsFeatureConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generative_questions_feature_config - * Required. The configuration managing the feature state. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Indicates which fields in the provided - * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] - * to update. If not set or empty, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The configuration managing the feature state. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig|null - */ - public function getGenerativeQuestionsFeatureConfig() - { - return $this->generative_questions_feature_config; - } - - public function hasGenerativeQuestionsFeatureConfig() - { - return isset($this->generative_questions_feature_config); - } - - public function clearGenerativeQuestionsFeatureConfig() - { - unset($this->generative_questions_feature_config); - } - - /** - * Required. The configuration managing the feature state. - * - * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $var - * @return $this - */ - public function setGenerativeQuestionsFeatureConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig::class); - $this->generative_questions_feature_config = $var; - - return $this; - } - - /** - * Optional. Indicates which fields in the provided - * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] - * to update. If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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 - * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] - * to update. If not set or empty, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php deleted file mode 100644 index ad11b0cfb1a..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateModelRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.retail.v2.UpdateModelRequest - */ -class UpdateModelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $model = null; - /** - * Optional. Indicates which fields in the provided 'model' to - * update. If not set, by default updates all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\Model $model Required. The body of the updated [Model][google.cloud.retail.v2.Model]. - * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided 'model' to - * update. If not set, by default updates all fields. - * - * @return \Google\Cloud\Retail\V2\UpdateModelRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\Model $model, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setModel($model) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Model $model - * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Indicates which fields in the provided 'model' to - * update. If not set, by default updates all fields. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Model|null - */ - public function getModel() - { - return $this->model; - } - - public function hasModel() - { - return isset($this->model); - } - - public function clearModel() - { - unset($this->model); - } - - /** - * Required. The body of the updated [Model][google.cloud.retail.v2.Model]. - * - * Generated from protobuf field .google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Model $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model::class); - $this->model = $var; - - return $this; - } - - /** - * Optional. Indicates which fields in the provided 'model' to - * update. If not set, by default updates all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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 'model' to - * update. If not set, by default updates all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php deleted file mode 100644 index 11f3ba45059..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateProductRequest.php +++ /dev/null @@ -1,264 +0,0 @@ -google.cloud.retail.v2.UpdateProductRequest - */ -class UpdateProductRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The product to update/create. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist - * and - * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] - * is not set, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $product = null; - /** - * Indicates which fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. The immutable and - * output only fields are NOT supported. If not set, all supported fields (the - * fields that are neither immutable nor output only) are updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * The attribute key can be updated by setting the mask path as - * "attributes.${key_name}". If a key name is present in the mask but not in - * the patching product from the request, this key will be deleted after the - * update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, a new [Product][google.cloud.retail.v2.Product] will be created. In - * this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\Retail\V2\Product $product Required. The product to update/create. - * - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * - * If the [Product][google.cloud.retail.v2.Product] to update does not exist - * and - * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] - * is not set, a NOT_FOUND error is returned. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. The immutable and - * output only fields are NOT supported. If not set, all supported fields (the - * fields that are neither immutable nor output only) are updated. - * - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * - * The attribute key can be updated by setting the mask path as - * "attributes.${key_name}". If a key name is present in the mask but not in - * the patching product from the request, this key will be deleted after the - * update. - * - * @return \Google\Cloud\Retail\V2\UpdateProductRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\Product $product, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setProduct($product) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\Product $product - * Required. The product to update/create. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist - * and - * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] - * is not set, a NOT_FOUND error is returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. The immutable and - * output only fields are NOT supported. If not set, all supported fields (the - * fields that are neither immutable nor output only) are updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * The attribute key can be updated by setting the mask path as - * "attributes.${key_name}". If a key name is present in the mask but not in - * the patching product from the request, this key will be deleted after the - * update. - * @type bool $allow_missing - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, a new [Product][google.cloud.retail.v2.Product] will be created. In - * this situation, `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The product to update/create. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist - * and - * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] - * is not set, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\Product|null - */ - public function getProduct() - { - return $this->product; - } - - public function hasProduct() - { - return isset($this->product); - } - - public function clearProduct() - { - unset($this->product); - } - - /** - * Required. The product to update/create. - * If the caller does not have permission to update the - * [Product][google.cloud.retail.v2.Product], regardless of whether or not it - * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist - * and - * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] - * is not set, a NOT_FOUND error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\Product $var - * @return $this - */ - public function setProduct($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Product::class); - $this->product = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. The immutable and - * output only fields are NOT supported. If not set, all supported fields (the - * fields that are neither immutable nor output only) are updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * The attribute key can be updated by setting the mask path as - * "attributes.${key_name}". If a key name is present in the mask but not in - * the patching product from the request, this key will be deleted after the - * update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [Product][google.cloud.retail.v2.Product] to update. The immutable and - * output only fields are NOT supported. If not set, all supported fields (the - * fields that are neither immutable nor output only) are updated. - * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - * is returned. - * The attribute key can be updated by setting the mask path as - * "attributes.${key_name}". If a key name is present in the mask but not in - * the patching product from the request, this key will be deleted after the - * update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, a new [Product][google.cloud.retail.v2.Product] will be created. In - * this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the [Product][google.cloud.retail.v2.Product] is not - * found, a new [Product][google.cloud.retail.v2.Product] will be created. In - * this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php deleted file mode 100644 index 62d43192355..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UpdateServingConfigRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.retail.v2.UpdateServingConfigRequest - */ -class UpdateServingConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ServingConfig to update. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $serving_config = null; - /** - * Indicates which fields in the provided - * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The - * following are NOT supported: - * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Retail\V2\ServingConfig $servingConfig Required. The ServingConfig to update. - * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided - * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The - * following are NOT supported: - * - * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] - * - * If not set, all supported fields are updated. - * - * @return \Google\Cloud\Retail\V2\UpdateServingConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Retail\V2\ServingConfig $servingConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setServingConfig($servingConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\ServingConfig $serving_config - * Required. The ServingConfig to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Indicates which fields in the provided - * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The - * following are NOT supported: - * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] - * If not set, all supported fields are updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ServingConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ServingConfig to update. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\ServingConfig|null - */ - public function getServingConfig() - { - return $this->serving_config; - } - - public function hasServingConfig() - { - return isset($this->serving_config); - } - - public function clearServingConfig() - { - unset($this->serving_config); - } - - /** - * Required. The ServingConfig to update. - * - * Generated from protobuf field .google.cloud.retail.v2.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\ServingConfig $var - * @return $this - */ - public function setServingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ServingConfig::class); - $this->serving_config = $var; - - return $this; - } - - /** - * Indicates which fields in the provided - * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The - * following are NOT supported: - * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Indicates which fields in the provided - * [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The - * following are NOT supported: - * * [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name] - * If not set, all supported fields are updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php deleted file mode 100644 index 40d8e34803c..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEvent.php +++ /dev/null @@ -1,1360 +0,0 @@ -google.cloud.retail.v2.UserEvent - */ -class UserEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Required. User event type. Allowed values are: - * * `add-to-cart`: Products being added to cart. - * * `remove-from-cart`: Products being removed from cart. - * * `category-page-view`: Special pages such as sale or promotion pages - * viewed. - * * `detail-page-view`: Products detail page viewed. - * * `home-page-view`: Homepage viewed. - * * `promotion-offered`: Promotion is offered to a user. - * * `promotion-not-offered`: Promotion is not offered to a user. - * * `purchase-complete`: User finishing a purchase. - * * `search`: Product search. - * * `shopping-cart-page-view`: User viewing a shopping cart. - * - * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $event_type = ''; - /** - * Required. A unique identifier for tracking visitors. - * For example, this could be implemented with an 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. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - * - * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $visitor_id = ''; - /** - * A unique identifier for tracking a visitor session with a length limit of - * 128 bytes. A session is an aggregation of an end user behavior in a time - * span. - * A general guideline to populate the sesion_id: - * 1. If user has no activity for 30 min, a new session_id should be assigned. - * 2. The session_id should be unique across users, suggest use uuid or add - * visitor_id as prefix. - * - * Generated from protobuf field string session_id = 21; - */ - protected $session_id = ''; - /** - * Only required for - * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] - * method. Timestamp of when the user event happened. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; - */ - protected $event_time = null; - /** - * 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 Retail API, using different - * recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 4; - */ - private $experiment_ids; - /** - * Highly recommended for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * This field enables accurate attribution of recommendation model - * performance. - * The value must be a valid - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * The value must be a valid - * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * for user events that are the result of - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased product. If user clicks on product K in the - * recommendation results, pass - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * as a URL parameter to product K's page. When recording events on product - * K's page, log the - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * to this field. - * - * Generated from protobuf field string attribution_token = 5; - */ - protected $attribution_token = ''; - /** - * The main product details related to the event. - * This field is optional except for the following event types: - * * `add-to-cart` - * * `detail-page-view` - * * `purchase-complete` - * In a `search` event, this field represents the products returned to the end - * user on the current page (the end user may have not finished browsing the - * whole page yet). When a new page is returned to the end user, after - * pagination/filtering/ordering even for the same query, a new `search` event - * with different - * [product_details][google.cloud.retail.v2.UserEvent.product_details] is - * desired. The end user may have not finished browsing the whole page yet. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; - */ - private $product_details; - /** - * The main auto-completion details related to the event. - * This field should be set for `search` event when autocomplete function is - * enabled and the user clicks a suggestion for search. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; - */ - protected $completion_detail = null; - /** - * Extra user event features to include in the recommendation model. - * If you provide custom attributes for ingested user events, also include - * them in the user events that you associate with prediction requests. Custom - * attribute formatting must be consistent between imported events and events - * provided with prediction requests. This lets the Retail API use - * those custom attributes when training models and serving predictions, which - * helps improve recommendation quality. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a UTF-8 encoded string with a length limit of - * 256 characters. - * * For number attributes, at most 400 values are allowed. - * For product recommendations, an example of extra user information is - * traffic_channel, which is how a user arrives at the site. Users can arrive - * at the site by coming to the site directly, coming through Google - * search, or in other ways. - * - * Generated from protobuf field map attributes = 7; - */ - private $attributes; - /** - * 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`, `purchase-complete`, or - * `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 8; - */ - protected $cart_id = ''; - /** - * A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; - */ - protected $purchase_transaction = null; - /** - * The user's search query. - * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for - * definition. - * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string search_query = 10; - */ - protected $search_query = ''; - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string filter = 16; - */ - protected $filter = ''; - /** - * The order in which products are returned. - * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] - * for definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string order_by = 17; - */ - protected $order_by = ''; - /** - * An integer that specifies the current offset for pagination (the 0-indexed - * starting location, amongst the products deemed by the API as relevant). - * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for - * definition. - * If this field is negative, an INVALID_ARGUMENT is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 offset = 18; - */ - protected $offset = 0; - /** - * The categories associated with a category page. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string page_categories = 11; - */ - private $page_categories; - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; - */ - protected $user_info = null; - /** - * Complete URL (window.location.href) of the user's current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. Maximum length 5,000 - * characters. - * - * Generated from protobuf field string uri = 13; - */ - protected $uri = ''; - /** - * The referrer URL of the current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 14; - */ - protected $referrer_uri = ''; - /** - * 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. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string page_view_id = 15; - */ - protected $page_view_id = ''; - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * We recommend that you set this field to get better per-entity search, - * completion, and prediction results. - * - * Generated from protobuf field string entity = 23; - */ - protected $entity = ''; - - /** - * 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. - * * `remove-from-cart`: Products being removed from cart. - * * `category-page-view`: Special pages such as sale or promotion pages - * viewed. - * * `detail-page-view`: Products detail page viewed. - * * `home-page-view`: Homepage viewed. - * * `promotion-offered`: Promotion is offered to a user. - * * `promotion-not-offered`: Promotion is not offered to a user. - * * `purchase-complete`: User finishing a purchase. - * * `search`: Product search. - * * `shopping-cart-page-view`: User viewing a shopping cart. - * @type string $visitor_id - * Required. A unique identifier for tracking visitors. - * For example, this could be implemented with an 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. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - * @type string $session_id - * A unique identifier for tracking a visitor session with a length limit of - * 128 bytes. A session is an aggregation of an end user behavior in a time - * span. - * A general guideline to populate the sesion_id: - * 1. If user has no activity for 30 min, a new session_id should be assigned. - * 2. The session_id should be unique across users, suggest use uuid or add - * visitor_id as prefix. - * @type \Google\Protobuf\Timestamp $event_time - * Only required for - * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] - * method. Timestamp of when the user event happened. - * @type array|\Google\Protobuf\Internal\RepeatedField $experiment_ids - * 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 Retail API, using different - * recommendation models). - * @type string $attribution_token - * Highly recommended for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * This field enables accurate attribution of recommendation model - * performance. - * The value must be a valid - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * The value must be a valid - * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * for user events that are the result of - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased product. If user clicks on product K in the - * recommendation results, pass - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * as a URL parameter to product K's page. When recording events on product - * K's page, log the - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * to this field. - * @type array<\Google\Cloud\Retail\V2\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $product_details - * The main product details related to the event. - * This field is optional except for the following event types: - * * `add-to-cart` - * * `detail-page-view` - * * `purchase-complete` - * In a `search` event, this field represents the products returned to the end - * user on the current page (the end user may have not finished browsing the - * whole page yet). When a new page is returned to the end user, after - * pagination/filtering/ordering even for the same query, a new `search` event - * with different - * [product_details][google.cloud.retail.v2.UserEvent.product_details] is - * desired. The end user may have not finished browsing the whole page yet. - * @type \Google\Cloud\Retail\V2\CompletionDetail $completion_detail - * The main auto-completion details related to the event. - * This field should be set for `search` event when autocomplete function is - * enabled and the user clicks a suggestion for search. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Extra user event features to include in the recommendation model. - * If you provide custom attributes for ingested user events, also include - * them in the user events that you associate with prediction requests. Custom - * attribute formatting must be consistent between imported events and events - * provided with prediction requests. This lets the Retail API use - * those custom attributes when training models and serving predictions, which - * helps improve recommendation quality. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a UTF-8 encoded string with a length limit of - * 256 characters. - * * For number attributes, at most 400 values are allowed. - * For product recommendations, an example of extra user information is - * traffic_channel, which is how a user arrives at the site. Users can arrive - * at the site by coming to the site directly, coming through Google - * search, or in other ways. - * @type string $cart_id - * 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`, `purchase-complete`, or - * `shopping-cart-page-view` events. - * @type \Google\Cloud\Retail\V2\PurchaseTransaction $purchase_transaction - * A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $search_query - * The user's search query. - * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for - * definition. - * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $filter - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $order_by - * The order in which products are returned. - * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] - * for definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * @type int $offset - * An integer that specifies the current offset for pagination (the 0-indexed - * starting location, amongst the products deemed by the API as relevant). - * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for - * definition. - * If this field is negative, an INVALID_ARGUMENT is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories - * The categories associated with a category page. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * @type \Google\Cloud\Retail\V2\UserInfo $user_info - * User information. - * @type string $uri - * Complete URL (window.location.href) of the user's current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. Maximum length 5,000 - * characters. - * @type string $referrer_uri - * The referrer URL of the current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * @type string $page_view_id - * 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. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * @type string $entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * We recommend that you set this field to get better per-entity search, - * completion, and prediction results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required. User event type. Allowed values are: - * * `add-to-cart`: Products being added to cart. - * * `remove-from-cart`: Products being removed from cart. - * * `category-page-view`: Special pages such as sale or promotion pages - * viewed. - * * `detail-page-view`: Products detail page viewed. - * * `home-page-view`: Homepage viewed. - * * `promotion-offered`: Promotion is offered to a user. - * * `promotion-not-offered`: Promotion is not offered to a user. - * * `purchase-complete`: User finishing a purchase. - * * `search`: Product search. - * * `shopping-cart-page-view`: User viewing a shopping cart. - * - * 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. - * * `remove-from-cart`: Products being removed from cart. - * * `category-page-view`: Special pages such as sale or promotion pages - * viewed. - * * `detail-page-view`: Products detail page viewed. - * * `home-page-view`: Homepage viewed. - * * `promotion-offered`: Promotion is offered to a user. - * * `promotion-not-offered`: Promotion is not offered to a user. - * * `purchase-complete`: User finishing a purchase. - * * `search`: Product search. - * * `shopping-cart-page-view`: User viewing a shopping cart. - * - * 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. A unique identifier for tracking visitors. - * For example, this could be implemented with an 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. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - * - * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVisitorId() - { - return $this->visitor_id; - } - - /** - * Required. A unique identifier for tracking visitors. - * For example, this could be implemented with an 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. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - * - * Generated from protobuf field string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVisitorId($var) - { - GPBUtil::checkString($var, True); - $this->visitor_id = $var; - - return $this; - } - - /** - * A unique identifier for tracking a visitor session with a length limit of - * 128 bytes. A session is an aggregation of an end user behavior in a time - * span. - * A general guideline to populate the sesion_id: - * 1. If user has no activity for 30 min, a new session_id should be assigned. - * 2. The session_id should be unique across users, suggest use uuid or add - * visitor_id as prefix. - * - * Generated from protobuf field string session_id = 21; - * @return string - */ - public function getSessionId() - { - return $this->session_id; - } - - /** - * A unique identifier for tracking a visitor session with a length limit of - * 128 bytes. A session is an aggregation of an end user behavior in a time - * span. - * A general guideline to populate the sesion_id: - * 1. If user has no activity for 30 min, a new session_id should be assigned. - * 2. The session_id should be unique across users, suggest use uuid or add - * visitor_id as prefix. - * - * Generated from protobuf field string session_id = 21; - * @param string $var - * @return $this - */ - public function setSessionId($var) - { - GPBUtil::checkString($var, True); - $this->session_id = $var; - - return $this; - } - - /** - * Only required for - * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] - * method. Timestamp of when the user event happened. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; - * @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); - } - - /** - * Only required for - * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] - * method. Timestamp of when the user event happened. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->event_time = $var; - - return $this; - } - - /** - * 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 Retail API, using different - * recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExperimentIds() - { - return $this->experiment_ids; - } - - /** - * 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 Retail API, using different - * recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 4; - * @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; - } - - /** - * Highly recommended for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * This field enables accurate attribution of recommendation model - * performance. - * The value must be a valid - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * The value must be a valid - * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * for user events that are the result of - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased product. If user clicks on product K in the - * recommendation results, pass - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * as a URL parameter to product K's page. When recording events on product - * K's page, log the - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * to this field. - * - * Generated from protobuf field string attribution_token = 5; - * @return string - */ - public function getAttributionToken() - { - return $this->attribution_token; - } - - /** - * Highly recommended for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * This field enables accurate attribution of recommendation model - * performance. - * The value must be a valid - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * for user events that are the result of - * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. - * The value must be a valid - * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] - * for user events that are the result of - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased product. If user clicks on product K in the - * recommendation results, pass - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * as a URL parameter to product K's page. When recording events on product - * K's page, log the - * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] - * to this field. - * - * Generated from protobuf field string attribution_token = 5; - * @param string $var - * @return $this - */ - public function setAttributionToken($var) - { - GPBUtil::checkString($var, True); - $this->attribution_token = $var; - - return $this; - } - - /** - * The main product details related to the event. - * This field is optional except for the following event types: - * * `add-to-cart` - * * `detail-page-view` - * * `purchase-complete` - * In a `search` event, this field represents the products returned to the end - * user on the current page (the end user may have not finished browsing the - * whole page yet). When a new page is returned to the end user, after - * pagination/filtering/ordering even for the same query, a new `search` event - * with different - * [product_details][google.cloud.retail.v2.UserEvent.product_details] is - * desired. The end user may have not finished browsing the whole page yet. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProductDetails() - { - return $this->product_details; - } - - /** - * The main product details related to the event. - * This field is optional except for the following event types: - * * `add-to-cart` - * * `detail-page-view` - * * `purchase-complete` - * In a `search` event, this field represents the products returned to the end - * user on the current page (the end user may have not finished browsing the - * whole page yet). When a new page is returned to the end user, after - * pagination/filtering/ordering even for the same query, a new `search` event - * with different - * [product_details][google.cloud.retail.v2.UserEvent.product_details] is - * desired. The end user may have not finished browsing the whole page yet. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.ProductDetail product_details = 6; - * @param array<\Google\Cloud\Retail\V2\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProductDetails($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ProductDetail::class); - $this->product_details = $arr; - - return $this; - } - - /** - * The main auto-completion details related to the event. - * This field should be set for `search` event when autocomplete function is - * enabled and the user clicks a suggestion for search. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; - * @return \Google\Cloud\Retail\V2\CompletionDetail|null - */ - public function getCompletionDetail() - { - return $this->completion_detail; - } - - public function hasCompletionDetail() - { - return isset($this->completion_detail); - } - - public function clearCompletionDetail() - { - unset($this->completion_detail); - } - - /** - * The main auto-completion details related to the event. - * This field should be set for `search` event when autocomplete function is - * enabled and the user clicks a suggestion for search. - * - * Generated from protobuf field .google.cloud.retail.v2.CompletionDetail completion_detail = 22; - * @param \Google\Cloud\Retail\V2\CompletionDetail $var - * @return $this - */ - public function setCompletionDetail($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CompletionDetail::class); - $this->completion_detail = $var; - - return $this; - } - - /** - * Extra user event features to include in the recommendation model. - * If you provide custom attributes for ingested user events, also include - * them in the user events that you associate with prediction requests. Custom - * attribute formatting must be consistent between imported events and events - * provided with prediction requests. This lets the Retail API use - * those custom attributes when training models and serving predictions, which - * helps improve recommendation quality. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a UTF-8 encoded string with a length limit of - * 256 characters. - * * For number attributes, at most 400 values are allowed. - * For product recommendations, an example of extra user information is - * traffic_channel, which is how a user arrives at the site. Users can arrive - * at the site by coming to the site directly, coming through Google - * search, or in other ways. - * - * Generated from protobuf field map attributes = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Extra user event features to include in the recommendation model. - * If you provide custom attributes for ingested user events, also include - * them in the user events that you associate with prediction requests. Custom - * attribute formatting must be consistent between imported events and events - * provided with prediction requests. This lets the Retail API use - * those custom attributes when training models and serving predictions, which - * helps improve recommendation quality. - * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - * error is returned: - * * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. - * * For text attributes, at most 400 values are allowed. Empty values are not - * allowed. Each value must be a UTF-8 encoded string with a length limit of - * 256 characters. - * * For number attributes, at most 400 values are allowed. - * For product recommendations, an example of extra user information is - * traffic_channel, which is how a user arrives at the site. Users can arrive - * at the site by coming to the site directly, coming through Google - * search, or in other ways. - * - * Generated from protobuf field map attributes = 7; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CustomAttribute::class); - $this->attributes = $arr; - - return $this; - } - - /** - * 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`, `purchase-complete`, or - * `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 8; - * @return string - */ - public function getCartId() - { - return $this->cart_id; - } - - /** - * 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`, `purchase-complete`, or - * `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 8; - * @param string $var - * @return $this - */ - public function setCartId($var) - { - GPBUtil::checkString($var, True); - $this->cart_id = $var; - - return $this; - } - - /** - * A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; - * @return \Google\Cloud\Retail\V2\PurchaseTransaction|null - */ - public function getPurchaseTransaction() - { - return $this->purchase_transaction; - } - - public function hasPurchaseTransaction() - { - return isset($this->purchase_transaction); - } - - public function clearPurchaseTransaction() - { - unset($this->purchase_transaction); - } - - /** - * A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field .google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9; - * @param \Google\Cloud\Retail\V2\PurchaseTransaction $var - * @return $this - */ - public function setPurchaseTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\PurchaseTransaction::class); - $this->purchase_transaction = $var; - - return $this; - } - - /** - * The user's search query. - * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for - * definition. - * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string search_query = 10; - * @return string - */ - public function getSearchQuery() - { - return $this->search_query; - } - - /** - * The user's search query. - * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for - * definition. - * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string search_query = 10; - * @param string $var - * @return $this - */ - public function setSearchQuery($var) - { - GPBUtil::checkString($var, True); - $this->search_query = $var; - - return $this; - } - - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string filter = 16; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The filter syntax consists of an expression language for constructing a - * predicate from one or more fields of the products being filtered. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string filter = 16; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The order in which products are returned. - * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] - * for definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string order_by = 17; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The order in which products are returned. - * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] - * for definition and syntax. - * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string order_by = 17; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - - /** - * An integer that specifies the current offset for pagination (the 0-indexed - * starting location, amongst the products deemed by the API as relevant). - * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for - * definition. - * If this field is negative, an INVALID_ARGUMENT is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 offset = 18; - * @return int - */ - public function getOffset() - { - return $this->offset; - } - - /** - * An integer that specifies the current offset for pagination (the 0-indexed - * starting location, amongst the products deemed by the API as relevant). - * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for - * definition. - * If this field is negative, an INVALID_ARGUMENT is returned. - * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field int32 offset = 18; - * @param int $var - * @return $this - */ - public function setOffset($var) - { - GPBUtil::checkInt32($var); - $this->offset = $var; - - return $this; - } - - /** - * The categories associated with a category page. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string page_categories = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageCategories() - { - return $this->page_categories; - } - - /** - * The categories associated with a category page. - * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, replace it with - * other character(s). - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. At least one of - * [search_query][google.cloud.retail.v2.UserEvent.search_query] or - * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is - * required for `search` events. Other event types should not set this field. - * Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field repeated string page_categories = 11; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageCategories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->page_categories = $arr; - - return $this; - } - - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; - * @return \Google\Cloud\Retail\V2\UserInfo|null - */ - public function getUserInfo() - { - return $this->user_info; - } - - public function hasUserInfo() - { - return isset($this->user_info); - } - - public function clearUserInfo() - { - unset($this->user_info); - } - - /** - * User information. - * - * Generated from protobuf field .google.cloud.retail.v2.UserInfo user_info = 12; - * @param \Google\Cloud\Retail\V2\UserInfo $var - * @return $this - */ - public function setUserInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserInfo::class); - $this->user_info = $var; - - return $this; - } - - /** - * Complete URL (window.location.href) of the user's current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. Maximum length 5,000 - * characters. - * - * Generated from protobuf field string uri = 13; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Complete URL (window.location.href) of the user's current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. Maximum length 5,000 - * characters. - * - * Generated from protobuf field string uri = 13; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The referrer URL of the current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 14; - * @return string - */ - public function getReferrerUri() - { - return $this->referrer_uri; - } - - /** - * The referrer URL of the current page. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 14; - * @param string $var - * @return $this - */ - public function setReferrerUri($var) - { - GPBUtil::checkString($var, True); - $this->referrer_uri = $var; - - return $this; - } - - /** - * 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. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string page_view_id = 15; - * @return string - */ - public function getPageViewId() - { - return $this->page_view_id; - } - - /** - * 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. - * When using the client side event reporting with JavaScript pixel and Google - * Tag Manager, this value is filled in automatically. - * - * Generated from protobuf field string page_view_id = 15; - * @param string $var - * @return $this - */ - public function setPageViewId($var) - { - GPBUtil::checkString($var, True); - $this->page_view_id = $var; - - return $this; - } - - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * We recommend that you set this field to get better per-entity search, - * completion, and prediction results. - * - * Generated from protobuf field string entity = 23; - * @return string - */ - public function getEntity() - { - return $this->entity; - } - - /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - * `google.com`, `youtube.com`, etc. - * We recommend that you set this field to get better per-entity search, - * completion, and prediction results. - * - * Generated from protobuf field string entity = 23; - * @param string $var - * @return $this - */ - public function setEntity($var) - { - GPBUtil::checkString($var, True); - $this->entity = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php deleted file mode 100644 index eaad6ecb75f..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventImportSummary.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.retail.v2.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\Retail\V2\ImportConfig::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/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php deleted file mode 100644 index ea0c781ba6d..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInlineSource.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.retail.v2.UserEventInlineSource - */ -class UserEventInlineSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $user_events; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Retail\V2\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events - * Required. A list of user events to import. Recommended max of 10k items. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUserEvents() - { - return $this->user_events; - } - - /** - * Required. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.retail.v2.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Retail\V2\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUserEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UserEvent::class); - $this->user_events = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php deleted file mode 100644 index 37beacfc140..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserEventInputConfig.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.retail.v2.UserEventInputConfig - */ -class UserEventInputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Retail\V2\UserEventInlineSource $user_event_inline_source - * Required. The Inline source for the input content for UserEvents. - * @type \Google\Cloud\Retail\V2\GcsSource $gcs_source - * Required. Google Cloud Storage location for the input content. - * @type \Google\Cloud\Retail\V2\BigQuerySource $big_query_source - * Required. BigQuery input source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Inline source for the input content for UserEvents. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\UserEventInlineSource|null - */ - public function getUserEventInlineSource() - { - return $this->readOneof(1); - } - - public function hasUserEventInlineSource() - { - return $this->hasOneof(1); - } - - /** - * Required. The Inline source for the input content for UserEvents. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\UserEventInlineSource $var - * @return $this - */ - public function setUserEventInlineSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEventInlineSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Required. Google Cloud Storage location for the input content. - * - * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\GcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Required. Google Cloud Storage location for the input content. - * - * Generated from protobuf field .google.cloud.retail.v2.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\GcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. BigQuery input source. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\BigQuerySource|null - */ - public function getBigQuerySource() - { - return $this->readOneof(3); - } - - public function hasBigQuerySource() - { - return $this->hasOneof(3); - } - - /** - * Required. BigQuery input source. - * - * Generated from protobuf field .google.cloud.retail.v2.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\BigQuerySource $var - * @return $this - */ - public function setBigQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\BigQuerySource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php deleted file mode 100644 index eab5a74504b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/UserInfo.php +++ /dev/null @@ -1,309 +0,0 @@ -google.cloud.retail.v2.UserInfo - */ -class UserInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Highly recommended for logged-in users. Unique identifier for logged-in - * user, such as a user name. Don't set for anonymous users. - * Always use a hashed value for this ID. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded - * model quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string user_id = 1; - */ - protected $user_id = ''; - /** - * The end user's IP address. This field is used to extract location - * information for personalization. - * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 - * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - * INVALID_ARGUMENT error is returned. - * This should not be set when: - * * setting - * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. - * * using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string ip_address = 2; - */ - protected $ip_address = ''; - /** - * User agent as included in the HTTP header. Required for getting - * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. - * The field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This should not be set when using the client side event reporting with - * GTM or JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string user_agent = 3; - */ - protected $user_agent = ''; - /** - * True if the request is made directly from the end user, in which case the - * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and - * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated - * from the HTTP request. 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). - * This should not be set when using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. - * - * Generated from protobuf field bool direct_user_request = 4; - */ - protected $direct_user_request = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $user_id - * Highly recommended for logged-in users. Unique identifier for logged-in - * user, such as a user name. Don't set for anonymous users. - * Always use a hashed value for this ID. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded - * model quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * @type string $ip_address - * The end user's IP address. This field is used to extract location - * information for personalization. - * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 - * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - * INVALID_ARGUMENT error is returned. - * This should not be set when: - * * setting - * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. - * * using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * @type string $user_agent - * User agent as included in the HTTP header. Required for getting - * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. - * The field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This should not be set when using the client side event reporting with - * GTM or JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * @type bool $direct_user_request - * True if the request is made directly from the end user, in which case the - * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and - * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated - * from the HTTP request. 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). - * This should not be set when using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); - parent::__construct($data); - } - - /** - * Highly recommended for logged-in users. Unique identifier for logged-in - * user, such as a user name. Don't set for anonymous users. - * Always use a hashed value for this ID. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded - * model quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string user_id = 1; - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Highly recommended for logged-in users. Unique identifier for logged-in - * user, such as a user name. Don't set for anonymous users. - * Always use a hashed value for this ID. - * Don't set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded - * model quality. - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * - * Generated from protobuf field string user_id = 1; - * @param string $var - * @return $this - */ - public function setUserId($var) - { - GPBUtil::checkString($var, True); - $this->user_id = $var; - - return $this; - } - - /** - * The end user's IP address. This field is used to extract location - * information for personalization. - * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 - * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - * INVALID_ARGUMENT error is returned. - * This should not be set when: - * * setting - * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. - * * using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string ip_address = 2; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * The end user's IP address. This field is used to extract location - * information for personalization. - * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 - * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - * INVALID_ARGUMENT error is returned. - * This should not be set when: - * * setting - * [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. - * * using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string ip_address = 2; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * User agent as included in the HTTP header. Required for getting - * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. - * The field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This should not be set when using the client side event reporting with - * GTM or JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string user_agent = 3; - * @return string - */ - public function getUserAgent() - { - return $this->user_agent; - } - - /** - * User agent as included in the HTTP header. Required for getting - * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. - * The field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. - * This should not be set when using the client side event reporting with - * GTM or JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] - * or if - * [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] - * is set. - * - * Generated from protobuf field string user_agent = 3; - * @param string $var - * @return $this - */ - public function setUserAgent($var) - { - GPBUtil::checkString($var, True); - $this->user_agent = $var; - - return $this; - } - - /** - * True if the request is made directly from the end user, in which case the - * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and - * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated - * from the HTTP request. 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). - * This should not be set when using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. - * - * Generated from protobuf field bool direct_user_request = 4; - * @return bool - */ - public function getDirectUserRequest() - { - return $this->direct_user_request; - } - - /** - * True if the request is made directly from the end user, in which case the - * [ip_address][google.cloud.retail.v2.UserInfo.ip_address] and - * [user_agent][google.cloud.retail.v2.UserInfo.user_agent] can be populated - * from the HTTP request. 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). - * This should not be set when using the JavaScript tag in - * [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent]. - * - * Generated from protobuf field bool direct_user_request = 4; - * @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/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php b/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php deleted file mode 100644 index 215b199d55b..00000000000 --- a/owl-bot-staging/Retail/v2/proto/src/Google/Cloud/Retail/V2/WriteUserEventRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.retail.v2.WriteUserEventRequest - */ -class WriteUserEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. User event to write. - * - * Generated from protobuf field .google.cloud.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = null; - /** - * If set to true, the user event will be written asynchronously after - * validation, and the API will respond without waiting for the write. - * Therefore, silent failures can occur even if the API returns success. In - * case of silent failures, error messages can be found in Stackdriver logs. - * - * Generated from protobuf field bool write_async = 3; - */ - protected $write_async = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * @type \Google\Cloud\Retail\V2\UserEvent $user_event - * Required. User event to write. - * @type bool $write_async - * If set to true, the user event will be written asynchronously after - * validation, and the API will respond without waiting for the write. - * Therefore, silent failures can occur even if the API returns success. In - * case of silent failures, error messages can be found in Stackdriver logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Retail\V2\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent catalog resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @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.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Retail\V2\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.retail.v2.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Retail\V2\UserEvent $var - * @return $this - */ - public function setUserEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\UserEvent::class); - $this->user_event = $var; - - return $this; - } - - /** - * If set to true, the user event will be written asynchronously after - * validation, and the API will respond without waiting for the write. - * Therefore, silent failures can occur even if the API returns success. In - * case of silent failures, error messages can be found in Stackdriver logs. - * - * Generated from protobuf field bool write_async = 3; - * @return bool - */ - public function getWriteAsync() - { - return $this->write_async; - } - - /** - * If set to true, the user event will be written asynchronously after - * validation, and the API will respond without waiting for the write. - * Therefore, silent failures can occur even if the API returns success. In - * case of silent failures, error messages can be found in Stackdriver logs. - * - * Generated from protobuf field bool write_async = 3; - * @param bool $var - * @return $this - */ - public function setWriteAsync($var) - { - GPBUtil::checkBool($var); - $this->write_async = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php b/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php deleted file mode 100644 index 10f1ac3a67d..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/AnalyticsServiceClient/export_analytics_metrics.php +++ /dev/null @@ -1,89 +0,0 @@ -setCatalog($catalog) - ->setOutputConfig($outputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $analyticsServiceClient->exportAnalyticsMetrics($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportAnalyticsMetricsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $catalog = '[CATALOG]'; - - export_analytics_metrics_sample($catalog); -} -// [END retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php deleted file mode 100644 index f687e458a6d..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/add_catalog_attribute.php +++ /dev/null @@ -1,99 +0,0 @@ -setKey($catalogAttributeKey); - $request = (new AddCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - - // Call the API and handle any network failures. - try { - /** @var AttributesConfig $response */ - $response = $catalogServiceClient->addCatalogAttribute($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]' - ); - $catalogAttributeKey = '[KEY]'; - - add_catalog_attribute_sample($formattedAttributesConfig, $catalogAttributeKey); -} -// [END retail_v2_generated_CatalogService_AddCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php deleted file mode 100644 index ea0756ae9ec..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_attributes_config.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var AttributesConfig $response */ - $response = $catalogServiceClient->getAttributesConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CatalogServiceClient::attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - get_attributes_config_sample($formattedName); -} -// [END retail_v2_generated_CatalogService_GetAttributesConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php deleted file mode 100644 index 458acf9c098..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_completion_config.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CompletionConfig $response */ - $response = $catalogServiceClient->getCompletionConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CatalogServiceClient::completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - get_completion_config_sample($formattedName); -} -// [END retail_v2_generated_CatalogService_GetCompletionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php deleted file mode 100644 index 8ef78d4eaf4..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/get_default_branch.php +++ /dev/null @@ -1,59 +0,0 @@ -getDefaultBranch($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END retail_v2_generated_CatalogService_GetDefaultBranch_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php deleted file mode 100644 index 1c0cf49cdee..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/list_catalogs.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $catalogServiceClient->listCatalogs($request); - - /** @var Catalog $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_catalogs_sample($formattedParent); -} -// [END retail_v2_generated_CatalogService_ListCatalogs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php deleted file mode 100644 index fa8a20fdbd6..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/remove_catalog_attribute.php +++ /dev/null @@ -1,85 +0,0 @@ -setAttributesConfig($formattedAttributesConfig) - ->setKey($key); - - // Call the API and handle any network failures. - try { - /** @var AttributesConfig $response */ - $response = $catalogServiceClient->removeCatalogAttribute($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]' - ); - $key = '[KEY]'; - - remove_catalog_attribute_sample($formattedAttributesConfig, $key); -} -// [END retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php deleted file mode 100644 index bac6a61170b..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/replace_catalog_attribute.php +++ /dev/null @@ -1,101 +0,0 @@ -setKey($catalogAttributeKey); - $request = (new ReplaceCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - - // Call the API and handle any network failures. - try { - /** @var AttributesConfig $response */ - $response = $catalogServiceClient->replaceCatalogAttribute($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedAttributesConfig = CatalogServiceClient::attributesConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]' - ); - $catalogAttributeKey = '[KEY]'; - - replace_catalog_attribute_sample($formattedAttributesConfig, $catalogAttributeKey); -} -// [END retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php deleted file mode 100644 index d515f8b8583..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/set_default_branch.php +++ /dev/null @@ -1,87 +0,0 @@ -setDefaultBranch($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END retail_v2_generated_CatalogService_SetDefaultBranch_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php deleted file mode 100644 index e5b9a6bb312..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_attributes_config.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($attributesConfigName); - $request = (new UpdateAttributesConfigRequest()) - ->setAttributesConfig($attributesConfig); - - // Call the API and handle any network failures. - try { - /** @var AttributesConfig $response */ - $response = $catalogServiceClient->updateAttributesConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $attributesConfigName = '[NAME]'; - - update_attributes_config_sample($attributesConfigName); -} -// [END retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php deleted file mode 100644 index 47c6438b7f5..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_catalog.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($catalogName) - ->setDisplayName($catalogDisplayName) - ->setProductLevelConfig($catalogProductLevelConfig); - $request = (new UpdateCatalogRequest()) - ->setCatalog($catalog); - - // Call the API and handle any network failures. - try { - /** @var Catalog $response */ - $response = $catalogServiceClient->updateCatalog($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $catalogName = '[NAME]'; - $catalogDisplayName = '[DISPLAY_NAME]'; - - update_catalog_sample($catalogName, $catalogDisplayName); -} -// [END retail_v2_generated_CatalogService_UpdateCatalog_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php b/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php deleted file mode 100644 index ec211a74b0c..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CatalogServiceClient/update_completion_config.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($completionConfigName); - $request = (new UpdateCompletionConfigRequest()) - ->setCompletionConfig($completionConfig); - - // Call the API and handle any network failures. - try { - /** @var CompletionConfig $response */ - $response = $catalogServiceClient->updateCompletionConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $completionConfigName = '[NAME]'; - - update_completion_config_sample($completionConfigName); -} -// [END retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php deleted file mode 100644 index ff5859941d1..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/complete_query.php +++ /dev/null @@ -1,82 +0,0 @@ -setCatalog($formattedCatalog) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var CompleteQueryResponse $response */ - $response = $completionServiceClient->completeQuery($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedCatalog = CompletionServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $query = '[QUERY]'; - - complete_query_sample($formattedCatalog, $query); -} -// [END retail_v2_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php b/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php deleted file mode 100644 index 8bacda58553..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/CompletionServiceClient/import_completion_data.php +++ /dev/null @@ -1,114 +0,0 @@ -setDatasetId($inputConfigBigQuerySourceDatasetId) - ->setTableId($inputConfigBigQuerySourceTableId); - $inputConfig = (new CompletionDataInputConfig()) - ->setBigQuerySource($inputConfigBigQuerySource); - $request = (new ImportCompletionDataRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $completionServiceClient->importCompletionData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportCompletionDataResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CompletionServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfigBigQuerySourceDatasetId = '[DATASET_ID]'; - $inputConfigBigQuerySourceTableId = '[TABLE_ID]'; - - import_completion_data_sample( - $formattedParent, - $inputConfigBigQuerySourceDatasetId, - $inputConfigBigQuerySourceTableId - ); -} -// [END retail_v2_generated_CompletionService_ImportCompletionData_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php deleted file mode 100644 index a44ad023558..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/create_control.php +++ /dev/null @@ -1,109 +0,0 @@ -setDisplayName($controlDisplayName) - ->setSolutionTypes($controlSolutionTypes); - $request = (new CreateControlRequest()) - ->setParent($formattedParent) - ->setControl($control) - ->setControlId($controlId); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->createControl($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ControlServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $controlDisplayName = '[DISPLAY_NAME]'; - $controlSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - $controlId = '[CONTROL_ID]'; - - create_control_sample( - $formattedParent, - $controlDisplayName, - $controlSolutionTypesElement, - $controlId - ); -} -// [END retail_v2_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php deleted file mode 100644 index 5f0e35af579..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/delete_control.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $controlServiceClient->deleteControl($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ControlServiceClient::controlName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[CONTROL]' - ); - - delete_control_sample($formattedName); -} -// [END retail_v2_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php deleted file mode 100644 index 69a50ab3679..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/get_control.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->getControl($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ControlServiceClient::controlName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[CONTROL]' - ); - - get_control_sample($formattedName); -} -// [END retail_v2_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php deleted file mode 100644 index b09cea51465..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/list_controls.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $controlServiceClient->listControls($request); - - /** @var Control $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ControlServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - list_controls_sample($formattedParent); -} -// [END retail_v2_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php b/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php deleted file mode 100644 index 6230a8dbfb5..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ControlServiceClient/update_control.php +++ /dev/null @@ -1,90 +0,0 @@ -setDisplayName($controlDisplayName) - ->setSolutionTypes($controlSolutionTypes); - $request = (new UpdateControlRequest()) - ->setControl($control); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->updateControl($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $controlDisplayName = '[DISPLAY_NAME]'; - $controlSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - - update_control_sample($controlDisplayName, $controlSolutionTypesElement); -} -// [END retail_v2_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php deleted file mode 100644 index 80df18e6762..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php +++ /dev/null @@ -1,86 +0,0 @@ -setCatalog($requestsGenerativeQuestionConfigCatalog) - ->setFacet($requestsGenerativeQuestionConfigFacet); - $updateGenerativeQuestionConfigRequest = (new UpdateGenerativeQuestionConfigRequest()) - ->setGenerativeQuestionConfig($requestsGenerativeQuestionConfig); - $requests = [$updateGenerativeQuestionConfigRequest,]; - $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) - ->setRequests($requests); - - // Call the API and handle any network failures. - try { - /** @var BatchUpdateGenerativeQuestionConfigsResponse $response */ - $response = $generativeQuestionServiceClient->batchUpdateGenerativeQuestionConfigs($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $requestsGenerativeQuestionConfigCatalog = '[CATALOG]'; - $requestsGenerativeQuestionConfigFacet = '[FACET]'; - - batch_update_generative_question_configs_sample( - $requestsGenerativeQuestionConfigCatalog, - $requestsGenerativeQuestionConfigFacet - ); -} -// [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php deleted file mode 100644 index a2c319426e8..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php +++ /dev/null @@ -1,77 +0,0 @@ -setCatalog($formattedCatalog); - - // Call the API and handle any network failures. - try { - /** @var GenerativeQuestionsFeatureConfig $response */ - $response = $generativeQuestionServiceClient->getGenerativeQuestionsFeatureConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedCatalog = GenerativeQuestionServiceClient::catalogName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]' - ); - - get_generative_questions_feature_config_sample($formattedCatalog); -} -// [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php deleted file mode 100644 index 75edd24a1c4..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ListGenerativeQuestionConfigsResponse $response */ - $response = $generativeQuestionServiceClient->listGenerativeQuestionConfigs($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = GenerativeQuestionServiceClient::catalogName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]' - ); - - list_generative_question_configs_sample($formattedParent); -} -// [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php deleted file mode 100644 index 238fd35b1e2..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php +++ /dev/null @@ -1,81 +0,0 @@ -setCatalog($generativeQuestionConfigCatalog) - ->setFacet($generativeQuestionConfigFacet); - $request = (new UpdateGenerativeQuestionConfigRequest()) - ->setGenerativeQuestionConfig($generativeQuestionConfig); - - // Call the API and handle any network failures. - try { - /** @var GenerativeQuestionConfig $response */ - $response = $generativeQuestionServiceClient->updateGenerativeQuestionConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $generativeQuestionConfigCatalog = '[CATALOG]'; - $generativeQuestionConfigFacet = '[FACET]'; - - update_generative_question_config_sample( - $generativeQuestionConfigCatalog, - $generativeQuestionConfigFacet - ); -} -// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php b/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php deleted file mode 100644 index 3bca45526e4..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php +++ /dev/null @@ -1,75 +0,0 @@ -setCatalog($generativeQuestionsFeatureConfigCatalog); - $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) - ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); - - // Call the API and handle any network failures. - try { - /** @var GenerativeQuestionsFeatureConfig $response */ - $response = $generativeQuestionServiceClient->updateGenerativeQuestionsFeatureConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $generativeQuestionsFeatureConfigCatalog = '[CATALOG]'; - - update_generative_questions_feature_config_sample($generativeQuestionsFeatureConfigCatalog); -} -// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php deleted file mode 100644 index 98249a1fc4a..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/create_model.php +++ /dev/null @@ -1,123 +0,0 @@ -setName($modelName) - ->setDisplayName($modelDisplayName) - ->setType($modelType); - $request = (new CreateModelRequest()) - ->setParent($formattedParent) - ->setModel($model); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $modelServiceClient->createModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Model $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ModelServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $modelName = '[NAME]'; - $modelDisplayName = '[DISPLAY_NAME]'; - $modelType = '[TYPE]'; - - create_model_sample($formattedParent, $modelName, $modelDisplayName, $modelType); -} -// [END retail_v2_generated_ModelService_CreateModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php deleted file mode 100644 index 87c0791403e..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/delete_model.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $modelServiceClient->deleteModel($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - - delete_model_sample($formattedName); -} -// [END retail_v2_generated_ModelService_DeleteModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php deleted file mode 100644 index 426d4691ec2..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/get_model.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Model $response */ - $response = $modelServiceClient->getModel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - - get_model_sample($formattedName); -} -// [END retail_v2_generated_ModelService_GetModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php deleted file mode 100644 index 7fbefb53063..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/list_models.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $modelServiceClient->listModels($request); - - /** @var Model $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ModelServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - list_models_sample($formattedParent); -} -// [END retail_v2_generated_ModelService_ListModels_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php deleted file mode 100644 index 934db502dca..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/pause_model.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Model $response */ - $response = $modelServiceClient->pauseModel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - - pause_model_sample($formattedName); -} -// [END retail_v2_generated_ModelService_PauseModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php deleted file mode 100644 index a3808d2ce83..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/resume_model.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var Model $response */ - $response = $modelServiceClient->resumeModel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - resume_model_sample($name); -} -// [END retail_v2_generated_ModelService_ResumeModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php deleted file mode 100644 index abcde637d7c..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/tune_model.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $modelServiceClient->tuneModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TuneModelResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - - tune_model_sample($formattedName); -} -// [END retail_v2_generated_ModelService_TuneModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php b/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php deleted file mode 100644 index f556aac16e4..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ModelServiceClient/update_model.php +++ /dev/null @@ -1,105 +0,0 @@ -setName($modelName) - ->setDisplayName($modelDisplayName) - ->setType($modelType); - $request = (new UpdateModelRequest()) - ->setModel($model); - - // Call the API and handle any network failures. - try { - /** @var Model $response */ - $response = $modelServiceClient->updateModel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $modelName = '[NAME]'; - $modelDisplayName = '[DISPLAY_NAME]'; - $modelType = '[TYPE]'; - - update_model_sample($modelName, $modelDisplayName, $modelType); -} -// [END retail_v2_generated_ModelService_UpdateModel_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php b/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php deleted file mode 100644 index cce7afb2ac3..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/PredictionServiceClient/predict.php +++ /dev/null @@ -1,123 +0,0 @@ -setEventType($userEventEventType) - ->setVisitorId($userEventVisitorId); - $request = (new PredictRequest()) - ->setPlacement($placement) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var PredictResponse $response */ - $response = $predictionServiceClient->predict($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $placement = '[PLACEMENT]'; - $userEventEventType = '[EVENT_TYPE]'; - $userEventVisitorId = '[VISITOR_ID]'; - - predict_sample($placement, $userEventEventType, $userEventVisitorId); -} -// [END retail_v2_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php deleted file mode 100644 index 36371b2045e..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_fulfillment_places.php +++ /dev/null @@ -1,167 +0,0 @@ -setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->addFulfillmentPlaces($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var AddFulfillmentPlacesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProduct = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - $type = '[TYPE]'; - $placeIdsElement = '[PLACE_IDS]'; - - add_fulfillment_places_sample($formattedProduct, $type, $placeIdsElement); -} -// [END retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php deleted file mode 100644 index 686c82fd578..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/add_local_inventories.php +++ /dev/null @@ -1,125 +0,0 @@ -setProduct($formattedProduct) - ->setLocalInventories($localInventories); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->addLocalInventories($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var AddLocalInventoriesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProduct = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - - add_local_inventories_sample($formattedProduct); -} -// [END retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php deleted file mode 100644 index 07bd44e2d33..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/create_product.php +++ /dev/null @@ -1,109 +0,0 @@ -setTitle($productTitle); - $request = (new CreateProductRequest()) - ->setParent($formattedParent) - ->setProduct($product) - ->setProductId($productId); - - // Call the API and handle any network failures. - try { - /** @var Product $response */ - $response = $productServiceClient->createProduct($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ProductServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]' - ); - $productTitle = '[TITLE]'; - $productId = '[PRODUCT_ID]'; - - create_product_sample($formattedParent, $productTitle, $productId); -} -// [END retail_v2_generated_ProductService_CreateProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php deleted file mode 100644 index 8614f38c8c9..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/delete_product.php +++ /dev/null @@ -1,95 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $productServiceClient->deleteProduct($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - - delete_product_sample($formattedName); -} -// [END retail_v2_generated_ProductService_DeleteProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php deleted file mode 100644 index a1fd427b076..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/get_product.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Product $response */ - $response = $productServiceClient->getProduct($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - - get_product_sample($formattedName); -} -// [END retail_v2_generated_ProductService_GetProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php deleted file mode 100644 index f0cf4f7810a..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/import_products.php +++ /dev/null @@ -1,101 +0,0 @@ -setParent($formattedParent) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->importProducts($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportProductsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ProductServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]' - ); - - import_products_sample($formattedParent); -} -// [END retail_v2_generated_ProductService_ImportProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php deleted file mode 100644 index 2b07288ea5b..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/list_products.php +++ /dev/null @@ -1,88 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $productServiceClient->listProducts($request); - - /** @var Product $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ProductServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]' - ); - - list_products_sample($formattedParent); -} -// [END retail_v2_generated_ProductService_ListProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php deleted file mode 100644 index 93a27488aa8..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/purge_products.php +++ /dev/null @@ -1,147 +0,0 @@ -", "<", ">=", "<=", "="). - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" - * * availability = "IN_STOCK" - * - * * Conjunctions ("AND") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - * - * * Disjunctions ("OR") - * Examples: - * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - * - * * Can support nested queries. - * Examples: - * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - * - * * Filter Limits: - * * Filter should not contain more than 6 conditions. - * * Max nesting depth should not exceed 2 levels. - * - * Examples queries: - * * Delete back order products created before a timestamp. - * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - */ -function purge_products_sample(string $formattedParent, string $filter): void -{ - // Create a client. - $productServiceClient = new ProductServiceClient(); - - // Prepare the request message. - $request = (new PurgeProductsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->purgeProducts($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var PurgeProductsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ProductServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]' - ); - $filter = '[FILTER]'; - - purge_products_sample($formattedParent, $filter); -} -// [END retail_v2_generated_ProductService_PurgeProducts_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php deleted file mode 100644 index 5ecfecae044..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_fulfillment_places.php +++ /dev/null @@ -1,162 +0,0 @@ -setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->removeFulfillmentPlaces($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var RemoveFulfillmentPlacesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProduct = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - $type = '[TYPE]'; - $placeIdsElement = '[PLACE_IDS]'; - - remove_fulfillment_places_sample($formattedProduct, $type, $placeIdsElement); -} -// [END retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php deleted file mode 100644 index aa8c98a473d..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/remove_local_inventories.php +++ /dev/null @@ -1,125 +0,0 @@ -setProduct($formattedProduct) - ->setPlaceIds($placeIds); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->removeLocalInventories($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var RemoveLocalInventoriesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProduct = ProductServiceClient::productName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[BRANCH]', - '[PRODUCT]' - ); - $placeIdsElement = '[PLACE_IDS]'; - - remove_local_inventories_sample($formattedProduct, $placeIdsElement); -} -// [END retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php deleted file mode 100644 index e62730e4257..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/set_inventory.php +++ /dev/null @@ -1,140 +0,0 @@ -setTitle($inventoryTitle); - $request = (new SetInventoryRequest()) - ->setInventory($inventory); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $productServiceClient->setInventory($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var SetInventoryResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $inventoryTitle = '[TITLE]'; - - set_inventory_sample($inventoryTitle); -} -// [END retail_v2_generated_ProductService_SetInventory_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php b/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php deleted file mode 100644 index 2fb61fc5b77..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ProductServiceClient/update_product.php +++ /dev/null @@ -1,79 +0,0 @@ -setTitle($productTitle); - $request = (new UpdateProductRequest()) - ->setProduct($product); - - // Call the API and handle any network failures. - try { - /** @var Product $response */ - $response = $productServiceClient->updateProduct($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $productTitle = '[TITLE]'; - - update_product_sample($productTitle); -} -// [END retail_v2_generated_ProductService_UpdateProduct_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php b/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php deleted file mode 100644 index 855ed0d905c..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/SearchServiceClient/search.php +++ /dev/null @@ -1,95 +0,0 @@ -setPlacement($placement) - ->setVisitorId($visitorId); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $searchServiceClient->search($request); - - /** @var SearchResult $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $placement = '[PLACEMENT]'; - $visitorId = '[VISITOR_ID]'; - - search_sample($placement, $visitorId); -} -// [END retail_v2_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php deleted file mode 100644 index f9b4ab46366..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/add_control.php +++ /dev/null @@ -1,87 +0,0 @@ -setServingConfig($formattedServingConfig) - ->setControlId($controlId); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->addControl($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedServingConfig = ServingConfigServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[SERVING_CONFIG]' - ); - $controlId = '[CONTROL_ID]'; - - add_control_sample($formattedServingConfig, $controlId); -} -// [END retail_v2_generated_ServingConfigService_AddControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php deleted file mode 100644 index 9c5f2c7019d..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/create_serving_config.php +++ /dev/null @@ -1,107 +0,0 @@ -setDisplayName($servingConfigDisplayName) - ->setSolutionTypes($servingConfigSolutionTypes); - $request = (new CreateServingConfigRequest()) - ->setParent($formattedParent) - ->setServingConfig($servingConfig) - ->setServingConfigId($servingConfigId); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->createServingConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServingConfigServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $servingConfigDisplayName = '[DISPLAY_NAME]'; - $servingConfigSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - $servingConfigId = '[SERVING_CONFIG_ID]'; - - create_serving_config_sample( - $formattedParent, - $servingConfigDisplayName, - $servingConfigSolutionTypesElement, - $servingConfigId - ); -} -// [END retail_v2_generated_ServingConfigService_CreateServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php deleted file mode 100644 index 06c4a133ffe..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/delete_serving_config.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $servingConfigServiceClient->deleteServingConfig($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServingConfigServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[SERVING_CONFIG]' - ); - - delete_serving_config_sample($formattedName); -} -// [END retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php deleted file mode 100644 index 420b6333f81..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/get_serving_config.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->getServingConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServingConfigServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[SERVING_CONFIG]' - ); - - get_serving_config_sample($formattedName); -} -// [END retail_v2_generated_ServingConfigService_GetServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php deleted file mode 100644 index c20f11f6532..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/list_serving_configs.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $servingConfigServiceClient->listServingConfigs($request); - - /** @var ServingConfig $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServingConfigServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - - list_serving_configs_sample($formattedParent); -} -// [END retail_v2_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php deleted file mode 100644 index 8117bc33ab1..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/remove_control.php +++ /dev/null @@ -1,84 +0,0 @@ -setServingConfig($formattedServingConfig) - ->setControlId($controlId); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->removeControl($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedServingConfig = ServingConfigServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[CATALOG]', - '[SERVING_CONFIG]' - ); - $controlId = '[CONTROL_ID]'; - - remove_control_sample($formattedServingConfig, $controlId); -} -// [END retail_v2_generated_ServingConfigService_RemoveControl_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php b/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php deleted file mode 100644 index 59721bf94f5..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/ServingConfigServiceClient/update_serving_config.php +++ /dev/null @@ -1,84 +0,0 @@ -setDisplayName($servingConfigDisplayName) - ->setSolutionTypes($servingConfigSolutionTypes); - $request = (new UpdateServingConfigRequest()) - ->setServingConfig($servingConfig); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->updateServingConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $servingConfigDisplayName = '[DISPLAY_NAME]'; - $servingConfigSolutionTypesElement = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - - update_serving_config_sample($servingConfigDisplayName, $servingConfigSolutionTypesElement); -} -// [END retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php deleted file mode 100644 index 0d78171e7f1..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/collect_user_event.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($parent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var HttpBody $response */ - $response = $userEventServiceClient->collectUserEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $userEvent = '[USER_EVENT]'; - - collect_user_event_sample($parent, $userEvent); -} -// [END retail_v2_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php deleted file mode 100644 index 0ebd88dfd85..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/import_user_events.php +++ /dev/null @@ -1,140 +0,0 @@ -setEventType($inputConfigUserEventInlineSourceUserEventsEventType) - ->setVisitorId($inputConfigUserEventInlineSourceUserEventsVisitorId); - $inputConfigUserEventInlineSourceUserEvents = [$userEvent,]; - $inputConfigUserEventInlineSource = (new UserEventInlineSource()) - ->setUserEvents($inputConfigUserEventInlineSourceUserEvents); - $inputConfig = (new UserEventInputConfig()) - ->setUserEventInlineSource($inputConfigUserEventInlineSource); - $request = (new ImportUserEventsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->importUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportUserEventsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfigUserEventInlineSourceUserEventsEventType = '[EVENT_TYPE]'; - $inputConfigUserEventInlineSourceUserEventsVisitorId = '[VISITOR_ID]'; - - import_user_events_sample( - $formattedParent, - $inputConfigUserEventInlineSourceUserEventsEventType, - $inputConfigUserEventInlineSourceUserEventsVisitorId - ); -} -// [END retail_v2_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php deleted file mode 100644 index e97fa60dc97..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/purge_user_events.php +++ /dev/null @@ -1,113 +0,0 @@ - "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z"` - * * Deleting specific eventType in time range: - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * * Deleting all events for a specific visitor: - * `visitorId = "visitor1024"` - * - * The filtering fields are assumed to have an implicit AND. - */ -function purge_user_events_sample(string $formattedParent, string $filter): void -{ - // Create a client. - $userEventServiceClient = new UserEventServiceClient(); - - // Prepare the request message. - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->purgeUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var PurgeUserEventsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = UserEventServiceClient::catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $filter = '[FILTER]'; - - purge_user_events_sample($formattedParent, $filter); -} -// [END retail_v2_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php deleted file mode 100644 index c7b843e74dd..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/rejoin_user_events.php +++ /dev/null @@ -1,90 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->rejoinUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var RejoinUserEventsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - rejoin_user_events_sample($parent); -} -// [END retail_v2_generated_UserEventService_RejoinUserEvents_sync] diff --git a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php b/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php deleted file mode 100644 index 8a1b7bf0938..00000000000 --- a/owl-bot-staging/Retail/v2/samples/V2/UserEventServiceClient/write_user_event.php +++ /dev/null @@ -1,110 +0,0 @@ -setEventType($userEventEventType) - ->setVisitorId($userEventVisitorId); - $request = (new WriteUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var UserEvent $response */ - $response = $userEventServiceClient->writeUserEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $userEventEventType = '[EVENT_TYPE]'; - $userEventVisitorId = '[VISITOR_ID]'; - - write_user_event_sample($parent, $userEventEventType, $userEventVisitorId); -} -// [END retail_v2_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php deleted file mode 100644 index b9b8dc8522c..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/AnalyticsServiceClient.php +++ /dev/null @@ -1,253 +0,0 @@ - exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest $request, array $optionalArgs = []) - */ -final class AnalyticsServiceClient -{ - use GapicClientTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.AnalyticsService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/analytics_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/analytics_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/analytics_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/analytics_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Exports analytics metrics. - * - * `Operation.response` is of type `ExportAnalyticsMetricsResponse`. - * `Operation.metadata` is of type `ExportMetadata`. - * - * The async variant is - * {@see AnalyticsServiceClient::exportAnalyticsMetricsAsync()} . - * - * @example samples/V2/AnalyticsServiceClient/export_analytics_metrics.php - * - * @param ExportAnalyticsMetricsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportAnalyticsMetrics(ExportAnalyticsMetricsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportAnalyticsMetrics', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php deleted file mode 100644 index 52d6e23be5d..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/CatalogServiceClient.php +++ /dev/null @@ -1,668 +0,0 @@ - addCatalogAttributeAsync(AddCatalogAttributeRequest $request, array $optionalArgs = []) - * @method PromiseInterface getAttributesConfigAsync(GetAttributesConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface getCompletionConfigAsync(GetCompletionConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface getDefaultBranchAsync(GetDefaultBranchRequest $request, array $optionalArgs = []) - * @method PromiseInterface listCatalogsAsync(ListCatalogsRequest $request, array $optionalArgs = []) - * @method PromiseInterface removeCatalogAttributeAsync(RemoveCatalogAttributeRequest $request, array $optionalArgs = []) - * @method PromiseInterface replaceCatalogAttributeAsync(ReplaceCatalogAttributeRequest $request, array $optionalArgs = []) - * @method PromiseInterface setDefaultBranchAsync(SetDefaultBranchRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateAttributesConfigAsync(UpdateAttributesConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateCatalogAsync(UpdateCatalogRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateCompletionConfigAsync(UpdateCompletionConfigRequest $request, array $optionalArgs = []) - */ -final class CatalogServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.CatalogService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * attributes_config resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * - * @return string The formatted attributes_config resource. - */ - public static function attributesConfigName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('attributesConfig')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a branch - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * - * @return string The formatted branch resource. - */ - public static function branchName(string $project, string $location, string $catalog, string $branch): string - { - return self::getPathTemplate('branch')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - ]); - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * completion_config resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * - * @return string The formatted completion_config resource. - */ - public static function completionConfigName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('completionConfig')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - attributesConfig: projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig - * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} - * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} - * - completionConfig: projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig - * - location: projects/{project}/locations/{location} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Adds the specified - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - * - * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add - * already exists, an ALREADY_EXISTS error is returned. - * - * The async variant is {@see CatalogServiceClient::addCatalogAttributeAsync()} . - * - * @example samples/V2/CatalogServiceClient/add_catalog_attribute.php - * - * @param AddCatalogAttributeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AttributesConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function addCatalogAttribute(AddCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig - { - return $this->startApiCall('AddCatalogAttribute', $request, $callOptions)->wait(); - } - - /** - * Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - * - * The async variant is {@see CatalogServiceClient::getAttributesConfigAsync()} . - * - * @example samples/V2/CatalogServiceClient/get_attributes_config.php - * - * @param GetAttributesConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AttributesConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getAttributesConfig(GetAttributesConfigRequest $request, array $callOptions = []): AttributesConfig - { - return $this->startApiCall('GetAttributesConfig', $request, $callOptions)->wait(); - } - - /** - * Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig]. - * - * The async variant is {@see CatalogServiceClient::getCompletionConfigAsync()} . - * - * @example samples/V2/CatalogServiceClient/get_completion_config.php - * - * @param GetCompletionConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CompletionConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCompletionConfig(GetCompletionConfigRequest $request, array $callOptions = []): CompletionConfig - { - return $this->startApiCall('GetCompletionConfig', $request, $callOptions)->wait(); - } - - /** - * Get which branch is currently default branch set by - * [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] - * method under a specified parent catalog. - * - * The async variant is {@see CatalogServiceClient::getDefaultBranchAsync()} . - * - * @example samples/V2/CatalogServiceClient/get_default_branch.php - * - * @param GetDefaultBranchRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 GetDefaultBranchResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDefaultBranch(GetDefaultBranchRequest $request, array $callOptions = []): GetDefaultBranchResponse - { - return $this->startApiCall('GetDefaultBranch', $request, $callOptions)->wait(); - } - - /** - * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with - * the project. - * - * The async variant is {@see CatalogServiceClient::listCatalogsAsync()} . - * - * @example samples/V2/CatalogServiceClient/list_catalogs.php - * - * @param ListCatalogsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listCatalogs(ListCatalogsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCatalogs', $request, $callOptions); - } - - /** - * Removes the specified - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - * - * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to - * remove does not exist, a NOT_FOUND error is returned. - * - * The async variant is {@see CatalogServiceClient::removeCatalogAttributeAsync()} - * . - * - * @example samples/V2/CatalogServiceClient/remove_catalog_attribute.php - * - * @param RemoveCatalogAttributeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AttributesConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function removeCatalogAttribute(RemoveCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig - { - return $this->startApiCall('RemoveCatalogAttribute', $request, $callOptions)->wait(); - } - - /** - * Replaces the specified - * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the - * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the - * catalog attribute with the same - * [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. - * - * If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to - * replace does not exist, a NOT_FOUND error is returned. - * - * The async variant is {@see CatalogServiceClient::replaceCatalogAttributeAsync()} - * . - * - * @example samples/V2/CatalogServiceClient/replace_catalog_attribute.php - * - * @param ReplaceCatalogAttributeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AttributesConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function replaceCatalogAttribute(ReplaceCatalogAttributeRequest $request, array $callOptions = []): AttributesConfig - { - return $this->startApiCall('ReplaceCatalogAttribute', $request, $callOptions)->wait(); - } - - /** - * Set a specified branch id as default branch. API methods such as - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - * will treat requests using "default_branch" to the actual branch id set as - * default. - * - * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as - * default, setting - * [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent - * to setting - * [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - * `projects/*/locations/*/catalogs/*/branches/1`. - * - * Using multiple branches can be useful when developers would like - * to have a staging branch to test and verify for future usage. When it - * becomes ready, developers switch on the staging branch using this API while - * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` - * as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - * route the traffic to this staging branch. - * - * CAUTION: If you have live predict/search traffic, switching the default - * branch could potentially cause outages if the ID space of the new branch is - * very different from the old one. - * - * More specifically: - * - * * PredictionService will only return product IDs from branch {newBranch}. - * * SearchService will only return product IDs from branch {newBranch} - * (if branch is not explicitly set). - * * UserEventService will only join events with products from branch - * {newBranch}. - * - * The async variant is {@see CatalogServiceClient::setDefaultBranchAsync()} . - * - * @example samples/V2/CatalogServiceClient/set_default_branch.php - * - * @param SetDefaultBranchRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function setDefaultBranch(SetDefaultBranchRequest $request, array $callOptions = []): void - { - $this->startApiCall('SetDefaultBranch', $request, $callOptions)->wait(); - } - - /** - * Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - * - * The catalog attributes in the request will be updated in the catalog, or - * inserted if they do not exist. Existing catalog attributes not included in - * the request will remain unchanged. Attributes that are assigned to - * products, but do not exist at the catalog level, are always included in the - * response. The product attribute is assigned default values for missing - * catalog attribute fields, e.g., searchable and dynamic facetable options. - * - * The async variant is {@see CatalogServiceClient::updateAttributesConfigAsync()} - * . - * - * @example samples/V2/CatalogServiceClient/update_attributes_config.php - * - * @param UpdateAttributesConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AttributesConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateAttributesConfig(UpdateAttributesConfigRequest $request, array $callOptions = []): AttributesConfig - { - return $this->startApiCall('UpdateAttributesConfig', $request, $callOptions)->wait(); - } - - /** - * Updates the [Catalog][google.cloud.retail.v2.Catalog]s. - * - * The async variant is {@see CatalogServiceClient::updateCatalogAsync()} . - * - * @example samples/V2/CatalogServiceClient/update_catalog.php - * - * @param UpdateCatalogRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Catalog - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCatalog(UpdateCatalogRequest $request, array $callOptions = []): Catalog - { - return $this->startApiCall('UpdateCatalog', $request, $callOptions)->wait(); - } - - /** - * Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s. - * - * The async variant is {@see CatalogServiceClient::updateCompletionConfigAsync()} - * . - * - * @example samples/V2/CatalogServiceClient/update_completion_config.php - * - * @param UpdateCompletionConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CompletionConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCompletionConfig(UpdateCompletionConfigRequest $request, array $callOptions = []): CompletionConfig - { - return $this->startApiCall('UpdateCompletionConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php deleted file mode 100644 index cfa9a0533eb..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/CompletionServiceClient.php +++ /dev/null @@ -1,340 +0,0 @@ - completeQueryAsync(CompleteQueryRequest $request, array $optionalArgs = []) - * @method PromiseInterface importCompletionDataAsync(ImportCompletionDataRequest $request, array $optionalArgs = []) - */ -final class CompletionServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.CompletionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/completion_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/completion_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/completion_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/completion_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * 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} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Completes the specified prefix with keyword suggestions. - * - * This feature is only available for users who have Retail Search enabled. - * Enable Retail Search on Cloud Console before using this feature. - * - * The async variant is {@see CompletionServiceClient::completeQueryAsync()} . - * - * @example samples/V2/CompletionServiceClient/complete_query.php - * - * @param CompleteQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CompleteQueryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function completeQuery(CompleteQueryRequest $request, array $callOptions = []): CompleteQueryResponse - { - return $this->startApiCall('CompleteQuery', $request, $callOptions)->wait(); - } - - /** - * Bulk import of processed completion dataset. - * - * Request processing is asynchronous. Partial updating is not supported. - * - * The operation is successfully finished only after the imported suggestions - * are indexed successfully and ready for serving. The process takes hours. - * - * This feature is only available for users who have Retail Search enabled. - * Enable Retail Search on Cloud Console before using this feature. - * - * The async variant is {@see CompletionServiceClient::importCompletionDataAsync()} - * . - * - * @example samples/V2/CompletionServiceClient/import_completion_data.php - * - * @param ImportCompletionDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importCompletionData(ImportCompletionDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportCompletionData', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php deleted file mode 100644 index af3facb1704..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/ControlServiceClient.php +++ /dev/null @@ -1,388 +0,0 @@ - createControlAsync(CreateControlRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteControlAsync(DeleteControlRequest $request, array $optionalArgs = []) - * @method PromiseInterface getControlAsync(GetControlRequest $request, array $optionalArgs = []) - * @method PromiseInterface listControlsAsync(ListControlsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateControlAsync(UpdateControlRequest $request, array $optionalArgs = []) - */ -final class ControlServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.ControlService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/control_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/control_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/control_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/control_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a control - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $control - * - * @return string The formatted control resource. - */ - public static function controlName(string $project, string $location, string $catalog, string $control): string - { - return self::getPathTemplate('control')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'control' => $control, - ]); - } - - /** - * 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} - * - control: projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Control. - * - * If the [Control][google.cloud.retail.v2.Control] to create already exists, - * an ALREADY_EXISTS error is returned. - * - * The async variant is {@see ControlServiceClient::createControlAsync()} . - * - * @example samples/V2/ControlServiceClient/create_control.php - * - * @param CreateControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Control - * - * @throws ApiException Thrown if the API call fails. - */ - public function createControl(CreateControlRequest $request, array $callOptions = []): Control - { - return $this->startApiCall('CreateControl', $request, $callOptions)->wait(); - } - - /** - * Deletes a Control. - * - * If the [Control][google.cloud.retail.v2.Control] to delete does not exist, - * a NOT_FOUND error is returned. - * - * The async variant is {@see ControlServiceClient::deleteControlAsync()} . - * - * @example samples/V2/ControlServiceClient/delete_control.php - * - * @param DeleteControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteControl(DeleteControlRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteControl', $request, $callOptions)->wait(); - } - - /** - * Gets a Control. - * - * The async variant is {@see ControlServiceClient::getControlAsync()} . - * - * @example samples/V2/ControlServiceClient/get_control.php - * - * @param GetControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Control - * - * @throws ApiException Thrown if the API call fails. - */ - public function getControl(GetControlRequest $request, array $callOptions = []): Control - { - return $this->startApiCall('GetControl', $request, $callOptions)->wait(); - } - - /** - * Lists all Controls by their parent - * [Catalog][google.cloud.retail.v2.Catalog]. - * - * The async variant is {@see ControlServiceClient::listControlsAsync()} . - * - * @example samples/V2/ControlServiceClient/list_controls.php - * - * @param ListControlsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listControls(ListControlsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListControls', $request, $callOptions); - } - - /** - * Updates a Control. - * - * [Control][google.cloud.retail.v2.Control] cannot be set to a different - * oneof field, if so an INVALID_ARGUMENT is returned. If the - * [Control][google.cloud.retail.v2.Control] to update does not exist, a - * NOT_FOUND error is returned. - * - * The async variant is {@see ControlServiceClient::updateControlAsync()} . - * - * @example samples/V2/ControlServiceClient/update_control.php - * - * @param UpdateControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Control - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateControl(UpdateControlRequest $request, array $callOptions = []): Control - { - return $this->startApiCall('UpdateControl', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php deleted file mode 100644 index 39b4b5e000b..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/GenerativeQuestionServiceClient.php +++ /dev/null @@ -1,368 +0,0 @@ - batchUpdateGenerativeQuestionConfigsAsync(BatchUpdateGenerativeQuestionConfigsRequest $request, array $optionalArgs = []) - * @method PromiseInterface getGenerativeQuestionsFeatureConfigAsync(GetGenerativeQuestionsFeatureConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface listGenerativeQuestionConfigsAsync(ListGenerativeQuestionConfigsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateGenerativeQuestionConfigAsync(UpdateGenerativeQuestionConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateGenerativeQuestionsFeatureConfigAsync(UpdateGenerativeQuestionsFeatureConfigRequest $request, array $optionalArgs = []) - */ -final class GenerativeQuestionServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.GenerativeQuestionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/generative_question_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/generative_question_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/generative_question_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/generative_question_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * 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} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Allows management of multiple questions. - * - * The async variant is - * {@see GenerativeQuestionServiceClient::batchUpdateGenerativeQuestionConfigsAsync()} - * . - * - * @example samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php - * - * @param BatchUpdateGenerativeQuestionConfigsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 BatchUpdateGenerativeQuestionConfigsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchUpdateGenerativeQuestionConfigs(BatchUpdateGenerativeQuestionConfigsRequest $request, array $callOptions = []): BatchUpdateGenerativeQuestionConfigsResponse - { - return $this->startApiCall('BatchUpdateGenerativeQuestionConfigs', $request, $callOptions)->wait(); - } - - /** - * Manages overal generative question feature state -- enables toggling - * feature on and off. - * - * The async variant is - * {@see GenerativeQuestionServiceClient::getGenerativeQuestionsFeatureConfigAsync()} - * . - * - * @example samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php - * - * @param GetGenerativeQuestionsFeatureConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 GenerativeQuestionsFeatureConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getGenerativeQuestionsFeatureConfig(GetGenerativeQuestionsFeatureConfigRequest $request, array $callOptions = []): GenerativeQuestionsFeatureConfig - { - return $this->startApiCall('GetGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); - } - - /** - * Returns all questions for a given catalog. - * - * The async variant is - * {@see GenerativeQuestionServiceClient::listGenerativeQuestionConfigsAsync()} . - * - * @example samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php - * - * @param ListGenerativeQuestionConfigsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ListGenerativeQuestionConfigsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGenerativeQuestionConfigs(ListGenerativeQuestionConfigsRequest $request, array $callOptions = []): ListGenerativeQuestionConfigsResponse - { - return $this->startApiCall('ListGenerativeQuestionConfigs', $request, $callOptions)->wait(); - } - - /** - * Allows management of individual questions. - * - * The async variant is - * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionConfigAsync()} . - * - * @example samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php - * - * @param UpdateGenerativeQuestionConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 GenerativeQuestionConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateGenerativeQuestionConfig(UpdateGenerativeQuestionConfigRequest $request, array $callOptions = []): GenerativeQuestionConfig - { - return $this->startApiCall('UpdateGenerativeQuestionConfig', $request, $callOptions)->wait(); - } - - /** - * Manages overal generative question feature state -- enables toggling - * feature on and off. - * - * The async variant is - * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionsFeatureConfigAsync()} - * . - * - * @example samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php - * - * @param UpdateGenerativeQuestionsFeatureConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 GenerativeQuestionsFeatureConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateGenerativeQuestionsFeatureConfig(UpdateGenerativeQuestionsFeatureConfigRequest $request, array $callOptions = []): GenerativeQuestionsFeatureConfig - { - return $this->startApiCall('UpdateGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php deleted file mode 100644 index 7762a6ed486..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/ModelServiceClient.php +++ /dev/null @@ -1,528 +0,0 @@ - createModelAsync(CreateModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteModelAsync(DeleteModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface getModelAsync(GetModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface listModelsAsync(ListModelsRequest $request, array $optionalArgs = []) - * @method PromiseInterface pauseModelAsync(PauseModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface resumeModelAsync(ResumeModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface tuneModelAsync(TuneModelRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateModelAsync(UpdateModelRequest $request, array $optionalArgs = []) - */ -final class ModelServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.ModelService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/model_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/model_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/model_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/model_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $catalog, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'model' => $model, - ]); - } - - /** - * 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} - * - model: projects/{project}/locations/{location}/catalogs/{catalog}/models/{model} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new model. - * - * The async variant is {@see ModelServiceClient::createModelAsync()} . - * - * @example samples/V2/ModelServiceClient/create_model.php - * - * @param CreateModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createModel(CreateModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateModel', $request, $callOptions)->wait(); - } - - /** - * Deletes an existing model. - * - * The async variant is {@see ModelServiceClient::deleteModelAsync()} . - * - * @example samples/V2/ModelServiceClient/delete_model.php - * - * @param DeleteModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteModel(DeleteModelRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteModel', $request, $callOptions)->wait(); - } - - /** - * Gets a model. - * - * The async variant is {@see ModelServiceClient::getModelAsync()} . - * - * @example samples/V2/ModelServiceClient/get_model.php - * - * @param GetModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Model - * - * @throws ApiException Thrown if the API call fails. - */ - public function getModel(GetModelRequest $request, array $callOptions = []): Model - { - return $this->startApiCall('GetModel', $request, $callOptions)->wait(); - } - - /** - * Lists all the models linked to this event store. - * - * The async variant is {@see ModelServiceClient::listModelsAsync()} . - * - * @example samples/V2/ModelServiceClient/list_models.php - * - * @param ListModelsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listModels(ListModelsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListModels', $request, $callOptions); - } - - /** - * Pauses the training of an existing model. - * - * The async variant is {@see ModelServiceClient::pauseModelAsync()} . - * - * @example samples/V2/ModelServiceClient/pause_model.php - * - * @param PauseModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Model - * - * @throws ApiException Thrown if the API call fails. - */ - public function pauseModel(PauseModelRequest $request, array $callOptions = []): Model - { - return $this->startApiCall('PauseModel', $request, $callOptions)->wait(); - } - - /** - * Resumes the training of an existing model. - * - * The async variant is {@see ModelServiceClient::resumeModelAsync()} . - * - * @example samples/V2/ModelServiceClient/resume_model.php - * - * @param ResumeModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Model - * - * @throws ApiException Thrown if the API call fails. - */ - public function resumeModel(ResumeModelRequest $request, array $callOptions = []): Model - { - return $this->startApiCall('ResumeModel', $request, $callOptions)->wait(); - } - - /** - * Tunes an existing model. - * - * The async variant is {@see ModelServiceClient::tuneModelAsync()} . - * - * @example samples/V2/ModelServiceClient/tune_model.php - * - * @param TuneModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function tuneModel(TuneModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('TuneModel', $request, $callOptions)->wait(); - } - - /** - * Update of model metadata. Only fields that - * currently can be updated are: `filtering_option` and - * `periodic_tuning_state`. - * If other values are provided, this API method ignores them. - * - * The async variant is {@see ModelServiceClient::updateModelAsync()} . - * - * @example samples/V2/ModelServiceClient/update_model.php - * - * @param UpdateModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Model - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateModel(UpdateModelRequest $request, array $callOptions = []): Model - { - return $this->startApiCall('UpdateModel', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php deleted file mode 100644 index c76b0674a7d..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/PredictionServiceClient.php +++ /dev/null @@ -1,247 +0,0 @@ - predictAsync(PredictRequest $request, array $optionalArgs = []) - */ -final class PredictionServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.PredictionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a product - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * @param string $product - * - * @return string The formatted product resource. - */ - public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string - { - return self::getPathTemplate('product')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - 'product' => $product, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Makes a recommendation prediction. - * - * The async variant is {@see PredictionServiceClient::predictAsync()} . - * - * @example samples/V2/PredictionServiceClient/predict.php - * - * @param PredictRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PredictResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function predict(PredictRequest $request, array $callOptions = []): PredictResponse - { - return $this->startApiCall('Predict', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php deleted file mode 100644 index 53e15fe343d..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/ProductServiceClient.php +++ /dev/null @@ -1,813 +0,0 @@ - addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest $request, array $optionalArgs = []) - * @method PromiseInterface addLocalInventoriesAsync(AddLocalInventoriesRequest $request, array $optionalArgs = []) - * @method PromiseInterface createProductAsync(CreateProductRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteProductAsync(DeleteProductRequest $request, array $optionalArgs = []) - * @method PromiseInterface getProductAsync(GetProductRequest $request, array $optionalArgs = []) - * @method PromiseInterface importProductsAsync(ImportProductsRequest $request, array $optionalArgs = []) - * @method PromiseInterface listProductsAsync(ListProductsRequest $request, array $optionalArgs = []) - * @method PromiseInterface purgeProductsAsync(PurgeProductsRequest $request, array $optionalArgs = []) - * @method PromiseInterface removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest $request, array $optionalArgs = []) - * @method PromiseInterface removeLocalInventoriesAsync(RemoveLocalInventoriesRequest $request, array $optionalArgs = []) - * @method PromiseInterface setInventoryAsync(SetInventoryRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateProductAsync(UpdateProductRequest $request, array $optionalArgs = []) - */ -final class ProductServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.ProductService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/product_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/product_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/product_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/product_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a branch - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * - * @return string The formatted branch resource. - */ - public static function branchName(string $project, string $location, string $catalog, string $branch): string - { - return self::getPathTemplate('branch')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a product - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * @param string $product - * - * @return string The formatted product resource. - */ - public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string - { - return self::getPathTemplate('product')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - 'product' => $product, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} - * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * We recommend that you use the - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * method instead of the - * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] - * method. - * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * achieves the same results but provides more fine-grained control over - * ingesting local inventory data. - * - * Incrementally adds place IDs to - * [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. - * - * This process is asynchronous and does not require the - * [Product][google.cloud.retail.v2.Product] to exist before updating - * fulfillment information. If the request is valid, the update will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, the added place IDs are not immediately manifested in the - * [Product][google.cloud.retail.v2.Product] queried by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * The returned [Operation][google.longrunning.Operation]s will be obsolete - * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - * API will return NOT_FOUND afterwards. - * - * If conflicting updates are issued, the - * [Operation][google.longrunning.Operation]s associated with the stale - * updates will not be marked as [done][google.longrunning.Operation.done] - * until being obsolete. - * - * The async variant is {@see ProductServiceClient::addFulfillmentPlacesAsync()} . - * - * @example samples/V2/ProductServiceClient/add_fulfillment_places.php - * - * @param AddFulfillmentPlacesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function addFulfillmentPlaces(AddFulfillmentPlacesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('AddFulfillmentPlaces', $request, $callOptions)->wait(); - } - - /** - * Updates local inventory information for a - * [Product][google.cloud.retail.v2.Product] at a list of places, while - * respecting the last update timestamps of each inventory field. - * - * This process is asynchronous and does not require the - * [Product][google.cloud.retail.v2.Product] to exist before updating - * inventory information. If the request is valid, the update will be enqueued - * and processed downstream. As a consequence, when a response is returned, - * updates are not immediately manifested in the - * [Product][google.cloud.retail.v2.Product] queried by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * Local inventory information can only be modified using this method. - * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - * and - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * has no effect on local inventories. - * - * The returned [Operation][google.longrunning.Operation]s will be obsolete - * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - * API will return NOT_FOUND afterwards. - * - * If conflicting updates are issued, the - * [Operation][google.longrunning.Operation]s associated with the stale - * updates will not be marked as [done][google.longrunning.Operation.done] - * until being obsolete. - * - * The async variant is {@see ProductServiceClient::addLocalInventoriesAsync()} . - * - * @example samples/V2/ProductServiceClient/add_local_inventories.php - * - * @param AddLocalInventoriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function addLocalInventories(AddLocalInventoriesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('AddLocalInventories', $request, $callOptions)->wait(); - } - - /** - * Creates a [Product][google.cloud.retail.v2.Product]. - * - * The async variant is {@see ProductServiceClient::createProductAsync()} . - * - * @example samples/V2/ProductServiceClient/create_product.php - * - * @param CreateProductRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Product - * - * @throws ApiException Thrown if the API call fails. - */ - public function createProduct(CreateProductRequest $request, array $callOptions = []): Product - { - return $this->startApiCall('CreateProduct', $request, $callOptions)->wait(); - } - - /** - * Deletes a [Product][google.cloud.retail.v2.Product]. - * - * The async variant is {@see ProductServiceClient::deleteProductAsync()} . - * - * @example samples/V2/ProductServiceClient/delete_product.php - * - * @param DeleteProductRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteProduct(DeleteProductRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteProduct', $request, $callOptions)->wait(); - } - - /** - * Gets a [Product][google.cloud.retail.v2.Product]. - * - * The async variant is {@see ProductServiceClient::getProductAsync()} . - * - * @example samples/V2/ProductServiceClient/get_product.php - * - * @param GetProductRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Product - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProduct(GetProductRequest $request, array $callOptions = []): Product - { - return $this->startApiCall('GetProduct', $request, $callOptions)->wait(); - } - - /** - * Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. - * - * Request processing may be synchronous. - * Non-existing items are created. - * - * Note that it is possible for a subset of the - * [Product][google.cloud.retail.v2.Product]s to be successfully updated. - * - * The async variant is {@see ProductServiceClient::importProductsAsync()} . - * - * @example samples/V2/ProductServiceClient/import_products.php - * - * @param ImportProductsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importProducts(ImportProductsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportProducts', $request, $callOptions)->wait(); - } - - /** - * Gets a list of [Product][google.cloud.retail.v2.Product]s. - * - * The async variant is {@see ProductServiceClient::listProductsAsync()} . - * - * @example samples/V2/ProductServiceClient/list_products.php - * - * @param ListProductsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProducts(ListProductsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProducts', $request, $callOptions); - } - - /** - * Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s - * under a branch. - * - * This process is asynchronous. If the request is valid, the removal will be - * enqueued and processed offline. Depending on the number of - * [Product][google.cloud.retail.v2.Product]s, this operation could take hours - * to complete. Before the operation completes, some - * [Product][google.cloud.retail.v2.Product]s may still be returned by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * Depending on the number of [Product][google.cloud.retail.v2.Product]s, this - * operation could take hours to complete. To get a sample of - * [Product][google.cloud.retail.v2.Product]s that would be deleted, set - * [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] - * to false. - * - * The async variant is {@see ProductServiceClient::purgeProductsAsync()} . - * - * @example samples/V2/ProductServiceClient/purge_products.php - * - * @param PurgeProductsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function purgeProducts(PurgeProductsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('PurgeProducts', $request, $callOptions)->wait(); - } - - /** - * We recommend that you use the - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * method instead of the - * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] - * method. - * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * achieves the same results but provides more fine-grained control over - * ingesting local inventory data. - * - * Incrementally removes place IDs from a - * [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. - * - * This process is asynchronous and does not require the - * [Product][google.cloud.retail.v2.Product] to exist before updating - * fulfillment information. If the request is valid, the update will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, the removed place IDs are not immediately manifested in the - * [Product][google.cloud.retail.v2.Product] queried by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * The returned [Operation][google.longrunning.Operation]s will be obsolete - * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - * API will return NOT_FOUND afterwards. - * - * If conflicting updates are issued, the - * [Operation][google.longrunning.Operation]s associated with the stale - * updates will not be marked as [done][google.longrunning.Operation.done] - * until being obsolete. - * - * The async variant is {@see ProductServiceClient::removeFulfillmentPlacesAsync()} - * . - * - * @example samples/V2/ProductServiceClient/remove_fulfillment_places.php - * - * @param RemoveFulfillmentPlacesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function removeFulfillmentPlaces(RemoveFulfillmentPlacesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RemoveFulfillmentPlaces', $request, $callOptions)->wait(); - } - - /** - * Remove local inventory information for a - * [Product][google.cloud.retail.v2.Product] at a list of places at a removal - * timestamp. - * - * This process is asynchronous. If the request is valid, the removal will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, removals are not immediately manifested in the - * [Product][google.cloud.retail.v2.Product] queried by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * Local inventory information can only be removed using this method. - * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - * and - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * has no effect on local inventories. - * - * The returned [Operation][google.longrunning.Operation]s will be obsolete - * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - * API will return NOT_FOUND afterwards. - * - * If conflicting updates are issued, the - * [Operation][google.longrunning.Operation]s associated with the stale - * updates will not be marked as [done][google.longrunning.Operation.done] - * until being obsolete. - * - * The async variant is {@see ProductServiceClient::removeLocalInventoriesAsync()} - * . - * - * @example samples/V2/ProductServiceClient/remove_local_inventories.php - * - * @param RemoveLocalInventoriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function removeLocalInventories(RemoveLocalInventoriesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RemoveLocalInventories', $request, $callOptions)->wait(); - } - - /** - * Updates inventory information for a - * [Product][google.cloud.retail.v2.Product] while respecting the last update - * timestamps of each inventory field. - * - * This process is asynchronous and does not require the - * [Product][google.cloud.retail.v2.Product] to exist before updating - * fulfillment information. If the request is valid, the update is enqueued - * and processed downstream. As a consequence, when a response is returned, - * updates are not immediately manifested in the - * [Product][google.cloud.retail.v2.Product] queried by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * or - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - * - * When inventory is updated with - * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - * and - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], - * the specified inventory field value(s) overwrite any existing value(s) - * while ignoring the last update time for this field. Furthermore, the last - * update times for the specified inventory fields are overwritten by the - * times of the - * [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - * or - * [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - * request. - * - * If no inventory fields are set in - * [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], - * then any pre-existing inventory information for this product is used. - * - * If no inventory fields are set in - * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], - * then any existing inventory information is preserved. - * - * Pre-existing inventory information can only be updated with - * [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], - * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], - * and - * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. - * - * The returned [Operation][google.longrunning.Operation]s is obsolete after - * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] - * API returns `NOT_FOUND` afterwards. - * - * If conflicting updates are issued, the - * [Operation][google.longrunning.Operation]s associated with the stale - * updates are not marked as [done][google.longrunning.Operation.done] until - * they are obsolete. - * - * The async variant is {@see ProductServiceClient::setInventoryAsync()} . - * - * @example samples/V2/ProductServiceClient/set_inventory.php - * - * @param SetInventoryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function setInventory(SetInventoryRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SetInventory', $request, $callOptions)->wait(); - } - - /** - * Updates a [Product][google.cloud.retail.v2.Product]. - * - * The async variant is {@see ProductServiceClient::updateProductAsync()} . - * - * @example samples/V2/ProductServiceClient/update_product.php - * - * @param UpdateProductRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Product - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateProduct(UpdateProductRequest $request, array $callOptions = []): Product - { - return $this->startApiCall('UpdateProduct', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php deleted file mode 100644 index 12904e8aa63..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/SearchServiceClient.php +++ /dev/null @@ -1,251 +0,0 @@ - searchAsync(SearchRequest $request, array $optionalArgs = []) - */ -final class SearchServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.SearchService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/search_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/search_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/search_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/search_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a branch - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * - * @return string The formatted branch resource. - */ - public static function branchName(string $project, string $location, string $catalog, string $branch): string - { - return self::getPathTemplate('branch')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - branch: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Performs a search. - * - * This feature is only available for users who have Retail Search enabled. - * Enable Retail Search on Cloud Console before using this feature. - * - * The async variant is {@see SearchServiceClient::searchAsync()} . - * - * @example samples/V2/SearchServiceClient/search.php - * - * @param SearchRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function search(SearchRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('Search', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php deleted file mode 100644 index 7b375c917f1..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/ServingConfigServiceClient.php +++ /dev/null @@ -1,454 +0,0 @@ - addControlAsync(AddControlRequest $request, array $optionalArgs = []) - * @method PromiseInterface createServingConfigAsync(CreateServingConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteServingConfigAsync(DeleteServingConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface getServingConfigAsync(GetServingConfigRequest $request, array $optionalArgs = []) - * @method PromiseInterface listServingConfigsAsync(ListServingConfigsRequest $request, array $optionalArgs = []) - * @method PromiseInterface removeControlAsync(RemoveControlRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateServingConfigAsync(UpdateServingConfigRequest $request, array $optionalArgs = []) - */ -final class ServingConfigServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.ServingConfigService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/serving_config_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/serving_config_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/serving_config_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/serving_config_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * serving_config resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $servingConfig - * - * @return string The formatted serving_config resource. - */ - public static function servingConfigName(string $project, string $location, string $catalog, string $servingConfig): string - { - return self::getPathTemplate('servingConfig')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'serving_config' => $servingConfig, - ]); - } - - /** - * 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} - * - servingConfig: projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Enables a Control on the specified ServingConfig. - * The control is added in the last position of the list of controls - * it belongs to (e.g. if it's a facet spec control it will be applied - * in the last position of servingConfig.facetSpecIds) - * Returns a ALREADY_EXISTS error if the control has already been applied. - * Returns a FAILED_PRECONDITION error if the addition could exceed maximum - * number of control allowed for that type of control. - * - * The async variant is {@see ServingConfigServiceClient::addControlAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/add_control.php - * - * @param AddControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ServingConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function addControl(AddControlRequest $request, array $callOptions = []): ServingConfig - { - return $this->startApiCall('AddControl', $request, $callOptions)->wait(); - } - - /** - * Creates a ServingConfig. - * - * A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are - * allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a - * FAILED_PRECONDITION error is returned. - * - * The async variant is - * {@see ServingConfigServiceClient::createServingConfigAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/create_serving_config.php - * - * @param CreateServingConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ServingConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function createServingConfig(CreateServingConfigRequest $request, array $callOptions = []): ServingConfig - { - return $this->startApiCall('CreateServingConfig', $request, $callOptions)->wait(); - } - - /** - * Deletes a ServingConfig. - * - * Returns a NotFound error if the ServingConfig does not exist. - * - * The async variant is - * {@see ServingConfigServiceClient::deleteServingConfigAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/delete_serving_config.php - * - * @param DeleteServingConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteServingConfig(DeleteServingConfigRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteServingConfig', $request, $callOptions)->wait(); - } - - /** - * Gets a ServingConfig. - * - * Returns a NotFound error if the ServingConfig does not exist. - * - * The async variant is {@see ServingConfigServiceClient::getServingConfigAsync()} - * . - * - * @example samples/V2/ServingConfigServiceClient/get_serving_config.php - * - * @param GetServingConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ServingConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getServingConfig(GetServingConfigRequest $request, array $callOptions = []): ServingConfig - { - return $this->startApiCall('GetServingConfig', $request, $callOptions)->wait(); - } - - /** - * Lists all ServingConfigs linked to this catalog. - * - * The async variant is - * {@see ServingConfigServiceClient::listServingConfigsAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/list_serving_configs.php - * - * @param ListServingConfigsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServingConfigs(ListServingConfigsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServingConfigs', $request, $callOptions); - } - - /** - * Disables a Control on the specified ServingConfig. - * The control is removed from the ServingConfig. - * Returns a NOT_FOUND error if the Control is not enabled for the - * ServingConfig. - * - * The async variant is {@see ServingConfigServiceClient::removeControlAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/remove_control.php - * - * @param RemoveControlRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ServingConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function removeControl(RemoveControlRequest $request, array $callOptions = []): ServingConfig - { - return $this->startApiCall('RemoveControl', $request, $callOptions)->wait(); - } - - /** - * Updates a ServingConfig. - * - * The async variant is - * {@see ServingConfigServiceClient::updateServingConfigAsync()} . - * - * @example samples/V2/ServingConfigServiceClient/update_serving_config.php - * - * @param UpdateServingConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ServingConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateServingConfig(UpdateServingConfigRequest $request, array $callOptions = []): ServingConfig - { - return $this->startApiCall('UpdateServingConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php b/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php deleted file mode 100644 index 3ae967be368..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/Client/UserEventServiceClient.php +++ /dev/null @@ -1,455 +0,0 @@ - collectUserEventAsync(CollectUserEventRequest $request, array $optionalArgs = []) - * @method PromiseInterface importUserEventsAsync(ImportUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface purgeUserEventsAsync(PurgeUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface rejoinUserEventsAsync(RejoinUserEventsRequest $request, array $optionalArgs = []) - * @method PromiseInterface writeUserEventAsync(WriteUserEventRequest $request, array $optionalArgs = []) - */ -final class UserEventServiceClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.retail.v2.UserEventService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'retail.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'retail.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * 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. - */ - public static function catalogName(string $project, string $location, string $catalog): string - { - return self::getPathTemplate('catalog')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a product - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $branch - * @param string $product - * - * @return string The formatted product resource. - */ - public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string - { - return self::getPathTemplate('product')->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'branch' => $branch, - 'product' => $product, - ]); - } - - /** - * 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} - * - product: projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'retail.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * 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 Retail API JavaScript pixel and Google Tag - * Manager. Users should not call this method directly. - * - * The async variant is {@see UserEventServiceClient::collectUserEventAsync()} . - * - * @example samples/V2/UserEventServiceClient/collect_user_event.php - * - * @param CollectUserEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 HttpBody - * - * @throws ApiException Thrown if the API call fails. - */ - public function collectUserEvent(CollectUserEventRequest $request, array $callOptions = []): HttpBody - { - return $this->startApiCall('CollectUserEvent', $request, $callOptions)->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`. - * - * The async variant is {@see UserEventServiceClient::importUserEventsAsync()} . - * - * @example samples/V2/UserEventServiceClient/import_user_events.php - * - * @param ImportUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importUserEvents(ImportUserEventsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportUserEvents', $request, $callOptions)->wait(); - } - - /** - * 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. - * - * The async variant is {@see UserEventServiceClient::purgeUserEventsAsync()} . - * - * @example samples/V2/UserEventServiceClient/purge_user_events.php - * - * @param PurgeUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function purgeUserEvents(PurgeUserEventsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('PurgeUserEvents', $request, $callOptions)->wait(); - } - - /** - * Starts a user-event rejoin operation with latest product catalog. Events - * are not annotated with detailed product information for products that are - * missing from the catalog when the user event is ingested. These - * events are stored as unjoined events with limited usage on training and - * serving. You can use this method to start a join operation on specified - * events with the latest version of product catalog. You can also use this - * method to correct events joined with the wrong product catalog. A rejoin - * operation can take hours or days to complete. - * - * The async variant is {@see UserEventServiceClient::rejoinUserEventsAsync()} . - * - * @example samples/V2/UserEventServiceClient/rejoin_user_events.php - * - * @param RejoinUserEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function rejoinUserEvents(RejoinUserEventsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RejoinUserEvents', $request, $callOptions)->wait(); - } - - /** - * Writes a single user event. - * - * The async variant is {@see UserEventServiceClient::writeUserEventAsync()} . - * - * @example samples/V2/UserEventServiceClient/write_user_event.php - * - * @param WriteUserEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 UserEvent - * - * @throws ApiException Thrown if the API call fails. - */ - public function writeUserEvent(WriteUserEventRequest $request, array $callOptions = []): UserEvent - { - return $this->startApiCall('WriteUserEvent', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json deleted file mode 100644 index a4ab5df7982..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/gapic_metadata.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.retail.v2", - "libraryPackage": "Google\\Cloud\\Retail\\V2", - "services": { - "AnalyticsService": { - "clients": { - "grpc": { - "libraryClient": "AnalyticsServiceGapicClient", - "rpcs": { - "ExportAnalyticsMetrics": { - "methods": [ - "exportAnalyticsMetrics" - ] - } - } - } - } - }, - "CatalogService": { - "clients": { - "grpc": { - "libraryClient": "CatalogServiceGapicClient", - "rpcs": { - "AddCatalogAttribute": { - "methods": [ - "addCatalogAttribute" - ] - }, - "GetAttributesConfig": { - "methods": [ - "getAttributesConfig" - ] - }, - "GetCompletionConfig": { - "methods": [ - "getCompletionConfig" - ] - }, - "GetDefaultBranch": { - "methods": [ - "getDefaultBranch" - ] - }, - "ListCatalogs": { - "methods": [ - "listCatalogs" - ] - }, - "RemoveCatalogAttribute": { - "methods": [ - "removeCatalogAttribute" - ] - }, - "ReplaceCatalogAttribute": { - "methods": [ - "replaceCatalogAttribute" - ] - }, - "SetDefaultBranch": { - "methods": [ - "setDefaultBranch" - ] - }, - "UpdateAttributesConfig": { - "methods": [ - "updateAttributesConfig" - ] - }, - "UpdateCatalog": { - "methods": [ - "updateCatalog" - ] - }, - "UpdateCompletionConfig": { - "methods": [ - "updateCompletionConfig" - ] - } - } - } - } - }, - "CompletionService": { - "clients": { - "grpc": { - "libraryClient": "CompletionServiceGapicClient", - "rpcs": { - "CompleteQuery": { - "methods": [ - "completeQuery" - ] - }, - "ImportCompletionData": { - "methods": [ - "importCompletionData" - ] - } - } - } - } - }, - "ControlService": { - "clients": { - "grpc": { - "libraryClient": "ControlServiceGapicClient", - "rpcs": { - "CreateControl": { - "methods": [ - "createControl" - ] - }, - "DeleteControl": { - "methods": [ - "deleteControl" - ] - }, - "GetControl": { - "methods": [ - "getControl" - ] - }, - "ListControls": { - "methods": [ - "listControls" - ] - }, - "UpdateControl": { - "methods": [ - "updateControl" - ] - } - } - } - } - }, - "GenerativeQuestionService": { - "clients": { - "grpc": { - "libraryClient": "GenerativeQuestionServiceGapicClient", - "rpcs": { - "BatchUpdateGenerativeQuestionConfigs": { - "methods": [ - "batchUpdateGenerativeQuestionConfigs" - ] - }, - "GetGenerativeQuestionsFeatureConfig": { - "methods": [ - "getGenerativeQuestionsFeatureConfig" - ] - }, - "ListGenerativeQuestionConfigs": { - "methods": [ - "listGenerativeQuestionConfigs" - ] - }, - "UpdateGenerativeQuestionConfig": { - "methods": [ - "updateGenerativeQuestionConfig" - ] - }, - "UpdateGenerativeQuestionsFeatureConfig": { - "methods": [ - "updateGenerativeQuestionsFeatureConfig" - ] - } - } - } - } - }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "ModelServiceGapicClient", - "rpcs": { - "CreateModel": { - "methods": [ - "createModel" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "GetModel": { - "methods": [ - "getModel" - ] - }, - "ListModels": { - "methods": [ - "listModels" - ] - }, - "PauseModel": { - "methods": [ - "pauseModel" - ] - }, - "ResumeModel": { - "methods": [ - "resumeModel" - ] - }, - "TuneModel": { - "methods": [ - "tuneModel" - ] - }, - "UpdateModel": { - "methods": [ - "updateModel" - ] - } - } - } - } - }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionServiceGapicClient", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - } - } - } - } - }, - "ProductService": { - "clients": { - "grpc": { - "libraryClient": "ProductServiceGapicClient", - "rpcs": { - "AddFulfillmentPlaces": { - "methods": [ - "addFulfillmentPlaces" - ] - }, - "AddLocalInventories": { - "methods": [ - "addLocalInventories" - ] - }, - "CreateProduct": { - "methods": [ - "createProduct" - ] - }, - "DeleteProduct": { - "methods": [ - "deleteProduct" - ] - }, - "GetProduct": { - "methods": [ - "getProduct" - ] - }, - "ImportProducts": { - "methods": [ - "importProducts" - ] - }, - "ListProducts": { - "methods": [ - "listProducts" - ] - }, - "PurgeProducts": { - "methods": [ - "purgeProducts" - ] - }, - "RemoveFulfillmentPlaces": { - "methods": [ - "removeFulfillmentPlaces" - ] - }, - "RemoveLocalInventories": { - "methods": [ - "removeLocalInventories" - ] - }, - "SetInventory": { - "methods": [ - "setInventory" - ] - }, - "UpdateProduct": { - "methods": [ - "updateProduct" - ] - } - } - } - } - }, - "SearchService": { - "clients": { - "grpc": { - "libraryClient": "SearchServiceGapicClient", - "rpcs": { - "Search": { - "methods": [ - "search" - ] - } - } - } - } - }, - "ServingConfigService": { - "clients": { - "grpc": { - "libraryClient": "ServingConfigServiceGapicClient", - "rpcs": { - "AddControl": { - "methods": [ - "addControl" - ] - }, - "CreateServingConfig": { - "methods": [ - "createServingConfig" - ] - }, - "DeleteServingConfig": { - "methods": [ - "deleteServingConfig" - ] - }, - "GetServingConfig": { - "methods": [ - "getServingConfig" - ] - }, - "ListServingConfigs": { - "methods": [ - "listServingConfigs" - ] - }, - "RemoveControl": { - "methods": [ - "removeControl" - ] - }, - "UpdateServingConfig": { - "methods": [ - "updateServingConfig" - ] - } - } - } - } - }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "UserEventServiceGapicClient", - "rpcs": { - "CollectUserEvent": { - "methods": [ - "collectUserEvent" - ] - }, - "ImportUserEvents": { - "methods": [ - "importUserEvents" - ] - }, - "PurgeUserEvents": { - "methods": [ - "purgeUserEvents" - ] - }, - "RejoinUserEvents": { - "methods": [ - "rejoinUserEvents" - ] - }, - "WriteUserEvent": { - "methods": [ - "writeUserEvent" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json deleted file mode 100644 index aa40f9904b7..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_client_config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.AnalyticsService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_4_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_4_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "ExportAnalyticsMetrics": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php deleted file mode 100644 index c0885c7d573..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_descriptor_config.php +++ /dev/null @@ -1,47 +0,0 @@ - [ - 'google.cloud.retail.v2.AnalyticsService' => [ - 'ExportAnalyticsMetrics' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\ExportAnalyticsMetricsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\ExportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'catalog', - 'fieldAccessors' => [ - 'getCatalog', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php deleted file mode 100644 index f15d33d89d3..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/analytics_service_rest_client_config.php +++ /dev/null @@ -1,89 +0,0 @@ - [ - 'google.cloud.retail.v2.AnalyticsService' => [ - 'ExportAnalyticsMetrics' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics', - 'body' => '*', - 'placeholders' => [ - 'catalog' => [ - 'getters' => [ - 'getCatalog', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json deleted file mode 100644 index f1ab69f29a1..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_client_config.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.CatalogService": { - "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": 5000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000, - "total_timeout_millis": 5000 - } - }, - "methods": { - "AddCatalogAttribute": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetAttributesConfig": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetCompletionConfig": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetDefaultBranch": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListCatalogs": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RemoveCatalogAttribute": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ReplaceCatalogAttribute": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetDefaultBranch": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateAttributesConfig": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateCatalog": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateCompletionConfig": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php deleted file mode 100644 index fc8dc2fece6..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_descriptor_config.php +++ /dev/null @@ -1,178 +0,0 @@ - [ - 'google.cloud.retail.v2.CatalogService' => [ - 'AddCatalogAttribute' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', - 'headerParams' => [ - [ - 'keyName' => 'attributes_config', - 'fieldAccessors' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'GetAttributesConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetCompletionConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\CompletionConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetDefaultBranch' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\GetDefaultBranchResponse', - 'headerParams' => [ - [ - 'keyName' => 'catalog', - 'fieldAccessors' => [ - 'getCatalog', - ], - ], - ], - ], - 'ListCatalogs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCatalogs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListCatalogsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveCatalogAttribute' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', - 'headerParams' => [ - [ - 'keyName' => 'attributes_config', - 'fieldAccessors' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'ReplaceCatalogAttribute' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', - 'headerParams' => [ - [ - 'keyName' => 'attributes_config', - 'fieldAccessors' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'SetDefaultBranch' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'catalog', - 'fieldAccessors' => [ - 'getCatalog', - ], - ], - ], - ], - 'UpdateAttributesConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\AttributesConfig', - 'headerParams' => [ - [ - 'keyName' => 'attributes_config.name', - 'fieldAccessors' => [ - 'getAttributesConfig', - 'getName', - ], - ], - ], - ], - 'UpdateCatalog' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Catalog', - 'headerParams' => [ - [ - 'keyName' => 'catalog.name', - 'fieldAccessors' => [ - 'getCatalog', - 'getName', - ], - ], - ], - ], - 'UpdateCompletionConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\CompletionConfig', - 'headerParams' => [ - [ - 'keyName' => 'completion_config.name', - 'fieldAccessors' => [ - 'getCompletionConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'attributesConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig', - 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'completionConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php deleted file mode 100644 index b0bb0fa62cd..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/catalog_service_rest_client_config.php +++ /dev/null @@ -1,208 +0,0 @@ - [ - 'google.cloud.retail.v2.CatalogService' => [ - 'AddCatalogAttribute' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute', - 'body' => '*', - 'placeholders' => [ - 'attributes_config' => [ - 'getters' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'GetAttributesConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCompletionConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetDefaultBranch' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch', - 'placeholders' => [ - 'catalog' => [ - 'getters' => [ - 'getCatalog', - ], - ], - ], - ], - 'ListCatalogs' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/catalogs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveCatalogAttribute' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute', - 'body' => '*', - 'placeholders' => [ - 'attributes_config' => [ - 'getters' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'ReplaceCatalogAttribute' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute', - 'body' => '*', - 'placeholders' => [ - 'attributes_config' => [ - 'getters' => [ - 'getAttributesConfig', - ], - ], - ], - ], - 'SetDefaultBranch' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch', - 'body' => '*', - 'placeholders' => [ - 'catalog' => [ - 'getters' => [ - 'getCatalog', - ], - ], - ], - ], - 'UpdateAttributesConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}', - 'body' => 'attributes_config', - 'placeholders' => [ - 'attributes_config.name' => [ - 'getters' => [ - 'getAttributesConfig', - 'getName', - ], - ], - ], - ], - 'UpdateCatalog' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{catalog.name=projects/*/locations/*/catalogs/*}', - 'body' => 'catalog', - 'placeholders' => [ - 'catalog.name' => [ - 'getters' => [ - 'getCatalog', - 'getName', - ], - ], - ], - ], - 'UpdateCompletionConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}', - 'body' => 'completion_config', - 'placeholders' => [ - 'completion_config.name' => [ - 'getters' => [ - 'getCompletionConfig', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json deleted file mode 100644 index 4d3bf0a8de9..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_client_config.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.CompletionService": { - "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": 5000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000, - "total_timeout_millis": 5000 - } - }, - "methods": { - "CompleteQuery": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ImportCompletionData": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php deleted file mode 100644 index 09de7c3e467..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_descriptor_config.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - 'google.cloud.retail.v2.CompletionService' => [ - 'ImportCompletionData' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportCompletionDataResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CompleteQuery' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\CompleteQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'catalog', - 'fieldAccessors' => [ - 'getCatalog', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php deleted file mode 100644 index da7514c1838..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/completion_service_rest_client_config.php +++ /dev/null @@ -1,100 +0,0 @@ - [ - 'google.cloud.retail.v2.CompletionService' => [ - 'CompleteQuery' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery', - 'placeholders' => [ - 'catalog' => [ - 'getters' => [ - 'getCatalog', - ], - ], - ], - ], - 'ImportCompletionData' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json deleted file mode 100644 index 6238fa9ab45..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_client_config.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.ControlService": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListControls": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php deleted file mode 100644 index 56d55d39007..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_descriptor_config.php +++ /dev/null @@ -1,101 +0,0 @@ - [ - 'google.cloud.retail.v2.ControlService' => [ - 'CreateControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Control', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Control', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListControls' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getControls', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListControlsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Control', - 'headerParams' => [ - [ - 'keyName' => 'control.name', - 'fieldAccessors' => [ - 'getControl', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'control' => 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php deleted file mode 100644 index 3c7844395f6..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/control_service_rest_client_config.php +++ /dev/null @@ -1,138 +0,0 @@ - [ - 'google.cloud.retail.v2.ControlService' => [ - 'CreateControl' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/controls', - 'body' => 'control', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'control_id', - ], - ], - 'DeleteControl' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/controls/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetControl' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/controls/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListControls' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/controls', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateControl' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}', - 'body' => 'control', - 'placeholders' => [ - 'control.name' => [ - 'getters' => [ - 'getControl', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json deleted file mode 100644 index a22e14095f7..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_client_config.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.GenerativeQuestionService": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "BatchUpdateGenerativeQuestionConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetGenerativeQuestionsFeatureConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListGenerativeQuestionConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateGenerativeQuestionConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateGenerativeQuestionsFeatureConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php deleted file mode 100644 index 56b813c7153..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_descriptor_config.php +++ /dev/null @@ -1,93 +0,0 @@ - [ - 'google.cloud.retail.v2.GenerativeQuestionService' => [ - 'BatchUpdateGenerativeQuestionConfigs' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetGenerativeQuestionsFeatureConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', - 'headerParams' => [ - [ - 'keyName' => 'catalog', - 'fieldAccessors' => [ - 'getCatalog', - ], - ], - ], - ], - 'ListGenerativeQuestionConfigs' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateGenerativeQuestionConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionConfig', - 'headerParams' => [ - [ - 'keyName' => 'generative_question_config.catalog', - 'fieldAccessors' => [ - 'getGenerativeQuestionConfig', - 'getCatalog', - ], - ], - ], - ], - 'UpdateGenerativeQuestionsFeatureConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', - 'headerParams' => [ - [ - 'keyName' => 'generative_questions_feature_config.catalog', - 'fieldAccessors' => [ - 'getGenerativeQuestionsFeatureConfig', - 'getCatalog', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php deleted file mode 100644 index eef5c95d149..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/generative_question_service_rest_client_config.php +++ /dev/null @@ -1,137 +0,0 @@ - [ - 'google.cloud.retail.v2.GenerativeQuestionService' => [ - 'BatchUpdateGenerativeQuestionConfigs' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetGenerativeQuestionsFeatureConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', - 'placeholders' => [ - 'catalog' => [ - 'getters' => [ - 'getCatalog', - ], - ], - ], - ], - 'ListGenerativeQuestionConfigs' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateGenerativeQuestionConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion', - 'body' => 'generative_question_config', - 'placeholders' => [ - 'generative_question_config.catalog' => [ - 'getters' => [ - 'getGenerativeQuestionConfig', - 'getCatalog', - ], - ], - ], - ], - 'UpdateGenerativeQuestionsFeatureConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', - 'body' => 'generative_questions_feature_config', - 'placeholders' => [ - 'generative_questions_feature_config.catalog' => [ - 'getters' => [ - 'getGenerativeQuestionsFeatureConfig', - 'getCatalog', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json deleted file mode 100644 index 0e96f5ce8c6..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_client_config.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.ModelService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_4_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_4_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "DeleteModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "GetModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "ListModels": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "PauseModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "ResumeModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "TuneModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "UpdateModel": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php deleted file mode 100644 index 6171fd3a107..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_descriptor_config.php +++ /dev/null @@ -1,151 +0,0 @@ - [ - 'google.cloud.retail.v2.ModelService' => [ - 'CreateModel' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\Model', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\CreateModelMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'TuneModel' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\TuneModelResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\TuneModelMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteModel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetModel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Model', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListModels' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getModels', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListModelsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PauseModel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Model', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ResumeModel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Model', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateModel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Model', - 'headerParams' => [ - [ - 'keyName' => 'model.name', - 'fieldAccessors' => [ - 'getModel', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'model' => 'projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php deleted file mode 100644 index 98c6f0e7d57..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/model_service_rest_client_config.php +++ /dev/null @@ -1,171 +0,0 @@ - [ - 'google.cloud.retail.v2.ModelService' => [ - 'CreateModel' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/models', - 'body' => 'model', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteModel' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetModel' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListModels' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/models', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseModel' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeModel' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'TuneModel' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/models/*}:tune', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateModel' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{model.name=projects/*/locations/*/catalogs/*/models/*}', - 'body' => 'model', - 'placeholders' => [ - 'model.name' => [ - 'getters' => [ - 'getModel', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json deleted file mode 100644 index 97e9893bed7..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_client_config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.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": 5000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000, - "total_timeout_millis": 5000 - } - }, - "methods": { - "Predict": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php deleted file mode 100644 index 628c060ff11..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_descriptor_config.php +++ /dev/null @@ -1,43 +0,0 @@ - [ - 'google.cloud.retail.v2.PredictionService' => [ - 'Predict' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\PredictResponse', - 'headerParams' => [ - [ - 'keyName' => 'placement', - 'fieldAccessors' => [ - 'getPlacement', - ], - ], - ], - ], - 'templateMap' => [ - 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php deleted file mode 100644 index 5a66073b4f0..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/prediction_service_rest_client_config.php +++ /dev/null @@ -1,96 +0,0 @@ - [ - 'google.cloud.retail.v2.PredictionService' => [ - 'Predict' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'placement' => [ - 'getters' => [ - 'getPlacement', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json deleted file mode 100644 index cd5260972f0..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_client_config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.ProductService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_3_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "retry_policy_5_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_3_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 30000, - "initial_rpc_timeout_millis": 30000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 30000, - "total_timeout_millis": 30000 - }, - "retry_policy_5_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 300000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - } - }, - "methods": { - "AddFulfillmentPlaces": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "AddLocalInventories": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "CreateProduct": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "DeleteProduct": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "GetProduct": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "ImportProducts": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_5_codes", - "retry_params_name": "retry_policy_5_params" - }, - "ListProducts": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "PurgeProducts": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "RemoveFulfillmentPlaces": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "RemoveLocalInventories": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "SetInventory": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "UpdateProduct": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php deleted file mode 100644 index 24cfd2c05de..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_descriptor_config.php +++ /dev/null @@ -1,235 +0,0 @@ - [ - 'google.cloud.retail.v2.ProductService' => [ - 'AddFulfillmentPlaces' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\AddFulfillmentPlacesResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\AddFulfillmentPlacesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'product', - 'fieldAccessors' => [ - 'getProduct', - ], - ], - ], - ], - 'AddLocalInventories' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\AddLocalInventoriesResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\AddLocalInventoriesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'product', - 'fieldAccessors' => [ - 'getProduct', - ], - ], - ], - ], - 'ImportProducts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportProductsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeProducts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveFulfillmentPlaces' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\RemoveFulfillmentPlacesResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\RemoveFulfillmentPlacesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'product', - 'fieldAccessors' => [ - 'getProduct', - ], - ], - ], - ], - 'RemoveLocalInventories' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\RemoveLocalInventoriesResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\RemoveLocalInventoriesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'product', - 'fieldAccessors' => [ - 'getProduct', - ], - ], - ], - ], - 'SetInventory' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\SetInventoryResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\SetInventoryMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'inventory.name', - 'fieldAccessors' => [ - 'getInventory', - 'getName', - ], - ], - ], - ], - 'CreateProduct' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Product', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteProduct' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetProduct' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Product', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListProducts' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProducts', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListProductsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateProduct' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\Product', - 'headerParams' => [ - [ - 'keyName' => 'product.name', - 'fieldAccessors' => [ - 'getProduct', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', - 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php deleted file mode 100644 index a7470a66da8..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/product_service_rest_client_config.php +++ /dev/null @@ -1,223 +0,0 @@ - [ - 'google.cloud.retail.v2.ProductService' => [ - 'AddFulfillmentPlaces' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces', - 'body' => '*', - 'placeholders' => [ - 'product' => [ - 'getters' => [ - 'getProduct', - ], - ], - ], - ], - 'AddLocalInventories' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories', - 'body' => '*', - 'placeholders' => [ - 'product' => [ - 'getters' => [ - 'getProduct', - ], - ], - ], - ], - 'CreateProduct' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products', - 'body' => 'product', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'product_id', - ], - ], - 'DeleteProduct' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProduct' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportProducts' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListProducts' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeProducts' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveFulfillmentPlaces' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces', - 'body' => '*', - 'placeholders' => [ - 'product' => [ - 'getters' => [ - 'getProduct', - ], - ], - ], - ], - 'RemoveLocalInventories' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories', - 'body' => '*', - 'placeholders' => [ - 'product' => [ - 'getters' => [ - 'getProduct', - ], - ], - ], - ], - 'SetInventory' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory', - 'body' => '*', - 'placeholders' => [ - 'inventory.name' => [ - 'getters' => [ - 'getInventory', - 'getName', - ], - ], - ], - ], - 'UpdateProduct' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}', - 'body' => 'product', - 'placeholders' => [ - 'product.name' => [ - 'getters' => [ - 'getProduct', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json deleted file mode 100644 index 75b66324de6..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_client_config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.SearchService": { - "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": 5000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000, - "total_timeout_millis": 5000 - } - }, - "methods": { - "Search": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php deleted file mode 100644 index 051351283f4..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_descriptor_config.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'google.cloud.retail.v2.SearchService' => [ - 'Search' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\SearchResponse', - 'headerParams' => [ - [ - 'keyName' => 'placement', - 'fieldAccessors' => [ - 'getPlacement', - ], - ], - ], - ], - 'templateMap' => [ - 'branch' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php deleted file mode 100644 index 8e70173e2f4..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/search_service_rest_client_config.php +++ /dev/null @@ -1,96 +0,0 @@ - [ - 'google.cloud.retail.v2.SearchService' => [ - 'Search' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'placement' => [ - 'getters' => [ - 'getPlacement', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json deleted file mode 100644 index 3464c528f5d..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_client_config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.ServingConfigService": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "AddControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateServingConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteServingConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetServingConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListServingConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "RemoveControl": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateServingConfig": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php deleted file mode 100644 index a1058834d03..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_descriptor_config.php +++ /dev/null @@ -1,125 +0,0 @@ - [ - 'google.cloud.retail.v2.ServingConfigService' => [ - 'AddControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', - 'headerParams' => [ - [ - 'keyName' => 'serving_config', - 'fieldAccessors' => [ - 'getServingConfig', - ], - ], - ], - ], - 'CreateServingConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteServingConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetServingConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListServingConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServingConfigs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ListServingConfigsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveControl' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', - 'headerParams' => [ - [ - 'keyName' => 'serving_config', - 'fieldAccessors' => [ - 'getServingConfig', - ], - ], - ], - ], - 'UpdateServingConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\ServingConfig', - 'headerParams' => [ - [ - 'keyName' => 'serving_config.name', - 'fieldAccessors' => [ - 'getServingConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'servingConfig' => 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php deleted file mode 100644 index c7021c644b2..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/serving_config_service_rest_client_config.php +++ /dev/null @@ -1,162 +0,0 @@ - [ - 'google.cloud.retail.v2.ServingConfigService' => [ - 'AddControl' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl', - 'body' => '*', - 'placeholders' => [ - 'serving_config' => [ - 'getters' => [ - 'getServingConfig', - ], - ], - ], - ], - 'CreateServingConfig' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs', - 'body' => 'serving_config', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'serving_config_id', - ], - ], - 'DeleteServingConfig' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetServingConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListServingConfigs' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RemoveControl' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl', - 'body' => '*', - 'placeholders' => [ - 'serving_config' => [ - 'getters' => [ - 'getServingConfig', - ], - ], - ], - ], - 'UpdateServingConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}', - 'body' => 'serving_config', - 'placeholders' => [ - 'serving_config.name' => [ - 'getters' => [ - 'getServingConfig', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json deleted file mode 100644 index 3715586469a..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_client_config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "interfaces": { - "google.cloud.retail.v2.UserEventService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_2_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "retry_policy_3_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "retry_policy_6_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_2_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 5000, - "initial_rpc_timeout_millis": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - }, - "retry_policy_3_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 30000, - "initial_rpc_timeout_millis": 30000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 30000, - "total_timeout_millis": 30000 - }, - "retry_policy_6_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 300000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CollectUserEvent": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - }, - "ImportUserEvents": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_6_codes", - "retry_params_name": "retry_policy_6_params" - }, - "PurgeUserEvents": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" - }, - "RejoinUserEvents": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - }, - "WriteUserEvent": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - } - } - } - } -} diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php deleted file mode 100644 index d5aee057f1a..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_descriptor_config.php +++ /dev/null @@ -1,113 +0,0 @@ - [ - 'google.cloud.retail.v2.UserEventService' => [ - 'ImportUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\ImportUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\ImportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\PurgeUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\PurgeMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RejoinUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Retail\V2\RejoinUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\Retail\V2\RejoinUserEventsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CollectUserEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\HttpBody', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'WriteUserEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Retail\V2\UserEvent', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', - 'product' => 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php b/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php deleted file mode 100644 index 8693b90c34d..00000000000 --- a/owl-bot-staging/Retail/v2/src/V2/resources/user_event_service_rest_client_config.php +++ /dev/null @@ -1,136 +0,0 @@ - [ - 'google.cloud.retail.v2.UserEventService' => [ - 'CollectUserEvent' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ImportUserEvents' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeUserEvents' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RejoinUserEvents' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'WriteUserEvent' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:write', - 'body' => 'user_event', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php deleted file mode 100644 index 0980ca752f0..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/AnalyticsServiceClientTest.php +++ /dev/null @@ -1,262 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AnalyticsServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AnalyticsServiceClient($options); - } - - /** @test */ - public function exportAnalyticsMetricsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportAnalyticsMetricsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportAnalyticsMetricsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportAnalyticsMetricsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $catalog = 'catalog555704345'; - $outputConfig = new OutputConfig(); - $request = (new ExportAnalyticsMetricsRequest()) - ->setCatalog($catalog) - ->setOutputConfig($outputConfig); - $response = $gapicClient->exportAnalyticsMetrics($request); - $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.retail.v2.AnalyticsService/ExportAnalyticsMetrics', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCatalog(); - $this->assertProtobufEquals($catalog, $actualValue); - $actualValue = $actualApiRequestObject->getOutputConfig(); - $this->assertProtobufEquals($outputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); - $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 exportAnalyticsMetricsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportAnalyticsMetricsTest'); - $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 - $catalog = 'catalog555704345'; - $outputConfig = new OutputConfig(); - $request = (new ExportAnalyticsMetricsRequest()) - ->setCatalog($catalog) - ->setOutputConfig($outputConfig); - $response = $gapicClient->exportAnalyticsMetrics($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); - 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 exportAnalyticsMetricsAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/exportAnalyticsMetricsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportAnalyticsMetricsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportAnalyticsMetricsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $catalog = 'catalog555704345'; - $outputConfig = new OutputConfig(); - $request = (new ExportAnalyticsMetricsRequest()) - ->setCatalog($catalog) - ->setOutputConfig($outputConfig); - $response = $gapicClient->exportAnalyticsMetricsAsync($request)->wait(); - $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.retail.v2.AnalyticsService/ExportAnalyticsMetrics', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCatalog(); - $this->assertProtobufEquals($catalog, $actualValue); - $actualValue = $actualApiRequestObject->getOutputConfig(); - $this->assertProtobufEquals($outputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportAnalyticsMetricsTest'); - $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()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php deleted file mode 100644 index de88ff03be0..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CatalogServiceClientTest.php +++ /dev/null @@ -1,885 +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 addCatalogAttributeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogAttribute = new CatalogAttribute(); - $catalogAttributeKey = 'catalogAttributeKey-1525777188'; - $catalogAttribute->setKey($catalogAttributeKey); - $request = (new AddCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - $response = $gapicClient->addCatalogAttribute($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/AddCatalogAttribute', $actualFuncCall); - $actualValue = $actualRequestObject->getAttributesConfig(); - $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); - $actualValue = $actualRequestObject->getCatalogAttribute(); - $this->assertProtobufEquals($catalogAttribute, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addCatalogAttributeExceptionTest() - { - $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 - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogAttribute = new CatalogAttribute(); - $catalogAttributeKey = 'catalogAttributeKey-1525777188'; - $catalogAttribute->setKey($catalogAttributeKey); - $request = (new AddCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - try { - $gapicClient->addCatalogAttribute($request); - // 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 getAttributesConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetAttributesConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getAttributesConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/GetAttributesConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAttributesConfigExceptionTest() - { - $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->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetAttributesConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getAttributesConfig($request); - // 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 getCompletionConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $matchingOrder = 'matchingOrder1035789452'; - $maxSuggestions = 618824852; - $minPrefixLength = 96853510; - $autoLearning = true; - $lastSuggestionsImportOperation = 'lastSuggestionsImportOperation-470644314'; - $lastDenylistImportOperation = 'lastDenylistImportOperation-181585959'; - $lastAllowlistImportOperation = 'lastAllowlistImportOperation723854958'; - $expectedResponse = new CompletionConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setMatchingOrder($matchingOrder); - $expectedResponse->setMaxSuggestions($maxSuggestions); - $expectedResponse->setMinPrefixLength($minPrefixLength); - $expectedResponse->setAutoLearning($autoLearning); - $expectedResponse->setLastSuggestionsImportOperation($lastSuggestionsImportOperation); - $expectedResponse->setLastDenylistImportOperation($lastDenylistImportOperation); - $expectedResponse->setLastAllowlistImportOperation($lastAllowlistImportOperation); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetCompletionConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getCompletionConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/GetCompletionConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCompletionConfigExceptionTest() - { - $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->completionConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetCompletionConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getCompletionConfig($request); - // 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 getDefaultBranchTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $branch = 'branch-1381030494'; - $note = 'note3387378'; - $expectedResponse = new GetDefaultBranchResponse(); - $expectedResponse->setBranch($branch); - $expectedResponse->setNote($note); - $transport->addResponse($expectedResponse); - $request = new GetDefaultBranchRequest(); - $response = $gapicClient->getDefaultBranch($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/GetDefaultBranch', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDefaultBranchExceptionTest() - { - $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); - $request = new GetDefaultBranchRequest(); - try { - $gapicClient->getDefaultBranch($request); - // 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 listCatalogsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $catalogsElement = new Catalog(); - $catalogs = [ - $catalogsElement, - ]; - $expectedResponse = new ListCatalogsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCatalogs($catalogs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCatalogsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listCatalogs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/ListCatalogs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCatalogsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCatalogsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listCatalogs($request); - // 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 removeCatalogAttributeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $key = 'key106079'; - $request = (new RemoveCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setKey($key); - $response = $gapicClient->removeCatalogAttribute($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/RemoveCatalogAttribute', $actualFuncCall); - $actualValue = $actualRequestObject->getAttributesConfig(); - $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); - $actualValue = $actualRequestObject->getKey(); - $this->assertProtobufEquals($key, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeCatalogAttributeExceptionTest() - { - $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 - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $key = 'key106079'; - $request = (new RemoveCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setKey($key); - try { - $gapicClient->removeCatalogAttribute($request); - // 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 replaceCatalogAttributeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogAttribute = new CatalogAttribute(); - $catalogAttributeKey = 'catalogAttributeKey-1525777188'; - $catalogAttribute->setKey($catalogAttributeKey); - $request = (new ReplaceCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - $response = $gapicClient->replaceCatalogAttribute($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/ReplaceCatalogAttribute', $actualFuncCall); - $actualValue = $actualRequestObject->getAttributesConfig(); - $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); - $actualValue = $actualRequestObject->getCatalogAttribute(); - $this->assertProtobufEquals($catalogAttribute, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function replaceCatalogAttributeExceptionTest() - { - $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 - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogAttribute = new CatalogAttribute(); - $catalogAttributeKey = 'catalogAttributeKey-1525777188'; - $catalogAttribute->setKey($catalogAttributeKey); - $request = (new ReplaceCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - try { - $gapicClient->replaceCatalogAttribute($request); - // 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 setDefaultBranchTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - $request = new SetDefaultBranchRequest(); - $gapicClient->setDefaultBranch($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/SetDefaultBranch', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setDefaultBranchExceptionTest() - { - $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); - $request = new SetDefaultBranchRequest(); - try { - $gapicClient->setDefaultBranch($request); - // 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 updateAttributesConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $attributesConfig = new AttributesConfig(); - $attributesConfigName = 'attributesConfigName-1073347164'; - $attributesConfig->setName($attributesConfigName); - $request = (new UpdateAttributesConfigRequest()) - ->setAttributesConfig($attributesConfig); - $response = $gapicClient->updateAttributesConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateAttributesConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getAttributesConfig(); - $this->assertProtobufEquals($attributesConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAttributesConfigExceptionTest() - { - $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 - $attributesConfig = new AttributesConfig(); - $attributesConfigName = 'attributesConfigName-1073347164'; - $attributesConfig->setName($attributesConfigName); - $request = (new UpdateAttributesConfigRequest()) - ->setAttributesConfig($attributesConfig); - try { - $gapicClient->updateAttributesConfig($request); - // 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 updateCatalogTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Catalog(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $catalog = new Catalog(); - $catalogName = 'catalogName-1007379900'; - $catalog->setName($catalogName); - $catalogDisplayName = 'catalogDisplayName1836270740'; - $catalog->setDisplayName($catalogDisplayName); - $catalogProductLevelConfig = new ProductLevelConfig(); - $catalog->setProductLevelConfig($catalogProductLevelConfig); - $request = (new UpdateCatalogRequest()) - ->setCatalog($catalog); - $response = $gapicClient->updateCatalog($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateCatalog', $actualFuncCall); - $actualValue = $actualRequestObject->getCatalog(); - $this->assertProtobufEquals($catalog, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCatalogExceptionTest() - { - $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 - $catalog = new Catalog(); - $catalogName = 'catalogName-1007379900'; - $catalog->setName($catalogName); - $catalogDisplayName = 'catalogDisplayName1836270740'; - $catalog->setDisplayName($catalogDisplayName); - $catalogProductLevelConfig = new ProductLevelConfig(); - $catalog->setProductLevelConfig($catalogProductLevelConfig); - $request = (new UpdateCatalogRequest()) - ->setCatalog($catalog); - try { - $gapicClient->updateCatalog($request); - // 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 updateCompletionConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $matchingOrder = 'matchingOrder1035789452'; - $maxSuggestions = 618824852; - $minPrefixLength = 96853510; - $autoLearning = true; - $lastSuggestionsImportOperation = 'lastSuggestionsImportOperation-470644314'; - $lastDenylistImportOperation = 'lastDenylistImportOperation-181585959'; - $lastAllowlistImportOperation = 'lastAllowlistImportOperation723854958'; - $expectedResponse = new CompletionConfig(); - $expectedResponse->setName($name); - $expectedResponse->setMatchingOrder($matchingOrder); - $expectedResponse->setMaxSuggestions($maxSuggestions); - $expectedResponse->setMinPrefixLength($minPrefixLength); - $expectedResponse->setAutoLearning($autoLearning); - $expectedResponse->setLastSuggestionsImportOperation($lastSuggestionsImportOperation); - $expectedResponse->setLastDenylistImportOperation($lastDenylistImportOperation); - $expectedResponse->setLastAllowlistImportOperation($lastAllowlistImportOperation); - $transport->addResponse($expectedResponse); - // Mock request - $completionConfig = new CompletionConfig(); - $completionConfigName = 'completionConfigName2129042921'; - $completionConfig->setName($completionConfigName); - $request = (new UpdateCompletionConfigRequest()) - ->setCompletionConfig($completionConfig); - $response = $gapicClient->updateCompletionConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/UpdateCompletionConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getCompletionConfig(); - $this->assertProtobufEquals($completionConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCompletionConfigExceptionTest() - { - $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 - $completionConfig = new CompletionConfig(); - $completionConfigName = 'completionConfigName2129042921'; - $completionConfig->setName($completionConfigName); - $request = (new UpdateCompletionConfigRequest()) - ->setCompletionConfig($completionConfig); - try { - $gapicClient->updateCompletionConfig($request); - // 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 addCatalogAttributeAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new AttributesConfig(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedAttributesConfig = $gapicClient->attributesConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogAttribute = new CatalogAttribute(); - $catalogAttributeKey = 'catalogAttributeKey-1525777188'; - $catalogAttribute->setKey($catalogAttributeKey); - $request = (new AddCatalogAttributeRequest()) - ->setAttributesConfig($formattedAttributesConfig) - ->setCatalogAttribute($catalogAttribute); - $response = $gapicClient->addCatalogAttributeAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CatalogService/AddCatalogAttribute', $actualFuncCall); - $actualValue = $actualRequestObject->getAttributesConfig(); - $this->assertProtobufEquals($formattedAttributesConfig, $actualValue); - $actualValue = $actualRequestObject->getCatalogAttribute(); - $this->assertProtobufEquals($catalogAttribute, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php deleted file mode 100644 index 80eb6811827..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/CompletionServiceClientTest.php +++ /dev/null @@ -1,312 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CompletionServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CompletionServiceClient($options); - } - - /** @test */ - public function completeQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $attributionToken = 'attributionToken-729411015'; - $expectedResponse = new CompleteQueryResponse(); - $expectedResponse->setAttributionToken($attributionToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $query = 'query107944136'; - $request = (new CompleteQueryRequest()) - ->setCatalog($formattedCatalog) - ->setQuery($query); - $response = $gapicClient->completeQuery($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CompletionService/CompleteQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getCatalog(); - $this->assertProtobufEquals($formattedCatalog, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function completeQueryExceptionTest() - { - $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 - $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $query = 'query107944136'; - $request = (new CompleteQueryRequest()) - ->setCatalog($formattedCatalog) - ->setQuery($query); - try { - $gapicClient->completeQuery($request); - // 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 importCompletionDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importCompletionDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportCompletionDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importCompletionDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfig = new CompletionDataInputConfig(); - $inputConfigBigQuerySource = new BigQuerySource(); - $bigQuerySourceDatasetId = 'bigQuerySourceDatasetId-567522032'; - $inputConfigBigQuerySource->setDatasetId($bigQuerySourceDatasetId); - $bigQuerySourceTableId = 'bigQuerySourceTableId1074792998'; - $inputConfigBigQuerySource->setTableId($bigQuerySourceTableId); - $inputConfig->setBigQuerySource($inputConfigBigQuerySource); - $request = (new ImportCompletionDataRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importCompletionData($request); - $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.retail.v2.CompletionService/ImportCompletionData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importCompletionDataTest'); - $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 importCompletionDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importCompletionDataTest'); - $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 CompletionDataInputConfig(); - $inputConfigBigQuerySource = new BigQuerySource(); - $bigQuerySourceDatasetId = 'bigQuerySourceDatasetId-567522032'; - $inputConfigBigQuerySource->setDatasetId($bigQuerySourceDatasetId); - $bigQuerySourceTableId = 'bigQuerySourceTableId1074792998'; - $inputConfigBigQuerySource->setTableId($bigQuerySourceTableId); - $inputConfig->setBigQuerySource($inputConfigBigQuerySource); - $request = (new ImportCompletionDataRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importCompletionData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importCompletionDataTest'); - 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 completeQueryAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $attributionToken = 'attributionToken-729411015'; - $expectedResponse = new CompleteQueryResponse(); - $expectedResponse->setAttributionToken($attributionToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $query = 'query107944136'; - $request = (new CompleteQueryRequest()) - ->setCatalog($formattedCatalog) - ->setQuery($query); - $response = $gapicClient->completeQueryAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.CompletionService/CompleteQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getCatalog(); - $this->assertProtobufEquals($formattedCatalog, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php deleted file mode 100644 index f6ef148c6f8..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ControlServiceClientTest.php +++ /dev/null @@ -1,470 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ControlServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ControlServiceClient($options); - } - - /** @test */ - public function createControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Control(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $control = new Control(); - $controlDisplayName = 'controlDisplayName-1438249776'; - $control->setDisplayName($controlDisplayName); - $controlSolutionTypes = []; - $control->setSolutionTypes($controlSolutionTypes); - $controlId = 'controlId637416253'; - $request = (new CreateControlRequest()) - ->setParent($formattedParent) - ->setControl($control) - ->setControlId($controlId); - $response = $gapicClient->createControl($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/CreateControl', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getControl(); - $this->assertProtobufEquals($control, $actualValue); - $actualValue = $actualRequestObject->getControlId(); - $this->assertProtobufEquals($controlId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createControlExceptionTest() - { - $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]'); - $control = new Control(); - $controlDisplayName = 'controlDisplayName-1438249776'; - $control->setDisplayName($controlDisplayName); - $controlSolutionTypes = []; - $control->setSolutionTypes($controlSolutionTypes); - $controlId = 'controlId637416253'; - $request = (new CreateControlRequest()) - ->setParent($formattedParent) - ->setControl($control) - ->setControlId($controlId); - try { - $gapicClient->createControl($request); - // 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 deleteControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); - $request = (new DeleteControlRequest()) - ->setName($formattedName); - $gapicClient->deleteControl($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/DeleteControl', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteControlExceptionTest() - { - $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->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); - $request = (new DeleteControlRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteControl($request); - // 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 getControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Control(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); - $request = (new GetControlRequest()) - ->setName($formattedName); - $response = $gapicClient->getControl($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/GetControl', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getControlExceptionTest() - { - $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->controlName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CONTROL]'); - $request = (new GetControlRequest()) - ->setName($formattedName); - try { - $gapicClient->getControl($request); - // 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 listControlsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $controlsElement = new Control(); - $controls = [ - $controlsElement, - ]; - $expectedResponse = new ListControlsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setControls($controls); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new ListControlsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listControls($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getControls()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/ListControls', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listControlsExceptionTest() - { - $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]'); - $request = (new ListControlsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listControls($request); - // 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 updateControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Control(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $control = new Control(); - $controlDisplayName = 'controlDisplayName-1438249776'; - $control->setDisplayName($controlDisplayName); - $controlSolutionTypes = []; - $control->setSolutionTypes($controlSolutionTypes); - $request = (new UpdateControlRequest()) - ->setControl($control); - $response = $gapicClient->updateControl($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/UpdateControl', $actualFuncCall); - $actualValue = $actualRequestObject->getControl(); - $this->assertProtobufEquals($control, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateControlExceptionTest() - { - $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 - $control = new Control(); - $controlDisplayName = 'controlDisplayName-1438249776'; - $control->setDisplayName($controlDisplayName); - $controlSolutionTypes = []; - $control->setSolutionTypes($controlSolutionTypes); - $request = (new UpdateControlRequest()) - ->setControl($control); - try { - $gapicClient->updateControl($request); - // 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 createControlAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Control(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $control = new Control(); - $controlDisplayName = 'controlDisplayName-1438249776'; - $control->setDisplayName($controlDisplayName); - $controlSolutionTypes = []; - $control->setSolutionTypes($controlSolutionTypes); - $controlId = 'controlId637416253'; - $request = (new CreateControlRequest()) - ->setParent($formattedParent) - ->setControl($control) - ->setControlId($controlId); - $response = $gapicClient->createControlAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ControlService/CreateControl', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getControl(); - $this->assertProtobufEquals($control, $actualValue); - $actualValue = $actualRequestObject->getControlId(); - $this->assertProtobufEquals($controlId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php deleted file mode 100644 index 150f4a82cab..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php +++ /dev/null @@ -1,442 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return GenerativeQuestionServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new GenerativeQuestionServiceClient($options); - } - - /** @test */ - public function batchUpdateGenerativeQuestionConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $requests = []; - $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) - ->setRequests($requests); - $response = $gapicClient->batchUpdateGenerativeQuestionConfigs($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchUpdateGenerativeQuestionConfigsExceptionTest() - { - $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 - $requests = []; - $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) - ->setRequests($requests); - try { - $gapicClient->batchUpdateGenerativeQuestionConfigs($request); - // 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 getGenerativeQuestionsFeatureConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $catalog2 = 'catalog21455933836'; - $featureEnabled = true; - $minimumProducts = 417095051; - $expectedResponse = new GenerativeQuestionsFeatureConfig(); - $expectedResponse->setCatalog($catalog2); - $expectedResponse->setFeatureEnabled($featureEnabled); - $expectedResponse->setMinimumProducts($minimumProducts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetGenerativeQuestionsFeatureConfigRequest()) - ->setCatalog($formattedCatalog); - $response = $gapicClient->getGenerativeQuestionsFeatureConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/GetGenerativeQuestionsFeatureConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getCatalog(); - $this->assertProtobufEquals($formattedCatalog, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGenerativeQuestionsFeatureConfigExceptionTest() - { - $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 - $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new GetGenerativeQuestionsFeatureConfigRequest()) - ->setCatalog($formattedCatalog); - try { - $gapicClient->getGenerativeQuestionsFeatureConfig($request); - // 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 listGenerativeQuestionConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListGenerativeQuestionConfigsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new ListGenerativeQuestionConfigsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listGenerativeQuestionConfigs($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/ListGenerativeQuestionConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGenerativeQuestionConfigsExceptionTest() - { - $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]'); - $request = (new ListGenerativeQuestionConfigsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listGenerativeQuestionConfigs($request); - // 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 updateGenerativeQuestionConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $catalog = 'catalog555704345'; - $facet = 'facet97187255'; - $generatedQuestion = 'generatedQuestion-1515248490'; - $finalQuestion = 'finalQuestion1509683343'; - $frequency = -7002384; - $allowedInConversation = true; - $expectedResponse = new GenerativeQuestionConfig(); - $expectedResponse->setCatalog($catalog); - $expectedResponse->setFacet($facet); - $expectedResponse->setGeneratedQuestion($generatedQuestion); - $expectedResponse->setFinalQuestion($finalQuestion); - $expectedResponse->setFrequency($frequency); - $expectedResponse->setAllowedInConversation($allowedInConversation); - $transport->addResponse($expectedResponse); - // Mock request - $generativeQuestionConfig = new GenerativeQuestionConfig(); - $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; - $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); - $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; - $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); - $request = (new UpdateGenerativeQuestionConfigRequest()) - ->setGenerativeQuestionConfig($generativeQuestionConfig); - $response = $gapicClient->updateGenerativeQuestionConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getGenerativeQuestionConfig(); - $this->assertProtobufEquals($generativeQuestionConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateGenerativeQuestionConfigExceptionTest() - { - $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 - $generativeQuestionConfig = new GenerativeQuestionConfig(); - $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; - $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); - $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; - $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); - $request = (new UpdateGenerativeQuestionConfigRequest()) - ->setGenerativeQuestionConfig($generativeQuestionConfig); - try { - $gapicClient->updateGenerativeQuestionConfig($request); - // 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 updateGenerativeQuestionsFeatureConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $catalog = 'catalog555704345'; - $featureEnabled = true; - $minimumProducts = 417095051; - $expectedResponse = new GenerativeQuestionsFeatureConfig(); - $expectedResponse->setCatalog($catalog); - $expectedResponse->setFeatureEnabled($featureEnabled); - $expectedResponse->setMinimumProducts($minimumProducts); - $transport->addResponse($expectedResponse); - // Mock request - $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); - $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; - $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); - $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) - ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); - $response = $gapicClient->updateGenerativeQuestionsFeatureConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionsFeatureConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getGenerativeQuestionsFeatureConfig(); - $this->assertProtobufEquals($generativeQuestionsFeatureConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateGenerativeQuestionsFeatureConfigExceptionTest() - { - $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 - $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); - $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; - $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); - $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) - ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); - try { - $gapicClient->updateGenerativeQuestionsFeatureConfig($request); - // 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 batchUpdateGenerativeQuestionConfigsAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $requests = []; - $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) - ->setRequests($requests); - $response = $gapicClient->batchUpdateGenerativeQuestionConfigsAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php deleted file mode 100644 index 5dd7ad9cee6..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ModelServiceClientTest.php +++ /dev/null @@ -1,863 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ModelServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ModelServiceClient($options); - } - - /** @test */ - public function createModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $model = new Model(); - $modelName = 'modelName-2010829484'; - $model->setName($modelName); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $modelType = 'modelType-2010627581'; - $model->setType($modelType); - $request = (new CreateModelRequest()) - ->setParent($formattedParent) - ->setModel($model); - $response = $gapicClient->createModel($request); - $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.retail.v2.ModelService/CreateModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createModelTest'); - $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 createModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createModelTest'); - $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]'); - $model = new Model(); - $modelName = 'modelName-2010829484'; - $model->setName($modelName); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $modelType = 'modelType-2010627581'; - $model->setType($modelType); - $request = (new CreateModelRequest()) - ->setParent($formattedParent) - ->setModel($model); - $response = $gapicClient->createModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createModelTest'); - 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 deleteModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new DeleteModelRequest()) - ->setName($formattedName); - $gapicClient->deleteModel($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/DeleteModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteModelExceptionTest() - { - $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new DeleteModelRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteModel($request); - // 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 getModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new GetModelRequest()) - ->setName($formattedName); - $response = $gapicClient->getModel($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/GetModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelExceptionTest() - { - $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new GetModelRequest()) - ->setName($formattedName); - try { - $gapicClient->getModel($request); - // 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 listModelsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelsElement = new Model(); - $models = [ - $modelsElement, - ]; - $expectedResponse = new ListModelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModels($models); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new ListModelsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listModels($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/ListModels', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelsExceptionTest() - { - $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]'); - $request = (new ListModelsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listModels($request); - // 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 pauseModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new PauseModelRequest()) - ->setName($formattedName); - $response = $gapicClient->pauseModel($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/PauseModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseModelExceptionTest() - { - $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->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new PauseModelRequest()) - ->setName($formattedName); - try { - $gapicClient->pauseModel($request); - // 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 resumeModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new ResumeModelRequest()) - ->setName($name); - $response = $gapicClient->resumeModel($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/ResumeModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeModelExceptionTest() - { - $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 - $name = 'name3373707'; - $request = (new ResumeModelRequest()) - ->setName($name); - try { - $gapicClient->resumeModel($request); - // 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 tuneModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/tuneModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new TuneModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/tuneModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new TuneModelRequest()) - ->setName($formattedName); - $response = $gapicClient->tuneModel($request); - $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.retail.v2.ModelService/TuneModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/tuneModelTest'); - $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 tuneModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/tuneModelTest'); - $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 - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[MODEL]'); - $request = (new TuneModelRequest()) - ->setName($formattedName); - $response = $gapicClient->tuneModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/tuneModelTest'); - 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 updateModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $transport->addResponse($expectedResponse); - // Mock request - $model = new Model(); - $modelName = 'modelName-2010829484'; - $model->setName($modelName); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $modelType = 'modelType-2010627581'; - $model->setType($modelType); - $request = (new UpdateModelRequest()) - ->setModel($model); - $response = $gapicClient->updateModel($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ModelService/UpdateModel', $actualFuncCall); - $actualValue = $actualRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateModelExceptionTest() - { - $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 - $model = new Model(); - $modelName = 'modelName-2010829484'; - $model->setName($modelName); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $modelType = 'modelType-2010627581'; - $model->setType($modelType); - $request = (new UpdateModelRequest()) - ->setModel($model); - try { - $gapicClient->updateModel($request); - // 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 createModelAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $type = 'type3575610'; - $optimizationObjective = 'optimizationObjective1167007975'; - $tuningOperation = 'tuningOperation1763651677'; - $expectedResponse = new Model(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setType($type); - $expectedResponse->setOptimizationObjective($optimizationObjective); - $expectedResponse->setTuningOperation($tuningOperation); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $model = new Model(); - $modelName = 'modelName-2010829484'; - $model->setName($modelName); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $modelType = 'modelType-2010627581'; - $model->setType($modelType); - $request = (new CreateModelRequest()) - ->setParent($formattedParent) - ->setModel($model); - $response = $gapicClient->createModelAsync($request)->wait(); - $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.retail.v2.ModelService/CreateModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createModelTest'); - $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()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php deleted file mode 100644 index 01d2f155daf..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/PredictionServiceClientTest.php +++ /dev/null @@ -1,182 +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 - $attributionToken = 'attributionToken-729411015'; - $validateOnly2 = true; - $expectedResponse = new PredictResponse(); - $expectedResponse->setAttributionToken($attributionToken); - $expectedResponse->setValidateOnly($validateOnly2); - $transport->addResponse($expectedResponse); - // Mock request - $placement = 'placement1792938725'; - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventVisitorId = 'userEventVisitorId-2104193702'; - $userEvent->setVisitorId($userEventVisitorId); - $request = (new PredictRequest()) - ->setPlacement($placement) - ->setUserEvent($userEvent); - $response = $gapicClient->predict($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.PredictionService/Predict', $actualFuncCall); - $actualValue = $actualRequestObject->getPlacement(); - $this->assertProtobufEquals($placement, $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 - $placement = 'placement1792938725'; - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventVisitorId = 'userEventVisitorId-2104193702'; - $userEvent->setVisitorId($userEventVisitorId); - $request = (new PredictRequest()) - ->setPlacement($placement) - ->setUserEvent($userEvent); - try { - $gapicClient->predict($request); - // 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 predictAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $attributionToken = 'attributionToken-729411015'; - $validateOnly2 = true; - $expectedResponse = new PredictResponse(); - $expectedResponse->setAttributionToken($attributionToken); - $expectedResponse->setValidateOnly($validateOnly2); - $transport->addResponse($expectedResponse); - // Mock request - $placement = 'placement1792938725'; - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventVisitorId = 'userEventVisitorId-2104193702'; - $userEvent->setVisitorId($userEventVisitorId); - $request = (new PredictRequest()) - ->setPlacement($placement) - ->setUserEvent($userEvent); - $response = $gapicClient->predictAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.PredictionService/Predict', $actualFuncCall); - $actualValue = $actualRequestObject->getPlacement(); - $this->assertProtobufEquals($placement, $actualValue); - $actualValue = $actualRequestObject->getUserEvent(); - $this->assertProtobufEquals($userEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php deleted file mode 100644 index de4b554b847..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ProductServiceClientTest.php +++ /dev/null @@ -1,1447 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ProductServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ProductServiceClient($options); - } - - /** @test */ - public function addFulfillmentPlacesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/addFulfillmentPlacesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AddFulfillmentPlacesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/addFulfillmentPlacesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $type = 'type3575610'; - $placeIds = []; - $request = (new AddFulfillmentPlacesRequest()) - ->setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - $response = $gapicClient->addFulfillmentPlaces($request); - $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.retail.v2.ProductService/AddFulfillmentPlaces', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProduct(); - $this->assertProtobufEquals($formattedProduct, $actualValue); - $actualValue = $actualApiRequestObject->getType(); - $this->assertProtobufEquals($type, $actualValue); - $actualValue = $actualApiRequestObject->getPlaceIds(); - $this->assertProtobufEquals($placeIds, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); - $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 addFulfillmentPlacesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/addFulfillmentPlacesTest'); - $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 - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $type = 'type3575610'; - $placeIds = []; - $request = (new AddFulfillmentPlacesRequest()) - ->setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - $response = $gapicClient->addFulfillmentPlaces($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); - 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 addLocalInventoriesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/addLocalInventoriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AddLocalInventoriesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/addLocalInventoriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $localInventories = []; - $request = (new AddLocalInventoriesRequest()) - ->setProduct($formattedProduct) - ->setLocalInventories($localInventories); - $response = $gapicClient->addLocalInventories($request); - $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.retail.v2.ProductService/AddLocalInventories', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProduct(); - $this->assertProtobufEquals($formattedProduct, $actualValue); - $actualValue = $actualApiRequestObject->getLocalInventories(); - $this->assertProtobufEquals($localInventories, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addLocalInventoriesTest'); - $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 addLocalInventoriesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/addLocalInventoriesTest'); - $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 - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $localInventories = []; - $request = (new AddLocalInventoriesRequest()) - ->setProduct($formattedProduct) - ->setLocalInventories($localInventories); - $response = $gapicClient->addLocalInventories($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addLocalInventoriesTest'); - 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 createProductTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $id = 'id3355'; - $primaryProductId = 'primaryProductId-898851640'; - $gtin = 'gtin3183314'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $uri = 'uri116076'; - $expectedResponse = new Product(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setPrimaryProductId($primaryProductId); - $expectedResponse->setGtin($gtin); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setUri($uri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $product = new Product(); - $productTitle = 'productTitle1004085929'; - $product->setTitle($productTitle); - $productId = 'productId1753008747'; - $request = (new CreateProductRequest()) - ->setParent($formattedParent) - ->setProduct($product) - ->setProductId($productId); - $response = $gapicClient->createProduct($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ProductService/CreateProduct', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getProduct(); - $this->assertProtobufEquals($product, $actualValue); - $actualValue = $actualRequestObject->getProductId(); - $this->assertProtobufEquals($productId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProductExceptionTest() - { - $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $product = new Product(); - $productTitle = 'productTitle1004085929'; - $product->setTitle($productTitle); - $productId = 'productId1753008747'; - $request = (new CreateProductRequest()) - ->setParent($formattedParent) - ->setProduct($product) - ->setProductId($productId); - try { - $gapicClient->createProduct($request); - // 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 deleteProductTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $request = (new DeleteProductRequest()) - ->setName($formattedName); - $gapicClient->deleteProduct($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ProductService/DeleteProduct', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteProductExceptionTest() - { - $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->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $request = (new DeleteProductRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteProduct($request); - // 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 getProductTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $primaryProductId = 'primaryProductId-898851640'; - $gtin = 'gtin3183314'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $uri = 'uri116076'; - $expectedResponse = new Product(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setPrimaryProductId($primaryProductId); - $expectedResponse->setGtin($gtin); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setUri($uri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $request = (new GetProductRequest()) - ->setName($formattedName); - $response = $gapicClient->getProduct($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ProductService/GetProduct', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProductExceptionTest() - { - $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->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $request = (new GetProductRequest()) - ->setName($formattedName); - try { - $gapicClient->getProduct($request); - // 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 importProductsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importProductsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportProductsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importProductsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $inputConfig = new ProductInputConfig(); - $request = (new ImportProductsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importProducts($request); - $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.retail.v2.ProductService/ImportProducts', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importProductsTest'); - $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 importProductsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/importProductsTest'); - $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $inputConfig = new ProductInputConfig(); - $request = (new ImportProductsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importProducts($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importProductsTest'); - 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 listProductsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $productsElement = new Product(); - $products = [ - $productsElement, - ]; - $expectedResponse = new ListProductsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProducts($products); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $request = (new ListProductsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProducts($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ProductService/ListProducts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProductsExceptionTest() - { - $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $request = (new ListProductsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProducts($request); - // 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 purgeProductsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/purgeProductsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $purgeCount = 575305851; - $expectedResponse = new PurgeProductsResponse(); - $expectedResponse->setPurgeCount($purgeCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/purgeProductsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $filter = 'filter-1274492040'; - $request = (new PurgeProductsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeProducts($request); - $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.retail.v2.ProductService/PurgeProducts', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); - $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 purgeProductsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/purgeProductsTest'); - $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->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); - $filter = 'filter-1274492040'; - $request = (new PurgeProductsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeProducts($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); - 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 removeFulfillmentPlacesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/removeFulfillmentPlacesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new RemoveFulfillmentPlacesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/removeFulfillmentPlacesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $type = 'type3575610'; - $placeIds = []; - $request = (new RemoveFulfillmentPlacesRequest()) - ->setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - $response = $gapicClient->removeFulfillmentPlaces($request); - $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.retail.v2.ProductService/RemoveFulfillmentPlaces', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProduct(); - $this->assertProtobufEquals($formattedProduct, $actualValue); - $actualValue = $actualApiRequestObject->getType(); - $this->assertProtobufEquals($type, $actualValue); - $actualValue = $actualApiRequestObject->getPlaceIds(); - $this->assertProtobufEquals($placeIds, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeFulfillmentPlacesTest'); - $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 removeFulfillmentPlacesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/removeFulfillmentPlacesTest'); - $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 - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $type = 'type3575610'; - $placeIds = []; - $request = (new RemoveFulfillmentPlacesRequest()) - ->setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - $response = $gapicClient->removeFulfillmentPlaces($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeFulfillmentPlacesTest'); - 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 removeLocalInventoriesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/removeLocalInventoriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new RemoveLocalInventoriesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/removeLocalInventoriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $placeIds = []; - $request = (new RemoveLocalInventoriesRequest()) - ->setProduct($formattedProduct) - ->setPlaceIds($placeIds); - $response = $gapicClient->removeLocalInventories($request); - $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.retail.v2.ProductService/RemoveLocalInventories', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProduct(); - $this->assertProtobufEquals($formattedProduct, $actualValue); - $actualValue = $actualApiRequestObject->getPlaceIds(); - $this->assertProtobufEquals($placeIds, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeLocalInventoriesTest'); - $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 removeLocalInventoriesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/removeLocalInventoriesTest'); - $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 - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $placeIds = []; - $request = (new RemoveLocalInventoriesRequest()) - ->setProduct($formattedProduct) - ->setPlaceIds($placeIds); - $response = $gapicClient->removeLocalInventories($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeLocalInventoriesTest'); - 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 setInventoryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/setInventoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SetInventoryResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setInventoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $inventory = new Product(); - $inventoryTitle = 'inventoryTitle-43609508'; - $inventory->setTitle($inventoryTitle); - $request = (new SetInventoryRequest()) - ->setInventory($inventory); - $response = $gapicClient->setInventory($request); - $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.retail.v2.ProductService/SetInventory', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInventory(); - $this->assertProtobufEquals($inventory, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInventoryTest'); - $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 setInventoryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/setInventoryTest'); - $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 - $inventory = new Product(); - $inventoryTitle = 'inventoryTitle-43609508'; - $inventory->setTitle($inventoryTitle); - $request = (new SetInventoryRequest()) - ->setInventory($inventory); - $response = $gapicClient->setInventory($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInventoryTest'); - 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 updateProductTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $id = 'id3355'; - $primaryProductId = 'primaryProductId-898851640'; - $gtin = 'gtin3183314'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $uri = 'uri116076'; - $expectedResponse = new Product(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setPrimaryProductId($primaryProductId); - $expectedResponse->setGtin($gtin); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setUri($uri); - $transport->addResponse($expectedResponse); - // Mock request - $product = new Product(); - $productTitle = 'productTitle1004085929'; - $product->setTitle($productTitle); - $request = (new UpdateProductRequest()) - ->setProduct($product); - $response = $gapicClient->updateProduct($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ProductService/UpdateProduct', $actualFuncCall); - $actualValue = $actualRequestObject->getProduct(); - $this->assertProtobufEquals($product, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProductExceptionTest() - { - $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 - $product = new Product(); - $productTitle = 'productTitle1004085929'; - $product->setTitle($productTitle); - $request = (new UpdateProductRequest()) - ->setProduct($product); - try { - $gapicClient->updateProduct($request); - // 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 addFulfillmentPlacesAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/addFulfillmentPlacesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AddFulfillmentPlacesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/addFulfillmentPlacesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProduct = $gapicClient->productName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]', '[PRODUCT]'); - $type = 'type3575610'; - $placeIds = []; - $request = (new AddFulfillmentPlacesRequest()) - ->setProduct($formattedProduct) - ->setType($type) - ->setPlaceIds($placeIds); - $response = $gapicClient->addFulfillmentPlacesAsync($request)->wait(); - $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.retail.v2.ProductService/AddFulfillmentPlaces', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProduct(); - $this->assertProtobufEquals($formattedProduct, $actualValue); - $actualValue = $actualApiRequestObject->getType(); - $this->assertProtobufEquals($type, $actualValue); - $actualValue = $actualApiRequestObject->getPlaceIds(); - $this->assertProtobufEquals($placeIds, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addFulfillmentPlacesTest'); - $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()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php deleted file mode 100644 index ef3baf51166..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/SearchServiceClientTest.php +++ /dev/null @@ -1,198 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SearchServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SearchServiceClient($options); - } - - /** @test */ - public function searchTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $totalSize = 705419236; - $correctedQuery = 'correctedQuery107869074'; - $attributionToken = 'attributionToken-729411015'; - $nextPageToken = ''; - $redirectUri = 'redirectUri951230089'; - $resultsElement = new SearchResult(); - $results = [ - $resultsElement, - ]; - $expectedResponse = new SearchResponse(); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCorrectedQuery($correctedQuery); - $expectedResponse->setAttributionToken($attributionToken); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRedirectUri($redirectUri); - $expectedResponse->setResults($results); - $transport->addResponse($expectedResponse); - // Mock request - $placement = 'placement1792938725'; - $visitorId = 'visitorId-1832599924'; - $request = (new SearchRequest()) - ->setPlacement($placement) - ->setVisitorId($visitorId); - $response = $gapicClient->search($request); - $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.retail.v2.SearchService/Search', $actualFuncCall); - $actualValue = $actualRequestObject->getPlacement(); - $this->assertProtobufEquals($placement, $actualValue); - $actualValue = $actualRequestObject->getVisitorId(); - $this->assertProtobufEquals($visitorId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchExceptionTest() - { - $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 - $placement = 'placement1792938725'; - $visitorId = 'visitorId-1832599924'; - $request = (new SearchRequest()) - ->setPlacement($placement) - ->setVisitorId($visitorId); - try { - $gapicClient->search($request); - // 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 searchAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $totalSize = 705419236; - $correctedQuery = 'correctedQuery107869074'; - $attributionToken = 'attributionToken-729411015'; - $nextPageToken = ''; - $redirectUri = 'redirectUri951230089'; - $resultsElement = new SearchResult(); - $results = [ - $resultsElement, - ]; - $expectedResponse = new SearchResponse(); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCorrectedQuery($correctedQuery); - $expectedResponse->setAttributionToken($attributionToken); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRedirectUri($redirectUri); - $expectedResponse->setResults($results); - $transport->addResponse($expectedResponse); - // Mock request - $placement = 'placement1792938725'; - $visitorId = 'visitorId-1832599924'; - $request = (new SearchRequest()) - ->setPlacement($placement) - ->setVisitorId($visitorId); - $response = $gapicClient->searchAsync($request)->wait(); - $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.retail.v2.SearchService/Search', $actualFuncCall); - $actualValue = $actualRequestObject->getPlacement(); - $this->assertProtobufEquals($placement, $actualValue); - $actualValue = $actualRequestObject->getVisitorId(); - $this->assertProtobufEquals($visitorId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php deleted file mode 100644 index d810ba23992..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/ServingConfigServiceClientTest.php +++ /dev/null @@ -1,668 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ServingConfigServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ServingConfigServiceClient($options); - } - - /** @test */ - public function addControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $controlId = 'controlId637416253'; - $request = (new AddControlRequest()) - ->setServingConfig($formattedServingConfig) - ->setControlId($controlId); - $response = $gapicClient->addControl($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/AddControl', $actualFuncCall); - $actualValue = $actualRequestObject->getServingConfig(); - $this->assertProtobufEquals($formattedServingConfig, $actualValue); - $actualValue = $actualRequestObject->getControlId(); - $this->assertProtobufEquals($controlId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addControlExceptionTest() - { - $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 - $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $controlId = 'controlId637416253'; - $request = (new AddControlRequest()) - ->setServingConfig($formattedServingConfig) - ->setControlId($controlId); - try { - $gapicClient->addControl($request); - // 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 createServingConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $servingConfig = new ServingConfig(); - $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; - $servingConfig->setDisplayName($servingConfigDisplayName); - $servingConfigSolutionTypes = []; - $servingConfig->setSolutionTypes($servingConfigSolutionTypes); - $servingConfigId = 'servingConfigId-600821051'; - $request = (new CreateServingConfigRequest()) - ->setParent($formattedParent) - ->setServingConfig($servingConfig) - ->setServingConfigId($servingConfigId); - $response = $gapicClient->createServingConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/CreateServingConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServingConfig(); - $this->assertProtobufEquals($servingConfig, $actualValue); - $actualValue = $actualRequestObject->getServingConfigId(); - $this->assertProtobufEquals($servingConfigId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServingConfigExceptionTest() - { - $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]'); - $servingConfig = new ServingConfig(); - $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; - $servingConfig->setDisplayName($servingConfigDisplayName); - $servingConfigSolutionTypes = []; - $servingConfig->setSolutionTypes($servingConfigSolutionTypes); - $servingConfigId = 'servingConfigId-600821051'; - $request = (new CreateServingConfigRequest()) - ->setParent($formattedParent) - ->setServingConfig($servingConfig) - ->setServingConfigId($servingConfigId); - try { - $gapicClient->createServingConfig($request); - // 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 deleteServingConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $request = (new DeleteServingConfigRequest()) - ->setName($formattedName); - $gapicClient->deleteServingConfig($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/DeleteServingConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServingConfigExceptionTest() - { - $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->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $request = (new DeleteServingConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteServingConfig($request); - // 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 getServingConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $request = (new GetServingConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getServingConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/GetServingConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServingConfigExceptionTest() - { - $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->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $request = (new GetServingConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getServingConfig($request); - // 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 listServingConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servingConfigsElement = new ServingConfig(); - $servingConfigs = [ - $servingConfigsElement, - ]; - $expectedResponse = new ListServingConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServingConfigs($servingConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $request = (new ListServingConfigsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listServingConfigs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServingConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/ListServingConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServingConfigsExceptionTest() - { - $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]'); - $request = (new ListServingConfigsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listServingConfigs($request); - // 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 removeControlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $controlId = 'controlId637416253'; - $request = (new RemoveControlRequest()) - ->setServingConfig($formattedServingConfig) - ->setControlId($controlId); - $response = $gapicClient->removeControl($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/RemoveControl', $actualFuncCall); - $actualValue = $actualRequestObject->getServingConfig(); - $this->assertProtobufEquals($formattedServingConfig, $actualValue); - $actualValue = $actualRequestObject->getControlId(); - $this->assertProtobufEquals($controlId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeControlExceptionTest() - { - $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 - $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $controlId = 'controlId637416253'; - $request = (new RemoveControlRequest()) - ->setServingConfig($formattedServingConfig) - ->setControlId($controlId); - try { - $gapicClient->removeControl($request); - // 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 updateServingConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $servingConfig = new ServingConfig(); - $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; - $servingConfig->setDisplayName($servingConfigDisplayName); - $servingConfigSolutionTypes = []; - $servingConfig->setSolutionTypes($servingConfigSolutionTypes); - $request = (new UpdateServingConfigRequest()) - ->setServingConfig($servingConfig); - $response = $gapicClient->updateServingConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/UpdateServingConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getServingConfig(); - $this->assertProtobufEquals($servingConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServingConfigExceptionTest() - { - $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 - $servingConfig = new ServingConfig(); - $servingConfigDisplayName = 'servingConfigDisplayName-490549473'; - $servingConfig->setDisplayName($servingConfigDisplayName); - $servingConfigSolutionTypes = []; - $servingConfig->setSolutionTypes($servingConfigSolutionTypes); - $request = (new UpdateServingConfigRequest()) - ->setServingConfig($servingConfig); - try { - $gapicClient->updateServingConfig($request); - // 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 addControlAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $modelId = 'modelId-619038223'; - $priceRerankingLevel = 'priceRerankingLevel1240955890'; - $diversityLevel = 'diversityLevel1294448926'; - $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; - $ignoreRecsDenylist = false; - $expectedResponse = new ServingConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModelId($modelId); - $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); - $expectedResponse->setDiversityLevel($diversityLevel); - $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); - $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); - $transport->addResponse($expectedResponse); - // Mock request - $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); - $controlId = 'controlId637416253'; - $request = (new AddControlRequest()) - ->setServingConfig($formattedServingConfig) - ->setControlId($controlId); - $response = $gapicClient->addControlAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.ServingConfigService/AddControl', $actualFuncCall); - $actualValue = $actualRequestObject->getServingConfig(); - $this->assertProtobufEquals($formattedServingConfig, $actualValue); - $actualValue = $actualRequestObject->getControlId(); - $this->assertProtobufEquals($controlId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php b/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php deleted file mode 100644 index 8845e40faa9..00000000000 --- a/owl-bot-staging/Retail/v2/tests/Unit/V2/Client/UserEventServiceClientTest.php +++ /dev/null @@ -1,672 +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 - $parent = 'parent-995424086'; - $userEvent = 'userEvent1921940774'; - $request = (new CollectUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - $response = $gapicClient->collectUserEvent($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.UserEventService/CollectUserEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $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 - $parent = 'parent-995424086'; - $userEvent = 'userEvent1921940774'; - $request = (new CollectUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - try { - $gapicClient->collectUserEvent($request); - // 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([ - 'apiEndpoint' => '', - '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfig = new UserEventInputConfig(); - $inputConfigUserEventInlineSource = new UserEventInlineSource(); - $userEventInlineSourceUserEvents = []; - $inputConfigUserEventInlineSource->setUserEvents($userEventInlineSourceUserEvents); - $inputConfig->setUserEventInlineSource($inputConfigUserEventInlineSource); - $request = (new ImportUserEventsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importUserEvents($request); - $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.retail.v2.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([ - 'apiEndpoint' => '', - '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfig = new UserEventInputConfig(); - $inputConfigUserEventInlineSource = new UserEventInlineSource(); - $userEventInlineSourceUserEvents = []; - $inputConfigUserEventInlineSource->setUserEvents($userEventInlineSourceUserEvents); - $inputConfig->setUserEventInlineSource($inputConfigUserEventInlineSource); - $request = (new ImportUserEventsRequest()) - ->setParent($formattedParent) - ->setInputConfig($inputConfig); - $response = $gapicClient->importUserEvents($request); - $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 purgeUserEventsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $filter = 'filter-1274492040'; - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeUserEvents($request); - $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.retail.v2.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([ - 'apiEndpoint' => '', - '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->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $filter = 'filter-1274492040'; - $request = (new PurgeUserEventsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); - $response = $gapicClient->purgeUserEvents($request); - $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 rejoinUserEventsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/rejoinUserEventsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $rejoinedUserEventsCount = 1152281574; - $expectedResponse = new RejoinUserEventsResponse(); - $expectedResponse->setRejoinedUserEventsCount($rejoinedUserEventsCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/rejoinUserEventsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $request = (new RejoinUserEventsRequest()) - ->setParent($parent); - $response = $gapicClient->rejoinUserEvents($request); - $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.retail.v2.UserEventService/RejoinUserEvents', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rejoinUserEventsTest'); - $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 rejoinUserEventsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/rejoinUserEventsTest'); - $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 - $parent = 'parent-995424086'; - $request = (new RejoinUserEventsRequest()) - ->setParent($parent); - $response = $gapicClient->rejoinUserEvents($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rejoinUserEventsTest'); - 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'; - $visitorId = 'visitorId-1832599924'; - $sessionId = 'sessionId1661853540'; - $attributionToken = 'attributionToken-729411015'; - $cartId = 'cartId554410650'; - $searchQuery = 'searchQuery461177713'; - $filter = 'filter-1274492040'; - $orderBy = 'orderBy1234304744'; - $offset = 1019779949; - $uri = 'uri116076'; - $referrerUri = 'referrerUri-2093856436'; - $pageViewId = 'pageViewId948896581'; - $entity = 'entity-1298275357'; - $expectedResponse = new UserEvent(); - $expectedResponse->setEventType($eventType); - $expectedResponse->setVisitorId($visitorId); - $expectedResponse->setSessionId($sessionId); - $expectedResponse->setAttributionToken($attributionToken); - $expectedResponse->setCartId($cartId); - $expectedResponse->setSearchQuery($searchQuery); - $expectedResponse->setFilter($filter); - $expectedResponse->setOrderBy($orderBy); - $expectedResponse->setOffset($offset); - $expectedResponse->setUri($uri); - $expectedResponse->setReferrerUri($referrerUri); - $expectedResponse->setPageViewId($pageViewId); - $expectedResponse->setEntity($entity); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventVisitorId = 'userEventVisitorId-2104193702'; - $userEvent->setVisitorId($userEventVisitorId); - $request = (new WriteUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - $response = $gapicClient->writeUserEvent($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.UserEventService/WriteUserEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $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 - $parent = 'parent-995424086'; - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventVisitorId = 'userEventVisitorId-2104193702'; - $userEvent->setVisitorId($userEventVisitorId); - $request = (new WriteUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - try { - $gapicClient->writeUserEvent($request); - // 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 collectUserEventAsyncTest() - { - $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 - $parent = 'parent-995424086'; - $userEvent = 'userEvent1921940774'; - $request = (new CollectUserEventRequest()) - ->setParent($parent) - ->setUserEvent($userEvent); - $response = $gapicClient->collectUserEventAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.retail.v2.UserEventService/CollectUserEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getUserEvent(); - $this->assertProtobufEquals($userEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php deleted file mode 100644 index d54649f835f7a54acab79d2e68ebac1315f85d5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2450 zcmb7G&u<$=6lR^qO~y$hHiEboh`|lSiP~M^N(DI$Xx$`jRUjd$ii9k!X4hkT$a-g) znROH*AK+i$#DzbFKY$}hoQuSX8&^)uk6nB7OHFfdRy*%~^WOK~_ufAIEEy!=4t$Jb z%#grc7@R;cz%XG{(2zzjNP9iZU`U4vi7;~@+}?v#{UT7636CVxFK7!^ivWFR(yeBv9wEcI!M+Zk>ZP?!0Jj0uV-s zbJ$ky;1odlm!v^NLdXRY^4}`qK8cASC?em>sJCDbMI1}di?+Qq4h5kxR1SM_h#TwB zU@F_ygvu?Z6N?a!0c^V7MVia|@F%KC@1ZDfuwAJckF`-MnX{=}0Dmc=E4HILl zbs@+tC|HV%w?oLVNLjq8<5mFU$y4VNn!JQ`yf~(c1sd~KYnsy(;wr~S5y7!|J)d2I zqi!1y(1=j>daegJYmI9M`8kdIvU6e*_d9!uYRIdT)OEY}Daoqjb-Rbkvln~k5ia^uPwH!_z^b|{ekkOPG+%9;sjEn5( zPIeSc6L#q&VPjPPxeV;XG#C=0b#Q>cOEDMrGAJjA$vCPOv>Nm6nU`M4_P{MJ8x-}i zZ%D6}*cP`1vIW(q+TDcnF$s6|DV4e&WK*~sUW(s`(mb8qea*urdRK20GKfWCM zLd1>^U%7Mr^u)5CfrTy&k1)#sXEosc>jG|T-yG~6u*5MNkr4YR3~4HvDd*u^l9|de zW$G#=^y*E0a`&ZY{pWoMR&}X$QrX?In%t4Y&iz_DDSg{-f*S($d36rX7{0CABB&IC zsQp<2OXsqbb-F2ANRT1U3RS9Fwv06&N4`KzjuKrcT}6EwqHuuyOA2AxD*yzDXNS55 znOh3p!tsbO8V_Y#_#?y!3L?y_vohdH^Q-I9dM*QJXA1fv$J~hpJ5eoT*&l!^j@3mz zN(CLNx$LKj9P09BRe(8dR@(%(uLQCyVCD#)7=r9YFgrp~iVY>L(kE7X4wOwlw-;pg zY909EB*FC`EUKGU})wfWb=aW+~$tFat@oGauSN-9SfBgMZ=|TM?wX9FgSlN>6TE)xV4L72pnZfSH z*erA2;#%M>YooUNn`f&jX+})0oZmfXAVk7ju6ulZeD2Vdtuip*2=|f*i5_Lc_OBLL zk&?SC>Ne19=%u`GeY0*-&u5yHX`kwE4SBiDKn9ZpoBH=3k6csT-X!1C>}g!c`!uIu q?3yv6CIWX)3o~ULl%=Df_tz#n=dM}wh3|qZzX`OZ+1+C>2H<}@%pJM_ diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php deleted file mode 100644 index 7d7617e7aa8761e1228820dc4126e8daf75f83de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2428 zcma)8+iu%N5RD_>G`=x((kMyOY#alz+eQYQmsV+7P}E9hEs+FCIdLF>psBS(Kqd*2 zGMW}aKcv6Vr+!AiqR;(`&MrmDas;G)u*lt+*)wO(?C^)5;`cE;BOMm9#LL)_oP8kK zdq(0U$|64+k+bpnIZKEiUB*e;jfV%x zI6SyIJn*A%7-T^d)pz%w~^e-q6duK}Wa_RPH*k#^K=P@D+eR^3s&3 zMF{u}2>!+6vr*uaH1jh2*$q-R2=NGS6#R^bEs0{V9*ZOXxL=$y{jNf8jWdI(;)L)%fy@j zYms@E@qAxF$crC?N&3ogSZ3QsCG3^>INIm%?*=^k9}{IW8)hZ&&cW@W=mbqEtg{jc2%R$r@ad++TVG*=ISTEU=zlYV7U9lv{KGc>3gu(N| z{CbwxF-+{`CM+k+OQW#1EIhyYjH4P|UPhrMT$+`Cl*-X9xd&Sby9!d2wmS({6~SJ7 zCYUwxnhj@w#C~D^n72w1Z%xFjeVw=l9@_?I;d)`?_sXRcmXsCEb#7 zSv7RLO*BJyO^Q!?M_P~{z`g0RMe$kHx_s-ld>5qYR$I}!7^foNhwbUA-B(pgTez{f z(}q>MAiM^5ZF)j2%{jdRqY6vZvJ4B4UW1i4ilyg=t-_+Fw+*SX^H&AduNOdm1ou^= z*F)GARc!p}>n+;WbdeSY>FdY3@kYmp+puNP6V2u+mVm#4ho)t8ENa_siz+S5j=J=1 zfqO!Xqu{dT_B7k(fR^Pa@CfsqESuC4I~cb`bx!DtOyJ9@f!0$xoN=Y^92u7O4lP#Y zI(&W8qS#kN8Pp@H9v4Wf@-7gntJbM0Hjn8k*6HTCz=7ScnhCSU4Q#4f)UjO!%Y$jp z7_9S}zfn*KddF=WmTTZC0*|!88Ps|`96DS;7{WT0Hu<7y*p6u+<&(uNyd73G-JzDQ zbR}u$@7u6BD|GoWJSdAXzi?9(VimDI)H$FM zmUs=0sM2+gCMizo&PBG&IaT|%WAu1UTvI_)JPA{=Y1suU@>6)+({xwUv2%2!%*D~` zqH1z2iDIIOqB`0Mr)46suGZ5Wd{vO&mQ#{z8K=yDlVOy5$qFQhStPR#RXqv`U_@7pe?Qd2QQqsyDwEn4mi zkag7XJ8Bu&0tj9;TAcC?y!UzH-Mq(<=E-YLJ65DcyVOD8OU){*internalAddGeneratedFile( - ' -� -#google/cloud/run/v2/execution.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto\'google/cloud/run/v2/task_template.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto"I -GetExecutionRequest2 -name ( B$�A�A -run.googleapis.com/Execution"� -ListExecutionsRequest4 -parent ( B$�A�Arun.googleapis.com/Execution - page_size ( - -page_token (  - show_deleted ("e -ListExecutionsResponse2 - -executions ( 2.google.cloud.run.v2.Execution -next_page_token ( "q -DeleteExecutionRequest2 -name ( B$�A�A -run.googleapis.com/Execution - validate_only ( -etag ( "q -CancelExecutionRequest2 -name ( B$�A�A -run.googleapis.com/Execution - validate_only ( -etag ( "� - - Execution -name ( B�A -uid ( B�A - -generation (B�A? -labels ( 2*.google.cloud.run.v2.Execution.LabelsEntryB�AI - annotations ( 2/.google.cloud.run.v2.Execution.AnnotationsEntryB�A4 - create_time ( 2.google.protobuf.TimestampB�A3 - -start_time ( 2.google.protobuf.TimestampB�A8 -completion_time ( 2.google.protobuf.TimestampB�A4 - update_time ( 2.google.protobuf.TimestampB�A4 - delete_time ( 2.google.protobuf.TimestampB�A4 - expire_time - ( 2.google.protobuf.TimestampB�A- - launch_stage (2.google.api.LaunchStage+ -job ( B�A�A -run.googleapis.com/Job - parallelism (B�A - -task_count (B�A8 -template ( 2!.google.cloud.run.v2.TaskTemplateB�A - reconciling (B�A7 - -conditions ( 2.google.cloud.run.v2.ConditionB�A -observed_generation (B�A - running_count (B�A -succeeded_count (B�A - failed_count (B�A -cancelled_count (B�A - retried_count (B�A -log_uri ( B�A - satisfies_pzs (B�A -etagc ( B�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8:o�Al -run.googleapis.com/ExecutionIprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}R2� - -Executions� - GetExecution(.google.cloud.run.v2.GetExecutionRequest.google.cloud.run.v2.Execution"D�Aname���75/v2/{name=projects/*/locations/*/jobs/*/executions/*}� -ListExecutions*.google.cloud.run.v2.ListExecutionsRequest+.google.cloud.run.v2.ListExecutionsResponse"F�Aparent���75/v2/{parent=projects/*/locations/*/jobs/*}/executions� -DeleteExecution+.google.cloud.run.v2.DeleteExecutionRequest.google.longrunning.Operation"]�A - Execution Execution�Aname���7*5/v2/{name=projects/*/locations/*/jobs/*/executions/*}� -CancelExecution+.google.cloud.run.v2.CancelExecutionRequest.google.longrunning.Operation"g�A - Execution Execution�Aname���A"internalAddGeneratedFile( - ' -� -,google/cloud/run/v2/execution_template.protogoogle.cloud.run.v2\'google/cloud/run/v2/task_template.proto"� -ExecutionTemplateB -labels ( 22.google.cloud.run.v2.ExecutionTemplate.LabelsEntryL - annotations ( 27.google.cloud.run.v2.ExecutionTemplate.AnnotationsEntry - parallelism ( - -task_count (8 -template ( 2!.google.cloud.run.v2.TaskTemplateB�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8B^ -com.google.cloud.run.v2BExecutionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php deleted file mode 100644 index f04aa7b7517d80a67f221929ccd91e2fa22497c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6807 zcmcIp&2t+`6<=AlW3~Jtx086H-DJnwu(5?bBFa_~6r7a4Y#bb0<&P8vs+t;&+VZSN zGqW=zIZnzPC@w5iap1-uz=b2lpTH$>f(xXIf&(Z1gq(QYJzt6?TQZQUSkk=r`n`Vd z_ddGkyU(m+3wlpQy`6mdey5czEbF+coAQApqorbQdqT?zqeB9R@Su-?OQ*`Y$SiCMC zDY`>I?jr9|$536(G(;+}Yp7&-MdWKz-uspbJ6soiGir3xu;Kca;S$?W^m>Ijs;ybB zY1e?YP-qc1a20*ByyB^)%V|gAGPki%xM1YE=-M3;)h>!QaXYs0gxO6OI1j$n`#7m+ zY4xIEnA8iV;S>ttp28&t36^z@8185?8yeA@C338EHPaqVbXx((AMd+Li;O0?M?5@@ zw7WgC<7!50cvVrr)yt;Q1UQ+-HRY?Xhzk1ud-(&>wsgqCYufSs$NMj|>u%yDF`A~m zPh9HA5x}*jwCgV)*5RXOLXw^hZ@VWss@S$^w4l5gU}k;SqE&0OYzUIP(&4hhTO5cU zXi&^trET?>Wp!okspeIYVzU_(jSVQG%R!pcqoO+dr;o?9+Ha+RNp`&?@wk`zai2VPq_$>wEGzw3x(x5K;{o1dz2~uNN;}tm zn1c`5VzBn;>0Wvd&G&#F0yJj^0R2D#>x$57a!n6~9^H>!KzDtpafZyVV<=U&2~-K_ zk9*{+4ge8LXwp(_K!6YvW6O!sy?++R-WLUYn?i+~46$}3=;ApL!&wxE)+~$xb22Y@ z96jigfUOjVW$*%;1YTKd3URhJdw2`YbfNu14=1u|=x4$>(55o$Xl9eRAnF^oipFW< z?==ezFe~#FN*!8s&BzL#sdQggntH)1YVj0KqZvil%~QFpIS!N!ZY!#B~ia|}i_iB4e9@;tVWQlWmwg1%1h z=V%-}?ts(cm+cuZqB(=Sa^;9B8qq|Cpj3rviTH7(NZ=qWOy} zgHOUd!t-ccv0Dykh(oed9OGpaCq@^bMj`XDzk0M^NL8czQn9I#s!kMJW=pWV<*D#K zf#MKL>i>wY6pD8s_ZhG#Uz{$`;>QJOybRoNPWS>%>Pmy?G)~lv`+dy-71B0is~WC- zhM%IO5>Boi7x%?L>sj_+~Qx^-9;Pqra?aK%L4O+HuYqG;i4VStxv=mQY zE;Ti@6nSN7HsMl<;iPV&8*E>uEg+C!agNhk28Sb8ZktUFdb=$oL)t8wRRxL0Cw~r#Z$oPMPaI)^A#o_dPtaUApz!R!32IsP$MFsl z=u{6;<3Mf70kd$MSyzA1*Sx?Jdj!tl1dgxVP5~ut0+yqIL7q za)ckDIeNJQLjhzcuMo8JT`mM#qJ?PUN`ZYeAJGCha67!6&gLHvi9Kj|zM1<>KJ!~T zi+=DBFQL2T-50g(>cQ6Tj=Xs7u7)q4=5gLD^@Ad<_Hx;Ju`fQQ$UJA~inV-ep77_2Cw28he&hvqM6);Et!~Fb{ zzx?Z0W4X*Sy%>ALsp|oLvk}~8IbI8NM*o@$t>JI_13q5rD-u9`J$sIS7ekYL496MY z>YnP{Goz;m&i|Q{cSSY|Fw3);TTW+#0e15=%bqi%CA`XW2j9Qa)pes1V3_w>v_jhsyx_huqq$5Ar4gxa|KIaDRg|;fIC+Y0`6| zxT*mB971#(CBjA!evM|)!wiqtFtLI@Q;21+l}x{gp=rqS;8rf&AzW!l-G@??=tt_7 zUo1QxelwRTGN3)d-(f)WFNCfr0raLk)c#8_2d);w2SHu(R7Htbm{VcqJk5+|4&3tu z+QF&#_c4SIU?igt>C6Zh190}n!8GgHb&FKE##^A<>j_v%t%o@F3J~HigsfHF|9`FMm?GB}>=Vqfu z--Og+KV0Dyeuc!Yk6I>sxdV$s8v{$M#uN6pF$q=PH6J|)E;m>C8;{5f5;}HhYM+-Q NjFZ2_I7jCQ{Rd^~s=NRI diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php deleted file mode 100644 index 41d418de4e9098803c8c743234a3263e691f4371..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3770 zcmb7H>vG#f6t3gMagK9UZ*I$gqNX%~)&`eC>hyx0J0XcDPBR1J8I3Hhoh7oQtX2lo z$xHB)r(lL(ya5lu1MrtVLVs~~B{_DY($XL4S~}miXV2w3tEVr#V-N1Co5Uf^;KWj! zJ(V95)nhJqP1jbNL90cWYPubd+JqHUb!}hW+dov-*R~Jm5$d}EGf7!(yKdViMbmZz ztH=VU*ew-LmiJ1K_|FTPHZ@hB8yx>zpuSEW%Bf+~pV9GWYRj;Fg3!yht-vukbsbdz_8pTf zE~z1>uwC$6Jm@nu_M|4xj^}P{JDf1bup4W{HyQP~%W7y^F1HEqM@&3fT#B|8bhM=| zhCY_dmz;d2au$%m-Bpzl9x!J``Yi~~`m07loGKn|Y*1obRdQ@}smsdc^HZIZybXFl zqJ$-)WGEg!r_sSHmeoJ!2Bv?p@0sxPKK!1C`FG}Bxf+@jWN8$zGz#6)?OPGf@Mw`m zK81Cn{g#G_RoCGL#iCRuVN}#jKBcA>Clm$7Xvb)i{D}BjP5)gPQD$Hq%d=xRRz9t! z(Fh?1Yy0_8`D+o<#Odb8@JFt6r;y-GVcqE-8BBQ!6R|6PK7$+NN=u3MaS#v4X+Rn2 z5QqE9=P>5EjQjamAG|>vz{^wSfQGQj2SA(0=QR@&qO& zfgZMz+%i|1PdrvgTbBa4b)}kxjD-5y9!w6tQ=Y@LPfXMS9X-_P7>(X?G z^ydgdwGVgl4VX6LCf7yd$WV@HParo~=?OWx2_V}=_Y8h4 zQK1lMe~myU#3~7}C;e~;?Z}lH_x~fhAx)e*Wfc^uUb=s3ROq~r0PY}rxiL$bWA3#&ECE;#WB(oV}qArsy&B<{MmQNIjoo3WZDgEm($ zfT~lF>xR0-dmhmkC}C9$a-#+fmzUIH6hX>K$H$@(a+@rIQH313HB6v#4JIwpG6I{U z3R+=Q$FvGe4Vz&`WxnMch?{e`MuqSXP~3yri&?f1>b3RN?TzjAwb?5O z%IvQ1?jL+No6@QDC!#nYBZh_2Z1-e=X0;udxsYPP(G1KJ z!Xu6$lpx9~*I_E`GS?GVCm+d#(*HREW8vt~;Cgib(k)^eJsq{d#i<}E$3%uw$_FsR zX@|H0@4pr7(c3#P?GZ*@tN&66c=Yl^m}?o-4j9q-F^=V9*S2t?_usET_Ly@|$Gce6 z63NB3b$D3YB)lRofYK{$#TNkF^iacP48l>L+#H9iwYsz#CintI+srd@){AERD6uj& z4{EDJsOltu9L&0Gt5cX7a!!cWaEYgsGEB--9%D{XSLK!FZTktbEom19U(g9%6@n24 zReJ<*Zj~gGc)uE$kCI1QfSC(Xke&)^(ToxGV}SDmCm3L#kBhpcD4eoXC3*FqG~C3o zlN7*eZfDuY>pzwocWbHdm%;D#aGeltZ2I?eqLa`7hlE8vm#FA1H5bDGdZ7ec~&%I8hjeA z#qd6RUHRty2JGF0&BN)6gy90otp77|l`r3evxv$e#yaj2t>iXZ*E0>%#Jl6Ac)5-v zuNlho1o}8gNEa_LHZerRCSIR4Gl=Kzqx=1@hzH@<(7?yjTR)tnW%zk>24?{O0internalAddGeneratedFile( - ' -� -"google/cloud/run/v2/revision.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto google/cloud/run/v2/status.proto)google/cloud/run/v2/vendor_settings.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.proto"G -GetRevisionRequest1 -name ( B#�A�A -run.googleapis.com/Revision"� -ListRevisionsRequest3 -parent ( B#�A�Arun.googleapis.com/Revision - page_size ( - -page_token (  - show_deleted ("b -ListRevisionsResponse0 - revisions ( 2.google.cloud.run.v2.Revision -next_page_token ( "o -DeleteRevisionRequest1 -name ( B#�A�A -run.googleapis.com/Revision - validate_only ( -etag ( "� -Revision -name ( B�A -uid ( B�A - -generation (B�A> -labels ( 2).google.cloud.run.v2.Revision.LabelsEntryB�AH - annotations ( 2..google.cloud.run.v2.Revision.AnnotationsEntryB�A4 - create_time ( 2.google.protobuf.TimestampB�A4 - update_time ( 2.google.protobuf.TimestampB�A4 - delete_time ( 2.google.protobuf.TimestampB�A4 - expire_time ( 2.google.protobuf.TimestampB�A- - launch_stage - (2.google.api.LaunchStage3 -service ( B"�A�A -run.googleapis.com/Service5 -scaling ( 2$.google.cloud.run.v2.RevisionScaling2 - -vpc_access ( 2.google.cloud.run.v2.VpcAccess( - max_instance_request_concurrency" (* -timeout ( 2.google.protobuf.Duration -service_account ( 2 - -containers ( 2.google.cloud.run.v2.Container, -volumes ( 2.google.cloud.run.v2.VolumeH -execution_environment (2).google.cloud.run.v2.ExecutionEnvironment> -encryption_key ( B&�A# -!cloudkms.googleapis.com/CryptoKey6 - service_mesh ( 2 .google.cloud.run.v2.ServiceMesh\\ - encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionC - encryption_key_shutdown_duration ( 2.google.protobuf.Duration - reconciling (B�A7 - -conditions ( 2.google.cloud.run.v2.ConditionB�A -observed_generation (B�A -log_uri! ( B�A - satisfies_pzs% (B�A -session_affinity& (G -scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusB�A8 - node_selector( ( 2!.google.cloud.run.v2.NodeSelector -etagc ( B�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8:t�Aq -run.googleapis.com/RevisionOprojects/{project}/locations/{location}/services/{service}/revisions/{revision}R2� - Revisions� - GetRevision\'.google.cloud.run.v2.GetRevisionRequest.google.cloud.run.v2.Revision"{�Aname���:8/v2/{name=projects/*/locations/*/services/*/revisions/*}���., -name$projects/*/locations/{location=*}/**� - ListRevisions).google.cloud.run.v2.ListRevisionsRequest*.google.cloud.run.v2.ListRevisionsResponse"�Aparent���:8/v2/{parent=projects/*/locations/*/services/*}/revisions���0. -parent$projects/*/locations/{location=*}/**� -DeleteRevision*.google.cloud.run.v2.DeleteRevisionRequest.google.longrunning.Operation"��A -RevisionRevision�Aname���:*8/v2/{name=projects/*/locations/*/services/*/revisions/*}���., -name$projects/*/locations/{location=*}/**F�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBU -com.google.cloud.run.v2B RevisionProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php deleted file mode 100644 index 0df8acbe163..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php +++ /dev/null @@ -1,62 +0,0 @@ -internalAddGeneratedFile( - ' -� -+google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"� -RevisionTemplate5 -revision ( B#�A�A -run.googleapis.com/RevisionF -labels ( 21.google.cloud.run.v2.RevisionTemplate.LabelsEntryB�AP - annotations ( 26.google.cloud.run.v2.RevisionTemplate.AnnotationsEntryB�A: -scaling ( 2$.google.cloud.run.v2.RevisionScalingB�A7 - -vpc_access ( 2.google.cloud.run.v2.VpcAccessB�A/ -timeout ( 2.google.protobuf.DurationB�A -service_account ( B�A2 - -containers - ( 2.google.cloud.run.v2.Container1 -volumes ( 2.google.cloud.run.v2.VolumeB�AM -execution_environment (2).google.cloud.run.v2.ExecutionEnvironmentB�A> -encryption_key ( B&�A# -!cloudkms.googleapis.com/CryptoKey- - max_instance_request_concurrency (B�A; - service_mesh ( 2 .google.cloud.run.v2.ServiceMeshB�Aa - encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionB�AH - encryption_key_shutdown_duration ( 2.google.protobuf.DurationB�A -session_affinity (B�A" -health_check_disabled (B�A= - node_selector ( 2!.google.cloud.run.v2.NodeSelectorB�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8B] -com.google.cloud.run.v2BRevisionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php deleted file mode 100644 index 784370ba87d..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php +++ /dev/null @@ -1,135 +0,0 @@ -internalAddGeneratedFile( - ' -�% -!google/cloud/run/v2/service.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto+google/cloud/run/v2/revision_template.proto(google/cloud/run/v2/traffic_target.proto)google/cloud/run/v2/vendor_settings.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"� -CreateServiceRequest2 -parent ( B"�A�Arun.googleapis.com/Service2 -service ( 2.google.cloud.run.v2.ServiceB�A - -service_id ( B�A - validate_only ("� -UpdateServiceRequest4 - update_mask ( 2.google.protobuf.FieldMaskB�A2 -service ( 2.google.cloud.run.v2.ServiceB�A - validate_only ( - allow_missing (B�A"� -ListServicesRequest2 -parent ( B"�A�Arun.googleapis.com/Service - page_size ( - -page_token (  - show_deleted ("_ -ListServicesResponse. -services ( 2.google.cloud.run.v2.Service -next_page_token ( "E -GetServiceRequest0 -name ( B"�A�A -run.googleapis.com/Service"m -DeleteServiceRequest0 -name ( B"�A�A -run.googleapis.com/Service - validate_only ( -etag ( "� -Service -name (  - description (  -uid ( B�A - -generation (B�A= -labels ( 2(.google.cloud.run.v2.Service.LabelsEntryB�AG - annotations ( 2-.google.cloud.run.v2.Service.AnnotationsEntryB�A4 - create_time ( 2.google.protobuf.TimestampB�A4 - update_time ( 2.google.protobuf.TimestampB�A4 - delete_time ( 2.google.protobuf.TimestampB�A4 - expire_time - ( 2.google.protobuf.TimestampB�A -creator ( B�A - last_modifier ( B�A -client (  -client_version ( 9 -ingress (2#.google.cloud.run.v2.IngressTrafficB�A2 - launch_stage (2.google.api.LaunchStageB�AK -binary_authorization ( 2(.google.cloud.run.v2.BinaryAuthorizationB�A< -template ( 2%.google.cloud.run.v2.RevisionTemplateB�A8 -traffic ( 2".google.cloud.run.v2.TrafficTargetB�A9 -scaling ( 2#.google.cloud.run.v2.ServiceScalingB�A! -invoker_iam_disabled (B�A! -default_uri_disabled (B�A -urls ( B�A -custom_audiences% (  -observed_generation (B�A? -terminal_condition ( 2.google.cloud.run.v2.ConditionB�A7 - -conditions ( 2.google.cloud.run.v2.ConditionB�AB -latest_ready_revision! ( B#�A�A -run.googleapis.com/RevisionD -latest_created_revision" ( B#�A�A -run.googleapis.com/RevisionG -traffic_statuses# ( 2(.google.cloud.run.v2.TrafficTargetStatusB�A -uri$ ( B�A - satisfies_pzs& (B�A - reconcilingb (B�A -etagc ( B�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8:^�A[ -run.googleapis.com/Service:projects/{project}/locations/{location}/services/{service}R2� -Services� - CreateService).google.cloud.run.v2.CreateServiceRequest.google.longrunning.Operation"��A -ServiceService�Aparent,service,service_id���7",/v2/{parent=projects/*/locations/*}/services:service���-+ -parent!projects/*/locations/{location=*}� - -GetService&.google.cloud.run.v2.GetServiceRequest.google.cloud.run.v2.Service"o�Aname���.,/v2/{name=projects/*/locations/*/services/*}���., -name$projects/*/locations/{location=*}/**� - ListServices(.google.cloud.run.v2.ListServicesRequest).google.cloud.run.v2.ListServicesResponse"p�Aparent���.,/v2/{parent=projects/*/locations/*}/services���-+ -parent!projects/*/locations/{location=*}� - UpdateService).google.cloud.run.v2.UpdateServiceRequest.google.longrunning.Operation"��A -ServiceService�Aservice�Aservice,update_mask���?24/v2/{service.name=projects/*/locations/*/services/*}:service���64 - service.name$projects/*/locations/{location=*}/**� - DeleteService).google.cloud.run.v2.DeleteServiceRequest.google.longrunning.Operation"��A -ServiceService�Aname���.*,/v2/{name=projects/*/locations/*/services/*}���., -name$projects/*/locations/{location=*}/**� - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"E���?=/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy� - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"H���B"=/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy:*� -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"N���H"C/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions:*F�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBT -com.google.cloud.run.v2B ServiceProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php deleted file mode 100644 index 2b1ce742f01..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - ' -� - google/cloud/run/v2/status.protogoogle.cloud.run.v2"; -RevisionScalingStatus" -desired_min_instance_count (BS -com.google.cloud.run.v2B StatusProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php deleted file mode 100644 index 868016cd657..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php +++ /dev/null @@ -1,103 +0,0 @@ -internalAddGeneratedFile( - ' -� -google/cloud/run/v2/task.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.protogoogle/rpc/status.proto"? -GetTaskRequest- -name ( B�A�A -run.googleapis.com/Task"� -ListTasksRequest/ -parent ( B�A�Arun.googleapis.com/Task - page_size ( - -page_token (  - show_deleted ("V -ListTasksResponse( -tasks ( 2.google.cloud.run.v2.Task -next_page_token ( "� -Task -name ( B�A -uid ( B�A - -generation (B�A: -labels ( 2%.google.cloud.run.v2.Task.LabelsEntryB�AD - annotations ( 2*.google.cloud.run.v2.Task.AnnotationsEntryB�A4 - create_time ( 2.google.protobuf.TimestampB�A7 -scheduled_time" ( 2.google.protobuf.TimestampB�A3 - -start_time ( 2.google.protobuf.TimestampB�A8 -completion_time ( 2.google.protobuf.TimestampB�A4 - update_time ( 2.google.protobuf.TimestampB�A4 - delete_time ( 2.google.protobuf.TimestampB�A4 - expire_time - ( 2.google.protobuf.TimestampB�A+ -job ( B�A�A -run.googleapis.com/Job7 - execution ( B$�A�A -run.googleapis.com/Execution2 - -containers ( 2.google.cloud.run.v2.Container, -volumes ( 2.google.cloud.run.v2.Volume - max_retries (* -timeout ( 2.google.protobuf.Duration -service_account ( H -execution_environment (2).google.cloud.run.v2.ExecutionEnvironment - reconciling (B�A7 - -conditions ( 2.google.cloud.run.v2.ConditionB�A -observed_generation (B�A -index (B�A -retried (B�AH -last_attempt_result ( 2&.google.cloud.run.v2.TaskAttemptResultB�AA -encryption_key ( B)�A�A# -!cloudkms.googleapis.com/CryptoKey7 - -vpc_access ( 2.google.cloud.run.v2.VpcAccessB�A -log_uri ( B�A - satisfies_pzs! (B�A -etagc ( B�A- - LabelsEntry -key (  -value ( :82 -AnnotationsEntry -key (  -value ( :8:w�At -run.googleapis.com/TaskVprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}R"T -TaskAttemptResult\' -status ( 2.google.rpc.StatusB�A - exit_code (B�A2� -Tasks� -GetTask#.google.cloud.run.v2.GetTaskRequest.google.cloud.run.v2.Task"L�Aname���?=/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}� - ListTasks%.google.cloud.run.v2.ListTasksRequest&.google.cloud.run.v2.ListTasksResponse"N�Aparent���?=/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasksF�Arun.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBQ -com.google.cloud.run.v2B TaskProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php deleted file mode 100644 index 75bcf93617ef9dc602423b9df478aafd2ecd206c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1579 zcma)6(M}UV6tz~Y3gbb4DR-JRLY%r;cR zFZn~h_#HkuJG)y-C<%RNo85EH+KH1-#BWm8LASYq)^2JAqF0lsVBl-S%$nks+2WR!;S_&@Qk)& zH4);(2Ne(s_^??&0Zn>D6Zg>4-MxtJo`u|PSGEzN9#IOnj7%$0LB9|-pCIgdjAEsU zHa{Cobr@%w5s&>eP3+)4@e~+=+t_}{sb+%Xh;Yg&6iYbPjIbMlFir2^w4P?Hz-v0A-ViCbM1SUxyLrzE&cBF(jvaN! zjJh+btSl#N60ovNe2pi5Wo?%5a7#Hp;|ZiR3o^16byVU}0$oj@_BNTxEcX&4;`eWU zXVKH?3zM&yYb3ZP%v^C*$lz>op|a}4DmQv?_EK2>1Imqr7n+M&cxVZ)W)j*KQ_udb zW%5gC!6%m;Gr*D=S{7%Db6+3i%P6Or4sg5tjENf;fh8{u4r@fJTLaQiUhB!P(xn16s2vdvJXo zB1tuFQnYc_=}PYIYQ3&h zP(OwT_yWF;C&qS~HngZb;s@U}=ggToGyDF7JeKGM?omz^(R7BVXILLoES1nA5D}gx zVMrAY#EE1PRTjpb0qzex>~vi3IY48PsDRe-T!?u@t3f1^Syd&xdRnV$MZ%B;6HU~d zYAYi}h?5f?XbtG)y}I zUGQD5sp2H^J2VaylUk@Dgx2d&+OmJ?pK@i9Hl<@BF6SES^=l%VSgV9y&5p66I#Ill z=}rmGmv8$JA>%|MS<3^Vu9hCY+DXkerKxc1h%0cEWq>?jfe_$s&uIJ1WCD|*Ue_%5yi z$AcFBWj{mPX~LX~NETZ#qt($O&U}LINeY9>b#Waao908buF1T(k>YoL8fa@J;~2&$ ziT^*Psq93t;$|v)@4JDvS7iUuC=2a*BfHym+Y`?o^&D?v9~=zYw&xD|6YulTnSAPx zhfdq=x=yEX$E={2x5OXVo-_6ehWQHlrCVZ0&Y?SoOog@95qb)4++=jiTqz*iuAy;M z$w%m7GQi2X$W9S(77h|{T233;eR?-LM&6Z{gZnz)qAN@H*M-X>^W8W{=Lr1<&5@7> diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php deleted file mode 100644 index 5504bca48fbb4fb082ec617d7bef602dfd51f869..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2510 zcmb7GUvt_<5Dz$Yfecu!#FDFp}gg)k;qZ^!5n#DTz^?~l|y@~|rl|q1CD-gZz?n3~> z(mjuKB~UxYftNt==LCJrG>GTxK0fZ6o@NTuH+9QA#zgkWP`5me5NB$n+mx{fuH}o!KCXS&?n_Ps2P+krN zoG(r7l|5MGBZT+TN%UOZ&Bmsuxa4NR!Z#-Eiwl3#gwg~>aQ|1^eU6etO$<@XUV4En zWS4jI{{f{&j#5jZpG4g3Kx%$LxdtD`QR4h$>*LlEx}6)^2MDYP-ow)%_|fr!FaLuuN+;t<$3W`_)n^p=`iYjNNAoL|+a(t_}E54=i62z9M-&x}=m~(Xp{r zkFZ1`-3M61H}nhG?n@y3U7-0rYf481xd-XK%k}4@a3E;U0?#*xrXhpNO^i}5UWK&~ z6(NtcF-L}jOdHl(d}4Y?vu)sX5F_O?P{yXf&BMmT_SXzM5E1DQqGE;y`ipsku-cJ9 zhQV^1yA#vkb?zN1-@;{_X@~JfW#7019?)7USxm!q?c9i&EUc&q-R72TY9$TJVISkEqrdHO z?1ALYp9xs43fYhyS0ADda7S+<7b)#n#dDNU(enl}OUw=u{i3 z#?)@L)lln9?aU?cDQuo^R$=M`%;VqIcT>q72W~N8xJOPH|1m$pp0K0-q4F?PzJmKq zEw!FDC6UMMsn%lMMhW*2dC`)5oEaNUvm+`zlXGt`xre;L1> zgoogle.cloud.run.v2.BinaryAuthorization - */ -class BinaryAuthorization extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. If present, indicates to use Breakglass using this justification. - * If use_default is False, then it must be empty. - * For more information on breakglass, see - * https://cloud.google.com/binary-authorization/docs/using-breakglass - * - * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $breakglass_justification = ''; - protected $binauthz_method; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $use_default - * Optional. If True, indicates to use the default project's binary - * authorization policy. If False, binary authorization will be disabled. - * @type string $policy - * Optional. The path to a binary authorization policy. - * Format: `projects/{project}/platforms/cloudRun/{policy-name}` - * @type string $breakglass_justification - * Optional. If present, indicates to use Breakglass using this justification. - * If use_default is False, then it must be empty. - * For more information on breakglass, see - * https://cloud.google.com/binary-authorization/docs/using-breakglass - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * Optional. If True, indicates to use the default project's binary - * authorization policy. If False, binary authorization will be disabled. - * - * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseDefault() - { - return $this->readOneof(1); - } - - public function hasUseDefault() - { - return $this->hasOneof(1); - } - - /** - * Optional. If True, indicates to use the default project's binary - * authorization policy. If False, binary authorization will be disabled. - * - * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseDefault($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. The path to a binary authorization policy. - * Format: `projects/{project}/platforms/cloudRun/{policy-name}` - * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getPolicy() - { - return $this->readOneof(3); - } - - public function hasPolicy() - { - return $this->hasOneof(3); - } - - /** - * Optional. The path to a binary authorization policy. - * Format: `projects/{project}/platforms/cloudRun/{policy-name}` - * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. If present, indicates to use Breakglass using this justification. - * If use_default is False, then it must be empty. - * For more information on breakglass, see - * https://cloud.google.com/binary-authorization/docs/using-breakglass - * - * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBreakglassJustification() - { - return $this->breakglass_justification; - } - - /** - * Optional. If present, indicates to use Breakglass using this justification. - * If use_default is False, then it must be empty. - * For more information on breakglass, see - * https://cloud.google.com/binary-authorization/docs/using-breakglass - * - * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBreakglassJustification($var) - { - GPBUtil::checkString($var, True); - $this->breakglass_justification = $var; - - return $this; - } - - /** - * @return string - */ - public function getBinauthzMethod() - { - return $this->whichOneof("binauthz_method"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php deleted file mode 100644 index 771e535b0e3..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php +++ /dev/null @@ -1,172 +0,0 @@ -google.cloud.run.v2.CancelExecutionRequest - */ -class CancelExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * cancelling any resources. - * - * Generated from protobuf field bool validate_only = 2; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - - /** - * @param string $name Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. Please see - * {@see ExecutionsClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\CancelExecutionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @type bool $validate_only - * Indicates that the request should be validated without actually - * cancelling any resources. - * @type string $etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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 name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * cancelling any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * cancelling any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php deleted file mode 100644 index 93ca08a9f46..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.run.v2.CloudSqlInstance - */ -class CloudSqlInstance extends \Google\Protobuf\Internal\Message -{ - /** - * The Cloud SQL instance connection names, as can be found in - * https://console.cloud.google.com/sql/instances. Visit - * https://cloud.google.com/sql/docs/mysql/connect-run for more information on - * how to connect Cloud SQL and Cloud Run. Format: - * {project}:{location}:{instance} - * - * Generated from protobuf field repeated string instances = 1; - */ - private $instances; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $instances - * The Cloud SQL instance connection names, as can be found in - * https://console.cloud.google.com/sql/instances. Visit - * https://cloud.google.com/sql/docs/mysql/connect-run for more information on - * how to connect Cloud SQL and Cloud Run. Format: - * {project}:{location}:{instance} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud SQL instance connection names, as can be found in - * https://console.cloud.google.com/sql/instances. Visit - * https://cloud.google.com/sql/docs/mysql/connect-run for more information on - * how to connect Cloud SQL and Cloud Run. Format: - * {project}:{location}:{instance} - * - * Generated from protobuf field repeated string instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The Cloud SQL instance connection names, as can be found in - * https://console.cloud.google.com/sql/instances. Visit - * https://cloud.google.com/sql/docs/mysql/connect-run for more information on - * how to connect Cloud SQL and Cloud Run. Format: - * {project}:{location}:{instance} - * - * Generated from protobuf field repeated string instances = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->instances = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php deleted file mode 100644 index e15712d24b3..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.run.v2.Condition - */ -class Condition extends \Google\Protobuf\Internal\Message -{ - /** - * type is used to communicate the status of the reconciliation process. - * See also: - * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - * Types common to all resources include: - * * "Ready": True when the Resource is ready. - * - * Generated from protobuf field string type = 1; - */ - protected $type = ''; - /** - * State of the condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; - */ - protected $state = 0; - /** - * Human readable message indicating details about the current status. - * - * Generated from protobuf field string message = 3; - */ - protected $message = ''; - /** - * Last time the condition transitioned from one status to another. - * - * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; - */ - protected $last_transition_time = null; - /** - * How to interpret failures of this condition, one of Error, Warning, Info - * - * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; - */ - protected $severity = 0; - protected $reasons; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $type - * type is used to communicate the status of the reconciliation process. - * See also: - * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - * Types common to all resources include: - * * "Ready": True when the Resource is ready. - * @type int $state - * State of the condition. - * @type string $message - * Human readable message indicating details about the current status. - * @type \Google\Protobuf\Timestamp $last_transition_time - * Last time the condition transitioned from one status to another. - * @type int $severity - * How to interpret failures of this condition, one of Error, Warning, Info - * @type int $reason - * Output only. A common (service-level) reason for this condition. - * @type int $revision_reason - * Output only. A reason for the revision condition. - * @type int $execution_reason - * Output only. A reason for the execution condition. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Condition::initOnce(); - parent::__construct($data); - } - - /** - * type is used to communicate the status of the reconciliation process. - * See also: - * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - * Types common to all resources include: - * * "Ready": True when the Resource is ready. - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * type is used to communicate the status of the reconciliation process. - * See also: - * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - * Types common to all resources include: - * * "Ready": True when the Resource is ready. - * - * Generated from protobuf field string type = 1; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * State of the condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * State of the condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\State::class); - $this->state = $var; - - return $this; - } - - /** - * Human readable message indicating details about the current status. - * - * Generated from protobuf field string message = 3; - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * Human readable message indicating details about the current status. - * - * Generated from protobuf field string message = 3; - * @param string $var - * @return $this - */ - public function setMessage($var) - { - GPBUtil::checkString($var, True); - $this->message = $var; - - return $this; - } - - /** - * Last time the condition transitioned from one status to another. - * - * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastTransitionTime() - { - return $this->last_transition_time; - } - - public function hasLastTransitionTime() - { - return isset($this->last_transition_time); - } - - public function clearLastTransitionTime() - { - unset($this->last_transition_time); - } - - /** - * Last time the condition transitioned from one status to another. - * - * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastTransitionTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_transition_time = $var; - - return $this; - } - - /** - * How to interpret failures of this condition, one of Error, Warning, Info - * - * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * How to interpret failures of this condition, one of Error, Warning, Info - * - * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\Severity::class); - $this->severity = $var; - - return $this; - } - - /** - * Output only. A common (service-level) reason for this condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getReason() - { - return $this->readOneof(6); - } - - public function hasReason() - { - return $this->hasOneof(6); - } - - /** - * Output only. A common (service-level) reason for this condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\CommonReason::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Output only. A reason for the revision condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRevisionReason() - { - return $this->readOneof(9); - } - - public function hasRevisionReason() - { - return $this->hasOneof(9); - } - - /** - * Output only. A reason for the revision condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRevisionReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\RevisionReason::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Output only. A reason for the execution condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getExecutionReason() - { - return $this->readOneof(11); - } - - public function hasExecutionReason() - { - return $this->hasOneof(11); - } - - /** - * Output only. A reason for the execution condition. - * - * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setExecutionReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\ExecutionReason::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * @return string - */ - public function getReasons() - { - return $this->whichOneof("reasons"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php deleted file mode 100644 index b7883e34e0a..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.run.v2.Condition.CommonReason - */ -class CommonReason -{ - /** - * Default value. - * - * Generated from protobuf enum COMMON_REASON_UNDEFINED = 0; - */ - const COMMON_REASON_UNDEFINED = 0; - /** - * Reason unknown. Further details will be in message. - * - * Generated from protobuf enum UNKNOWN = 1; - */ - const UNKNOWN = 1; - /** - * Revision creation process failed. - * - * Generated from protobuf enum REVISION_FAILED = 3; - */ - const REVISION_FAILED = 3; - /** - * Timed out waiting for completion. - * - * Generated from protobuf enum PROGRESS_DEADLINE_EXCEEDED = 4; - */ - const PROGRESS_DEADLINE_EXCEEDED = 4; - /** - * The container image path is incorrect. - * - * Generated from protobuf enum CONTAINER_MISSING = 6; - */ - const CONTAINER_MISSING = 6; - /** - * Insufficient permissions on the container image. - * - * Generated from protobuf enum CONTAINER_PERMISSION_DENIED = 7; - */ - const CONTAINER_PERMISSION_DENIED = 7; - /** - * Container image is not authorized by policy. - * - * Generated from protobuf enum CONTAINER_IMAGE_UNAUTHORIZED = 8; - */ - const CONTAINER_IMAGE_UNAUTHORIZED = 8; - /** - * Container image policy authorization check failed. - * - * Generated from protobuf enum CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; - */ - const CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; - /** - * Insufficient permissions on encryption key. - * - * Generated from protobuf enum ENCRYPTION_KEY_PERMISSION_DENIED = 10; - */ - const ENCRYPTION_KEY_PERMISSION_DENIED = 10; - /** - * Permission check on encryption key failed. - * - * Generated from protobuf enum ENCRYPTION_KEY_CHECK_FAILED = 11; - */ - const ENCRYPTION_KEY_CHECK_FAILED = 11; - /** - * At least one Access check on secrets failed. - * - * Generated from protobuf enum SECRETS_ACCESS_CHECK_FAILED = 12; - */ - const SECRETS_ACCESS_CHECK_FAILED = 12; - /** - * Waiting for operation to complete. - * - * Generated from protobuf enum WAITING_FOR_OPERATION = 13; - */ - const WAITING_FOR_OPERATION = 13; - /** - * System will retry immediately. - * - * Generated from protobuf enum IMMEDIATE_RETRY = 14; - */ - const IMMEDIATE_RETRY = 14; - /** - * System will retry later; current attempt failed. - * - * Generated from protobuf enum POSTPONED_RETRY = 15; - */ - const POSTPONED_RETRY = 15; - /** - * An internal error occurred. Further information may be in the message. - * - * Generated from protobuf enum INTERNAL = 16; - */ - const INTERNAL = 16; - - private static $valueToName = [ - self::COMMON_REASON_UNDEFINED => 'COMMON_REASON_UNDEFINED', - self::UNKNOWN => 'UNKNOWN', - self::REVISION_FAILED => 'REVISION_FAILED', - self::PROGRESS_DEADLINE_EXCEEDED => 'PROGRESS_DEADLINE_EXCEEDED', - self::CONTAINER_MISSING => 'CONTAINER_MISSING', - self::CONTAINER_PERMISSION_DENIED => 'CONTAINER_PERMISSION_DENIED', - self::CONTAINER_IMAGE_UNAUTHORIZED => 'CONTAINER_IMAGE_UNAUTHORIZED', - self::CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED => 'CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED', - self::ENCRYPTION_KEY_PERMISSION_DENIED => 'ENCRYPTION_KEY_PERMISSION_DENIED', - self::ENCRYPTION_KEY_CHECK_FAILED => 'ENCRYPTION_KEY_CHECK_FAILED', - self::SECRETS_ACCESS_CHECK_FAILED => 'SECRETS_ACCESS_CHECK_FAILED', - self::WAITING_FOR_OPERATION => 'WAITING_FOR_OPERATION', - self::IMMEDIATE_RETRY => 'IMMEDIATE_RETRY', - self::POSTPONED_RETRY => 'POSTPONED_RETRY', - self::INTERNAL => 'INTERNAL', - ]; - - 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(CommonReason::class, \Google\Cloud\Run\V2\Condition_CommonReason::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php deleted file mode 100644 index 11956647ed4..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.run.v2.Condition.ExecutionReason - */ -class ExecutionReason -{ - /** - * Default value. - * - * Generated from protobuf enum EXECUTION_REASON_UNDEFINED = 0; - */ - const EXECUTION_REASON_UNDEFINED = 0; - /** - * Internal system error getting execution status. System will retry. - * - * Generated from protobuf enum JOB_STATUS_SERVICE_POLLING_ERROR = 1; - */ - const JOB_STATUS_SERVICE_POLLING_ERROR = 1; - /** - * A task reached its retry limit and the last attempt failed due to the - * user container exiting with a non-zero exit code. - * - * Generated from protobuf enum NON_ZERO_EXIT_CODE = 2; - */ - const NON_ZERO_EXIT_CODE = 2; - /** - * The execution was cancelled by users. - * - * Generated from protobuf enum CANCELLED = 3; - */ - const CANCELLED = 3; - /** - * The execution is in the process of being cancelled. - * - * Generated from protobuf enum CANCELLING = 4; - */ - const CANCELLING = 4; - /** - * The execution was deleted. - * - * Generated from protobuf enum DELETED = 5; - */ - const DELETED = 5; - - private static $valueToName = [ - self::EXECUTION_REASON_UNDEFINED => 'EXECUTION_REASON_UNDEFINED', - self::JOB_STATUS_SERVICE_POLLING_ERROR => 'JOB_STATUS_SERVICE_POLLING_ERROR', - self::NON_ZERO_EXIT_CODE => 'NON_ZERO_EXIT_CODE', - self::CANCELLED => 'CANCELLED', - self::CANCELLING => 'CANCELLING', - self::DELETED => 'DELETED', - ]; - - 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(ExecutionReason::class, \Google\Cloud\Run\V2\Condition_ExecutionReason::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php deleted file mode 100644 index 26765337581..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.run.v2.Condition.RevisionReason - */ -class RevisionReason -{ - /** - * Default value. - * - * Generated from protobuf enum REVISION_REASON_UNDEFINED = 0; - */ - const REVISION_REASON_UNDEFINED = 0; - /** - * Revision in Pending state. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * Revision is in Reserve state. - * - * Generated from protobuf enum RESERVE = 2; - */ - const RESERVE = 2; - /** - * Revision is Retired. - * - * Generated from protobuf enum RETIRED = 3; - */ - const RETIRED = 3; - /** - * Revision is being retired. - * - * Generated from protobuf enum RETIRING = 4; - */ - const RETIRING = 4; - /** - * Revision is being recreated. - * - * Generated from protobuf enum RECREATING = 5; - */ - const RECREATING = 5; - /** - * There was a health check error. - * - * Generated from protobuf enum HEALTH_CHECK_CONTAINER_ERROR = 6; - */ - const HEALTH_CHECK_CONTAINER_ERROR = 6; - /** - * Health check failed due to user error from customized path of the - * container. System will retry. - * - * Generated from protobuf enum CUSTOMIZED_PATH_RESPONSE_PENDING = 7; - */ - const CUSTOMIZED_PATH_RESPONSE_PENDING = 7; - /** - * A revision with min_instance_count > 0 was created and is reserved, but - * it was not configured to serve traffic, so it's not live. This can also - * happen momentarily during traffic migration. - * - * Generated from protobuf enum MIN_INSTANCES_NOT_PROVISIONED = 8; - */ - const MIN_INSTANCES_NOT_PROVISIONED = 8; - /** - * The maximum allowed number of active revisions has been reached. - * - * Generated from protobuf enum ACTIVE_REVISION_LIMIT_REACHED = 9; - */ - const ACTIVE_REVISION_LIMIT_REACHED = 9; - /** - * There was no deployment defined. - * This value is no longer used, but Services created in older versions of - * the API might contain this value. - * - * Generated from protobuf enum NO_DEPLOYMENT = 10; - */ - const NO_DEPLOYMENT = 10; - /** - * A revision's container has no port specified since the revision is of a - * manually scaled service with 0 instance count - * - * Generated from protobuf enum HEALTH_CHECK_SKIPPED = 11; - */ - const HEALTH_CHECK_SKIPPED = 11; - /** - * A revision with min_instance_count > 0 was created and is waiting for - * enough instances to begin a traffic migration. - * - * Generated from protobuf enum MIN_INSTANCES_WARMING = 12; - */ - const MIN_INSTANCES_WARMING = 12; - - private static $valueToName = [ - self::REVISION_REASON_UNDEFINED => 'REVISION_REASON_UNDEFINED', - self::PENDING => 'PENDING', - self::RESERVE => 'RESERVE', - self::RETIRED => 'RETIRED', - self::RETIRING => 'RETIRING', - self::RECREATING => 'RECREATING', - self::HEALTH_CHECK_CONTAINER_ERROR => 'HEALTH_CHECK_CONTAINER_ERROR', - self::CUSTOMIZED_PATH_RESPONSE_PENDING => 'CUSTOMIZED_PATH_RESPONSE_PENDING', - self::MIN_INSTANCES_NOT_PROVISIONED => 'MIN_INSTANCES_NOT_PROVISIONED', - self::ACTIVE_REVISION_LIMIT_REACHED => 'ACTIVE_REVISION_LIMIT_REACHED', - self::NO_DEPLOYMENT => 'NO_DEPLOYMENT', - self::HEALTH_CHECK_SKIPPED => 'HEALTH_CHECK_SKIPPED', - self::MIN_INSTANCES_WARMING => 'MIN_INSTANCES_WARMING', - ]; - - 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(RevisionReason::class, \Google\Cloud\Run\V2\Condition_RevisionReason::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php deleted file mode 100644 index eb2c0967fd4..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.run.v2.Condition.Severity - */ -class Severity -{ - /** - * Unspecified severity - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * Error severity. - * - * Generated from protobuf enum ERROR = 1; - */ - const ERROR = 1; - /** - * Warning severity. - * - * Generated from protobuf enum WARNING = 2; - */ - const WARNING = 2; - /** - * Info severity. - * - * Generated from protobuf enum INFO = 3; - */ - const INFO = 3; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::ERROR => 'ERROR', - self::WARNING => 'WARNING', - self::INFO => 'INFO', - ]; - - 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(Severity::class, \Google\Cloud\Run\V2\Condition_Severity::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php deleted file mode 100644 index 3ca42a0f1e3..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.run.v2.Condition.State - */ -class State -{ - /** - * The default value. This value is used if the state is omitted. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Transient state: Reconciliation has not started yet. - * - * Generated from protobuf enum CONDITION_PENDING = 1; - */ - const CONDITION_PENDING = 1; - /** - * Transient state: reconciliation is still in progress. - * - * Generated from protobuf enum CONDITION_RECONCILING = 2; - */ - const CONDITION_RECONCILING = 2; - /** - * Terminal state: Reconciliation did not succeed. - * - * Generated from protobuf enum CONDITION_FAILED = 3; - */ - const CONDITION_FAILED = 3; - /** - * Terminal state: Reconciliation completed successfully. - * - * Generated from protobuf enum CONDITION_SUCCEEDED = 4; - */ - const CONDITION_SUCCEEDED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CONDITION_PENDING => 'CONDITION_PENDING', - self::CONDITION_RECONCILING => 'CONDITION_RECONCILING', - self::CONDITION_FAILED => 'CONDITION_FAILED', - self::CONDITION_SUCCEEDED => 'CONDITION_SUCCEEDED', - ]; - - 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(State::class, \Google\Cloud\Run\V2\Condition_State::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php deleted file mode 100644 index 1dc5d80d18b..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php +++ /dev/null @@ -1,531 +0,0 @@ -google.cloud.run.v2.Container - */ -class Container extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the container specified as a DNS_LABEL (RFC 1123). - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Required. Name of the container image in Dockerhub, Google Artifact - * Registry, or Google Container Registry. If the host is not provided, - * Dockerhub is assumed. - * - * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $image = ''; - /** - * Entrypoint array. Not executed within a shell. - * The docker image's ENTRYPOINT is used if this is not provided. - * - * Generated from protobuf field repeated string command = 3; - */ - private $command; - /** - * Arguments to the entrypoint. - * The docker image's CMD is used if this is not provided. - * - * Generated from protobuf field repeated string args = 4; - */ - private $args; - /** - * List of environment variables to set in the container. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; - */ - private $env; - /** - * Compute Resource requirements by this container. - * - * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; - */ - protected $resources = null; - /** - * List of ports to expose from the container. Only a single port can be - * specified. The specified ports must be listening on all interfaces - * (0.0.0.0) within the container to be accessible. - * If omitted, a port number will be chosen and passed to the container - * through the PORT environment variable for the container to listen on. - * - * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; - */ - private $ports; - /** - * Volume to mount into the container's filesystem. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; - */ - private $volume_mounts; - /** - * Container's working directory. - * If not specified, the container runtime's default will be used, which - * might be configured in the container image. - * - * Generated from protobuf field string working_dir = 9; - */ - protected $working_dir = ''; - /** - * Periodic probe of container liveness. - * Container will be restarted if the probe fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; - */ - protected $liveness_probe = null; - /** - * Startup probe of application within the container. - * All other probes are disabled if a startup probe is provided, until it - * succeeds. Container will not be added to service endpoints if the probe - * fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; - */ - protected $startup_probe = null; - /** - * Names of the containers that must start before this container. - * - * Generated from protobuf field repeated string depends_on = 12; - */ - private $depends_on; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the container specified as a DNS_LABEL (RFC 1123). - * @type string $image - * Required. Name of the container image in Dockerhub, Google Artifact - * Registry, or Google Container Registry. If the host is not provided, - * Dockerhub is assumed. - * @type array|\Google\Protobuf\Internal\RepeatedField $command - * Entrypoint array. Not executed within a shell. - * The docker image's ENTRYPOINT is used if this is not provided. - * @type array|\Google\Protobuf\Internal\RepeatedField $args - * Arguments to the entrypoint. - * The docker image's CMD is used if this is not provided. - * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env - * List of environment variables to set in the container. - * @type \Google\Cloud\Run\V2\ResourceRequirements $resources - * Compute Resource requirements by this container. - * @type array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $ports - * List of ports to expose from the container. Only a single port can be - * specified. The specified ports must be listening on all interfaces - * (0.0.0.0) within the container to be accessible. - * If omitted, a port number will be chosen and passed to the container - * through the PORT environment variable for the container to listen on. - * @type array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $volume_mounts - * Volume to mount into the container's filesystem. - * @type string $working_dir - * Container's working directory. - * If not specified, the container runtime's default will be used, which - * might be configured in the container image. - * @type \Google\Cloud\Run\V2\Probe $liveness_probe - * Periodic probe of container liveness. - * Container will be restarted if the probe fails. - * @type \Google\Cloud\Run\V2\Probe $startup_probe - * Startup probe of application within the container. - * All other probes are disabled if a startup probe is provided, until it - * succeeds. Container will not be added to service endpoints if the probe - * fails. - * @type array|\Google\Protobuf\Internal\RepeatedField $depends_on - * Names of the containers that must start before this container. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Name of the container specified as a DNS_LABEL (RFC 1123). - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the container specified as a DNS_LABEL (RFC 1123). - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Name of the container image in Dockerhub, Google Artifact - * Registry, or Google Container Registry. If the host is not provided, - * Dockerhub is assumed. - * - * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * Required. Name of the container image in Dockerhub, Google Artifact - * Registry, or Google Container Registry. If the host is not provided, - * Dockerhub is assumed. - * - * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkString($var, True); - $this->image = $var; - - return $this; - } - - /** - * Entrypoint array. Not executed within a shell. - * The docker image's ENTRYPOINT is used if this is not provided. - * - * Generated from protobuf field repeated string command = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCommand() - { - return $this->command; - } - - /** - * Entrypoint array. Not executed within a shell. - * The docker image's ENTRYPOINT is used if this is not provided. - * - * Generated from protobuf field repeated string command = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCommand($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->command = $arr; - - return $this; - } - - /** - * Arguments to the entrypoint. - * The docker image's CMD is used if this is not provided. - * - * Generated from protobuf field repeated string args = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getArgs() - { - return $this->args; - } - - /** - * Arguments to the entrypoint. - * The docker image's CMD is used if this is not provided. - * - * Generated from protobuf field repeated string args = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setArgs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->args = $arr; - - return $this; - } - - /** - * List of environment variables to set in the container. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * List of environment variables to set in the container. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; - * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); - $this->env = $arr; - - return $this; - } - - /** - * Compute Resource requirements by this container. - * - * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; - * @return \Google\Cloud\Run\V2\ResourceRequirements|null - */ - public function getResources() - { - return $this->resources; - } - - public function hasResources() - { - return isset($this->resources); - } - - public function clearResources() - { - unset($this->resources); - } - - /** - * Compute Resource requirements by this container. - * - * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; - * @param \Google\Cloud\Run\V2\ResourceRequirements $var - * @return $this - */ - public function setResources($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ResourceRequirements::class); - $this->resources = $var; - - return $this; - } - - /** - * List of ports to expose from the container. Only a single port can be - * specified. The specified ports must be listening on all interfaces - * (0.0.0.0) within the container to be accessible. - * If omitted, a port number will be chosen and passed to the container - * through the PORT environment variable for the container to listen on. - * - * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPorts() - { - return $this->ports; - } - - /** - * List of ports to expose from the container. Only a single port can be - * specified. The specified ports must be listening on all interfaces - * (0.0.0.0) within the container to be accessible. - * If omitted, a port number will be chosen and passed to the container - * through the PORT environment variable for the container to listen on. - * - * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; - * @param array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPorts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\ContainerPort::class); - $this->ports = $arr; - - return $this; - } - - /** - * Volume to mount into the container's filesystem. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumeMounts() - { - return $this->volume_mounts; - } - - /** - * Volume to mount into the container's filesystem. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; - * @param array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumeMounts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VolumeMount::class); - $this->volume_mounts = $arr; - - return $this; - } - - /** - * Container's working directory. - * If not specified, the container runtime's default will be used, which - * might be configured in the container image. - * - * Generated from protobuf field string working_dir = 9; - * @return string - */ - public function getWorkingDir() - { - return $this->working_dir; - } - - /** - * Container's working directory. - * If not specified, the container runtime's default will be used, which - * might be configured in the container image. - * - * Generated from protobuf field string working_dir = 9; - * @param string $var - * @return $this - */ - public function setWorkingDir($var) - { - GPBUtil::checkString($var, True); - $this->working_dir = $var; - - return $this; - } - - /** - * Periodic probe of container liveness. - * Container will be restarted if the probe fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; - * @return \Google\Cloud\Run\V2\Probe|null - */ - public function getLivenessProbe() - { - return $this->liveness_probe; - } - - public function hasLivenessProbe() - { - return isset($this->liveness_probe); - } - - public function clearLivenessProbe() - { - unset($this->liveness_probe); - } - - /** - * Periodic probe of container liveness. - * Container will be restarted if the probe fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; - * @param \Google\Cloud\Run\V2\Probe $var - * @return $this - */ - public function setLivenessProbe($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); - $this->liveness_probe = $var; - - return $this; - } - - /** - * Startup probe of application within the container. - * All other probes are disabled if a startup probe is provided, until it - * succeeds. Container will not be added to service endpoints if the probe - * fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; - * @return \Google\Cloud\Run\V2\Probe|null - */ - public function getStartupProbe() - { - return $this->startup_probe; - } - - public function hasStartupProbe() - { - return isset($this->startup_probe); - } - - public function clearStartupProbe() - { - unset($this->startup_probe); - } - - /** - * Startup probe of application within the container. - * All other probes are disabled if a startup probe is provided, until it - * succeeds. Container will not be added to service endpoints if the probe - * fails. - * - * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; - * @param \Google\Cloud\Run\V2\Probe $var - * @return $this - */ - public function setStartupProbe($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); - $this->startup_probe = $var; - - return $this; - } - - /** - * Names of the containers that must start before this container. - * - * Generated from protobuf field repeated string depends_on = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDependsOn() - { - return $this->depends_on; - } - - /** - * Names of the containers that must start before this container. - * - * Generated from protobuf field repeated string depends_on = 12; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDependsOn($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->depends_on = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php deleted file mode 100644 index 9fad73b12ee..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.run.v2.ContainerPort - */ -class ContainerPort extends \Google\Protobuf\Internal\Message -{ - /** - * If specified, used to specify which protocol to use. - * Allowed values are "http1" and "h2c". - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Port number the container listens on. - * This must be a valid TCP port number, 0 < container_port < 65536. - * - * Generated from protobuf field int32 container_port = 3; - */ - protected $container_port = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * If specified, used to specify which protocol to use. - * Allowed values are "http1" and "h2c". - * @type int $container_port - * Port number the container listens on. - * This must be a valid TCP port number, 0 < container_port < 65536. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * If specified, used to specify which protocol to use. - * Allowed values are "http1" and "h2c". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * If specified, used to specify which protocol to use. - * Allowed values are "http1" and "h2c". - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Port number the container listens on. - * This must be a valid TCP port number, 0 < container_port < 65536. - * - * Generated from protobuf field int32 container_port = 3; - * @return int - */ - public function getContainerPort() - { - return $this->container_port; - } - - /** - * Port number the container listens on. - * This must be a valid TCP port number, 0 < container_port < 65536. - * - * Generated from protobuf field int32 container_port = 3; - * @param int $var - * @return $this - */ - public function setContainerPort($var) - { - GPBUtil::checkInt32($var); - $this->container_port = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php deleted file mode 100644 index f201e0ba2b8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.run.v2.CreateJobRequest - */ -class CreateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Job instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job = null; - /** - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * - * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job_id = ''; - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Please see - * {@see JobsClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Run\V2\Job $job Required. The Job instance to create. - * @param string $jobId Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * - * @return \Google\Cloud\Run\V2\CreateJobRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Run\V2\Job $job, string $jobId): self - { - return (new self()) - ->setParent($parent) - ->setJob($job) - ->setJobId($jobId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @type \Google\Cloud\Run\V2\Job $job - * Required. The Job instance to create. - * @type string $job_id - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * @type bool $validate_only - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * 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 location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * 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 Job instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\Job|null - */ - public function getJob() - { - return $this->job; - } - - public function hasJob() - { - return isset($this->job); - } - - public function clearJob() - { - unset($this->job); - } - - /** - * Required. The Job instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); - $this->job = $var; - - return $this; - } - - /** - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * - * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getJobId() - { - return $this->job_id; - } - - /** - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * - * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setJobId($var) - { - GPBUtil::checkString($var, True); - $this->job_id = $var; - - return $this; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php deleted file mode 100644 index 7a5677b8d35..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.run.v2.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Service instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - /** - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * - * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service_id = ''; - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. Please see - * {@see ServicesClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Run\V2\Service $service Required. The Service instance to create. - * @param string $serviceId Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * - * @return \Google\Cloud\Run\V2\CreateServiceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Run\V2\Service $service, string $serviceId): self - { - return (new self()) - ->setParent($parent) - ->setService($service) - ->setServiceId($serviceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * @type \Google\Cloud\Run\V2\Service $service - * Required. The Service instance to create. - * @type string $service_id - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * @type bool $validate_only - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * - * 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 location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * - * 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 Service instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Service instance to create. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * - * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * - * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php deleted file mode 100644 index ea7d31e245f..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php +++ /dev/null @@ -1,172 +0,0 @@ -google.cloud.run.v2.DeleteExecutionRequest - */ -class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - - /** - * @param string $name Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. Please see - * {@see ExecutionsClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\DeleteExecutionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @type bool $validate_only - * Indicates that the request should be validated without actually - * deleting any resources. - * @type string $etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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 name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php deleted file mode 100644 index 0c4f53d9768..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.run.v2.DeleteJobRequest - */ -class DeleteJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 4; - */ - protected $etag = ''; - - /** - * @param string $name Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. Please see - * {@see JobsClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\DeleteJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @type bool $validate_only - * Indicates that the request should be validated without actually - * deleting any resources. - * @type string $etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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 full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 4; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 4; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php deleted file mode 100644 index 0b7bb2e7693..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.run.v2.DeleteRevisionRequest - */ -class DeleteRevisionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - - /** - * @param string $name Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * Please see {@see RevisionsClient::revisionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\DeleteRevisionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * @type bool $validate_only - * Indicates that the request should be validated without actually - * deleting any resources. - * @type string $etag - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * 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 name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php deleted file mode 100644 index 16182d4a160..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.run.v2.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - - /** - * @param string $name Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. Please see - * {@see ServicesClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\DeleteServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * @type bool $validate_only - * Indicates that the request should be validated without actually - * deleting any resources. - * @type string $etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * 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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php deleted file mode 100644 index be49c7f974b..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.run.v2.EmptyDirVolumeSource - */ -class EmptyDirVolumeSource extends \Google\Protobuf\Internal\Message -{ - /** - * The medium on which the data is stored. Acceptable values today is only - * MEMORY or none. When none, the default will currently be backed by memory - * but could change over time. +optional - * - * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; - */ - protected $medium = 0; - /** - * Limit on the storage usable by this EmptyDir volume. - * The size limit is also applicable for memory medium. - * The maximum usage on memory medium EmptyDir would be the minimum value - * between the SizeLimit specified here and the sum of memory limits of all - * containers. The default is nil which means that the limit is undefined. - * More info: - * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - * Info in Kubernetes: - * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - * - * Generated from protobuf field string size_limit = 2; - */ - protected $size_limit = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $medium - * The medium on which the data is stored. Acceptable values today is only - * MEMORY or none. When none, the default will currently be backed by memory - * but could change over time. +optional - * @type string $size_limit - * Limit on the storage usable by this EmptyDir volume. - * The size limit is also applicable for memory medium. - * The maximum usage on memory medium EmptyDir would be the minimum value - * between the SizeLimit specified here and the sum of memory limits of all - * containers. The default is nil which means that the limit is undefined. - * More info: - * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - * Info in Kubernetes: - * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * The medium on which the data is stored. Acceptable values today is only - * MEMORY or none. When none, the default will currently be backed by memory - * but could change over time. +optional - * - * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; - * @return int - */ - public function getMedium() - { - return $this->medium; - } - - /** - * The medium on which the data is stored. Acceptable values today is only - * MEMORY or none. When none, the default will currently be backed by memory - * but could change over time. +optional - * - * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; - * @param int $var - * @return $this - */ - public function setMedium($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource\Medium::class); - $this->medium = $var; - - return $this; - } - - /** - * Limit on the storage usable by this EmptyDir volume. - * The size limit is also applicable for memory medium. - * The maximum usage on memory medium EmptyDir would be the minimum value - * between the SizeLimit specified here and the sum of memory limits of all - * containers. The default is nil which means that the limit is undefined. - * More info: - * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - * Info in Kubernetes: - * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - * - * Generated from protobuf field string size_limit = 2; - * @return string - */ - public function getSizeLimit() - { - return $this->size_limit; - } - - /** - * Limit on the storage usable by this EmptyDir volume. - * The size limit is also applicable for memory medium. - * The maximum usage on memory medium EmptyDir would be the minimum value - * between the SizeLimit specified here and the sum of memory limits of all - * containers. The default is nil which means that the limit is undefined. - * More info: - * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - * Info in Kubernetes: - * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - * - * Generated from protobuf field string size_limit = 2; - * @param string $var - * @return $this - */ - public function setSizeLimit($var) - { - GPBUtil::checkString($var, True); - $this->size_limit = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php deleted file mode 100644 index f226a6c0cdd..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.run.v2.EmptyDirVolumeSource.Medium - */ -class Medium -{ - /** - * When not specified, falls back to the default implementation which - * is currently in memory (this may change over time). - * - * Generated from protobuf enum MEDIUM_UNSPECIFIED = 0; - */ - const MEDIUM_UNSPECIFIED = 0; - /** - * Explicitly set the EmptyDir to be in memory. Uses tmpfs. - * - * Generated from protobuf enum MEMORY = 1; - */ - const MEMORY = 1; - - private static $valueToName = [ - self::MEDIUM_UNSPECIFIED => 'MEDIUM_UNSPECIFIED', - self::MEMORY => 'MEMORY', - ]; - - 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(Medium::class, \Google\Cloud\Run\V2\EmptyDirVolumeSource_Medium::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php deleted file mode 100644 index 0b07b810a08..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.run.v2.EncryptionKeyRevocationAction - */ -class EncryptionKeyRevocationAction -{ - /** - * Unspecified - * - * Generated from protobuf enum ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; - */ - const ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; - /** - * Prevents the creation of new instances. - * - * Generated from protobuf enum PREVENT_NEW = 1; - */ - const PREVENT_NEW = 1; - /** - * Shuts down existing instances, and prevents creation of new ones. - * - * Generated from protobuf enum SHUTDOWN = 2; - */ - const SHUTDOWN = 2; - - private static $valueToName = [ - self::ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED => 'ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED', - self::PREVENT_NEW => 'PREVENT_NEW', - self::SHUTDOWN => 'SHUTDOWN', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php deleted file mode 100644 index 2073c4252a5..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.run.v2.EnvVar - */ -class EnvVar extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the environment variable. Must not exceed 32768 - * characters. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - protected $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the environment variable. Must not exceed 32768 - * characters. - * @type string $value - * Literal value of the environment variable. - * Defaults to "", and the maximum length is 32768 bytes. - * Variable references are not supported in Cloud Run. - * @type \Google\Cloud\Run\V2\EnvVarSource $value_source - * Source for the environment variable's value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the environment variable. Must not exceed 32768 - * characters. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the environment variable. Must not exceed 32768 - * characters. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Literal value of the environment variable. - * Defaults to "", and the maximum length is 32768 bytes. - * Variable references are not supported in Cloud Run. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->readOneof(2); - } - - public function hasValue() - { - return $this->hasOneof(2); - } - - /** - * Literal value of the environment variable. - * Defaults to "", and the maximum length is 32768 bytes. - * Variable references are not supported in Cloud Run. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Source for the environment variable's value. - * - * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; - * @return \Google\Cloud\Run\V2\EnvVarSource|null - */ - public function getValueSource() - { - return $this->readOneof(3); - } - - public function hasValueSource() - { - return $this->hasOneof(3); - } - - /** - * Source for the environment variable's value. - * - * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; - * @param \Google\Cloud\Run\V2\EnvVarSource $var - * @return $this - */ - public function setValueSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EnvVarSource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getValues() - { - return $this->whichOneof("values"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php deleted file mode 100644 index 99ffb8e651c..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.run.v2.EnvVarSource - */ -class EnvVarSource extends \Google\Protobuf\Internal\Message -{ - /** - * Selects a secret and a specific version from Cloud Secret Manager. - * - * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; - */ - protected $secret_key_ref = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Run\V2\SecretKeySelector $secret_key_ref - * Selects a secret and a specific version from Cloud Secret Manager. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Selects a secret and a specific version from Cloud Secret Manager. - * - * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; - * @return \Google\Cloud\Run\V2\SecretKeySelector|null - */ - public function getSecretKeyRef() - { - return $this->secret_key_ref; - } - - public function hasSecretKeyRef() - { - return isset($this->secret_key_ref); - } - - public function clearSecretKeyRef() - { - unset($this->secret_key_ref); - } - - /** - * Selects a secret and a specific version from Cloud Secret Manager. - * - * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; - * @param \Google\Cloud\Run\V2\SecretKeySelector $var - * @return $this - */ - public function setSecretKeyRef($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretKeySelector::class); - $this->secret_key_ref = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php deleted file mode 100644 index b72c09e5f96..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php +++ /dev/null @@ -1,1183 +0,0 @@ -google.cloud.run.v2.Execution - */ -class Execution extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique name of this Execution. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $labels; - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $annotations; - /** - * Output only. Represents time when the execution was acknowledged by the - * execution controller. It is not guaranteed to be set in happens-before - * order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Represents time when the execution started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. Represents time when the execution was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $completion_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; - */ - protected $launch_stage = 0; - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $job = ''; - /** - * Output only. Specifies the maximum desired number of tasks the execution - * should run at any given time. Must be <= task_count. The actual number of - * tasks running in steady state will be less than this number when - * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - * the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $parallelism = 0; - /** - * Output only. Specifies the desired number of tasks the execution should - * run. Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. - * - * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $task_count = 0; - /** - * Output only. The template used to create tasks for this execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $template = null; - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Output only. The Condition of this Execution, containing its readiness - * status, and detailed error information in case it did not reach the desired - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $conditions; - /** - * Output only. The generation of this Execution. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $observed_generation = 0; - /** - * Output only. The number of actively running tasks. - * - * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $running_count = 0; - /** - * Output only. The number of tasks which reached phase Succeeded. - * - * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $succeeded_count = 0; - /** - * Output only. The number of tasks which reached phase Failed. - * - * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $failed_count = 0; - /** - * Output only. The number of tasks which reached phase Cancelled. - * - * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cancelled_count = 0; - /** - * Output only. The number of tasks which have retried at least once. - * - * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $retried_count = 0; - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $log_uri = ''; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique name of this Execution. - * @type string $uid - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * @type int|string $generation - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Represents time when the execution was acknowledged by the - * execution controller. It is not guaranteed to be set in happens-before - * order across separate operations. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Represents time when the execution started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * @type \Google\Protobuf\Timestamp $completion_time - * Output only. Represents time when the execution was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * @type int $launch_stage - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * @type string $job - * Output only. The name of the parent Job. - * @type int $parallelism - * Output only. Specifies the maximum desired number of tasks the execution - * should run at any given time. Must be <= task_count. The actual number of - * tasks running in steady state will be less than this number when - * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - * the work left to do is less than max parallelism. - * @type int $task_count - * Output only. Specifies the desired number of tasks the execution should - * run. Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. - * @type \Google\Cloud\Run\V2\TaskTemplate $template - * Output only. The template used to create tasks for this execution. - * @type bool $reconciling - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions - * Output only. The Condition of this Execution, containing its readiness - * status, and detailed error information in case it did not reach the desired - * state. - * @type int|string $observed_generation - * Output only. The generation of this Execution. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * @type int $running_count - * Output only. The number of actively running tasks. - * @type int $succeeded_count - * Output only. The number of tasks which reached phase Succeeded. - * @type int $failed_count - * Output only. The number of tasks which reached phase Failed. - * @type int $cancelled_count - * Output only. The number of tasks which reached phase Cancelled. - * @type int $retried_count - * Output only. The number of tasks which have retried at least once. - * @type string $log_uri - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type string $etag - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique name of this Execution. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique name of this Execution. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Represents time when the execution was acknowledged by the - * execution controller. It is not guaranteed to be set in happens-before - * order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Represents time when the execution was acknowledged by the - * execution controller. It is not guaranteed to be set in happens-before - * order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Represents time when the execution started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Represents time when the execution started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Represents time when the execution was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompletionTime() - { - return $this->completion_time; - } - - public function hasCompletionTime() - { - return isset($this->completion_time); - } - - public function clearCompletionTime() - { - unset($this->completion_time); - } - - /** - * Output only. Represents time when the execution was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompletionTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->completion_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getJob() - { - return $this->job; - } - - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkString($var, True); - $this->job = $var; - - return $this; - } - - /** - * Output only. Specifies the maximum desired number of tasks the execution - * should run at any given time. Must be <= task_count. The actual number of - * tasks running in steady state will be less than this number when - * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - * the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getParallelism() - { - return $this->parallelism; - } - - /** - * Output only. Specifies the maximum desired number of tasks the execution - * should run at any given time. Must be <= task_count. The actual number of - * tasks running in steady state will be less than this number when - * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - * the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setParallelism($var) - { - GPBUtil::checkInt32($var); - $this->parallelism = $var; - - return $this; - } - - /** - * Output only. Specifies the desired number of tasks the execution should - * run. Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. - * - * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTaskCount() - { - return $this->task_count; - } - - /** - * Output only. Specifies the desired number of tasks the execution should - * run. Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. - * - * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTaskCount($var) - { - GPBUtil::checkInt32($var); - $this->task_count = $var; - - return $this; - } - - /** - * Output only. The template used to create tasks for this execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\TaskTemplate|null - */ - public function getTemplate() - { - return $this->template; - } - - public function hasTemplate() - { - return isset($this->template); - } - - public function clearTemplate() - { - unset($this->template); - } - - /** - * Output only. The template used to create tasks for this execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\TaskTemplate $var - * @return $this - */ - public function setTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); - $this->template = $var; - - return $this; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Output only. The Condition of this Execution, containing its readiness - * status, and detailed error information in case it did not reach the desired - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Output only. The Condition of this Execution, containing its readiness - * status, and detailed error information in case it did not reach the desired - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * Output only. The generation of this Execution. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getObservedGeneration() - { - return $this->observed_generation; - } - - /** - * Output only. The generation of this Execution. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setObservedGeneration($var) - { - GPBUtil::checkInt64($var); - $this->observed_generation = $var; - - return $this; - } - - /** - * Output only. The number of actively running tasks. - * - * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRunningCount() - { - return $this->running_count; - } - - /** - * Output only. The number of actively running tasks. - * - * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRunningCount($var) - { - GPBUtil::checkInt32($var); - $this->running_count = $var; - - return $this; - } - - /** - * Output only. The number of tasks which reached phase Succeeded. - * - * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSucceededCount() - { - return $this->succeeded_count; - } - - /** - * Output only. The number of tasks which reached phase Succeeded. - * - * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSucceededCount($var) - { - GPBUtil::checkInt32($var); - $this->succeeded_count = $var; - - return $this; - } - - /** - * Output only. The number of tasks which reached phase Failed. - * - * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getFailedCount() - { - return $this->failed_count; - } - - /** - * Output only. The number of tasks which reached phase Failed. - * - * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setFailedCount($var) - { - GPBUtil::checkInt32($var); - $this->failed_count = $var; - - return $this; - } - - /** - * Output only. The number of tasks which reached phase Cancelled. - * - * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getCancelledCount() - { - return $this->cancelled_count; - } - - /** - * Output only. The number of tasks which reached phase Cancelled. - * - * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setCancelledCount($var) - { - GPBUtil::checkInt32($var); - $this->cancelled_count = $var; - - return $this; - } - - /** - * Output only. The number of tasks which have retried at least once. - * - * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRetriedCount() - { - return $this->retried_count; - } - - /** - * Output only. The number of tasks which have retried at least once. - * - * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRetriedCount($var) - { - GPBUtil::checkInt32($var); - $this->retried_count = $var; - - return $this; - } - - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLogUri() - { - return $this->log_uri; - } - - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLogUri($var) - { - GPBUtil::checkString($var, True); - $this->log_uri = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php deleted file mode 100644 index da77efe77d8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.run.v2.ExecutionEnvironment - */ -class ExecutionEnvironment -{ - /** - * Unspecified - * - * Generated from protobuf enum EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; - */ - const EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; - /** - * Uses the First Generation environment. - * - * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN1 = 1; - */ - const EXECUTION_ENVIRONMENT_GEN1 = 1; - /** - * Uses Second Generation environment. - * - * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN2 = 2; - */ - const EXECUTION_ENVIRONMENT_GEN2 = 2; - - private static $valueToName = [ - self::EXECUTION_ENVIRONMENT_UNSPECIFIED => 'EXECUTION_ENVIRONMENT_UNSPECIFIED', - self::EXECUTION_ENVIRONMENT_GEN1 => 'EXECUTION_ENVIRONMENT_GEN1', - self::EXECUTION_ENVIRONMENT_GEN2 => 'EXECUTION_ENVIRONMENT_GEN2', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php deleted file mode 100644 index 4de3dd33dde..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php +++ /dev/null @@ -1,238 +0,0 @@ -google.cloud.run.v2.ExecutionReference - */ -class ExecutionReference extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the execution. - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Creation timestamp of the execution. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - protected $create_time = null; - /** - * Creation timestamp of the execution. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; - */ - protected $completion_time = null; - /** - * The deletion time of the execution. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; - */ - protected $delete_time = null; - /** - * Status for the execution completion. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; - */ - protected $completion_status = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the execution. - * @type \Google\Protobuf\Timestamp $create_time - * Creation timestamp of the execution. - * @type \Google\Protobuf\Timestamp $completion_time - * Creation timestamp of the execution. - * @type \Google\Protobuf\Timestamp $delete_time - * The deletion time of the execution. It is only - * populated as a response to a Delete request. - * @type int $completion_status - * Status for the execution completion. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Name of the execution. - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the execution. - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Creation timestamp of the execution. - * - * 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); - } - - /** - * Creation timestamp of the execution. - * - * 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; - } - - /** - * Creation timestamp of the execution. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompletionTime() - { - return $this->completion_time; - } - - public function hasCompletionTime() - { - return isset($this->completion_time); - } - - public function clearCompletionTime() - { - unset($this->completion_time); - } - - /** - * Creation timestamp of the execution. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompletionTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->completion_time = $var; - - return $this; - } - - /** - * The deletion time of the execution. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * The deletion time of the execution. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Status for the execution completion. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; - * @return int - */ - public function getCompletionStatus() - { - return $this->completion_status; - } - - /** - * Status for the execution completion. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; - * @param int $var - * @return $this - */ - public function setCompletionStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionReference\CompletionStatus::class); - $this->completion_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php deleted file mode 100644 index 329e05e4330..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.run.v2.ExecutionReference.CompletionStatus - */ -class CompletionStatus -{ - /** - * The default value. This value is used if the state is omitted. - * - * Generated from protobuf enum COMPLETION_STATUS_UNSPECIFIED = 0; - */ - const COMPLETION_STATUS_UNSPECIFIED = 0; - /** - * Job execution has succeeded. - * - * Generated from protobuf enum EXECUTION_SUCCEEDED = 1; - */ - const EXECUTION_SUCCEEDED = 1; - /** - * Job execution has failed. - * - * Generated from protobuf enum EXECUTION_FAILED = 2; - */ - const EXECUTION_FAILED = 2; - /** - * Job execution is running normally. - * - * Generated from protobuf enum EXECUTION_RUNNING = 3; - */ - const EXECUTION_RUNNING = 3; - /** - * Waiting for backing resources to be provisioned. - * - * Generated from protobuf enum EXECUTION_PENDING = 4; - */ - const EXECUTION_PENDING = 4; - /** - * Job execution has been cancelled by the user. - * - * Generated from protobuf enum EXECUTION_CANCELLED = 5; - */ - const EXECUTION_CANCELLED = 5; - - private static $valueToName = [ - self::COMPLETION_STATUS_UNSPECIFIED => 'COMPLETION_STATUS_UNSPECIFIED', - self::EXECUTION_SUCCEEDED => 'EXECUTION_SUCCEEDED', - self::EXECUTION_FAILED => 'EXECUTION_FAILED', - self::EXECUTION_RUNNING => 'EXECUTION_RUNNING', - self::EXECUTION_PENDING => 'EXECUTION_PENDING', - self::EXECUTION_CANCELLED => 'EXECUTION_CANCELLED', - ]; - - 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(CompletionStatus::class, \Google\Cloud\Run\V2\ExecutionReference_CompletionStatus::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php deleted file mode 100644 index 18ee4a6bffb..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php +++ /dev/null @@ -1,322 +0,0 @@ -google.cloud.run.v2.ExecutionTemplate - */ -class ExecutionTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 ExecutionTemplate. - * - * Generated from protobuf field map labels = 1; - */ - private $labels; - /** - * Unstructured key value map that may be set by external tools to store and - * arbitrary metadata. They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 ExecutionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 2; - */ - private $annotations; - /** - * Specifies the maximum desired number of tasks the execution should run at - * given time. Must be <= task_count. - * When the job is run, if this field is 0 or unset, the maximum possible - * value will be used for that execution. - * The actual number of tasks running in steady state will be less than this - * number when there are fewer tasks waiting to be completed remaining, - * i.e. when the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 3; - */ - protected $parallelism = 0; - /** - * Specifies the desired number of tasks the execution should run. - * Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. Defaults to 1. - * - * Generated from protobuf field int32 task_count = 4; - */ - protected $task_count = 0; - /** - * Required. Describes the task(s) that will be created when executing an - * execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $template = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $labels - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 ExecutionTemplate. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Unstructured key value map that may be set by external tools to store and - * arbitrary metadata. They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 ExecutionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * @type int $parallelism - * Specifies the maximum desired number of tasks the execution should run at - * given time. Must be <= task_count. - * When the job is run, if this field is 0 or unset, the maximum possible - * value will be used for that execution. - * The actual number of tasks running in steady state will be less than this - * number when there are fewer tasks waiting to be completed remaining, - * i.e. when the work left to do is less than max parallelism. - * @type int $task_count - * Specifies the desired number of tasks the execution should run. - * Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. Defaults to 1. - * @type \Google\Cloud\Run\V2\TaskTemplate $template - * Required. Describes the task(s) that will be created when executing an - * execution. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\ExecutionTemplate::initOnce(); - parent::__construct($data); - } - - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 ExecutionTemplate. - * - * Generated from protobuf field map labels = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 ExecutionTemplate. - * - * Generated from protobuf field map labels = 1; - * @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; - } - - /** - * Unstructured key value map that may be set by external tools to store and - * arbitrary metadata. They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 ExecutionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Unstructured key value map that may be set by external tools to store and - * arbitrary metadata. They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 ExecutionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Specifies the maximum desired number of tasks the execution should run at - * given time. Must be <= task_count. - * When the job is run, if this field is 0 or unset, the maximum possible - * value will be used for that execution. - * The actual number of tasks running in steady state will be less than this - * number when there are fewer tasks waiting to be completed remaining, - * i.e. when the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 3; - * @return int - */ - public function getParallelism() - { - return $this->parallelism; - } - - /** - * Specifies the maximum desired number of tasks the execution should run at - * given time. Must be <= task_count. - * When the job is run, if this field is 0 or unset, the maximum possible - * value will be used for that execution. - * The actual number of tasks running in steady state will be less than this - * number when there are fewer tasks waiting to be completed remaining, - * i.e. when the work left to do is less than max parallelism. - * - * Generated from protobuf field int32 parallelism = 3; - * @param int $var - * @return $this - */ - public function setParallelism($var) - { - GPBUtil::checkInt32($var); - $this->parallelism = $var; - - return $this; - } - - /** - * Specifies the desired number of tasks the execution should run. - * Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. Defaults to 1. - * - * Generated from protobuf field int32 task_count = 4; - * @return int - */ - public function getTaskCount() - { - return $this->task_count; - } - - /** - * Specifies the desired number of tasks the execution should run. - * Setting to 1 means that parallelism is limited to 1 and the success of - * that task signals the success of the execution. Defaults to 1. - * - * Generated from protobuf field int32 task_count = 4; - * @param int $var - * @return $this - */ - public function setTaskCount($var) - { - GPBUtil::checkInt32($var); - $this->task_count = $var; - - return $this; - } - - /** - * Required. Describes the task(s) that will be created when executing an - * execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\TaskTemplate|null - */ - public function getTemplate() - { - return $this->template; - } - - public function hasTemplate() - { - return isset($this->template); - } - - public function clearTemplate() - { - unset($this->template); - } - - /** - * Required. Describes the task(s) that will be created when executing an - * execution. - * - * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\TaskTemplate $var - * @return $this - */ - public function setTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); - $this->template = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php deleted file mode 100644 index 659846b4e6b..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.run.v2.GCSVolumeSource - */ -class GCSVolumeSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage Bucket name. - * - * Generated from protobuf field string bucket = 1; - */ - protected $bucket = ''; - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 2; - */ - protected $read_only = false; - /** - * A list of additional flags to pass to the gcsfuse CLI. - * Options should be specified without the leading "--". - * - * Generated from protobuf field repeated string mount_options = 3; - */ - private $mount_options; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Cloud Storage Bucket name. - * @type bool $read_only - * If true, the volume will be mounted as read only for all mounts. - * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options - * A list of additional flags to pass to the gcsfuse CLI. - * Options should be specified without the leading "--". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage Bucket name. - * - * Generated from protobuf field string bucket = 1; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Cloud Storage Bucket name. - * - * Generated from protobuf field string bucket = 1; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 2; - * @return bool - */ - public function getReadOnly() - { - return $this->read_only; - } - - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 2; - * @param bool $var - * @return $this - */ - public function setReadOnly($var) - { - GPBUtil::checkBool($var); - $this->read_only = $var; - - return $this; - } - - /** - * A list of additional flags to pass to the gcsfuse CLI. - * Options should be specified without the leading "--". - * - * Generated from protobuf field repeated string mount_options = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMountOptions() - { - return $this->mount_options; - } - - /** - * A list of additional flags to pass to the gcsfuse CLI. - * Options should be specified without the leading "--". - * - * Generated from protobuf field repeated string mount_options = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMountOptions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->mount_options = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php deleted file mode 100644 index 826f06cb471..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.run.v2.GRPCAction - */ -class GRPCAction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Port number of the gRPC service. Number must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $port = 0; - /** - * Optional. Service is the name of the service to place in the gRPC - * HealthCheckRequest (see - * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - * is not specified, the default behavior is defined by gRPC. - * - * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $port - * Optional. Port number of the gRPC service. Number must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * @type string $service - * Optional. Service is the name of the service to place in the gRPC - * HealthCheckRequest (see - * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - * is not specified, the default behavior is defined by gRPC. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Port number of the gRPC service. Number must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional. Port number of the gRPC service. Number must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Optional. Service is the name of the service to place in the gRPC - * HealthCheckRequest (see - * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - * is not specified, the default behavior is defined by gRPC. - * - * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Optional. Service is the name of the service to place in the gRPC - * HealthCheckRequest (see - * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - * is not specified, the default behavior is defined by gRPC. - * - * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php deleted file mode 100644 index 8ecf98e5ef5..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.run.v2.GetExecutionRequest - */ -class GetExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. Please see - * {@see ExecutionsClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\GetExecutionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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 full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php deleted file mode 100644 index 8d43efd711f..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.run.v2.GetJobRequest - */ -class GetJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. Please see - * {@see JobsClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\GetJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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 full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php deleted file mode 100644 index 23fa3012691..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.run.v2.GetRevisionRequest - */ -class GetRevisionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * Please see {@see RevisionsClient::revisionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\GetRevisionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * 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 full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php deleted file mode 100644 index 4a5aeb399c0..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.run.v2.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. Please see - * {@see ServicesClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\GetServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * 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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php deleted file mode 100644 index 925a9bb9839..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.run.v2.GetTaskRequest - */ -class GetTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * Please see {@see TasksClient::taskName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\GetTaskRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * - * 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 full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php deleted file mode 100644 index 371a24d2a13..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.run.v2.HTTPGetAction - */ -class HTTPGetAction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Path to access on the HTTP server. Defaults to '/'. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - /** - * Optional. Custom headers to set in the request. HTTP allows repeated - * headers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $http_headers; - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $port = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Optional. Path to access on the HTTP server. Defaults to '/'. - * @type array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $http_headers - * Optional. Custom headers to set in the request. HTTP allows repeated - * headers. - * @type int $port - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Path to access on the HTTP server. Defaults to '/'. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. Path to access on the HTTP server. Defaults to '/'. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Optional. Custom headers to set in the request. HTTP allows repeated - * headers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHttpHeaders() - { - return $this->http_headers; - } - - /** - * Optional. Custom headers to set in the request. HTTP allows repeated - * headers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHttpHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\HTTPHeader::class); - $this->http_headers = $arr; - - return $this; - } - - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php deleted file mode 100644 index 036332d24bb..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.run.v2.HTTPHeader - */ -class HTTPHeader extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The header field name - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Optional. The header field value - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The header field name - * @type string $value - * Optional. The header field value - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The header field name - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The header field name - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The header field value - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Optional. The header field value - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php deleted file mode 100644 index c9e391f2e46..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.run.v2.IngressTraffic - */ -class IngressTraffic -{ - /** - * Unspecified - * - * Generated from protobuf enum INGRESS_TRAFFIC_UNSPECIFIED = 0; - */ - const INGRESS_TRAFFIC_UNSPECIFIED = 0; - /** - * All inbound traffic is allowed. - * - * Generated from protobuf enum INGRESS_TRAFFIC_ALL = 1; - */ - const INGRESS_TRAFFIC_ALL = 1; - /** - * Only internal traffic is allowed. - * - * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_ONLY = 2; - */ - const INGRESS_TRAFFIC_INTERNAL_ONLY = 2; - /** - * Both internal and Google Cloud Load Balancer traffic is allowed. - * - * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; - */ - const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; - /** - * No ingress traffic is allowed. - * - * Generated from protobuf enum INGRESS_TRAFFIC_NONE = 4; - */ - const INGRESS_TRAFFIC_NONE = 4; - - private static $valueToName = [ - self::INGRESS_TRAFFIC_UNSPECIFIED => 'INGRESS_TRAFFIC_UNSPECIFIED', - self::INGRESS_TRAFFIC_ALL => 'INGRESS_TRAFFIC_ALL', - self::INGRESS_TRAFFIC_INTERNAL_ONLY => 'INGRESS_TRAFFIC_INTERNAL_ONLY', - self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER => 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER', - self::INGRESS_TRAFFIC_NONE => 'INGRESS_TRAFFIC_NONE', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php deleted file mode 100644 index c38afcf3c49..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php +++ /dev/null @@ -1,1249 +0,0 @@ -google.cloud.run.v2.Job - */ -class Job extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified name of this Job. - * Format: - * projects/{project}/locations/{location}/jobs/{job} - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Job. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected on new resources. All system - * annotations in v1 now have a corresponding field in v2 Job. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 5; - */ - private $annotations; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $creator = ''; - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_modifier = ''; - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 12; - */ - protected $client = ''; - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 13; - */ - protected $client_version = ''; - /** - * The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; - */ - protected $launch_stage = 0; - /** - * Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; - */ - protected $binary_authorization = null; - /** - * Required. The template used to create executions for this Job. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $template = null; - /** - * Output only. The generation of this Job. See comments in `reconciling` for - * additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $observed_generation = 0; - /** - * Output only. The Condition of this Job, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $terminal_condition = null; - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Job does not reach - * its desired state. See comments in `reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $conditions; - /** - * Output only. Number of executions created for this job. - * - * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $execution_count = 0; - /** - * Output only. Name of the last created execution. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $latest_created_execution = null; - /** - * Output only. Returns true if the Job is currently being acted upon by the - * system to bring it into the desired state. - * When a new Job is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Job to the - * desired state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation` and - * `latest_succeeded_execution`, will have transient values that might - * mismatch the intended state: Once reconciliation is over (and this field is - * false), there are two possible outcomes: reconciliation succeeded and the - * state matches the Job, or there was an error, and reconciliation failed. - * This state can be found in `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: - * `observed_generation` and `generation`, `latest_succeeded_execution` and - * `latest_created_execution`. - * If reconciliation failed, `observed_generation` and - * `latest_succeeded_execution` will have the state of the last succeeded - * execution or empty for newly created Job. Additional information on the - * failure can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - protected $create_execution; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The fully qualified name of this Job. - * Format: - * projects/{project}/locations/{location}/jobs/{job} - * @type string $uid - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * @type int|string $generation - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Job. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected on new resources. All system - * annotations in v1 now have a corresponding field in v2 Job. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * @type string $creator - * Output only. Email address of the authenticated creator. - * @type string $last_modifier - * Output only. Email address of the last authenticated modifier. - * @type string $client - * Arbitrary identifier for the API client. - * @type string $client_version - * Arbitrary version identifier for the API client. - * @type int $launch_stage - * The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization - * Settings for the Binary Authorization feature. - * @type \Google\Cloud\Run\V2\ExecutionTemplate $template - * Required. The template used to create executions for this Job. - * @type int|string $observed_generation - * Output only. The generation of this Job. See comments in `reconciling` for - * additional information on reconciliation process in Cloud Run. - * @type \Google\Cloud\Run\V2\Condition $terminal_condition - * Output only. The Condition of this Job, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Job does not reach - * its desired state. See comments in `reconciling` for additional information - * on reconciliation process in Cloud Run. - * @type int $execution_count - * Output only. Number of executions created for this job. - * @type \Google\Cloud\Run\V2\ExecutionReference $latest_created_execution - * Output only. Name of the last created execution. - * @type bool $reconciling - * Output only. Returns true if the Job is currently being acted upon by the - * system to bring it into the desired state. - * When a new Job is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Job to the - * desired state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation` and - * `latest_succeeded_execution`, will have transient values that might - * mismatch the intended state: Once reconciliation is over (and this field is - * false), there are two possible outcomes: reconciliation succeeded and the - * state matches the Job, or there was an error, and reconciliation failed. - * This state can be found in `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: - * `observed_generation` and `generation`, `latest_succeeded_execution` and - * `latest_created_execution`. - * If reconciliation failed, `observed_generation` and - * `latest_succeeded_execution` will have the state of the last succeeded - * execution or empty for newly created Job. Additional information on the - * failure can be found in `terminal_condition` and `conditions`. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type string $start_execution_token - * A unique string used as a suffix creating a new execution. The Job will - * become ready when the execution is successfully started. - * The sum of job name and token length must be fewer than 63 characters. - * @type string $run_execution_token - * A unique string used as a suffix for creating a new execution. The Job - * will become ready when the execution is successfully completed. - * The sum of job name and token length must be fewer than 63 characters. - * @type string $etag - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified name of this Job. - * Format: - * projects/{project}/locations/{location}/jobs/{job} - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The fully qualified name of this Job. - * Format: - * projects/{project}/locations/{location}/jobs/{job} - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the Execution. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Job. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Unstructured key value map that can be used to organize and categorize - * objects. - * User-provided labels are shared with Google's billing system, so they can - * be used to filter, or break down billing charges by team, component, - * environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Job. - * - * Generated from protobuf field map labels = 4; - * @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; - } - - /** - * Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected on new resources. All system - * annotations in v1 now have a corresponding field in v2 Job. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected on new resources. All system - * annotations in v1 now have a corresponding field in v2 Job. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getCreator() - { - return $this->creator; - } - - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setCreator($var) - { - GPBUtil::checkString($var, True); - $this->creator = $var; - - return $this; - } - - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLastModifier() - { - return $this->last_modifier; - } - - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLastModifier($var) - { - GPBUtil::checkString($var, True); - $this->last_modifier = $var; - - return $this; - } - - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 12; - * @return string - */ - public function getClient() - { - return $this->client; - } - - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 12; - * @param string $var - * @return $this - */ - public function setClient($var) - { - GPBUtil::checkString($var, True); - $this->client = $var; - - return $this; - } - - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 13; - * @return string - */ - public function getClientVersion() - { - return $this->client_version; - } - - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 13; - * @param string $var - * @return $this - */ - public function setClientVersion($var) - { - GPBUtil::checkString($var, True); - $this->client_version = $var; - - return $this; - } - - /** - * The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - - /** - * Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; - * @return \Google\Cloud\Run\V2\BinaryAuthorization|null - */ - public function getBinaryAuthorization() - { - return $this->binary_authorization; - } - - public function hasBinaryAuthorization() - { - return isset($this->binary_authorization); - } - - public function clearBinaryAuthorization() - { - unset($this->binary_authorization); - } - - /** - * Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; - * @param \Google\Cloud\Run\V2\BinaryAuthorization $var - * @return $this - */ - public function setBinaryAuthorization($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); - $this->binary_authorization = $var; - - return $this; - } - - /** - * Required. The template used to create executions for this Job. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\ExecutionTemplate|null - */ - public function getTemplate() - { - return $this->template; - } - - public function hasTemplate() - { - return isset($this->template); - } - - public function clearTemplate() - { - unset($this->template); - } - - /** - * Required. The template used to create executions for this Job. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\ExecutionTemplate $var - * @return $this - */ - public function setTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionTemplate::class); - $this->template = $var; - - return $this; - } - - /** - * Output only. The generation of this Job. See comments in `reconciling` for - * additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getObservedGeneration() - { - return $this->observed_generation; - } - - /** - * Output only. The generation of this Job. See comments in `reconciling` for - * additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setObservedGeneration($var) - { - GPBUtil::checkInt64($var); - $this->observed_generation = $var; - - return $this; - } - - /** - * Output only. The Condition of this Job, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\Condition|null - */ - public function getTerminalCondition() - { - return $this->terminal_condition; - } - - public function hasTerminalCondition() - { - return isset($this->terminal_condition); - } - - public function clearTerminalCondition() - { - unset($this->terminal_condition); - } - - /** - * Output only. The Condition of this Job, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\Condition $var - * @return $this - */ - public function setTerminalCondition($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); - $this->terminal_condition = $var; - - return $this; - } - - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Job does not reach - * its desired state. See comments in `reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Job does not reach - * its desired state. See comments in `reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * Output only. Number of executions created for this job. - * - * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getExecutionCount() - { - return $this->execution_count; - } - - /** - * Output only. Number of executions created for this job. - * - * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setExecutionCount($var) - { - GPBUtil::checkInt32($var); - $this->execution_count = $var; - - return $this; - } - - /** - * Output only. Name of the last created execution. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\ExecutionReference|null - */ - public function getLatestCreatedExecution() - { - return $this->latest_created_execution; - } - - public function hasLatestCreatedExecution() - { - return isset($this->latest_created_execution); - } - - public function clearLatestCreatedExecution() - { - unset($this->latest_created_execution); - } - - /** - * Output only. Name of the last created execution. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\ExecutionReference $var - * @return $this - */ - public function setLatestCreatedExecution($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionReference::class); - $this->latest_created_execution = $var; - - return $this; - } - - /** - * Output only. Returns true if the Job is currently being acted upon by the - * system to bring it into the desired state. - * When a new Job is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Job to the - * desired state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation` and - * `latest_succeeded_execution`, will have transient values that might - * mismatch the intended state: Once reconciliation is over (and this field is - * false), there are two possible outcomes: reconciliation succeeded and the - * state matches the Job, or there was an error, and reconciliation failed. - * This state can be found in `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: - * `observed_generation` and `generation`, `latest_succeeded_execution` and - * `latest_created_execution`. - * If reconciliation failed, `observed_generation` and - * `latest_succeeded_execution` will have the state of the last succeeded - * execution or empty for newly created Job. Additional information on the - * failure can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Returns true if the Job is currently being acted upon by the - * system to bring it into the desired state. - * When a new Job is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Job to the - * desired state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation` and - * `latest_succeeded_execution`, will have transient values that might - * mismatch the intended state: Once reconciliation is over (and this field is - * false), there are two possible outcomes: reconciliation succeeded and the - * state matches the Job, or there was an error, and reconciliation failed. - * This state can be found in `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: - * `observed_generation` and `generation`, `latest_succeeded_execution` and - * `latest_created_execution`. - * If reconciliation failed, `observed_generation` and - * `latest_succeeded_execution` will have the state of the last succeeded - * execution or empty for newly created Job. Additional information on the - * failure can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * A unique string used as a suffix creating a new execution. The Job will - * become ready when the execution is successfully started. - * The sum of job name and token length must be fewer than 63 characters. - * - * Generated from protobuf field string start_execution_token = 26; - * @return string - */ - public function getStartExecutionToken() - { - return $this->readOneof(26); - } - - public function hasStartExecutionToken() - { - return $this->hasOneof(26); - } - - /** - * A unique string used as a suffix creating a new execution. The Job will - * become ready when the execution is successfully started. - * The sum of job name and token length must be fewer than 63 characters. - * - * Generated from protobuf field string start_execution_token = 26; - * @param string $var - * @return $this - */ - public function setStartExecutionToken($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(26, $var); - - return $this; - } - - /** - * A unique string used as a suffix for creating a new execution. The Job - * will become ready when the execution is successfully completed. - * The sum of job name and token length must be fewer than 63 characters. - * - * Generated from protobuf field string run_execution_token = 27; - * @return string - */ - public function getRunExecutionToken() - { - return $this->readOneof(27); - } - - public function hasRunExecutionToken() - { - return $this->hasOneof(27); - } - - /** - * A unique string used as a suffix for creating a new execution. The Job - * will become ready when the execution is successfully completed. - * The sum of job name and token length must be fewer than 63 characters. - * - * Generated from protobuf field string run_execution_token = 27; - * @param string $var - * @return $this - */ - public function setRunExecutionToken($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(27, $var); - - return $this; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * @return string - */ - public function getCreateExecution() - { - return $this->whichOneof("create_execution"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php deleted file mode 100644 index 909879ad84e..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.run.v2.ListExecutionsRequest - */ -class ListExecutionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of Executions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. Please see - * {@see ExecutionsClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\ListExecutionsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @type int $page_size - * Maximum number of Executions to return in this call. - * @type string $page_token - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @type bool $show_deleted - * If true, returns deleted (but unexpired) resources along with active ones. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * - * 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 Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * - * 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; - } - - /** - * Maximum number of Executions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of Executions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php deleted file mode 100644 index 66ffa08a98f..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.run.v2.ListExecutionsResponse - */ -class ListExecutionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting list of Executions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; - */ - private $executions; - /** - * A token indicating there are more items than page_size. Use it in the next - * ListExecutions request to continue. - * - * 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\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $executions - * The resulting list of Executions. - * @type string $next_page_token - * A token indicating there are more items than page_size. Use it in the next - * ListExecutions request to continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); - parent::__construct($data); - } - - /** - * The resulting list of Executions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExecutions() - { - return $this->executions; - } - - /** - * The resulting list of Executions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; - * @param array<\Google\Cloud\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExecutions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Execution::class); - $this->executions = $arr; - - return $this; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListExecutions request to continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListExecutions request to continue. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php deleted file mode 100644 index 076ac55e2e8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.run.v2.ListJobsRequest - */ -class ListJobsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of Jobs to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Please see - * {@see JobsClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\ListJobsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @type int $page_size - * Maximum number of Jobs to return in this call. - * @type string $page_token - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @type bool $show_deleted - * If true, returns deleted (but unexpired) resources along with active ones. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * 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 location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * - * 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; - } - - /** - * Maximum number of Jobs to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of Jobs to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php deleted file mode 100644 index 1d0b4c4b6c6..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.run.v2.ListJobsResponse - */ -class ListJobsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting list of Jobs. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; - */ - private $jobs; - /** - * A token indicating there are more items than page_size. Use it in the next - * ListJobs request to continue. - * - * 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\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $jobs - * The resulting list of Jobs. - * @type string $next_page_token - * A token indicating there are more items than page_size. Use it in the next - * ListJobs request to continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * The resulting list of Jobs. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getJobs() - { - return $this->jobs; - } - - /** - * The resulting list of Jobs. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; - * @param array<\Google\Cloud\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setJobs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Job::class); - $this->jobs = $arr; - - return $this; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListJobs request to continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListJobs request to continue. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php deleted file mode 100644 index 01cde2b85c9..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.run.v2.ListRevisionsRequest - */ -class ListRevisionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of revisions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * Please see {@see RevisionsClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\ListRevisionsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @type int $page_size - * Maximum number of revisions to return in this call. - * @type string $page_token - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @type bool $show_deleted - * If true, returns deleted (but unexpired) resources along with active ones. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * - * 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 Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * - * 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; - } - - /** - * Maximum number of revisions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of revisions to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php deleted file mode 100644 index e4a2db90f4f..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.run.v2.ListRevisionsResponse - */ -class ListRevisionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting list of Revisions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; - */ - private $revisions; - /** - * A token indicating there are more items than page_size. Use it in the next - * ListRevisions request to continue. - * - * 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\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions - * The resulting list of Revisions. - * @type string $next_page_token - * A token indicating there are more items than page_size. Use it in the next - * ListRevisions request to continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); - parent::__construct($data); - } - - /** - * The resulting list of Revisions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRevisions() - { - return $this->revisions; - } - - /** - * The resulting list of Revisions. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; - * @param array<\Google\Cloud\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRevisions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Revision::class); - $this->revisions = $arr; - - return $this; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListRevisions request to continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListRevisions request to continue. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php deleted file mode 100644 index 1cd78b61933..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.run.v2.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of Services to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token received from a previous call to ListServices. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. Please see - * {@see ServicesClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\ListServicesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @type int $page_size - * Maximum number of Services to return in this call. - * @type string $page_token - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @type bool $show_deleted - * If true, returns deleted (but unexpired) resources along with active ones. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * - * 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 location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * - * 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; - } - - /** - * Maximum number of Services to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of Services to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token received from a previous call to ListServices. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token received from a previous call to ListServices. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php deleted file mode 100644 index 06cdb054df8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.run.v2.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting list of Services. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; - */ - private $services; - /** - * A token indicating there are more items than page_size. Use it in the next - * ListServices request to continue. - * - * 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\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The resulting list of Services. - * @type string $next_page_token - * A token indicating there are more items than page_size. Use it in the next - * ListServices request to continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * The resulting list of Services. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The resulting list of Services. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; - * @param array<\Google\Cloud\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListServices request to continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListServices request to continue. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php deleted file mode 100644 index 421799f3819..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.run.v2.ListTasksRequest - */ -class ListTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of Tasks to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @param string $parent Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * Please see {@see TasksClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\ListTasksRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @type int $page_size - * Maximum number of Tasks to return in this call. - * @type string $page_token - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @type bool $show_deleted - * If true, returns deleted (but unexpired) resources along with active ones. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - * 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 Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - * 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; - } - - /** - * Maximum number of Tasks to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of Tasks to return in this call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, returns deleted (but unexpired) resources along with active ones. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php deleted file mode 100644 index 17804baa0f8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.run.v2.ListTasksResponse - */ -class ListTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting list of Tasks. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; - */ - private $tasks; - /** - * A token indicating there are more items than page_size. Use it in the next - * ListTasks request to continue. - * - * 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\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * The resulting list of Tasks. - * @type string $next_page_token - * A token indicating there are more items than page_size. Use it in the next - * ListTasks request to continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * The resulting list of Tasks. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * The resulting list of Tasks. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; - * @param array<\Google\Cloud\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Task::class); - $this->tasks = $arr; - - return $this; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListTasks request to continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token indicating there are more items than page_size. Use it in the next - * ListTasks request to continue. - * - * 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/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php deleted file mode 100644 index d77c34e73b2..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.run.v2.NFSVolumeSource - */ -class NFSVolumeSource extends \Google\Protobuf\Internal\Message -{ - /** - * Hostname or IP address of the NFS server - * - * Generated from protobuf field string server = 1; - */ - protected $server = ''; - /** - * Path that is exported by the NFS server. - * - * Generated from protobuf field string path = 2; - */ - protected $path = ''; - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 3; - */ - protected $read_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $server - * Hostname or IP address of the NFS server - * @type string $path - * Path that is exported by the NFS server. - * @type bool $read_only - * If true, the volume will be mounted as read only for all mounts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Hostname or IP address of the NFS server - * - * Generated from protobuf field string server = 1; - * @return string - */ - public function getServer() - { - return $this->server; - } - - /** - * Hostname or IP address of the NFS server - * - * Generated from protobuf field string server = 1; - * @param string $var - * @return $this - */ - public function setServer($var) - { - GPBUtil::checkString($var, True); - $this->server = $var; - - return $this; - } - - /** - * Path that is exported by the NFS server. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path that is exported by the NFS server. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 3; - * @return bool - */ - public function getReadOnly() - { - return $this->read_only; - } - - /** - * If true, the volume will be mounted as read only for all mounts. - * - * Generated from protobuf field bool read_only = 3; - * @param bool $var - * @return $this - */ - public function setReadOnly($var) - { - GPBUtil::checkBool($var); - $this->read_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php deleted file mode 100644 index 54fd94337d5..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.run.v2.NodeSelector - */ -class NodeSelector extends \Google\Protobuf\Internal\Message -{ - /** - * Required. GPU accelerator type to attach to an instance. - * - * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $accelerator = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $accelerator - * Required. GPU accelerator type to attach to an instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * Required. GPU accelerator type to attach to an instance. - * - * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAccelerator() - { - return $this->accelerator; - } - - /** - * Required. GPU accelerator type to attach to an instance. - * - * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAccelerator($var) - { - GPBUtil::checkString($var, True); - $this->accelerator = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php deleted file mode 100644 index 07da4f964c3..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php +++ /dev/null @@ -1,319 +0,0 @@ -google.cloud.run.v2.Probe - */ -class Probe extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Number of seconds after the container has started before the - * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - * value for liveness probe is 3600. Maximum value for startup probe is 240. - * - * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $initial_delay_seconds = 0; - /** - * Optional. Number of seconds after which the probe times out. - * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - * Must be smaller than period_seconds. - * - * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $timeout_seconds = 0; - /** - * Optional. How often (in seconds) to perform the probe. - * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - * is 3600. Maximum value for startup probe is 240. - * Must be greater or equal than timeout_seconds. - * - * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $period_seconds = 0; - /** - * Optional. Minimum consecutive failures for the probe to be considered - * failed after having succeeded. Defaults to 3. Minimum value is 1. - * - * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $failure_threshold = 0; - protected $probe_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $initial_delay_seconds - * Optional. Number of seconds after the container has started before the - * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - * value for liveness probe is 3600. Maximum value for startup probe is 240. - * @type int $timeout_seconds - * Optional. Number of seconds after which the probe times out. - * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - * Must be smaller than period_seconds. - * @type int $period_seconds - * Optional. How often (in seconds) to perform the probe. - * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - * is 3600. Maximum value for startup probe is 240. - * Must be greater or equal than timeout_seconds. - * @type int $failure_threshold - * Optional. Minimum consecutive failures for the probe to be considered - * failed after having succeeded. Defaults to 3. Minimum value is 1. - * @type \Google\Cloud\Run\V2\HTTPGetAction $http_get - * Optional. HTTPGet specifies the http request to perform. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * @type \Google\Cloud\Run\V2\TCPSocketAction $tcp_socket - * Optional. TCPSocket specifies an action involving a TCP port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * @type \Google\Cloud\Run\V2\GRPCAction $grpc - * Optional. GRPC specifies an action involving a gRPC port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Number of seconds after the container has started before the - * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - * value for liveness probe is 3600. Maximum value for startup probe is 240. - * - * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getInitialDelaySeconds() - { - return $this->initial_delay_seconds; - } - - /** - * Optional. Number of seconds after the container has started before the - * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - * value for liveness probe is 3600. Maximum value for startup probe is 240. - * - * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setInitialDelaySeconds($var) - { - GPBUtil::checkInt32($var); - $this->initial_delay_seconds = $var; - - return $this; - } - - /** - * Optional. Number of seconds after which the probe times out. - * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - * Must be smaller than period_seconds. - * - * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTimeoutSeconds() - { - return $this->timeout_seconds; - } - - /** - * Optional. Number of seconds after which the probe times out. - * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - * Must be smaller than period_seconds. - * - * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTimeoutSeconds($var) - { - GPBUtil::checkInt32($var); - $this->timeout_seconds = $var; - - return $this; - } - - /** - * Optional. How often (in seconds) to perform the probe. - * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - * is 3600. Maximum value for startup probe is 240. - * Must be greater or equal than timeout_seconds. - * - * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPeriodSeconds() - { - return $this->period_seconds; - } - - /** - * Optional. How often (in seconds) to perform the probe. - * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - * is 3600. Maximum value for startup probe is 240. - * Must be greater or equal than timeout_seconds. - * - * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPeriodSeconds($var) - { - GPBUtil::checkInt32($var); - $this->period_seconds = $var; - - return $this; - } - - /** - * Optional. Minimum consecutive failures for the probe to be considered - * failed after having succeeded. Defaults to 3. Minimum value is 1. - * - * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getFailureThreshold() - { - return $this->failure_threshold; - } - - /** - * Optional. Minimum consecutive failures for the probe to be considered - * failed after having succeeded. Defaults to 3. Minimum value is 1. - * - * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setFailureThreshold($var) - { - GPBUtil::checkInt32($var); - $this->failure_threshold = $var; - - return $this; - } - - /** - * Optional. HTTPGet specifies the http request to perform. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\HTTPGetAction|null - */ - public function getHttpGet() - { - return $this->readOneof(5); - } - - public function hasHttpGet() - { - return $this->hasOneof(5); - } - - /** - * Optional. HTTPGet specifies the http request to perform. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\HTTPGetAction $var - * @return $this - */ - public function setHttpGet($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\HTTPGetAction::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. TCPSocket specifies an action involving a TCP port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\TCPSocketAction|null - */ - public function getTcpSocket() - { - return $this->readOneof(6); - } - - public function hasTcpSocket() - { - return $this->hasOneof(6); - } - - /** - * Optional. TCPSocket specifies an action involving a TCP port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\TCPSocketAction $var - * @return $this - */ - public function setTcpSocket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TCPSocketAction::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Optional. GRPC specifies an action involving a gRPC port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\GRPCAction|null - */ - public function getGrpc() - { - return $this->readOneof(7); - } - - public function hasGrpc() - { - return $this->hasOneof(7); - } - - /** - * Optional. GRPC specifies an action involving a gRPC port. - * Exactly one of httpGet, tcpSocket, or grpc must be specified. - * - * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\GRPCAction $var - * @return $this - */ - public function setGrpc($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GRPCAction::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @return string - */ - public function getProbeType() - { - return $this->whichOneof("probe_type"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php deleted file mode 100644 index 9ba7760c502..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.run.v2.ResourceRequirements - */ -class ResourceRequirements extends \Google\Protobuf\Internal\Message -{ - /** - * Only `memory` and `cpu` keys in the map are supported. - *

Notes: - * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - * CPU requires at least 2Gi of memory. For more information, go to - * https://cloud.google.com/run/docs/configuring/cpu. - * * For supported 'memory' values and syntax, go to - * https://cloud.google.com/run/docs/configuring/memory-limits - * - * Generated from protobuf field map limits = 1; - */ - private $limits; - /** - * Determines whether CPU is only allocated during requests (true by default). - * However, if ResourceRequirements is set, the caller must explicitly - * set this field to true to preserve the default behavior. - * - * Generated from protobuf field bool cpu_idle = 2; - */ - protected $cpu_idle = false; - /** - * Determines whether CPU should be boosted on startup of a new container - * instance above the requested CPU threshold, this can help reduce cold-start - * latency. - * - * Generated from protobuf field bool startup_cpu_boost = 3; - */ - protected $startup_cpu_boost = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $limits - * Only `memory` and `cpu` keys in the map are supported. - *

Notes: - * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - * CPU requires at least 2Gi of memory. For more information, go to - * https://cloud.google.com/run/docs/configuring/cpu. - * * For supported 'memory' values and syntax, go to - * https://cloud.google.com/run/docs/configuring/memory-limits - * @type bool $cpu_idle - * Determines whether CPU is only allocated during requests (true by default). - * However, if ResourceRequirements is set, the caller must explicitly - * set this field to true to preserve the default behavior. - * @type bool $startup_cpu_boost - * Determines whether CPU should be boosted on startup of a new container - * instance above the requested CPU threshold, this can help reduce cold-start - * latency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Only `memory` and `cpu` keys in the map are supported. - *

Notes: - * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - * CPU requires at least 2Gi of memory. For more information, go to - * https://cloud.google.com/run/docs/configuring/cpu. - * * For supported 'memory' values and syntax, go to - * https://cloud.google.com/run/docs/configuring/memory-limits - * - * Generated from protobuf field map limits = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLimits() - { - return $this->limits; - } - - /** - * Only `memory` and `cpu` keys in the map are supported. - *

Notes: - * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - * CPU requires at least 2Gi of memory. For more information, go to - * https://cloud.google.com/run/docs/configuring/cpu. - * * For supported 'memory' values and syntax, go to - * https://cloud.google.com/run/docs/configuring/memory-limits - * - * Generated from protobuf field map limits = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLimits($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->limits = $arr; - - return $this; - } - - /** - * Determines whether CPU is only allocated during requests (true by default). - * However, if ResourceRequirements is set, the caller must explicitly - * set this field to true to preserve the default behavior. - * - * Generated from protobuf field bool cpu_idle = 2; - * @return bool - */ - public function getCpuIdle() - { - return $this->cpu_idle; - } - - /** - * Determines whether CPU is only allocated during requests (true by default). - * However, if ResourceRequirements is set, the caller must explicitly - * set this field to true to preserve the default behavior. - * - * Generated from protobuf field bool cpu_idle = 2; - * @param bool $var - * @return $this - */ - public function setCpuIdle($var) - { - GPBUtil::checkBool($var); - $this->cpu_idle = $var; - - return $this; - } - - /** - * Determines whether CPU should be boosted on startup of a new container - * instance above the requested CPU threshold, this can help reduce cold-start - * latency. - * - * Generated from protobuf field bool startup_cpu_boost = 3; - * @return bool - */ - public function getStartupCpuBoost() - { - return $this->startup_cpu_boost; - } - - /** - * Determines whether CPU should be boosted on startup of a new container - * instance above the requested CPU threshold, this can help reduce cold-start - * latency. - * - * Generated from protobuf field bool startup_cpu_boost = 3; - * @param bool $var - * @return $this - */ - public function setStartupCpuBoost($var) - { - GPBUtil::checkBool($var); - $this->startup_cpu_boost = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php deleted file mode 100644 index f3bdf65355a..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php +++ /dev/null @@ -1,1373 +0,0 @@ -google.cloud.run.v2.Revision - */ -class Revision extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique name of this Revision. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Server assigned unique identifier for the Revision. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $labels; - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $annotations; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; - */ - protected $launch_stage = 0; - /** - * Output only. The name of the parent service. - * - * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $service = ''; - /** - * Scaling settings for this revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; - */ - protected $scaling = null; - /** - * VPC Access configuration for this Revision. For more information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; - */ - protected $vpc_access = null; - /** - * Sets the maximum number of requests that each serving instance can receive. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 34; - */ - protected $max_instance_request_concurrency = 0; - /** - * Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 15; - */ - protected $timeout = null; - /** - * Email address of the IAM service account associated with the revision of - * the service. The service account represents the identity of the running - * revision, and determines what permissions the revision has. - * - * Generated from protobuf field string service_account = 16; - */ - protected $service_account = ''; - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; - */ - private $containers; - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; - */ - private $volumes; - /** - * The execution environment being used to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - */ - protected $execution_environment = 0; - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { - */ - protected $encryption_key = ''; - /** - * Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; - */ - protected $service_mesh = null; - /** - * The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; - */ - protected $encryption_key_revocation_action = 0; - /** - * If encryption_key_revocation_action is SHUTDOWN, the duration before - * shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; - */ - protected $encryption_key_shutdown_duration = null; - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Service.reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Output only. The Condition of this Revision, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $conditions; - /** - * Output only. The generation of this Revision currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $observed_generation = 0; - /** - * Output only. The Google Console URI to obtain logs for the Revision. - * - * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $log_uri = ''; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 38; - */ - protected $session_affinity = false; - /** - * Output only. The current effective scaling settings for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $scaling_status = null; - /** - * The node selector for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; - */ - protected $node_selector = null; - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique name of this Revision. - * @type string $uid - * Output only. Server assigned unique identifier for the Revision. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * @type int|string $generation - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * @type int $launch_stage - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * @type string $service - * Output only. The name of the parent service. - * @type \Google\Cloud\Run\V2\RevisionScaling $scaling - * Scaling settings for this revision. - * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access - * VPC Access configuration for this Revision. For more information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * @type int $max_instance_request_concurrency - * Sets the maximum number of requests that each serving instance can receive. - * @type \Google\Protobuf\Duration $timeout - * Max allowed time for an instance to respond to a request. - * @type string $service_account - * Email address of the IAM service account associated with the revision of - * the service. The service account represents the identity of the running - * revision, and determines what permissions the revision has. - * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers - * Holds the single container that defines the unit of execution for this - * Revision. - * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * A list of Volumes to make available to containers. - * @type int $execution_environment - * The execution environment being used to host this Revision. - * @type string $encryption_key - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh - * Enables service mesh connectivity. - * @type int $encryption_key_revocation_action - * The action to take if the encryption key is revoked. - * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration - * If encryption_key_revocation_action is SHUTDOWN, the duration before - * shutting down all instances. The minimum increment is 1 hour. - * @type bool $reconciling - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Service.reconciling` for additional information - * on reconciliation process in Cloud Run. - * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions - * Output only. The Condition of this Revision, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. - * @type int|string $observed_generation - * Output only. The generation of this Revision currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * @type string $log_uri - * Output only. The Google Console URI to obtain logs for the Revision. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type bool $session_affinity - * Enable session affinity. - * @type \Google\Cloud\Run\V2\RevisionScalingStatus $scaling_status - * Output only. The current effective scaling settings for the revision. - * @type \Google\Cloud\Run\V2\NodeSelector $node_selector - * The node selector for the revision. - * @type string $etag - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique name of this Revision. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique name of this Revision. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the Revision. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the Revision. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * The least stable launch stage needed to create this resource, as defined by - * [Google Cloud Platform Launch - * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - * `ALPHA`, `BETA`, and `GA`. - *

Note that this value might not be what was used - * as input. For example, if ALPHA was provided as input in the parent - * resource, but only BETA and GA-level features are were, this field will be - * BETA. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - - /** - * Output only. The name of the parent service. - * - * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Output only. The name of the parent service. - * - * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Scaling settings for this revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; - * @return \Google\Cloud\Run\V2\RevisionScaling|null - */ - public function getScaling() - { - return $this->scaling; - } - - public function hasScaling() - { - return isset($this->scaling); - } - - public function clearScaling() - { - unset($this->scaling); - } - - /** - * Scaling settings for this revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; - * @param \Google\Cloud\Run\V2\RevisionScaling $var - * @return $this - */ - public function setScaling($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); - $this->scaling = $var; - - return $this; - } - - /** - * VPC Access configuration for this Revision. For more information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; - * @return \Google\Cloud\Run\V2\VpcAccess|null - */ - public function getVpcAccess() - { - return $this->vpc_access; - } - - public function hasVpcAccess() - { - return isset($this->vpc_access); - } - - public function clearVpcAccess() - { - unset($this->vpc_access); - } - - /** - * VPC Access configuration for this Revision. For more information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; - * @param \Google\Cloud\Run\V2\VpcAccess $var - * @return $this - */ - public function setVpcAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); - $this->vpc_access = $var; - - return $this; - } - - /** - * Sets the maximum number of requests that each serving instance can receive. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 34; - * @return int - */ - public function getMaxInstanceRequestConcurrency() - { - return $this->max_instance_request_concurrency; - } - - /** - * Sets the maximum number of requests that each serving instance can receive. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 34; - * @param int $var - * @return $this - */ - public function setMaxInstanceRequestConcurrency($var) - { - GPBUtil::checkInt32($var); - $this->max_instance_request_concurrency = $var; - - return $this; - } - - /** - * Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 15; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 15; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Email address of the IAM service account associated with the revision of - * the service. The service account represents the identity of the running - * revision, and determines what permissions the revision has. - * - * Generated from protobuf field string service_account = 16; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Email address of the IAM service account associated with the revision of - * the service. The service account represents the identity of the running - * revision, and determines what permissions the revision has. - * - * Generated from protobuf field string service_account = 16; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContainers() - { - return $this->containers; - } - - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; - * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContainers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); - $this->containers = $arr; - - return $this; - } - - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; - * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * The execution environment being used to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - * @return int - */ - public function getExecutionEnvironment() - { - return $this->execution_environment; - } - - /** - * The execution environment being used to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - * @param int $var - * @return $this - */ - public function setExecutionEnvironment($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); - $this->execution_environment = $var; - - return $this; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { - * @return string - */ - public function getEncryptionKey() - { - return $this->encryption_key; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEncryptionKey($var) - { - GPBUtil::checkString($var, True); - $this->encryption_key = $var; - - return $this; - } - - /** - * Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; - * @return \Google\Cloud\Run\V2\ServiceMesh|null - */ - public function getServiceMesh() - { - return $this->service_mesh; - } - - public function hasServiceMesh() - { - return isset($this->service_mesh); - } - - public function clearServiceMesh() - { - unset($this->service_mesh); - } - - /** - * Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; - * @param \Google\Cloud\Run\V2\ServiceMesh $var - * @return $this - */ - public function setServiceMesh($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); - $this->service_mesh = $var; - - return $this; - } - - /** - * The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; - * @return int - */ - public function getEncryptionKeyRevocationAction() - { - return $this->encryption_key_revocation_action; - } - - /** - * The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; - * @param int $var - * @return $this - */ - public function setEncryptionKeyRevocationAction($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); - $this->encryption_key_revocation_action = $var; - - return $this; - } - - /** - * If encryption_key_revocation_action is SHUTDOWN, the duration before - * shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; - * @return \Google\Protobuf\Duration|null - */ - public function getEncryptionKeyShutdownDuration() - { - return $this->encryption_key_shutdown_duration; - } - - public function hasEncryptionKeyShutdownDuration() - { - return isset($this->encryption_key_shutdown_duration); - } - - public function clearEncryptionKeyShutdownDuration() - { - unset($this->encryption_key_shutdown_duration); - } - - /** - * If encryption_key_revocation_action is SHUTDOWN, the duration before - * shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEncryptionKeyShutdownDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->encryption_key_shutdown_duration = $var; - - return $this; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Service.reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Service.reconciling` for additional information - * on reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Output only. The Condition of this Revision, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Output only. The Condition of this Revision, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * Output only. The generation of this Revision currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getObservedGeneration() - { - return $this->observed_generation; - } - - /** - * Output only. The generation of this Revision currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setObservedGeneration($var) - { - GPBUtil::checkInt64($var); - $this->observed_generation = $var; - - return $this; - } - - /** - * Output only. The Google Console URI to obtain logs for the Revision. - * - * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLogUri() - { - return $this->log_uri; - } - - /** - * Output only. The Google Console URI to obtain logs for the Revision. - * - * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLogUri($var) - { - GPBUtil::checkString($var, True); - $this->log_uri = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 38; - * @return bool - */ - public function getSessionAffinity() - { - return $this->session_affinity; - } - - /** - * Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 38; - * @param bool $var - * @return $this - */ - public function setSessionAffinity($var) - { - GPBUtil::checkBool($var); - $this->session_affinity = $var; - - return $this; - } - - /** - * Output only. The current effective scaling settings for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\RevisionScalingStatus|null - */ - public function getScalingStatus() - { - return $this->scaling_status; - } - - public function hasScalingStatus() - { - return isset($this->scaling_status); - } - - public function clearScalingStatus() - { - unset($this->scaling_status); - } - - /** - * Output only. The current effective scaling settings for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\RevisionScalingStatus $var - * @return $this - */ - public function setScalingStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScalingStatus::class); - $this->scaling_status = $var; - - return $this; - } - - /** - * The node selector for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; - * @return \Google\Cloud\Run\V2\NodeSelector|null - */ - public function getNodeSelector() - { - return $this->node_selector; - } - - public function hasNodeSelector() - { - return isset($this->node_selector); - } - - public function clearNodeSelector() - { - unset($this->node_selector); - } - - /** - * The node selector for the revision. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; - * @param \Google\Cloud\Run\V2\NodeSelector $var - * @return $this - */ - public function setNodeSelector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); - $this->node_selector = $var; - - return $this; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php deleted file mode 100644 index 5536c70fe0a..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.run.v2.RevisionScaling - */ -class RevisionScaling extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Minimum number of serving instances that this resource should - * have. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $min_instance_count = 0; - /** - * Optional. Maximum number of serving instances that this resource should - * have. When unspecified, the field is set to the server default value of - * 100. For more information see - * https://cloud.google.com/run/docs/configuring/max-instances - * - * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_instance_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $min_instance_count - * Optional. Minimum number of serving instances that this resource should - * have. - * @type int $max_instance_count - * Optional. Maximum number of serving instances that this resource should - * have. When unspecified, the field is set to the server default value of - * 100. For more information see - * https://cloud.google.com/run/docs/configuring/max-instances - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Minimum number of serving instances that this resource should - * have. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMinInstanceCount() - { - return $this->min_instance_count; - } - - /** - * Optional. Minimum number of serving instances that this resource should - * have. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMinInstanceCount($var) - { - GPBUtil::checkInt32($var); - $this->min_instance_count = $var; - - return $this; - } - - /** - * Optional. Maximum number of serving instances that this resource should - * have. When unspecified, the field is set to the server default value of - * 100. For more information see - * https://cloud.google.com/run/docs/configuring/max-instances - * - * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxInstanceCount() - { - return $this->max_instance_count; - } - - /** - * Optional. Maximum number of serving instances that this resource should - * have. When unspecified, the field is set to the server default value of - * 100. For more information see - * https://cloud.google.com/run/docs/configuring/max-instances - * - * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxInstanceCount($var) - { - GPBUtil::checkInt32($var); - $this->max_instance_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php deleted file mode 100644 index fff365b91e7..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.run.v2.RevisionScalingStatus - */ -class RevisionScalingStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The current number of min instances provisioned for this revision. - * - * Generated from protobuf field int32 desired_min_instance_count = 1; - */ - protected $desired_min_instance_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $desired_min_instance_count - * The current number of min instances provisioned for this revision. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Status::initOnce(); - parent::__construct($data); - } - - /** - * The current number of min instances provisioned for this revision. - * - * Generated from protobuf field int32 desired_min_instance_count = 1; - * @return int - */ - public function getDesiredMinInstanceCount() - { - return $this->desired_min_instance_count; - } - - /** - * The current number of min instances provisioned for this revision. - * - * Generated from protobuf field int32 desired_min_instance_count = 1; - * @param int $var - * @return $this - */ - public function setDesiredMinInstanceCount($var) - { - GPBUtil::checkInt32($var); - $this->desired_min_instance_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php deleted file mode 100644 index 36d1686c1e8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php +++ /dev/null @@ -1,822 +0,0 @@ -google.cloud.run.v2.RevisionTemplate - */ -class RevisionTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The unique name for the revision. If this field is omitted, it - * will be automatically generated based on the Service name. - * - * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $revision = ''; - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 RevisionTemplate. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 RevisionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $annotations; - /** - * Optional. Scaling settings for this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $scaling = null; - /** - * Optional. VPC Access configuration to use for this Revision. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $vpc_access = null; - /** - * Optional. Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $timeout = null; - /** - * Optional. Email address of the IAM service account associated with the - * revision of the service. The service account represents the identity of the - * running revision, and determines what permissions the revision has. If not - * provided, the revision will use the project's default service account. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account = ''; - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; - */ - private $containers; - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $volumes; - /** - * Optional. The sandbox environment to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $execution_environment = 0; - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { - */ - protected $encryption_key = ''; - /** - * Optional. Sets the maximum number of requests that each serving instance - * can receive. If not specified or 0, concurrency defaults to 80 when - * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_instance_request_concurrency = 0; - /** - * Optional. Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_mesh = null; - /** - * Optional. The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_key_revocation_action = 0; - /** - * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - * before shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_key_shutdown_duration = null; - /** - * Optional. Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $session_affinity = false; - /** - * Optional. Disables health checking containers during deployment. - * - * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $health_check_disabled = false; - /** - * Optional. The node selector for the revision template. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $node_selector = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $revision - * Optional. The unique name for the revision. If this field is omitted, it - * will be automatically generated based on the Service name. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 RevisionTemplate. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 RevisionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * @type \Google\Cloud\Run\V2\RevisionScaling $scaling - * Optional. Scaling settings for this Revision. - * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access - * Optional. VPC Access configuration to use for this Revision. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * @type \Google\Protobuf\Duration $timeout - * Optional. Max allowed time for an instance to respond to a request. - * @type string $service_account - * Optional. Email address of the IAM service account associated with the - * revision of the service. The service account represents the identity of the - * running revision, and determines what permissions the revision has. If not - * provided, the revision will use the project's default service account. - * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers - * Holds the single container that defines the unit of execution for this - * Revision. - * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * Optional. A list of Volumes to make available to containers. - * @type int $execution_environment - * Optional. The sandbox environment to host this Revision. - * @type string $encryption_key - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * @type int $max_instance_request_concurrency - * Optional. Sets the maximum number of requests that each serving instance - * can receive. If not specified or 0, concurrency defaults to 80 when - * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh - * Optional. Enables service mesh connectivity. - * @type int $encryption_key_revocation_action - * Optional. The action to take if the encryption key is revoked. - * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration - * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - * before shutting down all instances. The minimum increment is 1 hour. - * @type bool $session_affinity - * Optional. Enable session affinity. - * @type bool $health_check_disabled - * Optional. Disables health checking containers during deployment. - * @type \Google\Cloud\Run\V2\NodeSelector $node_selector - * Optional. The node selector for the revision template. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\RevisionTemplate::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The unique name for the revision. If this field is omitted, it - * will be automatically generated based on the Service name. - * - * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * Optional. The unique name for the revision. If this field is omitted, it - * will be automatically generated based on the Service name. - * - * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 RevisionTemplate. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 RevisionTemplate. - * - * Generated from protobuf field map labels = 2 [(.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; - } - - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 RevisionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system annotations in v1 now - * have a corresponding field in v2 RevisionTemplate. - *

This field follows Kubernetes annotations' namespacing, limits, and - * rules. - * - * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Optional. Scaling settings for this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\RevisionScaling|null - */ - public function getScaling() - { - return $this->scaling; - } - - public function hasScaling() - { - return isset($this->scaling); - } - - public function clearScaling() - { - unset($this->scaling); - } - - /** - * Optional. Scaling settings for this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\RevisionScaling $var - * @return $this - */ - public function setScaling($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); - $this->scaling = $var; - - return $this; - } - - /** - * Optional. VPC Access configuration to use for this Revision. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\VpcAccess|null - */ - public function getVpcAccess() - { - return $this->vpc_access; - } - - public function hasVpcAccess() - { - return isset($this->vpc_access); - } - - public function clearVpcAccess() - { - unset($this->vpc_access); - } - - /** - * Optional. VPC Access configuration to use for this Revision. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\VpcAccess $var - * @return $this - */ - public function setVpcAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); - $this->vpc_access = $var; - - return $this; - } - - /** - * Optional. Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Optional. Max allowed time for an instance to respond to a request. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Optional. Email address of the IAM service account associated with the - * revision of the service. The service account represents the identity of the - * running revision, and determines what permissions the revision has. If not - * provided, the revision will use the project's default service account. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. Email address of the IAM service account associated with the - * revision of the service. The service account represents the identity of the - * running revision, and determines what permissions the revision has. If not - * provided, the revision will use the project's default service account. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContainers() - { - return $this->containers; - } - - /** - * Holds the single container that defines the unit of execution for this - * Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; - * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContainers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); - $this->containers = $arr; - - return $this; - } - - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Optional. The sandbox environment to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getExecutionEnvironment() - { - return $this->execution_environment; - } - - /** - * Optional. The sandbox environment to host this Revision. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setExecutionEnvironment($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); - $this->execution_environment = $var; - - return $this; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { - * @return string - */ - public function getEncryptionKey() - { - return $this->encryption_key; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEncryptionKey($var) - { - GPBUtil::checkString($var, True); - $this->encryption_key = $var; - - return $this; - } - - /** - * Optional. Sets the maximum number of requests that each serving instance - * can receive. If not specified or 0, concurrency defaults to 80 when - * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxInstanceRequestConcurrency() - { - return $this->max_instance_request_concurrency; - } - - /** - * Optional. Sets the maximum number of requests that each serving instance - * can receive. If not specified or 0, concurrency defaults to 80 when - * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - * - * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxInstanceRequestConcurrency($var) - { - GPBUtil::checkInt32($var); - $this->max_instance_request_concurrency = $var; - - return $this; - } - - /** - * Optional. Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\ServiceMesh|null - */ - public function getServiceMesh() - { - return $this->service_mesh; - } - - public function hasServiceMesh() - { - return isset($this->service_mesh); - } - - public function clearServiceMesh() - { - unset($this->service_mesh); - } - - /** - * Optional. Enables service mesh connectivity. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\ServiceMesh $var - * @return $this - */ - public function setServiceMesh($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); - $this->service_mesh = $var; - - return $this; - } - - /** - * Optional. The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getEncryptionKeyRevocationAction() - { - return $this->encryption_key_revocation_action; - } - - /** - * Optional. The action to take if the encryption key is revoked. - * - * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setEncryptionKeyRevocationAction($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); - $this->encryption_key_revocation_action = $var; - - return $this; - } - - /** - * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - * before shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getEncryptionKeyShutdownDuration() - { - return $this->encryption_key_shutdown_duration; - } - - public function hasEncryptionKeyShutdownDuration() - { - return isset($this->encryption_key_shutdown_duration); - } - - public function clearEncryptionKeyShutdownDuration() - { - unset($this->encryption_key_shutdown_duration); - } - - /** - * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - * before shutting down all instances. The minimum increment is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEncryptionKeyShutdownDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->encryption_key_shutdown_duration = $var; - - return $this; - } - - /** - * Optional. Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getSessionAffinity() - { - return $this->session_affinity; - } - - /** - * Optional. Enable session affinity. - * - * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setSessionAffinity($var) - { - GPBUtil::checkBool($var); - $this->session_affinity = $var; - - return $this; - } - - /** - * Optional. Disables health checking containers during deployment. - * - * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getHealthCheckDisabled() - { - return $this->health_check_disabled; - } - - /** - * Optional. Disables health checking containers during deployment. - * - * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setHealthCheckDisabled($var) - { - GPBUtil::checkBool($var); - $this->health_check_disabled = $var; - - return $this; - } - - /** - * Optional. The node selector for the revision template. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\NodeSelector|null - */ - public function getNodeSelector() - { - return $this->node_selector; - } - - public function hasNodeSelector() - { - return isset($this->node_selector); - } - - public function clearNodeSelector() - { - unset($this->node_selector); - } - - /** - * Optional. The node selector for the revision template. - * - * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\NodeSelector $var - * @return $this - */ - public function setNodeSelector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); - $this->node_selector = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php deleted file mode 100644 index bf51806e3bc..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php +++ /dev/null @@ -1,215 +0,0 @@ -google.cloud.run.v2.RunJobRequest - */ -class RunJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - */ - protected $validate_only = false; - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - /** - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * - * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; - */ - protected $overrides = null; - - /** - * @param string $name Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. Please see - * {@see JobsClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Run\V2\RunJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @type bool $validate_only - * Indicates that the request should be validated without actually - * deleting any resources. - * @type string $etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @type \Google\Cloud\Run\V2\RunJobRequest\Overrides $overrides - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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 full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * - * 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; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated without actually - * deleting any resources. - * - * Generated from protobuf field bool validate_only = 2; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * - * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; - * @return \Google\Cloud\Run\V2\RunJobRequest\Overrides|null - */ - public function getOverrides() - { - return $this->overrides; - } - - public function hasOverrides() - { - return isset($this->overrides); - } - - public function clearOverrides() - { - unset($this->overrides); - } - - /** - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * - * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; - * @param \Google\Cloud\Run\V2\RunJobRequest\Overrides $var - * @return $this - */ - public function setOverrides($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RunJobRequest\Overrides::class); - $this->overrides = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php deleted file mode 100644 index 60098e2ce07..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.run.v2.RunJobRequest.Overrides - */ -class Overrides extends \Google\Protobuf\Internal\Message -{ - /** - * Per container override specification. - * - * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; - */ - private $container_overrides; - /** - * Optional. The desired number of tasks the execution should run. Will - * replace existing task_count value. - * - * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $task_count = 0; - /** - * Duration in seconds the task may be active before the system will - * actively try to mark it failed and kill associated containers. Will - * replace existing timeout_seconds value. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4; - */ - protected $timeout = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $container_overrides - * Per container override specification. - * @type int $task_count - * Optional. The desired number of tasks the execution should run. Will - * replace existing task_count value. - * @type \Google\Protobuf\Duration $timeout - * Duration in seconds the task may be active before the system will - * actively try to mark it failed and kill associated containers. Will - * replace existing timeout_seconds value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Per container override specification. - * - * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContainerOverrides() - { - return $this->container_overrides; - } - - /** - * Per container override specification. - * - * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; - * @param array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContainerOverrides($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride::class); - $this->container_overrides = $arr; - - return $this; - } - - /** - * Optional. The desired number of tasks the execution should run. Will - * replace existing task_count value. - * - * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTaskCount() - { - return $this->task_count; - } - - /** - * Optional. The desired number of tasks the execution should run. Will - * replace existing task_count value. - * - * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTaskCount($var) - { - GPBUtil::checkInt32($var); - $this->task_count = $var; - - return $this; - } - - /** - * Duration in seconds the task may be active before the system will - * actively try to mark it failed and kill associated containers. Will - * replace existing timeout_seconds value. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Duration in seconds the task may be active before the system will - * actively try to mark it failed and kill associated containers. Will - * replace existing timeout_seconds value. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Overrides::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php deleted file mode 100644 index 9d002dff8c0..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php +++ /dev/null @@ -1,180 +0,0 @@ -google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - */ -class ContainerOverride extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the container specified as a DNS_LABEL. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Optional. Arguments to the entrypoint. Will replace existing args for - * override. - * - * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $args; - /** - * List of environment variables to set in the container. Will be merged - * with existing env for override. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; - */ - private $env; - /** - * Optional. True if the intention is to clear out existing args list. - * - * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $clear_args = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the container specified as a DNS_LABEL. - * @type array|\Google\Protobuf\Internal\RepeatedField $args - * Optional. Arguments to the entrypoint. Will replace existing args for - * override. - * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env - * List of environment variables to set in the container. Will be merged - * with existing env for override. - * @type bool $clear_args - * Optional. True if the intention is to clear out existing args list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * The name of the container specified as a DNS_LABEL. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the container specified as a DNS_LABEL. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Arguments to the entrypoint. Will replace existing args for - * override. - * - * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getArgs() - { - return $this->args; - } - - /** - * Optional. Arguments to the entrypoint. Will replace existing args for - * override. - * - * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setArgs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->args = $arr; - - return $this; - } - - /** - * List of environment variables to set in the container. Will be merged - * with existing env for override. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * List of environment variables to set in the container. Will be merged - * with existing env for override. - * - * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; - * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); - $this->env = $arr; - - return $this; - } - - /** - * Optional. True if the intention is to clear out existing args list. - * - * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getClearArgs() - { - return $this->clear_args; - } - - /** - * Optional. True if the intention is to clear out existing args list. - * - * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setClearArgs($var) - { - GPBUtil::checkBool($var); - $this->clear_args = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContainerOverride::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides_ContainerOverride::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php deleted file mode 100644 index 060822bb245..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.run.v2.SecretKeySelector - */ -class SecretKeySelector extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret_name} if the secret is in the same project. - * projects/{project}/secrets/{secret_name} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $secret = ''; - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest version, an integer for a specific version, - * or a version alias. - * - * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { - */ - protected $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $secret - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret_name} if the secret is in the same project. - * projects/{project}/secrets/{secret_name} if the secret is - * in a different project. - * @type string $version - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest version, an integer for a specific version, - * or a version alias. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret_name} if the secret is in the same project. - * projects/{project}/secrets/{secret_name} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSecret() - { - return $this->secret; - } - - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret_name} if the secret is in the same project. - * projects/{project}/secrets/{secret_name} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->secret = $var; - - return $this; - } - - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest version, an integer for a specific version, - * or a version alias. - * - * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest version, an integer for a specific version, - * or a version alias. - * - * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php deleted file mode 100644 index 1007b817c05..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php +++ /dev/null @@ -1,217 +0,0 @@ -google.cloud.run.v2.SecretVolumeSource - */ -class SecretVolumeSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret} if the secret is in the same project. - * projects/{project}/secrets/{secret} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $secret = ''; - /** - * If unspecified, the volume will expose a file whose name is the - * secret, relative to VolumeMount.mount_path. - * If specified, the key will be used as the version to fetch from Cloud - * Secret Manager and the path will be the name of the file exposed in the - * volume. When items are defined, they must specify a path and a version. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; - */ - private $items; - /** - * Integer representation of mode bits to use on created files by default. - * Must be a value between 0000 and 0777 (octal), defaulting to 0444. - * Directories within the path are not affected by this setting. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * This might be in conflict with other options that affect the - * file mode, like fsGroup, and as a result, other mode bits could be set. - * - * Generated from protobuf field int32 default_mode = 3; - */ - protected $default_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $secret - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret} if the secret is in the same project. - * projects/{project}/secrets/{secret} if the secret is - * in a different project. - * @type array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $items - * If unspecified, the volume will expose a file whose name is the - * secret, relative to VolumeMount.mount_path. - * If specified, the key will be used as the version to fetch from Cloud - * Secret Manager and the path will be the name of the file exposed in the - * volume. When items are defined, they must specify a path and a version. - * @type int $default_mode - * Integer representation of mode bits to use on created files by default. - * Must be a value between 0000 and 0777 (octal), defaulting to 0444. - * Directories within the path are not affected by this setting. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * This might be in conflict with other options that affect the - * file mode, like fsGroup, and as a result, other mode bits could be set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret} if the secret is in the same project. - * projects/{project}/secrets/{secret} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSecret() - { - return $this->secret; - } - - /** - * Required. The name of the secret in Cloud Secret Manager. - * Format: {secret} if the secret is in the same project. - * projects/{project}/secrets/{secret} if the secret is - * in a different project. - * - * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->secret = $var; - - return $this; - } - - /** - * If unspecified, the volume will expose a file whose name is the - * secret, relative to VolumeMount.mount_path. - * If specified, the key will be used as the version to fetch from Cloud - * Secret Manager and the path will be the name of the file exposed in the - * volume. When items are defined, they must specify a path and a version. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getItems() - { - return $this->items; - } - - /** - * If unspecified, the volume will expose a file whose name is the - * secret, relative to VolumeMount.mount_path. - * If specified, the key will be used as the version to fetch from Cloud - * Secret Manager and the path will be the name of the file exposed in the - * volume. When items are defined, they must specify a path and a version. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; - * @param array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setItems($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VersionToPath::class); - $this->items = $arr; - - return $this; - } - - /** - * Integer representation of mode bits to use on created files by default. - * Must be a value between 0000 and 0777 (octal), defaulting to 0444. - * Directories within the path are not affected by this setting. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * This might be in conflict with other options that affect the - * file mode, like fsGroup, and as a result, other mode bits could be set. - * - * Generated from protobuf field int32 default_mode = 3; - * @return int - */ - public function getDefaultMode() - { - return $this->default_mode; - } - - /** - * Integer representation of mode bits to use on created files by default. - * Must be a value between 0000 and 0777 (octal), defaulting to 0444. - * Directories within the path are not affected by this setting. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * This might be in conflict with other options that affect the - * file mode, like fsGroup, and as a result, other mode bits could be set. - * - * Generated from protobuf field int32 default_mode = 3; - * @param int $var - * @return $this - */ - public function setDefaultMode($var) - { - GPBUtil::checkInt32($var); - $this->default_mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php deleted file mode 100644 index 685077c47a2..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php +++ /dev/null @@ -1,1609 +0,0 @@ -google.cloud.run.v2.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified name of this Service. In CreateServiceRequest, this - * field is ignored, and instead composed from CreateServiceRequest.parent and - * CreateServiceRequest.service_id. - * Format: - * projects/{project}/locations/{location}/services/{service_id} - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * User-provided description of the Service. This field currently has a - * 512-character limit. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Output only. Server assigned unique identifier for the trigger. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * Please note that unlike v1, this is an int64 value. As with most Google - * APIs, its JSON representation will be a `string` instead of an `integer`. - * - * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Service. - * - * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected in new resources. All system - * annotations in v1 now have a corresponding field in v2 Service. - *

This field follows Kubernetes - * annotations' namespacing, limits, and rules. - * - * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $annotations; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $creator = ''; - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_modifier = ''; - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 13; - */ - protected $client = ''; - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 14; - */ - protected $client_version = ''; - /** - * Optional. Provides the ingress settings for this Service. On output, - * returns the currently observed ingress settings, or - * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - * - * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ingress = 0; - /** - * Optional. The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $launch_stage = 0; - /** - * Optional. Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $binary_authorization = null; - /** - * Required. The template used to create revisions for this Service. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $template = null; - /** - * Optional. Specifies how to distribute traffic over a collection of - * Revisions belonging to the Service. If traffic is empty or not provided, - * defaults to 100% traffic to the latest `Ready` Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $traffic; - /** - * Optional. Specifies service-level scaling settings - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $scaling = null; - /** - * Optional. Disables IAM permission check for run.routes.invoke for callers - * of this service. This feature is available by invitation only. For more - * information, visit - * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - * - * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $invoker_iam_disabled = false; - /** - * Optional. Disables public resolution of the default URI of this service. - * - * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $default_uri_disabled = false; - /** - * Output only. All URLs serving traffic for this Service. - * - * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $urls; - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - */ - private $custom_audiences; - /** - * Output only. The generation of this Service currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. Please note that unlike v1, this is an int64 value. - * As with most Google APIs, its JSON representation will be a `string` - * instead of an `integer`. - * - * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $observed_generation = 0; - /** - * Output only. The Condition of this Service, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. See comments in `reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $terminal_condition = null; - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Service does not - * reach its Serving state. See comments in `reconciling` for additional - * information on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $conditions; - /** - * Output only. Name of the latest revision that is serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $latest_ready_revision = ''; - /** - * Output only. Name of the last created revision. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $latest_created_revision = ''; - /** - * Output only. Detailed status information for corresponding traffic targets. - * See comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $traffic_statuses; - /** - * Output only. The main URI in which this Service is serving traffic. - * - * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uri = ''; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. Returns true if the Service is currently being acted upon by - * the system to bring it into the desired state. - * When a new Service is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Service to the - * desired serving state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation`, - * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient - * values that might mismatch the intended state: Once reconciliation is over - * (and this field is false), there are two possible outcomes: reconciliation - * succeeded and the serving state matches the Service, or there was an error, - * and reconciliation failed. This state can be found in - * `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: `traffic` and - * `traffic_statuses`, `observed_generation` and `generation`, - * `latest_ready_revision` and `latest_created_revision`. - * If reconciliation failed, `traffic_statuses`, `observed_generation`, and - * `latest_ready_revision` will have the state of the last serving revision, - * or empty for newly created Services. Additional information on the failure - * can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The fully qualified name of this Service. In CreateServiceRequest, this - * field is ignored, and instead composed from CreateServiceRequest.parent and - * CreateServiceRequest.service_id. - * Format: - * projects/{project}/locations/{location}/services/{service_id} - * @type string $description - * User-provided description of the Service. This field currently has a - * 512-character limit. - * @type string $uid - * Output only. Server assigned unique identifier for the trigger. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * @type int|string $generation - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * Please note that unlike v1, this is an int64 value. As with most Google - * APIs, its JSON representation will be a `string` instead of an `integer`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Service. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected in new resources. All system - * annotations in v1 now have a corresponding field in v2 Service. - *

This field follows Kubernetes - * annotations' namespacing, limits, and rules. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * @type string $creator - * Output only. Email address of the authenticated creator. - * @type string $last_modifier - * Output only. Email address of the last authenticated modifier. - * @type string $client - * Arbitrary identifier for the API client. - * @type string $client_version - * Arbitrary version identifier for the API client. - * @type int $ingress - * Optional. Provides the ingress settings for this Service. On output, - * returns the currently observed ingress settings, or - * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - * @type int $launch_stage - * Optional. The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization - * Optional. Settings for the Binary Authorization feature. - * @type \Google\Cloud\Run\V2\RevisionTemplate $template - * Required. The template used to create revisions for this Service. - * @type array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $traffic - * Optional. Specifies how to distribute traffic over a collection of - * Revisions belonging to the Service. If traffic is empty or not provided, - * defaults to 100% traffic to the latest `Ready` Revision. - * @type \Google\Cloud\Run\V2\ServiceScaling $scaling - * Optional. Specifies service-level scaling settings - * @type bool $invoker_iam_disabled - * Optional. Disables IAM permission check for run.routes.invoke for callers - * of this service. This feature is available by invitation only. For more - * information, visit - * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - * @type bool $default_uri_disabled - * Optional. Disables public resolution of the default URI of this service. - * @type array|\Google\Protobuf\Internal\RepeatedField $urls - * Output only. All URLs serving traffic for this Service. - * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * @type int|string $observed_generation - * Output only. The generation of this Service currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. Please note that unlike v1, this is an int64 value. - * As with most Google APIs, its JSON representation will be a `string` - * instead of an `integer`. - * @type \Google\Cloud\Run\V2\Condition $terminal_condition - * Output only. The Condition of this Service, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. See comments in `reconciling` for additional information on - * reconciliation process in Cloud Run. - * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Service does not - * reach its Serving state. See comments in `reconciling` for additional - * information on reconciliation process in Cloud Run. - * @type string $latest_ready_revision - * Output only. Name of the latest revision that is serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * @type string $latest_created_revision - * Output only. Name of the last created revision. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * @type array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $traffic_statuses - * Output only. Detailed status information for corresponding traffic targets. - * See comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * @type string $uri - * Output only. The main URI in which this Service is serving traffic. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type bool $reconciling - * Output only. Returns true if the Service is currently being acted upon by - * the system to bring it into the desired state. - * When a new Service is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Service to the - * desired serving state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation`, - * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient - * values that might mismatch the intended state: Once reconciliation is over - * (and this field is false), there are two possible outcomes: reconciliation - * succeeded and the serving state matches the Service, or there was an error, - * and reconciliation failed. This state can be found in - * `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: `traffic` and - * `traffic_statuses`, `observed_generation` and `generation`, - * `latest_ready_revision` and `latest_created_revision`. - * If reconciliation failed, `traffic_statuses`, `observed_generation`, and - * `latest_ready_revision` will have the state of the last serving revision, - * or empty for newly created Services. Additional information on the failure - * can be found in `terminal_condition` and `conditions`. - * @type string $etag - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified name of this Service. In CreateServiceRequest, this - * field is ignored, and instead composed from CreateServiceRequest.parent and - * CreateServiceRequest.service_id. - * Format: - * projects/{project}/locations/{location}/services/{service_id} - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The fully qualified name of this Service. In CreateServiceRequest, this - * field is ignored, and instead composed from CreateServiceRequest.parent and - * CreateServiceRequest.service_id. - * Format: - * projects/{project}/locations/{location}/services/{service_id} - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-provided description of the Service. This field currently has a - * 512-character limit. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User-provided description of the Service. This field currently has a - * 512-character limit. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the trigger. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the trigger. The value - * is a UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * Please note that unlike v1, this is an int64 value. As with most Google - * APIs, its JSON representation will be a `string` instead of an `integer`. - * - * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * Please note that unlike v1, this is an int64 value. As with most Google - * APIs, its JSON representation will be a `string` instead of an `integer`. - * - * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Service. - * - * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels. - *

Cloud Run API v2 does not support labels with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected. All system labels in v1 now have a - * corresponding field in v2 Service. - * - * Generated from protobuf field map labels = 5 [(.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; - } - - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected in new resources. All system - * annotations in v1 now have a corresponding field in v2 Service. - *

This field follows Kubernetes - * annotations' namespacing, limits, and rules. - * - * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Optional. Unstructured key value map that may be set by external tools to - * store and arbitrary metadata. They are not queryable and should be - * preserved when modifying objects. - *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - * namespaces, and they will be rejected in new resources. All system - * annotations in v1 now have a corresponding field in v2 Service. - *

This field follows Kubernetes - * annotations' namespacing, limits, and rules. - * - * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. The deletion time. It is only populated as a response to a - * Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getCreator() - { - return $this->creator; - } - - /** - * Output only. Email address of the authenticated creator. - * - * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setCreator($var) - { - GPBUtil::checkString($var, True); - $this->creator = $var; - - return $this; - } - - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLastModifier() - { - return $this->last_modifier; - } - - /** - * Output only. Email address of the last authenticated modifier. - * - * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLastModifier($var) - { - GPBUtil::checkString($var, True); - $this->last_modifier = $var; - - return $this; - } - - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 13; - * @return string - */ - public function getClient() - { - return $this->client; - } - - /** - * Arbitrary identifier for the API client. - * - * Generated from protobuf field string client = 13; - * @param string $var - * @return $this - */ - public function setClient($var) - { - GPBUtil::checkString($var, True); - $this->client = $var; - - return $this; - } - - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 14; - * @return string - */ - public function getClientVersion() - { - return $this->client_version; - } - - /** - * Arbitrary version identifier for the API client. - * - * Generated from protobuf field string client_version = 14; - * @param string $var - * @return $this - */ - public function setClientVersion($var) - { - GPBUtil::checkString($var, True); - $this->client_version = $var; - - return $this; - } - - /** - * Optional. Provides the ingress settings for this Service. On output, - * returns the currently observed ingress settings, or - * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - * - * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getIngress() - { - return $this->ingress; - } - - /** - * Optional. Provides the ingress settings for this Service. On output, - * returns the currently observed ingress settings, or - * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - * - * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setIngress($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\IngressTraffic::class); - $this->ingress = $var; - - return $this; - } - - /** - * Optional. The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * Optional. The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - * is assumed. - * Set the launch stage to a preview stage on input to allow use of preview - * features in that stage. On read (or output), describes whether the resource - * uses preview features. - *

- * For example, if ALPHA is provided as input, but only BETA and GA-level - * features are used, this field will be BETA on output. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - - /** - * Optional. Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\BinaryAuthorization|null - */ - public function getBinaryAuthorization() - { - return $this->binary_authorization; - } - - public function hasBinaryAuthorization() - { - return isset($this->binary_authorization); - } - - public function clearBinaryAuthorization() - { - unset($this->binary_authorization); - } - - /** - * Optional. Settings for the Binary Authorization feature. - * - * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\BinaryAuthorization $var - * @return $this - */ - public function setBinaryAuthorization($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); - $this->binary_authorization = $var; - - return $this; - } - - /** - * Required. The template used to create revisions for this Service. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\RevisionTemplate|null - */ - public function getTemplate() - { - return $this->template; - } - - public function hasTemplate() - { - return isset($this->template); - } - - public function clearTemplate() - { - unset($this->template); - } - - /** - * Required. The template used to create revisions for this Service. - * - * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\RevisionTemplate $var - * @return $this - */ - public function setTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionTemplate::class); - $this->template = $var; - - return $this; - } - - /** - * Optional. Specifies how to distribute traffic over a collection of - * Revisions belonging to the Service. If traffic is empty or not provided, - * defaults to 100% traffic to the latest `Ready` Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTraffic() - { - return $this->traffic; - } - - /** - * Optional. Specifies how to distribute traffic over a collection of - * Revisions belonging to the Service. If traffic is empty or not provided, - * defaults to 100% traffic to the latest `Ready` Revision. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTraffic($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTarget::class); - $this->traffic = $arr; - - return $this; - } - - /** - * Optional. Specifies service-level scaling settings - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\ServiceScaling|null - */ - public function getScaling() - { - return $this->scaling; - } - - public function hasScaling() - { - return isset($this->scaling); - } - - public function clearScaling() - { - unset($this->scaling); - } - - /** - * Optional. Specifies service-level scaling settings - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\ServiceScaling $var - * @return $this - */ - public function setScaling($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceScaling::class); - $this->scaling = $var; - - return $this; - } - - /** - * Optional. Disables IAM permission check for run.routes.invoke for callers - * of this service. This feature is available by invitation only. For more - * information, visit - * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - * - * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getInvokerIamDisabled() - { - return $this->invoker_iam_disabled; - } - - /** - * Optional. Disables IAM permission check for run.routes.invoke for callers - * of this service. This feature is available by invitation only. For more - * information, visit - * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - * - * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setInvokerIamDisabled($var) - { - GPBUtil::checkBool($var); - $this->invoker_iam_disabled = $var; - - return $this; - } - - /** - * Optional. Disables public resolution of the default URI of this service. - * - * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDefaultUriDisabled() - { - return $this->default_uri_disabled; - } - - /** - * Optional. Disables public resolution of the default URI of this service. - * - * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDefaultUriDisabled($var) - { - GPBUtil::checkBool($var); - $this->default_uri_disabled = $var; - - return $this; - } - - /** - * Output only. All URLs serving traffic for this Service. - * - * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUrls() - { - return $this->urls; - } - - /** - * Output only. All URLs serving traffic for this Service. - * - * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->urls = $arr; - - return $this; - } - - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCustomAudiences() - { - return $this->custom_audiences; - } - - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCustomAudiences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->custom_audiences = $arr; - - return $this; - } - - /** - * Output only. The generation of this Service currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. Please note that unlike v1, this is an int64 value. - * As with most Google APIs, its JSON representation will be a `string` - * instead of an `integer`. - * - * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getObservedGeneration() - { - return $this->observed_generation; - } - - /** - * Output only. The generation of this Service currently serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. Please note that unlike v1, this is an int64 value. - * As with most Google APIs, its JSON representation will be a `string` - * instead of an `integer`. - * - * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setObservedGeneration($var) - { - GPBUtil::checkInt64($var); - $this->observed_generation = $var; - - return $this; - } - - /** - * Output only. The Condition of this Service, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. See comments in `reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\Condition|null - */ - public function getTerminalCondition() - { - return $this->terminal_condition; - } - - public function hasTerminalCondition() - { - return isset($this->terminal_condition); - } - - public function clearTerminalCondition() - { - unset($this->terminal_condition); - } - - /** - * Output only. The Condition of this Service, containing its readiness - * status, and detailed error information in case it did not reach a serving - * state. See comments in `reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\Condition $var - * @return $this - */ - public function setTerminalCondition($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); - $this->terminal_condition = $var; - - return $this; - } - - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Service does not - * reach its Serving state. See comments in `reconciling` for additional - * information on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Output only. The Conditions of all other associated sub-resources. They - * contain additional diagnostics information in case the Service does not - * reach its Serving state. See comments in `reconciling` for additional - * information on reconciliation process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * Output only. Name of the latest revision that is serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestReadyRevision() - { - return $this->latest_ready_revision; - } - - /** - * Output only. Name of the latest revision that is serving traffic. See - * comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestReadyRevision($var) - { - GPBUtil::checkString($var, True); - $this->latest_ready_revision = $var; - - return $this; - } - - /** - * Output only. Name of the last created revision. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestCreatedRevision() - { - return $this->latest_created_revision; - } - - /** - * Output only. Name of the last created revision. See comments in - * `reconciling` for additional information on reconciliation process in Cloud - * Run. - * - * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestCreatedRevision($var) - { - GPBUtil::checkString($var, True); - $this->latest_created_revision = $var; - - return $this; - } - - /** - * Output only. Detailed status information for corresponding traffic targets. - * See comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTrafficStatuses() - { - return $this->traffic_statuses; - } - - /** - * Output only. Detailed status information for corresponding traffic targets. - * See comments in `reconciling` for additional information on reconciliation - * process in Cloud Run. - * - * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTrafficStatuses($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTargetStatus::class); - $this->traffic_statuses = $arr; - - return $this; - } - - /** - * Output only. The main URI in which this Service is serving traffic. - * - * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Output only. The main URI in which this Service is serving traffic. - * - * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. Returns true if the Service is currently being acted upon by - * the system to bring it into the desired state. - * When a new Service is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Service to the - * desired serving state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation`, - * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient - * values that might mismatch the intended state: Once reconciliation is over - * (and this field is false), there are two possible outcomes: reconciliation - * succeeded and the serving state matches the Service, or there was an error, - * and reconciliation failed. This state can be found in - * `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: `traffic` and - * `traffic_statuses`, `observed_generation` and `generation`, - * `latest_ready_revision` and `latest_created_revision`. - * If reconciliation failed, `traffic_statuses`, `observed_generation`, and - * `latest_ready_revision` will have the state of the last serving revision, - * or empty for newly created Services. Additional information on the failure - * can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Returns true if the Service is currently being acted upon by - * the system to bring it into the desired state. - * When a new Service is created, or an existing one is updated, Cloud Run - * will asynchronously perform all necessary steps to bring the Service to the - * desired serving state. This process is called reconciliation. - * While reconciliation is in process, `observed_generation`, - * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient - * values that might mismatch the intended state: Once reconciliation is over - * (and this field is false), there are two possible outcomes: reconciliation - * succeeded and the serving state matches the Service, or there was an error, - * and reconciliation failed. This state can be found in - * `terminal_condition.state`. - * If reconciliation succeeded, the following fields will match: `traffic` and - * `traffic_statuses`, `observed_generation` and `generation`, - * `latest_ready_revision` and `latest_created_revision`. - * If reconciliation failed, `traffic_statuses`, `observed_generation`, and - * `latest_ready_revision` will have the state of the last serving revision, - * or empty for newly created Services. Additional information on the failure - * can be found in `terminal_condition` and `conditions`. - * - * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php deleted file mode 100644 index 19cd1b0263c..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.run.v2.ServiceMesh - */ -class ServiceMesh extends \Google\Protobuf\Internal\Message -{ - /** - * The Mesh resource name. Format: - * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - * be project id or number. - * - * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { - */ - protected $mesh = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $mesh - * The Mesh resource name. Format: - * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - * be project id or number. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * The Mesh resource name. Format: - * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - * be project id or number. - * - * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getMesh() - { - return $this->mesh; - } - - /** - * The Mesh resource name. Format: - * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - * be project id or number. - * - * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setMesh($var) - { - GPBUtil::checkString($var, True); - $this->mesh = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php deleted file mode 100644 index 7fa643373a0..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.run.v2.ServiceScaling - */ -class ServiceScaling extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. total min instances for the service. This number of instances is - * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $min_instance_count = 0; - /** - * Optional. The scaling mode for the service. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $scaling_mode = 0; - /** - * Optional. total instance count for the service in manual scaling mode. This - * number of instances is divided among all revisions with specified traffic - * based on the percent of traffic they are receiving. - * - * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $manual_instance_count = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $min_instance_count - * Optional. total min instances for the service. This number of instances is - * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. - * @type int $scaling_mode - * Optional. The scaling mode for the service. - * @type int $manual_instance_count - * Optional. total instance count for the service in manual scaling mode. This - * number of instances is divided among all revisions with specified traffic - * based on the percent of traffic they are receiving. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * Optional. total min instances for the service. This number of instances is - * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMinInstanceCount() - { - return $this->min_instance_count; - } - - /** - * Optional. total min instances for the service. This number of instances is - * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. - * - * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMinInstanceCount($var) - { - GPBUtil::checkInt32($var); - $this->min_instance_count = $var; - - return $this; - } - - /** - * Optional. The scaling mode for the service. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getScalingMode() - { - return $this->scaling_mode; - } - - /** - * Optional. The scaling mode for the service. - * - * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setScalingMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ServiceScaling\ScalingMode::class); - $this->scaling_mode = $var; - - return $this; - } - - /** - * Optional. total instance count for the service in manual scaling mode. This - * number of instances is divided among all revisions with specified traffic - * based on the percent of traffic they are receiving. - * - * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getManualInstanceCount() - { - return isset($this->manual_instance_count) ? $this->manual_instance_count : 0; - } - - public function hasManualInstanceCount() - { - return isset($this->manual_instance_count); - } - - public function clearManualInstanceCount() - { - unset($this->manual_instance_count); - } - - /** - * Optional. total instance count for the service in manual scaling mode. This - * number of instances is divided among all revisions with specified traffic - * based on the percent of traffic they are receiving. - * - * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setManualInstanceCount($var) - { - GPBUtil::checkInt32($var); - $this->manual_instance_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php deleted file mode 100644 index 58d181ecc82..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.run.v2.ServiceScaling.ScalingMode - */ -class ScalingMode -{ - /** - * Unspecified. - * - * Generated from protobuf enum SCALING_MODE_UNSPECIFIED = 0; - */ - const SCALING_MODE_UNSPECIFIED = 0; - /** - * Scale based on traffic between min and max instances. - * - * Generated from protobuf enum AUTOMATIC = 1; - */ - const AUTOMATIC = 1; - /** - * Scale to exactly min instances and ignore max instances. - * - * Generated from protobuf enum MANUAL = 2; - */ - const MANUAL = 2; - - private static $valueToName = [ - self::SCALING_MODE_UNSPECIFIED => 'SCALING_MODE_UNSPECIFIED', - self::AUTOMATIC => 'AUTOMATIC', - self::MANUAL => 'MANUAL', - ]; - - 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(ScalingMode::class, \Google\Cloud\Run\V2\ServiceScaling_ScalingMode::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php deleted file mode 100644 index a577d719f1a..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.run.v2.StorageSource - */ -class StorageSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Google Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $bucket = ''; - /** - * Required. Google Cloud Storage object containing the source. - * This object must be a gzipped archive file (`.tar.gz`) containing source to - * build. - * - * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $object = ''; - /** - * Optional. Google Cloud Storage generation for the object. If the generation - * is omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $generation = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Required. Google Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * @type string $object - * Required. Google Cloud Storage object containing the source. - * This object must be a gzipped archive file (`.tar.gz`) containing source to - * build. - * @type int|string $generation - * Optional. Google Cloud Storage generation for the object. If the generation - * is omitted, the latest generation will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); - parent::__construct($data); - } - - /** - * Required. Google Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Required. Google Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Required. Google Cloud Storage object containing the source. - * This object must be a gzipped archive file (`.tar.gz`) containing source to - * build. - * - * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getObject() - { - return $this->object; - } - - /** - * Required. Google Cloud Storage object containing the source. - * This object must be a gzipped archive file (`.tar.gz`) containing source to - * build. - * - * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setObject($var) - { - GPBUtil::checkString($var, True); - $this->object = $var; - - return $this; - } - - /** - * Optional. Google Cloud Storage generation for the object. If the generation - * is omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Optional. Google Cloud Storage generation for the object. If the generation - * is omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php deleted file mode 100644 index cb260e21eed..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php +++ /dev/null @@ -1,356 +0,0 @@ -google.cloud.run.v2.SubmitBuildRequest - */ -class SubmitBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. Artifact Registry URI to store the built image. - * - * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $image_uri = ''; - /** - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * - * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account = ''; - /** - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * - * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $worker_pool = ''; - /** - * Optional. Additional tags to annotate the build. - * - * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $tags; - protected $source; - protected $build_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * @type \Google\Cloud\Run\V2\StorageSource $storage_source - * Required. Source for the build. - * @type string $image_uri - * Required. Artifact Registry URI to store the built image. - * @type \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $buildpack_build - * Build the source using Buildpacks. - * @type \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $docker_build - * Build the source using Docker. This means the source has a Dockerfile. - * @type string $service_account - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * @type string $worker_pool - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Optional. Additional tags to annotate the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Source for the build. - * - * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\StorageSource|null - */ - public function getStorageSource() - { - return $this->readOneof(2); - } - - public function hasStorageSource() - { - return $this->hasOneof(2); - } - - /** - * Required. Source for the build. - * - * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\StorageSource $var - * @return $this - */ - public function setStorageSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\StorageSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. Artifact Registry URI to store the built image. - * - * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getImageUri() - { - return $this->image_uri; - } - - /** - * Required. Artifact Registry URI to store the built image. - * - * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setImageUri($var) - { - GPBUtil::checkString($var, True); - $this->image_uri = $var; - - return $this; - } - - /** - * Build the source using Buildpacks. - * - * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; - * @return \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild|null - */ - public function getBuildpackBuild() - { - return $this->readOneof(4); - } - - public function hasBuildpackBuild() - { - return $this->hasOneof(4); - } - - /** - * Build the source using Buildpacks. - * - * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; - * @param \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $var - * @return $this - */ - public function setBuildpackBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Build the source using Docker. This means the source has a Dockerfile. - * - * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; - * @return \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild|null - */ - public function getDockerBuild() - { - return $this->readOneof(5); - } - - public function hasDockerBuild() - { - return $this->hasOneof(5); - } - - /** - * Build the source using Docker. This means the source has a Dockerfile. - * - * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; - * @param \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $var - * @return $this - */ - public function setDockerBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * - * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * - * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * - * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * - * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Optional. Additional tags to annotate the build. - * - * 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. Additional tags to annotate the build. - * - * 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; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getBuildType() - { - return $this->whichOneof("build_type"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php deleted file mode 100644 index 7cedb432a08..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php +++ /dev/null @@ -1,273 +0,0 @@ -google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - */ -class BuildpacksBuild extends \Google\Protobuf\Internal\Message -{ - /** - * The runtime name, e.g. 'go113'. Leave blank for generic builds. - * - * Generated from protobuf field string runtime = 1 [deprecated = true]; - * @deprecated - */ - protected $runtime = ''; - /** - * Optional. Name of the function target if the source is a function source. - * Required for function builds. - * - * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $function_target = ''; - /** - * Optional. cache_image_uri is the GCR/AR URL where the cache image will be - * stored. cache_image_uri is optional and omitting it will disable caching. - * This URL must be stable across builds. It is used to derive a - * build-specific temporary URL by substituting the tag with the build ID. - * The build will clean up the temporary image on a best-effort basis. - * - * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cache_image_uri = ''; - /** - * Optional. The base image used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $base_image = ''; - /** - * Optional. User-provided build-time environment variables. - * - * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $environment_variables; - /** - * Optional. Whether or not the application container will be enrolled in - * automatic base image updates. When true, the application will be built on - * a scratch base image, so the base layers can be appended at run time. - * - * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_automatic_updates = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $runtime - * The runtime name, e.g. 'go113'. Leave blank for generic builds. - * @type string $function_target - * Optional. Name of the function target if the source is a function source. - * Required for function builds. - * @type string $cache_image_uri - * Optional. cache_image_uri is the GCR/AR URL where the cache image will be - * stored. cache_image_uri is optional and omitting it will disable caching. - * This URL must be stable across builds. It is used to derive a - * build-specific temporary URL by substituting the tag with the build ID. - * The build will clean up the temporary image on a best-effort basis. - * @type string $base_image - * Optional. The base image used to opt into automatic base image updates. - * @type array|\Google\Protobuf\Internal\MapField $environment_variables - * Optional. User-provided build-time environment variables. - * @type bool $enable_automatic_updates - * Optional. Whether or not the application container will be enrolled in - * automatic base image updates. When true, the application will be built on - * a scratch base image, so the base layers can be appended at run time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); - parent::__construct($data); - } - - /** - * The runtime name, e.g. 'go113'. Leave blank for generic builds. - * - * Generated from protobuf field string runtime = 1 [deprecated = true]; - * @return string - * @deprecated - */ - public function getRuntime() - { - @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); - return $this->runtime; - } - - /** - * The runtime name, e.g. 'go113'. Leave blank for generic builds. - * - * Generated from protobuf field string runtime = 1 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setRuntime($var) - { - @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->runtime = $var; - - return $this; - } - - /** - * Optional. Name of the function target if the source is a function source. - * Required for function builds. - * - * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFunctionTarget() - { - return $this->function_target; - } - - /** - * Optional. Name of the function target if the source is a function source. - * Required for function builds. - * - * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFunctionTarget($var) - { - GPBUtil::checkString($var, True); - $this->function_target = $var; - - return $this; - } - - /** - * Optional. cache_image_uri is the GCR/AR URL where the cache image will be - * stored. cache_image_uri is optional and omitting it will disable caching. - * This URL must be stable across builds. It is used to derive a - * build-specific temporary URL by substituting the tag with the build ID. - * The build will clean up the temporary image on a best-effort basis. - * - * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCacheImageUri() - { - return $this->cache_image_uri; - } - - /** - * Optional. cache_image_uri is the GCR/AR URL where the cache image will be - * stored. cache_image_uri is optional and omitting it will disable caching. - * This URL must be stable across builds. It is used to derive a - * build-specific temporary URL by substituting the tag with the build ID. - * The build will clean up the temporary image on a best-effort basis. - * - * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCacheImageUri($var) - { - GPBUtil::checkString($var, True); - $this->cache_image_uri = $var; - - return $this; - } - - /** - * Optional. The base image used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBaseImage() - { - return $this->base_image; - } - - /** - * Optional. The base image used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBaseImage($var) - { - GPBUtil::checkString($var, True); - $this->base_image = $var; - - return $this; - } - - /** - * Optional. User-provided build-time environment variables. - * - * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getEnvironmentVariables() - { - return $this->environment_variables; - } - - /** - * Optional. User-provided build-time environment variables. - * - * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setEnvironmentVariables($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->environment_variables = $arr; - - return $this; - } - - /** - * Optional. Whether or not the application container will be enrolled in - * automatic base image updates. When true, the application will be built on - * a scratch base image, so the base layers can be appended at run time. - * - * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableAutomaticUpdates() - { - return $this->enable_automatic_updates; - } - - /** - * Optional. Whether or not the application container will be enrolled in - * automatic base image updates. When true, the application will be built on - * a scratch base image, so the base layers can be appended at run time. - * - * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableAutomaticUpdates($var) - { - GPBUtil::checkBool($var); - $this->enable_automatic_updates = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BuildpacksBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_BuildpacksBuild::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php deleted file mode 100644 index 9089c3fd5f0..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php +++ /dev/null @@ -1,36 +0,0 @@ -google.cloud.run.v2.SubmitBuildRequest.DockerBuild - */ -class DockerBuild extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DockerBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_DockerBuild::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php deleted file mode 100644 index 42440dbfebd..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php +++ /dev/null @@ -1,149 +0,0 @@ -google.cloud.run.v2.SubmitBuildResponse - */ -class SubmitBuildResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Build operation to be polled via CloudBuild API. - * - * Generated from protobuf field .google.longrunning.Operation build_operation = 1; - */ - protected $build_operation = null; - /** - * URI of the base builder image in Artifact Registry being used in the build. - * Used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image_uri = 2; - */ - protected $base_image_uri = ''; - /** - * Warning message for the base image. - * - * Generated from protobuf field string base_image_warning = 3; - */ - protected $base_image_warning = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\LongRunning\Operation $build_operation - * Cloud Build operation to be polled via CloudBuild API. - * @type string $base_image_uri - * URI of the base builder image in Artifact Registry being used in the build. - * Used to opt into automatic base image updates. - * @type string $base_image_warning - * Warning message for the base image. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Build operation to be polled via CloudBuild API. - * - * Generated from protobuf field .google.longrunning.Operation build_operation = 1; - * @return \Google\LongRunning\Operation|null - */ - public function getBuildOperation() - { - return $this->build_operation; - } - - public function hasBuildOperation() - { - return isset($this->build_operation); - } - - public function clearBuildOperation() - { - unset($this->build_operation); - } - - /** - * Cloud Build operation to be polled via CloudBuild API. - * - * Generated from protobuf field .google.longrunning.Operation build_operation = 1; - * @param \Google\LongRunning\Operation $var - * @return $this - */ - public function setBuildOperation($var) - { - GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); - $this->build_operation = $var; - - return $this; - } - - /** - * URI of the base builder image in Artifact Registry being used in the build. - * Used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image_uri = 2; - * @return string - */ - public function getBaseImageUri() - { - return $this->base_image_uri; - } - - /** - * URI of the base builder image in Artifact Registry being used in the build. - * Used to opt into automatic base image updates. - * - * Generated from protobuf field string base_image_uri = 2; - * @param string $var - * @return $this - */ - public function setBaseImageUri($var) - { - GPBUtil::checkString($var, True); - $this->base_image_uri = $var; - - return $this; - } - - /** - * Warning message for the base image. - * - * Generated from protobuf field string base_image_warning = 3; - * @return string - */ - public function getBaseImageWarning() - { - return $this->base_image_warning; - } - - /** - * Warning message for the base image. - * - * Generated from protobuf field string base_image_warning = 3; - * @param string $var - * @return $this - */ - public function setBaseImageWarning($var) - { - GPBUtil::checkString($var, True); - $this->base_image_warning = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php deleted file mode 100644 index 52828310dc6..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.run.v2.TCPSocketAction - */ -class TCPSocketAction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $port = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $port - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional. Port number to access on the container. Must be in the range 1 to - * 65535. If not specified, defaults to the exposed port of the container, - * which is the value of container.ports[0].containerPort. - * - * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php deleted file mode 100644 index 6fe2768394c..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php +++ /dev/null @@ -1,1339 +0,0 @@ -google.cloud.run.v2.Task - */ -class Task extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique name of this Task. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Server assigned unique identifier for the Task. The value is a - * UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation = 0; - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $labels; - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $annotations; - /** - * Output only. Represents time when the task was created by the system. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Represents time when the task was scheduled to run by the - * system. It is not guaranteed to be set in happens-before order across - * separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $scheduled_time = null; - /** - * Output only. Represents time when the task started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. Represents time when the Task was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $completion_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $job = ''; - /** - * Output only. The name of the parent Execution. - * - * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $execution = ''; - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; - */ - private $containers; - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; - */ - private $volumes; - /** - * Number of retries allowed per Task, before marking this Task failed. - * - * Generated from protobuf field int32 max_retries = 16; - */ - protected $max_retries = 0; - /** - * Max allowed time duration the Task may be active before the system will - * actively try to mark it failed and kill associated containers. This applies - * per attempt of a task, meaning each retry can run for the full timeout. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 17; - */ - protected $timeout = null; - /** - * Email address of the IAM service account associated with the Task of a - * Job. The service account represents the identity of the - * running task, and determines what permissions the task has. If - * not provided, the task will use the project's default service account. - * - * Generated from protobuf field string service_account = 18; - */ - protected $service_account = ''; - /** - * The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - */ - protected $execution_environment = 0; - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Output only. The Condition of this Task, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $conditions; - /** - * Output only. The generation of this Task. See comments in `Job.reconciling` - * for additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $observed_generation = 0; - /** - * Output only. Index of the Task, unique per execution, and beginning at 0. - * - * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $index = 0; - /** - * Output only. The number of times this Task was retried. - * Tasks are retried when they fail up to the maxRetries limit. - * - * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $retried = 0; - /** - * Output only. Result of the last attempt of this Task. - * - * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $last_attempt_result = null; - /** - * Output only. A reference to a customer managed encryption key (CMEK) to use - * to encrypt this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $encryption_key = ''; - /** - * Output only. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $vpc_access = null; - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $log_uri = ''; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique name of this Task. - * @type string $uid - * Output only. Server assigned unique identifier for the Task. The value is a - * UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * @type int|string $generation - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Represents time when the task was created by the system. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * @type \Google\Protobuf\Timestamp $scheduled_time - * Output only. Represents time when the task was scheduled to run by the - * system. It is not guaranteed to be set in happens-before order across - * separate operations. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Represents time when the task started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * @type \Google\Protobuf\Timestamp $completion_time - * Output only. Represents time when the Task was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * @type string $job - * Output only. The name of the parent Job. - * @type string $execution - * Output only. The name of the parent Execution. - * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers - * Holds the single container that defines the unit of execution for this - * task. - * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * A list of Volumes to make available to containers. - * @type int $max_retries - * Number of retries allowed per Task, before marking this Task failed. - * @type \Google\Protobuf\Duration $timeout - * Max allowed time duration the Task may be active before the system will - * actively try to mark it failed and kill associated containers. This applies - * per attempt of a task, meaning each retry can run for the full timeout. - * @type string $service_account - * Email address of the IAM service account associated with the Task of a - * Job. The service account represents the identity of the - * running task, and determines what permissions the task has. If - * not provided, the task will use the project's default service account. - * @type int $execution_environment - * The execution environment being used to host this Task. - * @type bool $reconciling - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions - * Output only. The Condition of this Task, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * @type int|string $observed_generation - * Output only. The generation of this Task. See comments in `Job.reconciling` - * for additional information on reconciliation process in Cloud Run. - * @type int $index - * Output only. Index of the Task, unique per execution, and beginning at 0. - * @type int $retried - * Output only. The number of times this Task was retried. - * Tasks are retried when they fail up to the maxRetries limit. - * @type \Google\Cloud\Run\V2\TaskAttemptResult $last_attempt_result - * Output only. Result of the last attempt of this Task. - * @type string $encryption_key - * Output only. A reference to a customer managed encryption key (CMEK) to use - * to encrypt this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access - * Output only. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * @type string $log_uri - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type string $etag - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique name of this Task. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique name of this Task. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the Task. The value is a - * UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the Task. The value is a - * UUID4 string and guaranteed to remain unchanged until the resource is - * deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Output only. A number that monotonically increases every time the user - * modifies the desired state. - * - * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Output only. Unstructured key value map that can be used to organize and - * categorize objects. User-provided labels are shared with Google's billing - * system, so they can be used to filter, or break down billing charges by - * team, component, environment, state, etc. For more information, visit - * https://cloud.google.com/resource-manager/docs/creating-managing-labels or - * https://cloud.google.com/run/docs/configuring/labels - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Output only. Unstructured key value map that may - * be set by external tools to store and arbitrary metadata. - * They are not queryable and should be preserved - * when modifying objects. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Represents time when the task was created by the system. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. Represents time when the task was created by the system. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Represents time when the task was scheduled to run by the - * system. It is not guaranteed to be set in happens-before order across - * separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduledTime() - { - return $this->scheduled_time; - } - - public function hasScheduledTime() - { - return isset($this->scheduled_time); - } - - public function clearScheduledTime() - { - unset($this->scheduled_time); - } - - /** - * Output only. Represents time when the task was scheduled to run by the - * system. It is not guaranteed to be set in happens-before order across - * separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduledTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->scheduled_time = $var; - - return $this; - } - - /** - * Output only. Represents time when the task started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Represents time when the task started to run. - * It is not guaranteed to be set in happens-before order across separate - * operations. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Represents time when the Task was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompletionTime() - { - return $this->completion_time; - } - - public function hasCompletionTime() - { - return isset($this->completion_time); - } - - public function clearCompletionTime() - { - unset($this->completion_time); - } - - /** - * Output only. Represents time when the Task was completed. It is not - * guaranteed to be set in happens-before order across separate operations. - * - * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompletionTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->completion_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. For a deleted resource, the deletion time. It is only - * populated as a response to a Delete request. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. For a deleted resource, the time after which it will be - * permamently deleted. It is only populated as a response to a Delete - * request. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getJob() - { - return $this->job; - } - - /** - * Output only. The name of the parent Job. - * - * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkString($var, True); - $this->job = $var; - - return $this; - } - - /** - * Output only. The name of the parent Execution. - * - * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getExecution() - { - return $this->execution; - } - - /** - * Output only. The name of the parent Execution. - * - * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setExecution($var) - { - GPBUtil::checkString($var, True); - $this->execution = $var; - - return $this; - } - - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContainers() - { - return $this->containers; - } - - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; - * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContainers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); - $this->containers = $arr; - - return $this; - } - - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; - * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Number of retries allowed per Task, before marking this Task failed. - * - * Generated from protobuf field int32 max_retries = 16; - * @return int - */ - public function getMaxRetries() - { - return $this->max_retries; - } - - /** - * Number of retries allowed per Task, before marking this Task failed. - * - * Generated from protobuf field int32 max_retries = 16; - * @param int $var - * @return $this - */ - public function setMaxRetries($var) - { - GPBUtil::checkInt32($var); - $this->max_retries = $var; - - return $this; - } - - /** - * Max allowed time duration the Task may be active before the system will - * actively try to mark it failed and kill associated containers. This applies - * per attempt of a task, meaning each retry can run for the full timeout. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 17; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Max allowed time duration the Task may be active before the system will - * actively try to mark it failed and kill associated containers. This applies - * per attempt of a task, meaning each retry can run for the full timeout. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 17; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Email address of the IAM service account associated with the Task of a - * Job. The service account represents the identity of the - * running task, and determines what permissions the task has. If - * not provided, the task will use the project's default service account. - * - * Generated from protobuf field string service_account = 18; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Email address of the IAM service account associated with the Task of a - * Job. The service account represents the identity of the - * running task, and determines what permissions the task has. If - * not provided, the task will use the project's default service account. - * - * Generated from protobuf field string service_account = 18; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - * @return int - */ - public function getExecutionEnvironment() - { - return $this->execution_environment; - } - - /** - * The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; - * @param int $var - * @return $this - */ - public function setExecutionEnvironment($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); - $this->execution_environment = $var; - - return $this; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Indicates whether the resource's reconciliation is still in - * progress. See comments in `Job.reconciling` for additional information on - * reconciliation process in Cloud Run. - * - * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Output only. The Condition of this Task, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Output only. The Condition of this Task, containing its readiness status, - * and detailed error information in case it did not reach the desired state. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * Output only. The generation of this Task. See comments in `Job.reconciling` - * for additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getObservedGeneration() - { - return $this->observed_generation; - } - - /** - * Output only. The generation of this Task. See comments in `Job.reconciling` - * for additional information on reconciliation process in Cloud Run. - * - * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setObservedGeneration($var) - { - GPBUtil::checkInt64($var); - $this->observed_generation = $var; - - return $this; - } - - /** - * Output only. Index of the Task, unique per execution, and beginning at 0. - * - * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getIndex() - { - return $this->index; - } - - /** - * Output only. Index of the Task, unique per execution, and beginning at 0. - * - * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkInt32($var); - $this->index = $var; - - return $this; - } - - /** - * Output only. The number of times this Task was retried. - * Tasks are retried when they fail up to the maxRetries limit. - * - * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRetried() - { - return $this->retried; - } - - /** - * Output only. The number of times this Task was retried. - * Tasks are retried when they fail up to the maxRetries limit. - * - * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRetried($var) - { - GPBUtil::checkInt32($var); - $this->retried = $var; - - return $this; - } - - /** - * Output only. Result of the last attempt of this Task. - * - * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\TaskAttemptResult|null - */ - public function getLastAttemptResult() - { - return $this->last_attempt_result; - } - - public function hasLastAttemptResult() - { - return isset($this->last_attempt_result); - } - - public function clearLastAttemptResult() - { - unset($this->last_attempt_result); - } - - /** - * Output only. Result of the last attempt of this Task. - * - * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\TaskAttemptResult $var - * @return $this - */ - public function setLastAttemptResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskAttemptResult::class); - $this->last_attempt_result = $var; - - return $this; - } - - /** - * Output only. A reference to a customer managed encryption key (CMEK) to use - * to encrypt this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEncryptionKey() - { - return $this->encryption_key; - } - - /** - * Output only. A reference to a customer managed encryption key (CMEK) to use - * to encrypt this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEncryptionKey($var) - { - GPBUtil::checkString($var, True); - $this->encryption_key = $var; - - return $this; - } - - /** - * Output only. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Run\V2\VpcAccess|null - */ - public function getVpcAccess() - { - return $this->vpc_access; - } - - public function hasVpcAccess() - { - return isset($this->vpc_access); - } - - public function clearVpcAccess() - { - unset($this->vpc_access); - } - - /** - * Output only. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Run\V2\VpcAccess $var - * @return $this - */ - public function setVpcAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); - $this->vpc_access = $var; - - return $this; - } - - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLogUri() - { - return $this->log_uri; - } - - /** - * Output only. URI where logs for this execution can be found in Cloud - * Console. - * - * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLogUri($var) - { - GPBUtil::checkString($var, True); - $this->log_uri = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php deleted file mode 100644 index 26a5923b91a..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.run.v2.TaskAttemptResult - */ -class TaskAttemptResult extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The status of this attempt. - * If the status code is OK, then the attempt succeeded. - * - * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status = null; - /** - * Output only. The exit code of this attempt. - * This may be unset if the container was unable to exit cleanly with a code - * due to some other failure. - * See status field for possible failure details. - * - * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $exit_code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Rpc\Status $status - * Output only. The status of this attempt. - * If the status code is OK, then the attempt succeeded. - * @type int $exit_code - * Output only. The exit code of this attempt. - * This may be unset if the container was unable to exit cleanly with a code - * due to some other failure. - * See status field for possible failure details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The status of this attempt. - * If the status code is OK, then the attempt succeeded. - * - * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Rpc\Status|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Output only. The status of this attempt. - * If the status code is OK, then the attempt succeeded. - * - * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. The exit code of this attempt. - * This may be unset if the container was unable to exit cleanly with a code - * due to some other failure. - * See status field for possible failure details. - * - * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getExitCode() - { - return $this->exit_code; - } - - /** - * Output only. The exit code of this attempt. - * This may be unset if the container was unable to exit cleanly with a code - * due to some other failure. - * See status field for possible failure details. - * - * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setExitCode($var) - { - GPBUtil::checkInt32($var); - $this->exit_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php deleted file mode 100644 index 900f4f9ed2b..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php +++ /dev/null @@ -1,381 +0,0 @@ -google.cloud.run.v2.TaskTemplate - */ -class TaskTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; - */ - private $containers; - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $volumes; - /** - * Optional. Max allowed time duration the Task may be active before the - * system will actively try to mark it failed and kill associated containers. - * This applies per attempt of a task, meaning each retry can run for the full - * timeout. Defaults to 600 seconds. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $timeout = null; - /** - * Optional. Email address of the IAM service account associated with the Task - * of a Job. The service account represents the identity of the running task, - * and determines what permissions the task has. If not provided, the task - * will use the project's default service account. - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $service_account = ''; - /** - * Optional. The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $execution_environment = 0; - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { - */ - protected $encryption_key = ''; - /** - * Optional. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $vpc_access = null; - protected $retries; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers - * Holds the single container that defines the unit of execution for this - * task. - * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * Optional. A list of Volumes to make available to containers. - * @type int $max_retries - * Number of retries allowed per Task, before marking this Task failed. - * Defaults to 3. - * @type \Google\Protobuf\Duration $timeout - * Optional. Max allowed time duration the Task may be active before the - * system will actively try to mark it failed and kill associated containers. - * This applies per attempt of a task, meaning each retry can run for the full - * timeout. Defaults to 600 seconds. - * @type string $service_account - * Optional. Email address of the IAM service account associated with the Task - * of a Job. The service account represents the identity of the running task, - * and determines what permissions the task has. If not provided, the task - * will use the project's default service account. - * @type int $execution_environment - * Optional. The execution environment being used to host this Task. - * @type string $encryption_key - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access - * Optional. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\TaskTemplate::initOnce(); - parent::__construct($data); - } - - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContainers() - { - return $this->containers; - } - - /** - * Holds the single container that defines the unit of execution for this - * task. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; - * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContainers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); - $this->containers = $arr; - - return $this; - } - - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Optional. A list of Volumes to make available to containers. - * - * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Number of retries allowed per Task, before marking this Task failed. - * Defaults to 3. - * - * Generated from protobuf field int32 max_retries = 3; - * @return int - */ - public function getMaxRetries() - { - return $this->readOneof(3); - } - - public function hasMaxRetries() - { - return $this->hasOneof(3); - } - - /** - * Number of retries allowed per Task, before marking this Task failed. - * Defaults to 3. - * - * Generated from protobuf field int32 max_retries = 3; - * @param int $var - * @return $this - */ - public function setMaxRetries($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. Max allowed time duration the Task may be active before the - * system will actively try to mark it failed and kill associated containers. - * This applies per attempt of a task, meaning each retry can run for the full - * timeout. Defaults to 600 seconds. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Optional. Max allowed time duration the Task may be active before the - * system will actively try to mark it failed and kill associated containers. - * This applies per attempt of a task, meaning each retry can run for the full - * timeout. Defaults to 600 seconds. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Optional. Email address of the IAM service account associated with the Task - * of a Job. The service account represents the identity of the running task, - * and determines what permissions the task has. If not provided, the task - * will use the project's default service account. - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. Email address of the IAM service account associated with the Task - * of a Job. The service account represents the identity of the running task, - * and determines what permissions the task has. If not provided, the task - * will use the project's default service account. - * - * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Optional. The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getExecutionEnvironment() - { - return $this->execution_environment; - } - - /** - * Optional. The execution environment being used to host this Task. - * - * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setExecutionEnvironment($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); - $this->execution_environment = $var; - - return $this; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { - * @return string - */ - public function getEncryptionKey() - { - return $this->encryption_key; - } - - /** - * A reference to a customer managed encryption key (CMEK) to use to encrypt - * this container image. For more information, go to - * https://cloud.google.com/run/docs/securing/using-cmek - * - * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEncryptionKey($var) - { - GPBUtil::checkString($var, True); - $this->encryption_key = $var; - - return $this; - } - - /** - * Optional. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Run\V2\VpcAccess|null - */ - public function getVpcAccess() - { - return $this->vpc_access; - } - - public function hasVpcAccess() - { - return isset($this->vpc_access); - } - - public function clearVpcAccess() - { - unset($this->vpc_access); - } - - /** - * Optional. VPC Access configuration to use for this Task. For more - * information, visit - * https://cloud.google.com/run/docs/configuring/connecting-vpc. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Run\V2\VpcAccess $var - * @return $this - */ - public function setVpcAccess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); - $this->vpc_access = $var; - - return $this; - } - - /** - * @return string - */ - public function getRetries() - { - return $this->whichOneof("retries"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php deleted file mode 100644 index b4264dd3a66..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php +++ /dev/null @@ -1,182 +0,0 @@ -google.cloud.run.v2.TrafficTarget - */ -class TrafficTarget extends \Google\Protobuf\Internal\Message -{ - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - */ - protected $type = 0; - /** - * Revision to which to send this portion of traffic, if traffic allocation is - * by revision. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - */ - protected $revision = ''; - /** - * Specifies percent of the traffic to this Revision. - * This defaults to zero if unspecified. - * - * Generated from protobuf field int32 percent = 3; - */ - protected $percent = 0; - /** - * Indicates a string to be part of the URI to exclusively reference this - * target. - * - * Generated from protobuf field string tag = 4; - */ - protected $tag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The allocation type for this traffic target. - * @type string $revision - * Revision to which to send this portion of traffic, if traffic allocation is - * by revision. - * @type int $percent - * Specifies percent of the traffic to this Revision. - * This defaults to zero if unspecified. - * @type string $tag - * Indicates a string to be part of the URI to exclusively reference this - * target. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); - parent::__construct($data); - } - - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); - $this->type = $var; - - return $this; - } - - /** - * Revision to which to send this portion of traffic, if traffic allocation is - * by revision. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * Revision to which to send this portion of traffic, if traffic allocation is - * by revision. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - - /** - * Specifies percent of the traffic to this Revision. - * This defaults to zero if unspecified. - * - * Generated from protobuf field int32 percent = 3; - * @return int - */ - public function getPercent() - { - return $this->percent; - } - - /** - * Specifies percent of the traffic to this Revision. - * This defaults to zero if unspecified. - * - * Generated from protobuf field int32 percent = 3; - * @param int $var - * @return $this - */ - public function setPercent($var) - { - GPBUtil::checkInt32($var); - $this->percent = $var; - - return $this; - } - - /** - * Indicates a string to be part of the URI to exclusively reference this - * target. - * - * Generated from protobuf field string tag = 4; - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * Indicates a string to be part of the URI to exclusively reference this - * target. - * - * Generated from protobuf field string tag = 4; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->tag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php deleted file mode 100644 index f8b35045a42..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.run.v2.TrafficTargetAllocationType - */ -class TrafficTargetAllocationType -{ - /** - * Unspecified instance allocation type. - * - * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; - */ - const TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; - /** - * Allocates instances to the Service's latest ready Revision. - * - * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; - */ - const TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; - /** - * Allocates instances to a Revision by name. - * - * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; - */ - const TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; - - private static $valueToName = [ - self::TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED => 'TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED', - self::TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST => 'TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST', - self::TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION => 'TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php deleted file mode 100644 index b03251c15e8..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php +++ /dev/null @@ -1,203 +0,0 @@ -google.cloud.run.v2.TrafficTargetStatus - */ -class TrafficTargetStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - */ - protected $type = 0; - /** - * Revision to which this traffic is sent. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - */ - protected $revision = ''; - /** - * Specifies percent of the traffic to this Revision. - * - * Generated from protobuf field int32 percent = 3; - */ - protected $percent = 0; - /** - * Indicates the string used in the URI to exclusively reference this target. - * - * Generated from protobuf field string tag = 4; - */ - protected $tag = ''; - /** - * Displays the target URI. - * - * Generated from protobuf field string uri = 5; - */ - protected $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The allocation type for this traffic target. - * @type string $revision - * Revision to which this traffic is sent. - * @type int $percent - * Specifies percent of the traffic to this Revision. - * @type string $tag - * Indicates the string used in the URI to exclusively reference this target. - * @type string $uri - * Displays the target URI. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); - parent::__construct($data); - } - - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The allocation type for this traffic target. - * - * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); - $this->type = $var; - - return $this; - } - - /** - * Revision to which this traffic is sent. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * Revision to which this traffic is sent. - * - * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - - /** - * Specifies percent of the traffic to this Revision. - * - * Generated from protobuf field int32 percent = 3; - * @return int - */ - public function getPercent() - { - return $this->percent; - } - - /** - * Specifies percent of the traffic to this Revision. - * - * Generated from protobuf field int32 percent = 3; - * @param int $var - * @return $this - */ - public function setPercent($var) - { - GPBUtil::checkInt32($var); - $this->percent = $var; - - return $this; - } - - /** - * Indicates the string used in the URI to exclusively reference this target. - * - * Generated from protobuf field string tag = 4; - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * Indicates the string used in the URI to exclusively reference this target. - * - * Generated from protobuf field string tag = 4; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->tag = $var; - - return $this; - } - - /** - * Displays the target URI. - * - * Generated from protobuf field string uri = 5; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Displays the target URI. - * - * Generated from protobuf field string uri = 5; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php deleted file mode 100644 index 69d8b8afba1..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.run.v2.UpdateJobRequest - */ -class UpdateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Job to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job = null; - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - /** - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\Run\V2\Job $job Required. The Job to be updated. - * - * @return \Google\Cloud\Run\V2\UpdateJobRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Run\V2\Job $job): self - { - return (new self()) - ->setJob($job); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Run\V2\Job $job - * Required. The Job to be updated. - * @type bool $validate_only - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @type bool $allow_missing - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Job to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\Job|null - */ - public function getJob() - { - return $this->job; - } - - public function hasJob() - { - return isset($this->job); - } - - public function clearJob() - { - unset($this->job); - } - - /** - * Required. The Job to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); - $this->job = $var; - - return $this; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php deleted file mode 100644 index 0aa1548695f..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php +++ /dev/null @@ -1,229 +0,0 @@ -google.cloud.run.v2.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The Service to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - /** - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. - * - * @return \Google\Cloud\Run\V2\UpdateServiceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Run\V2\Service $service): self - { - return (new self()) - ->setService($service); - } - - /** - * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. - * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to be updated. - * - * @return \Google\Cloud\Run\V2\UpdateServiceRequest - * - * @experimental - */ - public static function buildFromServiceUpdateMask(\Google\Cloud\Run\V2\Service $service, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setService($service) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. The list of fields to be updated. - * @type \Google\Cloud\Run\V2\Service $service - * Required. The Service to be updated. - * @type bool $validate_only - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @type bool $allow_missing - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The Service to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Run\V2\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Service to be updated. - * - * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Run\V2\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * - * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php deleted file mode 100644 index 0bb46774d60..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php +++ /dev/null @@ -1,188 +0,0 @@ -google.cloud.run.v2.VersionToPath - */ -class VersionToPath extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative path of the secret in the container. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $path = ''; - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest value, or an integer or a secret alias for a - * specific version. - * - * Generated from protobuf field string version = 2; - */ - protected $version = ''; - /** - * Integer octal mode bits to use on this file, must be a value between - * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - * used. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * - * Generated from protobuf field int32 mode = 3; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Required. The relative path of the secret in the container. - * @type string $version - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest value, or an integer or a secret alias for a - * specific version. - * @type int $mode - * Integer octal mode bits to use on this file, must be a value between - * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - * used. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative path of the secret in the container. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Required. The relative path of the secret in the container. - * - * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest value, or an integer or a secret alias for a - * specific version. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Cloud Secret Manager secret version. - * Can be 'latest' for the latest value, or an integer or a secret alias for a - * specific version. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Integer octal mode bits to use on this file, must be a value between - * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - * used. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * - * Generated from protobuf field int32 mode = 3; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Integer octal mode bits to use on this file, must be a value between - * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - * used. - * Notes - * * Internally, a umask of 0222 will be applied to any non-zero value. - * * This is an integer representation of the mode bits. So, the octal - * integer value should look exactly as the chmod numeric notation with a - * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - * 493 (base-10). - * * This might be in conflict with other options that affect the - * file mode, like fsGroup, and the result can be other mode bits set. - * - * Generated from protobuf field int32 mode = 3; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkInt32($var); - $this->mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php deleted file mode 100644 index 0614cda4f01..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.run.v2.Volume - */ -class Volume extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Volume's name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - protected $volume_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Volume's name. - * @type \Google\Cloud\Run\V2\SecretVolumeSource $secret - * Secret represents a secret that should populate this volume. - * @type \Google\Cloud\Run\V2\CloudSqlInstance $cloud_sql_instance - * For Cloud SQL volumes, contains the specific instances that should be - * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for - * more information on how to connect Cloud SQL and Cloud Run. - * @type \Google\Cloud\Run\V2\EmptyDirVolumeSource $empty_dir - * Ephemeral storage used as a shared volume. - * @type \Google\Cloud\Run\V2\NFSVolumeSource $nfs - * For NFS Voumes, contains the path to the nfs Volume - * @type \Google\Cloud\Run\V2\GCSVolumeSource $gcs - * Persistent storage backed by a Google Cloud Storage bucket. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Volume's name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Volume's name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Secret represents a secret that should populate this volume. - * - * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; - * @return \Google\Cloud\Run\V2\SecretVolumeSource|null - */ - public function getSecret() - { - return $this->readOneof(2); - } - - public function hasSecret() - { - return $this->hasOneof(2); - } - - /** - * Secret represents a secret that should populate this volume. - * - * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; - * @param \Google\Cloud\Run\V2\SecretVolumeSource $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretVolumeSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * For Cloud SQL volumes, contains the specific instances that should be - * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for - * more information on how to connect Cloud SQL and Cloud Run. - * - * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; - * @return \Google\Cloud\Run\V2\CloudSqlInstance|null - */ - public function getCloudSqlInstance() - { - return $this->readOneof(3); - } - - public function hasCloudSqlInstance() - { - return $this->hasOneof(3); - } - - /** - * For Cloud SQL volumes, contains the specific instances that should be - * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for - * more information on how to connect Cloud SQL and Cloud Run. - * - * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; - * @param \Google\Cloud\Run\V2\CloudSqlInstance $var - * @return $this - */ - public function setCloudSqlInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\CloudSqlInstance::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Ephemeral storage used as a shared volume. - * - * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; - * @return \Google\Cloud\Run\V2\EmptyDirVolumeSource|null - */ - public function getEmptyDir() - { - return $this->readOneof(4); - } - - public function hasEmptyDir() - { - return $this->hasOneof(4); - } - - /** - * Ephemeral storage used as a shared volume. - * - * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; - * @param \Google\Cloud\Run\V2\EmptyDirVolumeSource $var - * @return $this - */ - public function setEmptyDir($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * For NFS Voumes, contains the path to the nfs Volume - * - * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; - * @return \Google\Cloud\Run\V2\NFSVolumeSource|null - */ - public function getNfs() - { - return $this->readOneof(5); - } - - public function hasNfs() - { - return $this->hasOneof(5); - } - - /** - * For NFS Voumes, contains the path to the nfs Volume - * - * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; - * @param \Google\Cloud\Run\V2\NFSVolumeSource $var - * @return $this - */ - public function setNfs($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NFSVolumeSource::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Persistent storage backed by a Google Cloud Storage bucket. - * - * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; - * @return \Google\Cloud\Run\V2\GCSVolumeSource|null - */ - public function getGcs() - { - return $this->readOneof(6); - } - - public function hasGcs() - { - return $this->hasOneof(6); - } - - /** - * Persistent storage backed by a Google Cloud Storage bucket. - * - * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; - * @param \Google\Cloud\Run\V2\GCSVolumeSource $var - * @return $this - */ - public function setGcs($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GCSVolumeSource::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getVolumeType() - { - return $this->whichOneof("volume_type"); - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php deleted file mode 100644 index 979b27f2084..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.run.v2.VolumeMount - */ -class VolumeMount extends \Google\Protobuf\Internal\Message -{ - /** - * Required. This must match the Name of a Volume. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. Path within the container at which the volume should be mounted. - * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - * otherwise be `/cloudsql`. All instances defined in the Volume will be - * available as `/cloudsql/[instance]`. For more information on Cloud SQL - * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - * - * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $mount_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. This must match the Name of a Volume. - * @type string $mount_path - * Required. Path within the container at which the volume should be mounted. - * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - * otherwise be `/cloudsql`. All instances defined in the Volume will be - * available as `/cloudsql/[instance]`. For more information on Cloud SQL - * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); - parent::__construct($data); - } - - /** - * Required. This must match the Name of a Volume. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. This must match the Name of a Volume. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Path within the container at which the volume should be mounted. - * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - * otherwise be `/cloudsql`. All instances defined in the Volume will be - * available as `/cloudsql/[instance]`. For more information on Cloud SQL - * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - * - * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMountPath() - { - return $this->mount_path; - } - - /** - * Required. Path within the container at which the volume should be mounted. - * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - * otherwise be `/cloudsql`. All instances defined in the Volume will be - * available as `/cloudsql/[instance]`. For more information on Cloud SQL - * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - * - * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMountPath($var) - { - GPBUtil::checkString($var, True); - $this->mount_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php deleted file mode 100644 index 2edc5d9e89b..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.run.v2.VpcAccess - */ -class VpcAccess extends \Google\Protobuf\Internal\Message -{ - /** - * VPC Access connector name. - * Format: `projects/{project}/locations/{location}/connectors/{connector}`, - * where `{project}` can be project id or number. - * For more information on sending traffic to a VPC network via a connector, - * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - * - * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { - */ - protected $connector = ''; - /** - * Optional. Traffic VPC egress settings. If not provided, it defaults to - * PRIVATE_RANGES_ONLY. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $egress = 0; - /** - * Optional. Direct VPC egress settings. Currently only single network - * interface is supported. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $network_interfaces; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $connector - * VPC Access connector name. - * Format: `projects/{project}/locations/{location}/connectors/{connector}`, - * where `{project}` can be project id or number. - * For more information on sending traffic to a VPC network via a connector, - * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - * @type int $egress - * Optional. Traffic VPC egress settings. If not provided, it defaults to - * PRIVATE_RANGES_ONLY. - * @type array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces - * Optional. Direct VPC egress settings. Currently only single network - * interface is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * VPC Access connector name. - * Format: `projects/{project}/locations/{location}/connectors/{connector}`, - * where `{project}` can be project id or number. - * For more information on sending traffic to a VPC network via a connector, - * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - * - * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getConnector() - { - return $this->connector; - } - - /** - * VPC Access connector name. - * Format: `projects/{project}/locations/{location}/connectors/{connector}`, - * where `{project}` can be project id or number. - * For more information on sending traffic to a VPC network via a connector, - * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - * - * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setConnector($var) - { - GPBUtil::checkString($var, True); - $this->connector = $var; - - return $this; - } - - /** - * Optional. Traffic VPC egress settings. If not provided, it defaults to - * PRIVATE_RANGES_ONLY. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getEgress() - { - return $this->egress; - } - - /** - * Optional. Traffic VPC egress settings. If not provided, it defaults to - * PRIVATE_RANGES_ONLY. - * - * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setEgress($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\VpcAccess\VpcEgress::class); - $this->egress = $var; - - return $this; - } - - /** - * Optional. Direct VPC egress settings. Currently only single network - * interface is supported. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNetworkInterfaces() - { - return $this->network_interfaces; - } - - /** - * Optional. Direct VPC egress settings. Currently only single network - * interface is supported. - * - * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNetworkInterfaces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VpcAccess\NetworkInterface::class); - $this->network_interfaces = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php deleted file mode 100644 index 41428271a60..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.run.v2.VpcAccess.NetworkInterface - */ -class NetworkInterface extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The VPC network that the Cloud Run resource will be able to - * send traffic to. At least one of network or subnetwork must be specified. - * If both network and subnetwork are specified, the given VPC subnetwork - * must belong to the given VPC network. If network is not specified, it - * will be looked up from the subnetwork. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $network = ''; - /** - * Optional. The VPC subnetwork that the Cloud Run resource will get IPs - * from. At least one of network or subnetwork must be specified. If both - * network and subnetwork are specified, the given VPC subnetwork must - * belong to the given VPC network. If subnetwork is not specified, the - * subnetwork with the same name with the network will be used. - * - * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $subnetwork = ''; - /** - * Optional. Network tags applied to this Cloud Run resource. - * - * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $tags; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Optional. The VPC network that the Cloud Run resource will be able to - * send traffic to. At least one of network or subnetwork must be specified. - * If both network and subnetwork are specified, the given VPC subnetwork - * must belong to the given VPC network. If network is not specified, it - * will be looked up from the subnetwork. - * @type string $subnetwork - * Optional. The VPC subnetwork that the Cloud Run resource will get IPs - * from. At least one of network or subnetwork must be specified. If both - * network and subnetwork are specified, the given VPC subnetwork must - * belong to the given VPC network. If subnetwork is not specified, the - * subnetwork with the same name with the network will be used. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Optional. Network tags applied to this Cloud Run resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The VPC network that the Cloud Run resource will be able to - * send traffic to. At least one of network or subnetwork must be specified. - * If both network and subnetwork are specified, the given VPC subnetwork - * must belong to the given VPC network. If network is not specified, it - * will be looked up from the subnetwork. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Optional. The VPC network that the Cloud Run resource will be able to - * send traffic to. At least one of network or subnetwork must be specified. - * If both network and subnetwork are specified, the given VPC subnetwork - * must belong to the given VPC network. If network is not specified, it - * will be looked up from the subnetwork. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. The VPC subnetwork that the Cloud Run resource will get IPs - * from. At least one of network or subnetwork must be specified. If both - * network and subnetwork are specified, the given VPC subnetwork must - * belong to the given VPC network. If subnetwork is not specified, the - * subnetwork with the same name with the network will be used. - * - * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSubnetwork() - { - return $this->subnetwork; - } - - /** - * Optional. The VPC subnetwork that the Cloud Run resource will get IPs - * from. At least one of network or subnetwork must be specified. If both - * network and subnetwork are specified, the given VPC subnetwork must - * belong to the given VPC network. If subnetwork is not specified, the - * subnetwork with the same name with the network will be used. - * - * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->subnetwork = $var; - - return $this; - } - - /** - * Optional. Network tags applied to this Cloud Run resource. - * - * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Optional. Network tags applied to this Cloud Run resource. - * - * Generated from protobuf field repeated string tags = 3 [(.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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkInterface::class, \Google\Cloud\Run\V2\VpcAccess_NetworkInterface::class); - diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php deleted file mode 100644 index b6178c267b9..00000000000 --- a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.run.v2.VpcAccess.VpcEgress - */ -class VpcEgress -{ - /** - * Unspecified - * - * Generated from protobuf enum VPC_EGRESS_UNSPECIFIED = 0; - */ - const VPC_EGRESS_UNSPECIFIED = 0; - /** - * All outbound traffic is routed through the VPC connector. - * - * Generated from protobuf enum ALL_TRAFFIC = 1; - */ - const ALL_TRAFFIC = 1; - /** - * Only private IP ranges are routed through the VPC connector. - * - * Generated from protobuf enum PRIVATE_RANGES_ONLY = 2; - */ - const PRIVATE_RANGES_ONLY = 2; - - private static $valueToName = [ - self::VPC_EGRESS_UNSPECIFIED => 'VPC_EGRESS_UNSPECIFIED', - self::ALL_TRAFFIC => 'ALL_TRAFFIC', - self::PRIVATE_RANGES_ONLY => 'PRIVATE_RANGES_ONLY', - ]; - - 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(VpcEgress::class, \Google\Cloud\Run\V2\VpcAccess_VpcEgress::class); - diff --git a/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php b/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php deleted file mode 100644 index efba1314213..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php +++ /dev/null @@ -1,94 +0,0 @@ -setBucket($storageSourceBucket) - ->setObject($storageSourceObject); - $request = (new SubmitBuildRequest()) - ->setParent($parent) - ->setStorageSource($storageSource) - ->setImageUri($imageUri); - - // Call the API and handle any network failures. - try { - /** @var SubmitBuildResponse $response */ - $response = $buildsClient->submitBuild($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $storageSourceBucket = '[BUCKET]'; - $storageSourceObject = '[OBJECT]'; - $imageUri = '[IMAGE_URI]'; - - submit_build_sample($parent, $storageSourceBucket, $storageSourceObject, $imageUri); -} -// [END run_v2_generated_Builds_SubmitBuild_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php deleted file mode 100644 index 64c82c0f877..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $executionsClient->cancelExecution($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Execution $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - - cancel_execution_sample($formattedName); -} -// [END run_v2_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php deleted file mode 100644 index 1e5eeab289d..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $executionsClient->deleteExecution($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Execution $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - - delete_execution_sample($formattedName); -} -// [END run_v2_generated_Executions_DeleteExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php deleted file mode 100644 index 1151abf84be..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php +++ /dev/null @@ -1,74 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Execution $response */ - $response = $executionsClient->getExecution($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - - get_execution_sample($formattedName); -} -// [END run_v2_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php deleted file mode 100644 index 9e3230df26c..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $executionsClient->listExecutions($request); - - /** @var Execution $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ExecutionsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - list_executions_sample($formattedParent); -} -// [END run_v2_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php deleted file mode 100644 index 40327f792c0..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php +++ /dev/null @@ -1,97 +0,0 @@ -setTemplate($jobTemplateTemplate); - $job = (new Job()) - ->setTemplate($jobTemplate); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job) - ->setJobId($jobId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $jobsClient->createJob($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Job $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); - $jobId = '[JOB_ID]'; - - create_job_sample($formattedParent, $jobId); -} -// [END run_v2_generated_Jobs_CreateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php deleted file mode 100644 index c62edc4aa31..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $jobsClient->deleteJob($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Job $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - delete_job_sample($formattedName); -} -// [END run_v2_generated_Jobs_DeleteJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php deleted file mode 100644 index ec63bee9b4e..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $jobsClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END run_v2_generated_Jobs_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php deleted file mode 100644 index e7913654919..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $jobsClient->getJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - get_job_sample($formattedName); -} -// [END run_v2_generated_Jobs_GetJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php deleted file mode 100644 index 5098a79046c..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $jobsClient->listJobs($request); - - /** @var Job $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); - - list_jobs_sample($formattedParent); -} -// [END run_v2_generated_Jobs_ListJobs_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php deleted file mode 100644 index 839082beaab..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $jobsClient->runJob($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Execution $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - run_job_sample($formattedName); -} -// [END run_v2_generated_Jobs_RunJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php deleted file mode 100644 index cd9a9bfc4f4..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php +++ /dev/null @@ -1,74 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $jobsClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END run_v2_generated_Jobs_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php deleted file mode 100644 index 49060c33d08..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php +++ /dev/null @@ -1,80 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $jobsClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END run_v2_generated_Jobs_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php deleted file mode 100644 index 2851843e2e3..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php +++ /dev/null @@ -1,77 +0,0 @@ -setTemplate($jobTemplateTemplate); - $job = (new Job()) - ->setTemplate($jobTemplate); - $request = (new UpdateJobRequest()) - ->setJob($job); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $jobsClient->updateJob($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Job $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END run_v2_generated_Jobs_UpdateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php deleted file mode 100644 index 396f1693cfb..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $revisionsClient->deleteRevision($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Revision $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RevisionsClient::revisionName( - '[PROJECT]', - '[LOCATION]', - '[SERVICE]', - '[REVISION]' - ); - - delete_revision_sample($formattedName); -} -// [END run_v2_generated_Revisions_DeleteRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php deleted file mode 100644 index 02c8bdec4ba..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Revision $response */ - $response = $revisionsClient->getRevision($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RevisionsClient::revisionName( - '[PROJECT]', - '[LOCATION]', - '[SERVICE]', - '[REVISION]' - ); - - get_revision_sample($formattedName); -} -// [END run_v2_generated_Revisions_GetRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php deleted file mode 100644 index 3326bafd47d..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $revisionsClient->listRevisions($request); - - /** @var Revision $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RevisionsClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - - list_revisions_sample($formattedParent); -} -// [END run_v2_generated_Revisions_ListRevisions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php deleted file mode 100644 index 4fc72ae86ea..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php +++ /dev/null @@ -1,95 +0,0 @@ -setTemplate($serviceTemplate); - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setService($service) - ->setServiceId($serviceId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $servicesClient->createService($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Service $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); - $serviceId = '[SERVICE_ID]'; - - create_service_sample($formattedParent, $serviceId); -} -// [END run_v2_generated_Services_CreateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php deleted file mode 100644 index 483cd74a586..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $servicesClient->deleteService($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Service $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - - delete_service_sample($formattedName); -} -// [END run_v2_generated_Services_DeleteService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php deleted file mode 100644 index b7b0f1d416b..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $servicesClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END run_v2_generated_Services_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php deleted file mode 100644 index c76820b3ff8..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $servicesClient->getService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - - get_service_sample($formattedName); -} -// [END run_v2_generated_Services_GetService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php deleted file mode 100644 index 2d88c7f1c0a..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $servicesClient->listServices($request); - - /** @var Service $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); - - list_services_sample($formattedParent); -} -// [END run_v2_generated_Services_ListServices_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php deleted file mode 100644 index 90386eccb59..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php +++ /dev/null @@ -1,74 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $servicesClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END run_v2_generated_Services_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php deleted file mode 100644 index 5b5144e3f93..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php +++ /dev/null @@ -1,80 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $servicesClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END run_v2_generated_Services_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php deleted file mode 100644 index ca153e68ad3..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php +++ /dev/null @@ -1,74 +0,0 @@ -setTemplate($serviceTemplate); - $request = (new UpdateServiceRequest()) - ->setService($service); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $servicesClient->updateService($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Service $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END run_v2_generated_Services_UpdateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php deleted file mode 100644 index bb37335118e..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Task $response */ - $response = $tasksClient->getTask($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = TasksClient::taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); - - get_task_sample($formattedName); -} -// [END run_v2_generated_Tasks_GetTask_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php deleted file mode 100644 index 1b4ebdbc40d..00000000000 --- a/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $tasksClient->listTasks($request); - - /** @var Task $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = TasksClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - - list_tasks_sample($formattedParent); -} -// [END run_v2_generated_Tasks_ListTasks_sync] diff --git a/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php deleted file mode 100644 index ea072eb07f2..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php +++ /dev/null @@ -1,243 +0,0 @@ - submitBuildAsync(SubmitBuildRequest $request, array $optionalArgs = []) - */ -final class BuildsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Builds'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/builds_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/builds_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/builds_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/builds_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a worker_pool - * resource. - * - * @param string $project - * @param string $location - * @param string $workerPool - * - * @return string The formatted worker_pool resource. - */ - public static function workerPoolName(string $project, string $location, string $workerPool): string - { - return self::getPathTemplate('workerPool')->render([ - 'project' => $project, - 'location' => $location, - 'worker_pool' => $workerPool, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Submits a build in a given project. - * - * The async variant is {@see BuildsClient::submitBuildAsync()} . - * - * @example samples/V2/BuildsClient/submit_build.php - * - * @param SubmitBuildRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 SubmitBuildResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function submitBuild(SubmitBuildRequest $request, array $callOptions = []): SubmitBuildResponse - { - return $this->startApiCall('SubmitBuild', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php deleted file mode 100644 index 725af0be60d..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php +++ /dev/null @@ -1,405 +0,0 @@ - cancelExecutionAsync(CancelExecutionRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteExecutionAsync(DeleteExecutionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getExecutionAsync(GetExecutionRequest $request, array $optionalArgs = []) - * @method PromiseInterface listExecutionsAsync(ListExecutionsRequest $request, array $optionalArgs = []) - */ -final class ExecutionsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Executions'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/executions_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/executions_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/executions_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/executions_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName(string $project, string $location, string $job, string $execution): string - { - return self::getPathTemplate('execution')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName(string $project, string $location, string $job): string - { - return self::getPathTemplate('job')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - job: projects/{project}/locations/{location}/jobs/{job} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Cancels an Execution. - * - * The async variant is {@see ExecutionsClient::cancelExecutionAsync()} . - * - * @example samples/V2/ExecutionsClient/cancel_execution.php - * - * @param CancelExecutionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function cancelExecution(CancelExecutionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CancelExecution', $request, $callOptions)->wait(); - } - - /** - * Deletes an Execution. - * - * The async variant is {@see ExecutionsClient::deleteExecutionAsync()} . - * - * @example samples/V2/ExecutionsClient/delete_execution.php - * - * @param DeleteExecutionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteExecution(DeleteExecutionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteExecution', $request, $callOptions)->wait(); - } - - /** - * Gets information about an Execution. - * - * The async variant is {@see ExecutionsClient::getExecutionAsync()} . - * - * @example samples/V2/ExecutionsClient/get_execution.php - * - * @param GetExecutionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Execution - * - * @throws ApiException Thrown if the API call fails. - */ - public function getExecution(GetExecutionRequest $request, array $callOptions = []): Execution - { - return $this->startApiCall('GetExecution', $request, $callOptions)->wait(); - } - - /** - * Lists Executions from a Job. Results are sorted by creation time, - * descending. - * - * The async variant is {@see ExecutionsClient::listExecutionsAsync()} . - * - * @example samples/V2/ExecutionsClient/list_executions.php - * - * @param ListExecutionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listExecutions(ListExecutionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListExecutions', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php deleted file mode 100644 index 27566391f6c..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php +++ /dev/null @@ -1,697 +0,0 @@ - createJobAsync(CreateJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) - * @method PromiseInterface runJobAsync(RunJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateJobAsync(UpdateJobRequest $request, array $optionalArgs = []) - */ -final class JobsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Jobs'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/jobs_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/jobs_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/jobs_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/jobs_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a connector - * resource. - * - * @param string $project - * @param string $location - * @param string $connector - * - * @return string The formatted connector resource. - */ - public static function connectorName(string $project, string $location, string $connector): string - { - return self::getPathTemplate('connector')->render([ - 'project' => $project, - 'location' => $location, - 'connector' => $connector, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string - { - return self::getPathTemplate('cryptoKey')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName(string $project, string $location, string $job, string $execution): string - { - return self::getPathTemplate('execution')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName(string $project, string $location, string $job): string - { - return self::getPathTemplate('job')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - */ - public static function locationPolicyName(string $location): string - { - return self::getPathTemplate('locationPolicy')->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - */ - public static function policyName(string $project): string - { - return self::getPathTemplate('policy')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - */ - public static function projectPolicyName(string $project): string - { - return self::getPathTemplate('projectPolicy')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a secret - * resource. - * - * @param string $project - * @param string $secret - * - * @return string The formatted secret resource. - */ - public static function secretName(string $project, string $secret): string - { - return self::getPathTemplate('secret')->render([ - 'project' => $project, - 'secret' => $secret, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName(string $project, string $secret, string $version): string - { - return self::getPathTemplate('secretVersion')->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - connector: projects/{project}/locations/{location}/connectors/{connector} - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - job: projects/{project}/locations/{location}/jobs/{job} - * - location: projects/{project}/locations/{location} - * - locationPolicy: locations/{location}/policy - * - policy: projects/{project}/policy - * - projectPolicy: projects/{project}/policy - * - secret: projects/{project}/secrets/{secret} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Job. - * - * The async variant is {@see JobsClient::createJobAsync()} . - * - * @example samples/V2/JobsClient/create_job.php - * - * @param CreateJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createJob(CreateJobRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); - } - - /** - * Deletes a Job. - * - * The async variant is {@see JobsClient::deleteJobAsync()} . - * - * @example samples/V2/JobsClient/delete_job.php - * - * @param DeleteJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteJob(DeleteJobRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); - } - - /** - * Gets the IAM Access Control policy currently in effect for the given Job. - * This result does not include any inherited policies. - * - * The async variant is {@see JobsClient::getIamPolicyAsync()} . - * - * @example samples/V2/JobsClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets information about a Job. - * - * The async variant is {@see JobsClient::getJobAsync()} . - * - * @example samples/V2/JobsClient/get_job.php - * - * @param GetJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function getJob(GetJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('GetJob', $request, $callOptions)->wait(); - } - - /** - * Lists Jobs. Results are sorted by creation time, descending. - * - * The async variant is {@see JobsClient::listJobsAsync()} . - * - * @example samples/V2/JobsClient/list_jobs.php - * - * @param ListJobsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListJobs', $request, $callOptions); - } - - /** - * Triggers creation of a new Execution of this Job. - * - * The async variant is {@see JobsClient::runJobAsync()} . - * - * @example samples/V2/JobsClient/run_job.php - * - * @param RunJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function runJob(RunJobRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RunJob', $request, $callOptions)->wait(); - } - - /** - * Sets the IAM Access control policy for the specified Job. Overwrites - * any existing policy. - * - * The async variant is {@see JobsClient::setIamPolicyAsync()} . - * - * @example samples/V2/JobsClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * The async variant is {@see JobsClient::testIamPermissionsAsync()} . - * - * @example samples/V2/JobsClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates a Job. - * - * The async variant is {@see JobsClient::updateJobAsync()} . - * - * @example samples/V2/JobsClient/update_job.php - * - * @param UpdateJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateJob(UpdateJobRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateJob', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php deleted file mode 100644 index 1970bae447c..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php +++ /dev/null @@ -1,377 +0,0 @@ - deleteRevisionAsync(DeleteRevisionRequest $request, array $optionalArgs = []) - * @method PromiseInterface getRevisionAsync(GetRevisionRequest $request, array $optionalArgs = []) - * @method PromiseInterface listRevisionsAsync(ListRevisionsRequest $request, array $optionalArgs = []) - */ -final class RevisionsClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Revisions'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/revisions_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/revisions_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/revisions_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/revisions_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a revision - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $revision - * - * @return string The formatted revision resource. - */ - public static function revisionName(string $project, string $location, string $service, string $revision): string - { - return self::getPathTemplate('revision')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'revision' => $revision, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - service: projects/{project}/locations/{location}/services/{service} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Deletes a Revision. - * - * The async variant is {@see RevisionsClient::deleteRevisionAsync()} . - * - * @example samples/V2/RevisionsClient/delete_revision.php - * - * @param DeleteRevisionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteRevision(DeleteRevisionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteRevision', $request, $callOptions)->wait(); - } - - /** - * Gets information about a Revision. - * - * The async variant is {@see RevisionsClient::getRevisionAsync()} . - * - * @example samples/V2/RevisionsClient/get_revision.php - * - * @param GetRevisionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Revision - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRevision(GetRevisionRequest $request, array $callOptions = []): Revision - { - return $this->startApiCall('GetRevision', $request, $callOptions)->wait(); - } - - /** - * Lists Revisions from a given Service, or from a given location. Results - * are sorted by creation time, descending. - * - * The async variant is {@see RevisionsClient::listRevisionsAsync()} . - * - * @example samples/V2/RevisionsClient/list_revisions.php - * - * @param ListRevisionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRevisions(ListRevisionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRevisions', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php deleted file mode 100644 index e2315b7670b..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php +++ /dev/null @@ -1,690 +0,0 @@ - createServiceAsync(CreateServiceRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteServiceAsync(DeleteServiceRequest $request, array $optionalArgs = []) - * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface getServiceAsync(GetServiceRequest $request, array $optionalArgs = []) - * @method PromiseInterface listServicesAsync(ListServicesRequest $request, array $optionalArgs = []) - * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) - * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateServiceAsync(UpdateServiceRequest $request, array $optionalArgs = []) - */ -final class ServicesClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Services'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/services_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/services_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/services_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/services_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - 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 - */ - 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; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a connector - * resource. - * - * @param string $project - * @param string $location - * @param string $connector - * - * @return string The formatted connector resource. - */ - public static function connectorName(string $project, string $location, string $connector): string - { - return self::getPathTemplate('connector')->render([ - 'project' => $project, - 'location' => $location, - 'connector' => $connector, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string - { - return self::getPathTemplate('cryptoKey')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - */ - public static function locationPolicyName(string $location): string - { - return self::getPathTemplate('locationPolicy')->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a mesh - * resource. - * - * @param string $project - * @param string $location - * @param string $mesh - * - * @return string The formatted mesh resource. - */ - public static function meshName(string $project, string $location, string $mesh): string - { - return self::getPathTemplate('mesh')->render([ - 'project' => $project, - 'location' => $location, - 'mesh' => $mesh, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - */ - public static function policyName(string $project): string - { - return self::getPathTemplate('policy')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - */ - public static function projectPolicyName(string $project): string - { - return self::getPathTemplate('projectPolicy')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a revision - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $revision - * - * @return string The formatted revision resource. - */ - public static function revisionName(string $project, string $location, string $service, string $revision): string - { - return self::getPathTemplate('revision')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'revision' => $revision, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a secret - * resource. - * - * @param string $project - * @param string $secret - * - * @return string The formatted secret resource. - */ - public static function secretName(string $project, string $secret): string - { - return self::getPathTemplate('secret')->render([ - 'project' => $project, - 'secret' => $secret, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName(string $project, string $secret, string $version): string - { - return self::getPathTemplate('secretVersion')->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - connector: projects/{project}/locations/{location}/connectors/{connector} - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - location: projects/{project}/locations/{location} - * - locationPolicy: locations/{location}/policy - * - mesh: projects/{project}/locations/{location}/meshes/{mesh} - * - policy: projects/{project}/policy - * - projectPolicy: projects/{project}/policy - * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * - secret: projects/{project}/secrets/{secret} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - service: projects/{project}/locations/{location}/services/{service} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new Service in a given project and location. - * - * The async variant is {@see ServicesClient::createServiceAsync()} . - * - * @example samples/V2/ServicesClient/create_service.php - * - * @param CreateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createService(CreateServiceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateService', $request, $callOptions)->wait(); - } - - /** - * Deletes a Service. - * This will cause the Service to stop serving traffic and will delete all - * revisions. - * - * The async variant is {@see ServicesClient::deleteServiceAsync()} . - * - * @example samples/V2/ServicesClient/delete_service.php - * - * @param DeleteServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteService(DeleteServiceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteService', $request, $callOptions)->wait(); - } - - /** - * Gets the IAM Access Control policy currently in effect for the given - * Cloud Run Service. This result does not include any inherited policies. - * - * The async variant is {@see ServicesClient::getIamPolicyAsync()} . - * - * @example samples/V2/ServicesClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets information about a Service. - * - * The async variant is {@see ServicesClient::getServiceAsync()} . - * - * @example samples/V2/ServicesClient/get_service.php - * - * @param GetServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function getService(GetServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('GetService', $request, $callOptions)->wait(); - } - - /** - * Lists Services. Results are sorted by creation time, descending. - * - * The async variant is {@see ServicesClient::listServicesAsync()} . - * - * @example samples/V2/ServicesClient/list_services.php - * - * @param ListServicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServices', $request, $callOptions); - } - - /** - * Sets the IAM Access control policy for the specified Service. Overwrites - * any existing policy. - * - * The async variant is {@see ServicesClient::setIamPolicyAsync()} . - * - * @example samples/V2/ServicesClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * The async variant is {@see ServicesClient::testIamPermissionsAsync()} . - * - * @example samples/V2/ServicesClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates a Service. - * - * The async variant is {@see ServicesClient::updateServiceAsync()} . - * - * @example samples/V2/ServicesClient/update_service.php - * - * @param UpdateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateService(UpdateServiceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php b/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php deleted file mode 100644 index e0f0369c6f2..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php +++ /dev/null @@ -1,298 +0,0 @@ - getTaskAsync(GetTaskRequest $request, array $optionalArgs = []) - * @method PromiseInterface listTasksAsync(ListTasksRequest $request, array $optionalArgs = []) - */ -final class TasksClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.run.v2.Tasks'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'run.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tasks_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tasks_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tasks_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tasks_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName(string $project, string $location, string $job, string $execution): string - { - return self::getPathTemplate('execution')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $execution - * @param string $task - * - * @return string The formatted task resource. - */ - public static function taskName(string $project, string $location, string $job, string $execution, string $task): string - { - return self::getPathTemplate('task')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'execution' => $execution, - 'task' => $task, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * - task: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'run.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Gets information about a Task. - * - * The async variant is {@see TasksClient::getTaskAsync()} . - * - * @example samples/V2/TasksClient/get_task.php - * - * @param GetTaskRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Task - * - * @throws ApiException Thrown if the API call fails. - */ - public function getTask(GetTaskRequest $request, array $callOptions = []): Task - { - return $this->startApiCall('GetTask', $request, $callOptions)->wait(); - } - - /** - * Lists Tasks from an Execution of a Job. - * - * The async variant is {@see TasksClient::listTasksAsync()} . - * - * @example samples/V2/TasksClient/list_tasks.php - * - * @param ListTasksRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTasks', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json deleted file mode 100644 index 2bf7b36f81c..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.run.v2", - "libraryPackage": "Google\\Cloud\\Run\\V2", - "services": { - "Builds": { - "clients": { - "grpc": { - "libraryClient": "BuildsGapicClient", - "rpcs": { - "SubmitBuild": { - "methods": [ - "submitBuild" - ] - } - } - } - } - }, - "Executions": { - "clients": { - "grpc": { - "libraryClient": "ExecutionsGapicClient", - "rpcs": { - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions" - ] - } - } - } - } - }, - "Jobs": { - "clients": { - "grpc": { - "libraryClient": "JobsGapicClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - } - } - } - } - }, - "Revisions": { - "clients": { - "grpc": { - "libraryClient": "RevisionsGapicClient", - "rpcs": { - "DeleteRevision": { - "methods": [ - "deleteRevision" - ] - }, - "GetRevision": { - "methods": [ - "getRevision" - ] - }, - "ListRevisions": { - "methods": [ - "listRevisions" - ] - } - } - } - } - }, - "Services": { - "clients": { - "grpc": { - "libraryClient": "ServicesGapicClient", - "rpcs": { - "CreateService": { - "methods": [ - "createService" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetService": { - "methods": [ - "getService" - ] - }, - "ListServices": { - "methods": [ - "listServices" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - } - } - } - } - }, - "Tasks": { - "clients": { - "grpc": { - "libraryClient": "TasksGapicClient", - "rpcs": { - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListTasks": { - "methods": [ - "listTasks" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json deleted file mode 100644 index b09e6e72184..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Builds": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "SubmitBuild": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php deleted file mode 100644 index 5cb8ed8624c..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php +++ /dev/null @@ -1,43 +0,0 @@ - [ - 'google.cloud.run.v2.Builds' => [ - 'SubmitBuild' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\SubmitBuildResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php deleted file mode 100644 index 5654061ec5f..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php +++ /dev/null @@ -1,88 +0,0 @@ - [ - 'google.cloud.run.v2.Builds' => [ - 'SubmitBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/builds:submit', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json deleted file mode 100644 index 2ca1a996052..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Executions": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CancelExecution": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteExecution": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetExecution": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListExecutions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php deleted file mode 100644 index eef9c8872f7..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php +++ /dev/null @@ -1,102 +0,0 @@ - [ - 'google.cloud.run.v2.Executions' => [ - 'CancelExecution' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteExecution' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetExecution' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\Execution', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListExecutions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getExecutions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Run\V2\ListExecutionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', - 'job' => 'projects/{project}/locations/{location}/jobs/{job}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php deleted file mode 100644 index d057b806912..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php +++ /dev/null @@ -1,121 +0,0 @@ - [ - 'google.cloud.run.v2.Executions' => [ - 'CancelExecution' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteExecution' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetExecution' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListExecutions' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*}/executions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json deleted file mode 100644 index c5f5321be6c..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Jobs": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "RunJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php deleted file mode 100644 index dabd773405a..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php +++ /dev/null @@ -1,191 +0,0 @@ - [ - 'google.cloud.run.v2.Jobs' => [ - 'CreateJob' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Job', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getParent', - ], - 'matchers' => [], - ], - ], - ], - 'DeleteJob' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Job', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'RunJob' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'UpdateJob' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Job', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getJob', - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\Job', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'ListJobs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getJobs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Run\V2\ListJobsResponse', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getParent', - ], - 'matchers' => [], - ], - ], - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', - 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', - 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', - 'job' => 'projects/{project}/locations/{location}/jobs/{job}', - 'location' => 'projects/{project}/locations/{location}', - 'locationPolicy' => 'locations/{location}/policy', - 'policy' => 'projects/{project}/policy', - 'projectPolicy' => 'projects/{project}/policy', - 'secret' => 'projects/{project}/secrets/{secret}', - 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php deleted file mode 100644 index 51959869ee1..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php +++ /dev/null @@ -1,184 +0,0 @@ - [ - 'google.cloud.run.v2.Jobs' => [ - 'CreateJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', - 'body' => 'job', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'job_id', - ], - ], - 'DeleteJob' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetJob' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListJobs' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RunJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}:run', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateJob' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{job.name=projects/*/locations/*/jobs/*}', - 'body' => 'job', - 'placeholders' => [ - 'job.name' => [ - 'getters' => [ - 'getJob', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json deleted file mode 100644 index ba39cada8bc..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Revisions": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "DeleteRevision": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetRevision": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php deleted file mode 100644 index a2b139922fc..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php +++ /dev/null @@ -1,86 +0,0 @@ - [ - 'google.cloud.run.v2.Revisions' => [ - 'DeleteRevision' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Revision', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Revision', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'GetRevision' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\Revision', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'ListRevisions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRevisions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Run\V2\ListRevisionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getParent', - ], - 'matchers' => [], - ], - ], - ], - 'templateMap' => [ - 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', - 'service' => 'projects/{project}/locations/{location}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php deleted file mode 100644 index 525cc8b3139..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php +++ /dev/null @@ -1,109 +0,0 @@ - [ - 'google.cloud.run.v2.Revisions' => [ - 'DeleteRevision' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRevision' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListRevisions' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/services/*}/revisions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json deleted file mode 100644 index 53e3bc1d5fa..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Services": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [], - "no_retry_2_codes": [] - }, - "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": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 15000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 15000, - "total_timeout_millis": 15000 - }, - "no_retry_2_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - } - }, - "methods": { - "CreateService": { - "timeout_millis": 15000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteService": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_2_codes", - "retry_params_name": "no_retry_2_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetService": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateService": { - "timeout_millis": 15000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php deleted file mode 100644 index 3264c3a5d62..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php +++ /dev/null @@ -1,172 +0,0 @@ - [ - 'google.cloud.run.v2.Services' => [ - 'CreateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Service', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getParent', - ], - 'matchers' => [], - ], - ], - ], - 'DeleteService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Service', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'UpdateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Run\V2\Service', - 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getService', - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\Service', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getName', - ], - 'matchers' => [], - ], - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Run\V2\ListServicesResponse', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getParent', - ], - 'matchers' => [], - ], - ], - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'templateMap' => [ - 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', - 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', - 'location' => 'projects/{project}/locations/{location}', - 'locationPolicy' => 'locations/{location}/policy', - 'mesh' => 'projects/{project}/locations/{location}/meshes/{mesh}', - 'policy' => 'projects/{project}/policy', - 'projectPolicy' => 'projects/{project}/policy', - 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', - 'secret' => 'projects/{project}/secrets/{secret}', - 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', - 'service' => 'projects/{project}/locations/{location}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php deleted file mode 100644 index 4ab42dd2248..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php +++ /dev/null @@ -1,172 +0,0 @@ - [ - 'google.cloud.run.v2.Services' => [ - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{service.name=projects/*/locations/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json deleted file mode 100644 index 60a75305960..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Tasks": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php deleted file mode 100644 index 4a057bedbd7..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php +++ /dev/null @@ -1,64 +0,0 @@ - [ - 'google.cloud.run.v2.Tasks' => [ - 'GetTask' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Run\V2\Task', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTasks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTasks', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Run\V2\ListTasksResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', - 'task' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php deleted file mode 100644 index b822ceb4435..00000000000 --- a/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php +++ /dev/null @@ -1,98 +0,0 @@ - [ - 'google.cloud.run.v2.Tasks' => [ - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'WaitOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php deleted file mode 100644 index da407d67506..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php +++ /dev/null @@ -1,192 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BuildsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BuildsClient($options); - } - - /** @test */ - public function submitBuildTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $baseImageUri = 'baseImageUri2088954010'; - $baseImageWarning = 'baseImageWarning-2033873974'; - $expectedResponse = new SubmitBuildResponse(); - $expectedResponse->setBaseImageUri($baseImageUri); - $expectedResponse->setBaseImageWarning($baseImageWarning); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $storageSource = new StorageSource(); - $storageSourceBucket = 'storageSourceBucket608605184'; - $storageSource->setBucket($storageSourceBucket); - $storageSourceObject = 'storageSourceObject963439957'; - $storageSource->setObject($storageSourceObject); - $imageUri = 'imageUri-877823864'; - $request = (new SubmitBuildRequest()) - ->setParent($parent) - ->setStorageSource($storageSource) - ->setImageUri($imageUri); - $response = $gapicClient->submitBuild($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getStorageSource(); - $this->assertProtobufEquals($storageSource, $actualValue); - $actualValue = $actualRequestObject->getImageUri(); - $this->assertProtobufEquals($imageUri, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function submitBuildExceptionTest() - { - $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 - $parent = 'parent-995424086'; - $storageSource = new StorageSource(); - $storageSourceBucket = 'storageSourceBucket608605184'; - $storageSource->setBucket($storageSourceBucket); - $storageSourceObject = 'storageSourceObject963439957'; - $storageSource->setObject($storageSourceObject); - $imageUri = 'imageUri-877823864'; - $request = (new SubmitBuildRequest()) - ->setParent($parent) - ->setStorageSource($storageSource) - ->setImageUri($imageUri); - try { - $gapicClient->submitBuild($request); - // 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 submitBuildAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $baseImageUri = 'baseImageUri2088954010'; - $baseImageWarning = 'baseImageWarning-2033873974'; - $expectedResponse = new SubmitBuildResponse(); - $expectedResponse->setBaseImageUri($baseImageUri); - $expectedResponse->setBaseImageWarning($baseImageWarning); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $storageSource = new StorageSource(); - $storageSourceBucket = 'storageSourceBucket608605184'; - $storageSource->setBucket($storageSourceBucket); - $storageSourceObject = 'storageSourceObject963439957'; - $storageSource->setObject($storageSourceObject); - $imageUri = 'imageUri-877823864'; - $request = (new SubmitBuildRequest()) - ->setParent($parent) - ->setStorageSource($storageSource) - ->setImageUri($imageUri); - $response = $gapicClient->submitBuildAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getStorageSource(); - $this->assertProtobufEquals($storageSource, $actualValue); - $actualValue = $actualRequestObject->getImageUri(); - $this->assertProtobufEquals($imageUri, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php deleted file mode 100644 index 16abbe3de83..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php +++ /dev/null @@ -1,638 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ExecutionsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ExecutionsClient($options); - } - - /** @test */ - public function cancelExecutionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/cancelExecutionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $parallelism = 635164956; - $taskCount = 1297805781; - $reconciling = false; - $observedGeneration = 900833007; - $runningCount = 261439119; - $succeededCount = 633694641; - $failedCount = 2013829491; - $cancelledCount = 1921113249; - $retriedCount = 1654679545; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setParallelism($parallelism); - $expectedResponse->setTaskCount($taskCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setRunningCount($runningCount); - $expectedResponse->setSucceededCount($succeededCount); - $expectedResponse->setFailedCount($failedCount); - $expectedResponse->setCancelledCount($cancelledCount); - $expectedResponse->setRetriedCount($retriedCount); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/cancelExecutionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->cancelExecution($request); - $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.run.v2.Executions/CancelExecution', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); - $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 cancelExecutionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/cancelExecutionTest'); - $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 - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->cancelExecution($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); - 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 deleteExecutionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteExecutionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $parallelism = 635164956; - $taskCount = 1297805781; - $reconciling = false; - $observedGeneration = 900833007; - $runningCount = 261439119; - $succeededCount = 633694641; - $failedCount = 2013829491; - $cancelledCount = 1921113249; - $retriedCount = 1654679545; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setParallelism($parallelism); - $expectedResponse->setTaskCount($taskCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setRunningCount($runningCount); - $expectedResponse->setSucceededCount($succeededCount); - $expectedResponse->setFailedCount($failedCount); - $expectedResponse->setCancelledCount($cancelledCount); - $expectedResponse->setRetriedCount($retriedCount); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteExecutionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteExecution($request); - $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.run.v2.Executions/DeleteExecution', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); - $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 deleteExecutionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteExecutionTest'); - $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 - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteExecution($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); - 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 getExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $parallelism = 635164956; - $taskCount = 1297805781; - $reconciling = false; - $observedGeneration = 900833007; - $runningCount = 261439119; - $succeededCount = 633694641; - $failedCount = 2013829491; - $cancelledCount = 1921113249; - $retriedCount = 1654679545; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag = 'etag3123477'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setParallelism($parallelism); - $expectedResponse->setTaskCount($taskCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setRunningCount($runningCount); - $expectedResponse->setSucceededCount($succeededCount); - $expectedResponse->setFailedCount($failedCount); - $expectedResponse->setCancelledCount($cancelledCount); - $expectedResponse->setRetriedCount($retriedCount); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->getExecution($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Executions/GetExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExecutionExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); - try { - $gapicClient->getExecution($request); - // 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 listExecutionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; - $expectedResponse = new ListExecutionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setExecutions($executions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listExecutions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Executions/ListExecutions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExecutionsExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listExecutions($request); - // 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 cancelExecutionAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/cancelExecutionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $parallelism = 635164956; - $taskCount = 1297805781; - $reconciling = false; - $observedGeneration = 900833007; - $runningCount = 261439119; - $succeededCount = 633694641; - $failedCount = 2013829491; - $cancelledCount = 1921113249; - $retriedCount = 1654679545; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setParallelism($parallelism); - $expectedResponse->setTaskCount($taskCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setRunningCount($runningCount); - $expectedResponse->setSucceededCount($succeededCount); - $expectedResponse->setFailedCount($failedCount); - $expectedResponse->setCancelledCount($cancelledCount); - $expectedResponse->setRetriedCount($retriedCount); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/cancelExecutionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->cancelExecutionAsync($request)->wait(); - $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.run.v2.Executions/CancelExecution', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); - $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()); - } -} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php deleted file mode 100644 index d8b665ac446..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php +++ /dev/null @@ -1,1170 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return JobsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new JobsClient($options); - } - - /** @test */ - public function createJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $observedGeneration = 900833007; - $executionCount = 1646136616; - $reconciling = false; - $satisfiesPzs = false; - $startExecutionToken = 'startExecutionToken-1179087819'; - $etag = 'etag3123477'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setExecutionCount($executionCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setStartExecutionToken($startExecutionToken); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $jobTemplate = new ExecutionTemplate(); - $templateTemplate = new TaskTemplate(); - $jobTemplate->setTemplate($templateTemplate); - $job->setTemplate($jobTemplate); - $jobId = 'jobId-1154752291'; - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job) - ->setJobId($jobId); - $response = $gapicClient->createJob($request); - $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.run.v2.Jobs/CreateJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $actualValue = $actualApiRequestObject->getJobId(); - $this->assertProtobufEquals($jobId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createJobTest'); - $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 createJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createJobTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $jobTemplate = new ExecutionTemplate(); - $templateTemplate = new TaskTemplate(); - $jobTemplate->setTemplate($templateTemplate); - $job->setTemplate($jobTemplate); - $jobId = 'jobId-1154752291'; - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job) - ->setJobId($jobId); - $response = $gapicClient->createJob($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createJobTest'); - 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 deleteJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $observedGeneration = 900833007; - $executionCount = 1646136616; - $reconciling = false; - $satisfiesPzs = false; - $startExecutionToken = 'startExecutionToken-1179087819'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setExecutionCount($executionCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setStartExecutionToken($startExecutionToken); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteJob($request); - $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.run.v2.Jobs/DeleteJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteJobTest'); - $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 deleteJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteJobTest'); - $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 - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteJob($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteJobTest'); - 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Jobs/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $observedGeneration = 900833007; - $executionCount = 1646136616; - $reconciling = false; - $satisfiesPzs = false; - $startExecutionToken = 'startExecutionToken-1179087819'; - $etag = 'etag3123477'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setExecutionCount($executionCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setStartExecutionToken($startExecutionToken); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); - $response = $gapicClient->getJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Jobs/GetJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); - try { - $gapicClient->getJob($request); - // 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 listJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listJobs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Jobs/ListJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listJobs($request); - // 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 runJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/runJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $parallelism = 635164956; - $taskCount = 1297805781; - $reconciling = false; - $observedGeneration = 900833007; - $runningCount = 261439119; - $succeededCount = 633694641; - $failedCount = 2013829491; - $cancelledCount = 1921113249; - $retriedCount = 1654679545; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setParallelism($parallelism); - $expectedResponse->setTaskCount($taskCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setRunningCount($runningCount); - $expectedResponse->setSucceededCount($succeededCount); - $expectedResponse->setFailedCount($failedCount); - $expectedResponse->setCancelledCount($cancelledCount); - $expectedResponse->setRetriedCount($retriedCount); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/runJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new RunJobRequest()) - ->setName($formattedName); - $response = $gapicClient->runJob($request); - $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.run.v2.Jobs/RunJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runJobTest'); - $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 runJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/runJobTest'); - $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 - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new RunJobRequest()) - ->setName($formattedName); - $response = $gapicClient->runJob($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runJobTest'); - 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Jobs/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Jobs/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 updateJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $observedGeneration = 900833007; - $executionCount = 1646136616; - $reconciling = false; - $satisfiesPzs = false; - $startExecutionToken = 'startExecutionToken-1179087819'; - $etag = 'etag3123477'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setExecutionCount($executionCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setStartExecutionToken($startExecutionToken); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $job = new Job(); - $jobTemplate = new ExecutionTemplate(); - $templateTemplate = new TaskTemplate(); - $jobTemplate->setTemplate($templateTemplate); - $job->setTemplate($jobTemplate); - $request = (new UpdateJobRequest()) - ->setJob($job); - $response = $gapicClient->updateJob($request); - $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.run.v2.Jobs/UpdateJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateJobTest'); - $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 updateJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateJobTest'); - $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 - $job = new Job(); - $jobTemplate = new ExecutionTemplate(); - $templateTemplate = new TaskTemplate(); - $jobTemplate->setTemplate($templateTemplate); - $job->setTemplate($jobTemplate); - $request = (new UpdateJobRequest()) - ->setJob($job); - $response = $gapicClient->updateJob($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateJobTest'); - 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 createJobAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $observedGeneration = 900833007; - $executionCount = 1646136616; - $reconciling = false; - $satisfiesPzs = false; - $startExecutionToken = 'startExecutionToken-1179087819'; - $etag = 'etag3123477'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setExecutionCount($executionCount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setStartExecutionToken($startExecutionToken); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $jobTemplate = new ExecutionTemplate(); - $templateTemplate = new TaskTemplate(); - $jobTemplate->setTemplate($templateTemplate); - $job->setTemplate($jobTemplate); - $jobId = 'jobId-1154752291'; - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job) - ->setJobId($jobId); - $response = $gapicClient->createJobAsync($request)->wait(); - $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.run.v2.Jobs/CreateJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $actualValue = $actualApiRequestObject->getJobId(); - $this->assertProtobufEquals($jobId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createJobTest'); - $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()); - } -} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php deleted file mode 100644 index 30d2f22dcac..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php +++ /dev/null @@ -1,466 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RevisionsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RevisionsClient($options); - } - - /** @test */ - public function deleteRevisionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteRevisionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $service = 'service1984153269'; - $maxInstanceRequestConcurrency = 117250100; - $serviceAccount = 'serviceAccount-1948028253'; - $encryptionKey = 'encryptionKey-1122344029'; - $reconciling = false; - $observedGeneration = 900833007; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $sessionAffinity = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Revision(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setService($service); - $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setEncryptionKey($encryptionKey); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSessionAffinity($sessionAffinity); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRevisionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); - $request = (new DeleteRevisionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteRevision($request); - $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.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); - $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 deleteRevisionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteRevisionTest'); - $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 - $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); - $request = (new DeleteRevisionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteRevision($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); - 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 getRevisionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $service = 'service1984153269'; - $maxInstanceRequestConcurrency = 117250100; - $serviceAccount = 'serviceAccount-1948028253'; - $encryptionKey = 'encryptionKey-1122344029'; - $reconciling = false; - $observedGeneration = 900833007; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $sessionAffinity = false; - $etag = 'etag3123477'; - $expectedResponse = new Revision(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setService($service); - $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setEncryptionKey($encryptionKey); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSessionAffinity($sessionAffinity); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); - $request = (new GetRevisionRequest()) - ->setName($formattedName); - $response = $gapicClient->getRevision($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Revisions/GetRevision', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRevisionExceptionTest() - { - $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->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); - $request = (new GetRevisionRequest()) - ->setName($formattedName); - try { - $gapicClient->getRevision($request); - // 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 listRevisionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $revisionsElement = new Revision(); - $revisions = [ - $revisionsElement, - ]; - $expectedResponse = new ListRevisionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRevisions($revisions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListRevisionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRevisions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRevisions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Revisions/ListRevisions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRevisionsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListRevisionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRevisions($request); - // 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 deleteRevisionAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteRevisionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $service = 'service1984153269'; - $maxInstanceRequestConcurrency = 117250100; - $serviceAccount = 'serviceAccount-1948028253'; - $encryptionKey = 'encryptionKey-1122344029'; - $reconciling = false; - $observedGeneration = 900833007; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $sessionAffinity = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Revision(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setService($service); - $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setEncryptionKey($encryptionKey); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSessionAffinity($sessionAffinity); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRevisionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); - $request = (new DeleteRevisionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteRevisionAsync($request)->wait(); - $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.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); - $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()); - } -} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php deleted file mode 100644 index c642d0821e4..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php +++ /dev/null @@ -1,1044 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ServicesClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ServicesClient($options); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $invokerIamDisabled = false; - $defaultUriDisabled = false; - $observedGeneration = 900833007; - $latestReadyRevision = 'latestReadyRevision-853854545'; - $latestCreatedRevision = 'latestCreatedRevision452370698'; - $uri = 'uri116076'; - $satisfiesPzs = false; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); - $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLatestReadyRevision($latestReadyRevision); - $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); - $expectedResponse->setUri($uri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $service = new Service(); - $serviceTemplate = new RevisionTemplate(); - $service->setTemplate($serviceTemplate); - $serviceId = 'serviceId-1724763419'; - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setService($service) - ->setServiceId($serviceId); - $response = $gapicClient->createService($request); - $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.run.v2.Services/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $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 createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createServiceTest'); - $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->locationName('[PROJECT]', '[LOCATION]'); - $service = new Service(); - $serviceTemplate = new RevisionTemplate(); - $service->setTemplate($serviceTemplate); - $serviceId = 'serviceId-1724763419'; - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setService($service) - ->setServiceId($serviceId); - $response = $gapicClient->createService($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - 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 deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $invokerIamDisabled = false; - $defaultUriDisabled = false; - $observedGeneration = 900833007; - $latestReadyRevision = 'latestReadyRevision-853854545'; - $latestCreatedRevision = 'latestCreatedRevision452370698'; - $uri = 'uri116076'; - $satisfiesPzs = false; - $reconciling = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); - $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLatestReadyRevision($latestReadyRevision); - $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); - $expectedResponse->setUri($uri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteService($request); - $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.run.v2.Services/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $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 deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/deleteServiceTest'); - $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 - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteService($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - 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 getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Services/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // 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 getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $invokerIamDisabled = false; - $defaultUriDisabled = false; - $observedGeneration = 900833007; - $latestReadyRevision = 'latestReadyRevision-853854545'; - $latestCreatedRevision = 'latestCreatedRevision452370698'; - $uri = 'uri116076'; - $satisfiesPzs = false; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); - $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLatestReadyRevision($latestReadyRevision); - $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); - $expectedResponse->setUri($uri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->getService($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Services/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->getService($request); - // 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 listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listServices($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Services/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listServices($request); - // 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 setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Services/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // 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 testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Services/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $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 - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $invokerIamDisabled = false; - $defaultUriDisabled = false; - $observedGeneration = 900833007; - $latestReadyRevision = 'latestReadyRevision-853854545'; - $latestCreatedRevision = 'latestCreatedRevision452370698'; - $uri = 'uri116076'; - $satisfiesPzs = false; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); - $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLatestReadyRevision($latestReadyRevision); - $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); - $expectedResponse->setUri($uri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $service = new Service(); - $serviceTemplate = new RevisionTemplate(); - $service->setTemplate($serviceTemplate); - $request = (new UpdateServiceRequest()) - ->setService($service); - $response = $gapicClient->updateService($request); - $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.run.v2.Services/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $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 updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/updateServiceTest'); - $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 - $service = new Service(); - $serviceTemplate = new RevisionTemplate(); - $service->setTemplate($serviceTemplate); - $request = (new UpdateServiceRequest()) - ->setService($service); - $response = $gapicClient->updateService($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - 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 createServiceAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - '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/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $uid = 'uid115792'; - $generation = 305703192; - $creator = 'creator1028554796'; - $lastModifier = 'lastModifier-28366240'; - $client = 'client-1357712437'; - $clientVersion = 'clientVersion-1506231196'; - $invokerIamDisabled = false; - $defaultUriDisabled = false; - $observedGeneration = 900833007; - $latestReadyRevision = 'latestReadyRevision-853854545'; - $latestCreatedRevision = 'latestCreatedRevision452370698'; - $uri = 'uri116076'; - $satisfiesPzs = false; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setCreator($creator); - $expectedResponse->setLastModifier($lastModifier); - $expectedResponse->setClient($client); - $expectedResponse->setClientVersion($clientVersion); - $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); - $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setLatestReadyRevision($latestReadyRevision); - $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); - $expectedResponse->setUri($uri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $service = new Service(); - $serviceTemplate = new RevisionTemplate(); - $service->setTemplate($serviceTemplate); - $serviceId = 'serviceId-1724763419'; - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setService($service) - ->setServiceId($serviceId); - $response = $gapicClient->createServiceAsync($request)->wait(); - $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.run.v2.Services/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $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()); - } -} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php deleted file mode 100644 index 2809f1bd76e..00000000000 --- a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php +++ /dev/null @@ -1,285 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TasksClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TasksClient($options); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $execution = 'execution-1090974952'; - $maxRetries = 1129288043; - $serviceAccount = 'serviceAccount-1948028253'; - $reconciling = false; - $observedGeneration = 900833007; - $index = 100346066; - $retried = 1098377527; - $encryptionKey = 'encryptionKey-1122344029'; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag = 'etag3123477'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setExecution($execution); - $expectedResponse->setMaxRetries($maxRetries); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setIndex($index); - $expectedResponse->setRetried($retried); - $expectedResponse->setEncryptionKey($encryptionKey); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); - $response = $gapicClient->getTask($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $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->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); - try { - $gapicClient->getTask($request); - // 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 listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listTasks($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Tasks/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listTasks($request); - // 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 getTaskAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $generation = 305703192; - $job = 'job105405'; - $execution = 'execution-1090974952'; - $maxRetries = 1129288043; - $serviceAccount = 'serviceAccount-1948028253'; - $reconciling = false; - $observedGeneration = 900833007; - $index = 100346066; - $retried = 1098377527; - $encryptionKey = 'encryptionKey-1122344029'; - $logUri = 'logUri342054385'; - $satisfiesPzs = false; - $etag = 'etag3123477'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setGeneration($generation); - $expectedResponse->setJob($job); - $expectedResponse->setExecution($execution); - $expectedResponse->setMaxRetries($maxRetries); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setObservedGeneration($observedGeneration); - $expectedResponse->setIndex($index); - $expectedResponse->setRetried($retried); - $expectedResponse->setEncryptionKey($encryptionKey); - $expectedResponse->setLogUri($logUri); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); - $response = $gapicClient->getTaskAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php deleted file mode 100644 index c572edac81d..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Cloudscheduler.php +++ /dev/null @@ -1,74 +0,0 @@ -internalAddGeneratedFile( - ' -� -.google/cloud/scheduler/v1/cloudscheduler.protogoogle.cloud.scheduler.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/scheduler/v1/job.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"s -ListJobsRequest9 -parent ( B)�A�A#!cloudscheduler.googleapis.com/Job - page_size ( - -page_token ( "Y -ListJobsResponse, -jobs ( 2.google.cloud.scheduler.v1.Job -next_page_token ( "H - GetJobRequest7 -name ( B)�A�A# -!cloudscheduler.googleapis.com/Job" -CreateJobRequest9 -parent ( B)�A�A#!cloudscheduler.googleapis.com/Job0 -job ( 2.google.cloud.scheduler.v1.JobB�A"u -UpdateJobRequest0 -job ( 2.google.cloud.scheduler.v1.JobB�A/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteJobRequest7 -name ( B)�A�A# -!cloudscheduler.googleapis.com/Job"J -PauseJobRequest7 -name ( B)�A�A# -!cloudscheduler.googleapis.com/Job"K -ResumeJobRequest7 -name ( B)�A�A# -!cloudscheduler.googleapis.com/Job"H - RunJobRequest7 -name ( B)�A�A# -!cloudscheduler.googleapis.com/Job2� - -CloudScheduler� -ListJobs*.google.cloud.scheduler.v1.ListJobsRequest+.google.cloud.scheduler.v1.ListJobsResponse"9�Aparent���*(/v1/{parent=projects/*/locations/*}/jobs� -GetJob(.google.cloud.scheduler.v1.GetJobRequest.google.cloud.scheduler.v1.Job"7�Aname���*(/v1/{name=projects/*/locations/*/jobs/*}� - CreateJob+.google.cloud.scheduler.v1.CreateJobRequest.google.cloud.scheduler.v1.Job"B�A -parent,job���/"(/v1/{parent=projects/*/locations/*}/jobs:job� - UpdateJob+.google.cloud.scheduler.v1.UpdateJobRequest.google.cloud.scheduler.v1.Job"K�Ajob,update_mask���32,/v1/{job.name=projects/*/locations/*/jobs/*}:job� - DeleteJob+.google.cloud.scheduler.v1.DeleteJobRequest.google.protobuf.Empty"7�Aname���**(/v1/{name=projects/*/locations/*/jobs/*}� -PauseJob*.google.cloud.scheduler.v1.PauseJobRequest.google.cloud.scheduler.v1.Job"@�Aname���3"./v1/{name=projects/*/locations/*/jobs/*}:pause:*� - ResumeJob+.google.cloud.scheduler.v1.ResumeJobRequest.google.cloud.scheduler.v1.Job"A�Aname���4"//v1/{name=projects/*/locations/*/jobs/*}:resume:*� -RunJob(.google.cloud.scheduler.v1.RunJobRequest.google.cloud.scheduler.v1.Job">�Aname���1",/v1/{name=projects/*/locations/*/jobs/*}:run:*Q�Acloudscheduler.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBz -com.google.cloud.scheduler.v1BSchedulerProtoPZ;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb� SCHEDULERbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Job.php deleted file mode 100644 index 242b2f5581c946b1e5dafa24b19a3e45ecbea3d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2214 zcmbVN;cnYD5U!ipOU}&@t4*f{*v6(=;{uzEq$>tE$u=i;QV&}q#7;XD0t8v2ZFRCl zNK~=5@DuJW_GiGJVn<3;z1dBI`G-xD_uU=8`;K?;0~<4VL{4c)V~10Z4Biqxri8^2 zkK8CAgLF8gF>#{_^8*?igtX7e*?FII+TH#`geFlMyR=D0Q8Wr@!wsU;Yb5TNdMVmB z-t0DBM*~Cp0|=c7O_<|Sa%vv^Lb>BP+_6q2)H)VWtEZsWi`{(yH*k`K{1gq~JrMk` zbP)J1Nw~xDXWLI~KlHip1pYhB{*VlvAfbqxw;iUT%l#-M0&pI>wEl!-K85Wzi}1FG zL?vSi0`T%yH{>)9oxp0-#EpH%qu4~#W^+V&L7UjAKgq)icm9ynvmBevxg-w>k5f7u zosgLFG!FM=-onAOSXm3GYBArspgHx;4;T7?Uxb<`*y=km-lKVA7X>Zt6!n5^{tsy1 zM-gym!fuYeV6N4}lBdaHjI7=_-}`y3TAo*w<^*M1FUS?LlT_NKqSw zsEs$fn~y(^=aSP*@|$1ecCrCbPYo|8EN7G;+`X{@OS{#SvM8w=Bq2*{0qGfE2!h{CE~HlX~9h{g!!?wMgrDVJdZkFfECy8OAil}hk`cs4s87j<&239sP+1- ze#gE%>zSS7?n$@PUcaSP;gil;>*#0vQ_=t`X6v$t>)WW`m3Ft6oh)fJSi3aa0)Eo! z3ghMGtG`<>;i1e~(HG}=ILuEBoJ|eU2z!{+YwGf(@jhQo8$smCXA1Y!aw-NA{>Sg> z(F#_Bz0Y_jU!$GOqIgL@M{vlFiy&~cUtcgUuNQ}#Hl<1;M%SU7Q9NAJuoR`7T3KD6G(Px%k?Pure zi9nV|(adB=?s2#m6=8$@nf0I|74meaczM6hhThDK6#e463+AJ=%tqN1rU3r{uer-a diff --git a/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php b/owl-bot-staging/Scheduler/v1/proto/src/GPBMetadata/Google/Cloud/Scheduler/V1/Target.php deleted file mode 100644 index 7ba328ba14fb88c941ffa798a087bde3faf58b85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2072 zcmb7F+iu%N5RERjqLJDVY}&dB3~W@lQF@_Zw?GToZYx=gB{Z>!nCU|yfLM`hX&ahL zkV^qhpkL}2^r@fF&&VhAsk0<4sd210dJ(alGka#v;mpC$;WUKL$uSF9L?!dc_=3nO zBVi<@aD`9C$=Ml;h%3%R?z6}sq&FldLz|erf&BoXu}C79waG+?iO*WDFA}d6yHn;R z7~h)hwj_-vOd4rQfPkK}IHWEk$5!_#lhmVdu218b*l8Ac z1q6R#GWNMkVo4?b?eN&)0hgTm{3X_KNY1DqGlX7^Jxc;tauE;(7zQqDJ|bC86}uA( ztoe{!^08DKumz(*AXyYpf7D~K8}U$z$imQe8!KBhPn|R$<=3io{ERd+j_vjpl7~b_ z30u9Lkci173ieapD#3j5Gmop3$}m$*uR$q^_*Q`wnpM3GwJE-G&Y7GFZ>xxh zAMSl&T${{LiO?k&tRF#T%BaVpc&kK8&D!4HJ8&5Rqo0AyKt>mO9m-?jU2K){=DL0W zH9-?Ob)|nI5g8R3y7!cfZbMR&g-dV$Gh`~Abo&oj$@xm^>U>A9p zK7frG^%Iu%r`j(5Sm=HNcNI|)@t5d%5ja^Z8h;hxqfQu_!Gs5FrR#4rT6O=%jXnmQ zhM~jKoK7SX$%9GCrMCC=n)((zo@EgIF4QCDBi|Wwlm|-4qN+bx>R3*7+`mcAWo>U4 zRB2a#-?ldXDL~yy#&I&v-TFO%6d`vVHK#H;y5!%^Hr&UVgJC&U8uHk{q1dujuyU0e zV`+hP{Z{}gWyHscWHCBTdG&`iHLemcItyfK*n7Kh=Zz!vMXmEn!v^h&6nCH!vuMWM zyeJ(HX80+gl`@y<8rkak*x91google.cloud.scheduler.v1.AppEngineHttpTarget - */ -class AppEngineHttpTarget extends \Google\Protobuf\Internal\Message -{ - /** - * The HTTP method to use for the request. PATCH and OPTIONS are not - * permitted. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; - */ - protected $http_method = 0; - /** - * App Engine Routing setting for the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; - */ - protected $app_engine_routing = null; - /** - * The relative URI. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path, query string arguments, and `#` fragments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - */ - protected $relative_uri = ''; - /** - * HTTP request headers. - * This map contains the header field names and values. Headers can be set - * when the job is created. - * Cloud Scheduler sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Scheduler will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * If the job has an - * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explictly - * setting `Content-Type` to a particular media type when the job is - * created. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Scheduler. This value is - * output only. It cannot be changed. - * The headers below are output only. They cannot be set or overridden: - * * `X-Google-*`: For Google internal use only. - * * `X-AppEngine-*`: For Google internal use only. - * In addition, some App Engine headers, which contain - * job-specific information, are also be sent to the job handler. - * - * Generated from protobuf field map headers = 4; - */ - private $headers; - /** - * Body. - * HTTP request body. A request body is allowed only if the HTTP method is - * POST or PUT. It will result in invalid argument error to set a body on a - * job with an incompatible - * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - */ - protected $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $http_method - * The HTTP method to use for the request. PATCH and OPTIONS are not - * permitted. - * @type \Google\Cloud\Scheduler\V1\AppEngineRouting $app_engine_routing - * App Engine Routing setting for the job. - * @type string $relative_uri - * The relative URI. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path, query string arguments, and `#` fragments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. Headers can be set - * when the job is created. - * Cloud Scheduler sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Scheduler will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * If the job has an - * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explictly - * setting `Content-Type` to a particular media type when the job is - * created. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Scheduler. This value is - * output only. It cannot be changed. - * The headers below are output only. They cannot be set or overridden: - * * `X-Google-*`: For Google internal use only. - * * `X-AppEngine-*`: For Google internal use only. - * In addition, some App Engine headers, which contain - * job-specific information, are also be sent to the job handler. - * @type string $body - * Body. - * HTTP request body. A request body is allowed only if the HTTP method is - * POST or PUT. It will result in invalid argument error to set a body on a - * job with an incompatible - * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * The HTTP method to use for the request. PATCH and OPTIONS are not - * permitted. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. PATCH and OPTIONS are not - * permitted. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 1; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * App Engine Routing setting for the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; - * @return \Google\Cloud\Scheduler\V1\AppEngineRouting|null - */ - public function getAppEngineRouting() - { - return $this->app_engine_routing; - } - - public function hasAppEngineRouting() - { - return isset($this->app_engine_routing); - } - - public function clearAppEngineRouting() - { - unset($this->app_engine_routing); - } - - /** - * App Engine Routing setting for the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineRouting app_engine_routing = 2; - * @param \Google\Cloud\Scheduler\V1\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRouting($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineRouting::class); - $this->app_engine_routing = $var; - - return $this; - } - - /** - * The relative URI. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path, query string arguments, and `#` fragments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @return string - */ - public function getRelativeUri() - { - return $this->relative_uri; - } - - /** - * The relative URI. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path, query string arguments, and `#` fragments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @param string $var - * @return $this - */ - public function setRelativeUri($var) - { - GPBUtil::checkString($var, True); - $this->relative_uri = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. Headers can be set - * when the job is created. - * Cloud Scheduler sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Scheduler will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * If the job has an - * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explictly - * setting `Content-Type` to a particular media type when the job is - * created. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Scheduler. This value is - * output only. It cannot be changed. - * The headers below are output only. They cannot be set or overridden: - * * `X-Google-*`: For Google internal use only. - * * `X-AppEngine-*`: For Google internal use only. - * In addition, some App Engine headers, which contain - * job-specific information, are also be sent to the job handler. - * - * Generated from protobuf field map headers = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. Headers can be set - * when the job is created. - * Cloud Scheduler sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Scheduler will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * If the job has an - * [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explictly - * setting `Content-Type` to a particular media type when the job is - * created. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Scheduler. This value is - * output only. It cannot be changed. - * The headers below are output only. They cannot be set or overridden: - * * `X-Google-*`: For Google internal use only. - * * `X-AppEngine-*`: For Google internal use only. - * In addition, some App Engine headers, which contain - * job-specific information, are also be sent to the job handler. - * - * Generated from protobuf field map headers = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * Body. - * HTTP request body. A request body is allowed only if the HTTP method is - * POST or PUT. It will result in invalid argument error to set a body on a - * job with an incompatible - * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * Body. - * HTTP request body. A request body is allowed only if the HTTP method is - * POST or PUT. It will result in invalid argument error to set a body on a - * job with an incompatible - * [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php deleted file mode 100644 index cb63e683678..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/AppEngineRouting.php +++ /dev/null @@ -1,414 +0,0 @@ -google.cloud.scheduler.v1.AppEngineRouting - */ -class AppEngineRouting extends \Google\Protobuf\Internal\Message -{ - /** - * App service. - * By default, the job is sent to the service which is the default - * service when the job is attempted. - * - * Generated from protobuf field string service = 1; - */ - protected $service = ''; - /** - * App version. - * By default, the job is sent to the version which is the default - * version when the job is attempted. - * - * Generated from protobuf field string version = 2; - */ - protected $version = ''; - /** - * App instance. - * By default, the job is sent to an instance which is available when - * the job is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - */ - protected $instance = ''; - /** - * Output only. The host that the job is sent to. - * For more information about how App Engine requests are routed, see - * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * job's project ID. - * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, - * then the job will be sent to the service which is the default service when - * the job is attempted. - * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, - * then the job will be sent to the version which is the default version when - * the job is attempted. - * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is - * empty, then the job will be sent to an instance which is available when the - * job is attempted. - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], - * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, - * then the job will be sent to the default version of the default service - * when the job is attempted. - * - * Generated from protobuf field string host = 4; - */ - protected $host = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * App service. - * By default, the job is sent to the service which is the default - * service when the job is attempted. - * @type string $version - * App version. - * By default, the job is sent to the version which is the default - * version when the job is attempted. - * @type string $instance - * App instance. - * By default, the job is sent to an instance which is available when - * the job is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * @type string $host - * Output only. The host that the job is sent to. - * For more information about how App Engine requests are routed, see - * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * job's project ID. - * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, - * then the job will be sent to the service which is the default service when - * the job is attempted. - * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, - * then the job will be sent to the version which is the default version when - * the job is attempted. - * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is - * empty, then the job will be sent to an instance which is available when the - * job is attempted. - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], - * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, - * then the job will be sent to the default version of the default service - * when the job is attempted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * App service. - * By default, the job is sent to the service which is the default - * service when the job is attempted. - * - * Generated from protobuf field string service = 1; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * App service. - * By default, the job is sent to the service which is the default - * service when the job is attempted. - * - * Generated from protobuf field string service = 1; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * App version. - * By default, the job is sent to the version which is the default - * version when the job is attempted. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * App version. - * By default, the job is sent to the version which is the default - * version when the job is attempted. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * App instance. - * By default, the job is sent to an instance which is available when - * the job is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @return string - */ - public function getInstance() - { - return $this->instance; - } - - /** - * App instance. - * By default, the job is sent to an instance which is available when - * the job is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @param string $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkString($var, True); - $this->instance = $var; - - return $this; - } - - /** - * Output only. The host that the job is sent to. - * For more information about how App Engine requests are routed, see - * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * job's project ID. - * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, - * then the job will be sent to the service which is the default service when - * the job is attempted. - * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, - * then the job will be sent to the version which is the default version when - * the job is attempted. - * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is - * empty, then the job will be sent to an instance which is available when the - * job is attempted. - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], - * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, - * then the job will be sent to the default version of the default service - * when the job is attempted. - * - * Generated from protobuf field string host = 4; - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Output only. The host that the job is sent to. - * For more information about how App Engine requests are routed, see - * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * job's project ID. - * * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +` - * [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.scheduler.v1.AppEngineRouting.service] - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty, - * then the job will be sent to the service which is the default service when - * the job is attempted. - * If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty, - * then the job will be sent to the version which is the default version when - * the job is attempted. - * If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is - * empty, then the job will be sent to an instance which is available when the - * job is attempted. - * If [service][google.cloud.scheduler.v1.AppEngineRouting.service], - * [version][google.cloud.scheduler.v1.AppEngineRouting.version], or - * [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid, - * then the job will be sent to the default version of the default service - * when the job is attempted. - * - * Generated from protobuf field string host = 4; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php deleted file mode 100644 index 9fc7f261948..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/CreateJobRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.scheduler.v1.CreateJobRequest - */ -class CreateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. - * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job = null; - - /** - * @param string $parent Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. Please see - * {@see CloudSchedulerClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Scheduler\V1\Job $job Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. - * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. - * - * @return \Google\Cloud\Scheduler\V1\CreateJobRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Scheduler\V1\Job $job): self - { - return (new self()) - ->setParent($parent) - ->setJob($job); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * @type \Google\Cloud\Scheduler\V1\Job $job - * Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. - * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * 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 location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * 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 job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. - * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Scheduler\V1\Job|null - */ - public function getJob() - { - return $this->job; - } - - public function hasJob() - { - return isset($this->job); - } - - public function clearJob() - { - unset($this->job); - } - - /** - * Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. - * [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Scheduler\V1\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\Job::class); - $this->job = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php deleted file mode 100644 index 1556a3f9938..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/DeleteJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.scheduler.v1.DeleteJobRequest - */ -class DeleteJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see - * {@see CloudSchedulerClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\DeleteJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php deleted file mode 100644 index 8663933090d..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/GetJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.scheduler.v1.GetJobRequest - */ -class GetJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see - * {@see CloudSchedulerClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\GetJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php deleted file mode 100644 index 3954ec47a8c..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpMethod.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.scheduler.v1.HttpMethod - */ -class HttpMethod -{ - /** - * HTTP method unspecified. Defaults to POST. - * - * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; - */ - const HTTP_METHOD_UNSPECIFIED = 0; - /** - * HTTP POST - * - * Generated from protobuf enum POST = 1; - */ - const POST = 1; - /** - * HTTP GET - * - * Generated from protobuf enum GET = 2; - */ - const GET = 2; - /** - * HTTP HEAD - * - * Generated from protobuf enum HEAD = 3; - */ - const HEAD = 3; - /** - * HTTP PUT - * - * Generated from protobuf enum PUT = 4; - */ - const PUT = 4; - /** - * HTTP DELETE - * - * Generated from protobuf enum DELETE = 5; - */ - const DELETE = 5; - /** - * HTTP PATCH - * - * Generated from protobuf enum PATCH = 6; - */ - const PATCH = 6; - /** - * HTTP OPTIONS - * - * Generated from protobuf enum OPTIONS = 7; - */ - const OPTIONS = 7; - - private static $valueToName = [ - self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', - self::POST => 'POST', - self::GET => 'GET', - self::HEAD => 'HEAD', - self::PUT => 'PUT', - self::DELETE => 'DELETE', - self::PATCH => 'PATCH', - self::OPTIONS => 'OPTIONS', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php deleted file mode 100644 index 34cea521913..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/HttpTarget.php +++ /dev/null @@ -1,383 +0,0 @@ -google.cloud.scheduler.v1.HttpTarget - */ -class HttpTarget extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full URI path that the request will be sent to. This string - * must begin with either "http://" or "https://". Some examples of - * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: - * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * - * Generated from protobuf field string uri = 1; - */ - protected $uri = ''; - /** - * Which HTTP method to use for the request. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * The user can specify HTTP request headers to send with the job's - * HTTP request. This map contains the header field names and - * values. Repeated headers are not supported, but a header value can - * contain commas. These headers represent a subset of the headers - * that will accompany the job's HTTP request. Some HTTP request - * headers will be ignored or replaced. A partial list of headers that - * will be ignored or replaced is below: - * - Host: This will be computed by Cloud Scheduler and derived from - * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. - * * `Content-Length`: This will be computed by Cloud Scheduler. - * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - * * `X-Google-*`: Google internal use only. - * * `X-AppEngine-*`: Google internal use only. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * The total size of headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - */ - private $headers; - /** - * HTTP request body. A request body is allowed only if the HTTP - * method is POST, PUT, or PATCH. It is an error to set body on a job with an - * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - */ - protected $body = ''; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. The full URI path that the request will be sent to. This string - * must begin with either "http://" or "https://". Some examples of - * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: - * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * @type int $http_method - * Which HTTP method to use for the request. - * @type array|\Google\Protobuf\Internal\MapField $headers - * The user can specify HTTP request headers to send with the job's - * HTTP request. This map contains the header field names and - * values. Repeated headers are not supported, but a header value can - * contain commas. These headers represent a subset of the headers - * that will accompany the job's HTTP request. Some HTTP request - * headers will be ignored or replaced. A partial list of headers that - * will be ignored or replaced is below: - * - Host: This will be computed by Cloud Scheduler and derived from - * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. - * * `Content-Length`: This will be computed by Cloud Scheduler. - * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - * * `X-Google-*`: Google internal use only. - * * `X-AppEngine-*`: Google internal use only. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * The total size of headers must be less than 80KB. - * @type string $body - * HTTP request body. A request body is allowed only if the HTTP - * method is POST, PUT, or PATCH. It is an error to set body on a job with an - * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * @type \Google\Cloud\Scheduler\V1\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Scheduler\V1\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full URI path that the request will be sent to. This string - * must begin with either "http://" or "https://". Some examples of - * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: - * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. The full URI path that the request will be sent to. This string - * must begin with either "http://" or "https://". Some examples of - * valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are: - * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Which HTTP method to use for the request. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * Which HTTP method to use for the request. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * The user can specify HTTP request headers to send with the job's - * HTTP request. This map contains the header field names and - * values. Repeated headers are not supported, but a header value can - * contain commas. These headers represent a subset of the headers - * that will accompany the job's HTTP request. Some HTTP request - * headers will be ignored or replaced. A partial list of headers that - * will be ignored or replaced is below: - * - Host: This will be computed by Cloud Scheduler and derived from - * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. - * * `Content-Length`: This will be computed by Cloud Scheduler. - * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - * * `X-Google-*`: Google internal use only. - * * `X-AppEngine-*`: Google internal use only. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * The total size of headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * The user can specify HTTP request headers to send with the job's - * HTTP request. This map contains the header field names and - * values. Repeated headers are not supported, but a header value can - * contain commas. These headers represent a subset of the headers - * that will accompany the job's HTTP request. Some HTTP request - * headers will be ignored or replaced. A partial list of headers that - * will be ignored or replaced is below: - * - Host: This will be computed by Cloud Scheduler and derived from - * [uri][google.cloud.scheduler.v1.HttpTarget.uri]. - * * `Content-Length`: This will be computed by Cloud Scheduler. - * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - * * `X-Google-*`: Google internal use only. - * * `X-AppEngine-*`: Google internal use only. - * * `X-CloudScheduler`: This header will be set to true. - * * `X-CloudScheduler-JobName`: This header will contain the job name. - * * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - * the unix-cron format, this header will contain the job schedule as an - * offset of UTC parsed according to RFC3339. - * The total size of headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. A request body is allowed only if the HTTP - * method is POST, PUT, or PATCH. It is an error to set body on a job with an - * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. A request body is allowed only if the HTTP - * method is POST, PUT, or PATCH. It is an error to set body on a job with an - * incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.scheduler.v1.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Scheduler\V1\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.scheduler.v1.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Scheduler\V1\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.scheduler.v1.OidcToken oidc_token = 6; - * @return \Google\Cloud\Scheduler\V1\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.scheduler.v1.OidcToken oidc_token = 6; - * @param \Google\Cloud\Scheduler\V1\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php deleted file mode 100644 index 65d3652c794..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job.php +++ /dev/null @@ -1,832 +0,0 @@ -google.cloud.scheduler.v1.Job - */ -class Job extends \Google\Protobuf\Internal\Message -{ - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after - * which it becomes output only. - * The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the job's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * A human-readable description for the job. This string must not contain - * more than 500 characters. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Required, except when used with - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * Describes the schedule on which the job will be executed. - * The schedule can be either of the following types: - * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - * * English-like - * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - * As a general rule, execution `n + 1` of a job will not begin - * until execution `n` has finished. Cloud Scheduler will never - * allow two simultaneously outstanding executions. For example, - * this implies that if the `n+1`th execution is scheduled to run at - * 16:00 but the `n`th execution takes until 16:15, the `n+1`th - * execution will not start until `16:15`. - * A scheduled start time will be delayed if the previous - * execution has not ended when its scheduled time occurs. - * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and - * a job attempt fails, the job will be tried a total of - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, - * with exponential backoff, until the next scheduled start time. - * - * Generated from protobuf field string schedule = 20; - */ - protected $schedule = ''; - /** - * Specifies the time zone to be used in interpreting - * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field - * must be a time zone name from the [tz - * database](http://en.wikipedia.org/wiki/Tz_database). - * Note that some time zones include a provision for - * daylight savings time. The rules for daylight saving time are - * determined by the chosen tz. For UTC use the string "utc". If a - * time zone is not specified, the default will be in UTC (also known - * as GMT). - * - * Generated from protobuf field string time_zone = 21; - */ - protected $time_zone = ''; - /** - * Output only. The creation time of the job. - * - * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; - */ - protected $user_update_time = null; - /** - * Output only. State of the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; - */ - protected $state = 0; - /** - * Output only. The response from the target for the last attempted execution. - * - * Generated from protobuf field .google.rpc.Status status = 11; - */ - protected $status = null; - /** - * Output only. The next time the job is scheduled. Note that this may be a - * retry of a previously failed attempt or the next execution time - * according to the schedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; - */ - protected $schedule_time = null; - /** - * Output only. The time the last job attempt started. - * - * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; - */ - protected $last_attempt_time = null; - /** - * Settings that determine the retry behavior. - * - * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; - */ - protected $retry_config = null; - /** - * The deadline for job attempts. If the request handler does not respond by - * this deadline then the request is cancelled and the attempt is marked as a - * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - * execution logs. Cloud Scheduler will retry the job according - * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. - * The default and the allowed values depend on the type of target: - * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the - * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - * minutes]. - * * For [App Engine HTTP - * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - * that the request has the default deadline. The default deadline depends on - * the scaling type of the service: 10 minutes for standard apps with - * automatic scaling, 24 hours for standard apps with manual and basic - * scaling, and 60 minutes for flex apps. If the request deadline is set, it - * must be in the interval [15 seconds, 24 hours 15 seconds]. - * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - * field is ignored. - * - * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; - */ - protected $attempt_deadline = null; - protected $target; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after - * which it becomes output only. - * The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the job's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * @type string $description - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * A human-readable description for the job. This string must not contain - * more than 500 characters. - * @type \Google\Cloud\Scheduler\V1\PubsubTarget $pubsub_target - * Pub/Sub target. - * @type \Google\Cloud\Scheduler\V1\AppEngineHttpTarget $app_engine_http_target - * App Engine HTTP target. - * @type \Google\Cloud\Scheduler\V1\HttpTarget $http_target - * HTTP target. - * @type string $schedule - * Required, except when used with - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * Describes the schedule on which the job will be executed. - * The schedule can be either of the following types: - * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - * * English-like - * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - * As a general rule, execution `n + 1` of a job will not begin - * until execution `n` has finished. Cloud Scheduler will never - * allow two simultaneously outstanding executions. For example, - * this implies that if the `n+1`th execution is scheduled to run at - * 16:00 but the `n`th execution takes until 16:15, the `n+1`th - * execution will not start until `16:15`. - * A scheduled start time will be delayed if the previous - * execution has not ended when its scheduled time occurs. - * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and - * a job attempt fails, the job will be tried a total of - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, - * with exponential backoff, until the next scheduled start time. - * @type string $time_zone - * Specifies the time zone to be used in interpreting - * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field - * must be a time zone name from the [tz - * database](http://en.wikipedia.org/wiki/Tz_database). - * Note that some time zones include a provision for - * daylight savings time. The rules for daylight saving time are - * determined by the chosen tz. For UTC use the string "utc". If a - * time zone is not specified, the default will be in UTC (also known - * as GMT). - * @type \Google\Protobuf\Timestamp $user_update_time - * Output only. The creation time of the job. - * @type int $state - * Output only. State of the job. - * @type \Google\Rpc\Status $status - * Output only. The response from the target for the last attempted execution. - * @type \Google\Protobuf\Timestamp $schedule_time - * Output only. The next time the job is scheduled. Note that this may be a - * retry of a previously failed attempt or the next execution time - * according to the schedule. - * @type \Google\Protobuf\Timestamp $last_attempt_time - * Output only. The time the last job attempt started. - * @type \Google\Cloud\Scheduler\V1\RetryConfig $retry_config - * Settings that determine the retry behavior. - * @type \Google\Protobuf\Duration $attempt_deadline - * The deadline for job attempts. If the request handler does not respond by - * this deadline then the request is cancelled and the attempt is marked as a - * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - * execution logs. Cloud Scheduler will retry the job according - * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. - * The default and the allowed values depend on the type of target: - * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the - * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - * minutes]. - * * For [App Engine HTTP - * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - * that the request has the default deadline. The default deadline depends on - * the scaling type of the service: 10 minutes for standard apps with - * automatic scaling, 24 hours for standard apps with manual and basic - * scaling, and 60 minutes for flex apps. If the request deadline is set, it - * must be in the interval [15 seconds, 24 hours 15 seconds]. - * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - * field is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after - * which it becomes output only. - * The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the job's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob], after - * which it becomes output only. - * The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the job's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * A human-readable description for the job. This string must not contain - * more than 500 characters. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optionally caller-specified in - * [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob] or - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * A human-readable description for the job. This string must not contain - * more than 500 characters. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Pub/Sub target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.PubsubTarget pubsub_target = 4; - * @return \Google\Cloud\Scheduler\V1\PubsubTarget|null - */ - public function getPubsubTarget() - { - return $this->readOneof(4); - } - - public function hasPubsubTarget() - { - return $this->hasOneof(4); - } - - /** - * Pub/Sub target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.PubsubTarget pubsub_target = 4; - * @param \Google\Cloud\Scheduler\V1\PubsubTarget $var - * @return $this - */ - public function setPubsubTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\PubsubTarget::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * App Engine HTTP target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineHttpTarget app_engine_http_target = 5; - * @return \Google\Cloud\Scheduler\V1\AppEngineHttpTarget|null - */ - public function getAppEngineHttpTarget() - { - return $this->readOneof(5); - } - - public function hasAppEngineHttpTarget() - { - return $this->hasOneof(5); - } - - /** - * App Engine HTTP target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.AppEngineHttpTarget app_engine_http_target = 5; - * @param \Google\Cloud\Scheduler\V1\AppEngineHttpTarget $var - * @return $this - */ - public function setAppEngineHttpTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineHttpTarget::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * HTTP target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpTarget http_target = 6; - * @return \Google\Cloud\Scheduler\V1\HttpTarget|null - */ - public function getHttpTarget() - { - return $this->readOneof(6); - } - - public function hasHttpTarget() - { - return $this->hasOneof(6); - } - - /** - * HTTP target. - * - * Generated from protobuf field .google.cloud.scheduler.v1.HttpTarget http_target = 6; - * @param \Google\Cloud\Scheduler\V1\HttpTarget $var - * @return $this - */ - public function setHttpTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\HttpTarget::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Required, except when used with - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * Describes the schedule on which the job will be executed. - * The schedule can be either of the following types: - * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - * * English-like - * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - * As a general rule, execution `n + 1` of a job will not begin - * until execution `n` has finished. Cloud Scheduler will never - * allow two simultaneously outstanding executions. For example, - * this implies that if the `n+1`th execution is scheduled to run at - * 16:00 but the `n`th execution takes until 16:15, the `n+1`th - * execution will not start until `16:15`. - * A scheduled start time will be delayed if the previous - * execution has not ended when its scheduled time occurs. - * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and - * a job attempt fails, the job will be tried a total of - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, - * with exponential backoff, until the next scheduled start time. - * - * Generated from protobuf field string schedule = 20; - * @return string - */ - public function getSchedule() - { - return $this->schedule; - } - - /** - * Required, except when used with - * [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob]. - * Describes the schedule on which the job will be executed. - * The schedule can be either of the following types: - * * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - * * English-like - * [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - * As a general rule, execution `n + 1` of a job will not begin - * until execution `n` has finished. Cloud Scheduler will never - * allow two simultaneously outstanding executions. For example, - * this implies that if the `n+1`th execution is scheduled to run at - * 16:00 but the `n`th execution takes until 16:15, the `n+1`th - * execution will not start until `16:15`. - * A scheduled start time will be delayed if the previous - * execution has not ended when its scheduled time occurs. - * If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and - * a job attempt fails, the job will be tried a total of - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times, - * with exponential backoff, until the next scheduled start time. - * - * Generated from protobuf field string schedule = 20; - * @param string $var - * @return $this - */ - public function setSchedule($var) - { - GPBUtil::checkString($var, True); - $this->schedule = $var; - - return $this; - } - - /** - * Specifies the time zone to be used in interpreting - * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field - * must be a time zone name from the [tz - * database](http://en.wikipedia.org/wiki/Tz_database). - * Note that some time zones include a provision for - * daylight savings time. The rules for daylight saving time are - * determined by the chosen tz. For UTC use the string "utc". If a - * time zone is not specified, the default will be in UTC (also known - * as GMT). - * - * Generated from protobuf field string time_zone = 21; - * @return string - */ - public function getTimeZone() - { - return $this->time_zone; - } - - /** - * Specifies the time zone to be used in interpreting - * [schedule][google.cloud.scheduler.v1.Job.schedule]. The value of this field - * must be a time zone name from the [tz - * database](http://en.wikipedia.org/wiki/Tz_database). - * Note that some time zones include a provision for - * daylight savings time. The rules for daylight saving time are - * determined by the chosen tz. For UTC use the string "utc". If a - * time zone is not specified, the default will be in UTC (also known - * as GMT). - * - * Generated from protobuf field string time_zone = 21; - * @param string $var - * @return $this - */ - public function setTimeZone($var) - { - GPBUtil::checkString($var, True); - $this->time_zone = $var; - - return $this; - } - - /** - * Output only. The creation time of the job. - * - * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUserUpdateTime() - { - return $this->user_update_time; - } - - public function hasUserUpdateTime() - { - return isset($this->user_update_time); - } - - public function clearUserUpdateTime() - { - unset($this->user_update_time); - } - - /** - * Output only. The creation time of the job. - * - * Generated from protobuf field .google.protobuf.Timestamp user_update_time = 9; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUserUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->user_update_time = $var; - - return $this; - } - - /** - * Output only. State of the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. State of the job. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job.State state = 10; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\Job\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The response from the target for the last attempted execution. - * - * Generated from protobuf field .google.rpc.Status status = 11; - * @return \Google\Rpc\Status|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Output only. The response from the target for the last attempted execution. - * - * Generated from protobuf field .google.rpc.Status status = 11; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. The next time the job is scheduled. Note that this may be a - * retry of a previously failed attempt or the next execution time - * according to the schedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Output only. The next time the job is scheduled. Note that this may be a - * retry of a previously failed attempt or the next execution time - * according to the schedule. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 17; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time the last job attempt started. - * - * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastAttemptTime() - { - return $this->last_attempt_time; - } - - public function hasLastAttemptTime() - { - return isset($this->last_attempt_time); - } - - public function clearLastAttemptTime() - { - unset($this->last_attempt_time); - } - - /** - * Output only. The time the last job attempt started. - * - * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 18; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastAttemptTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_attempt_time = $var; - - return $this; - } - - /** - * Settings that determine the retry behavior. - * - * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; - * @return \Google\Cloud\Scheduler\V1\RetryConfig|null - */ - public function getRetryConfig() - { - return $this->retry_config; - } - - public function hasRetryConfig() - { - return isset($this->retry_config); - } - - public function clearRetryConfig() - { - unset($this->retry_config); - } - - /** - * Settings that determine the retry behavior. - * - * Generated from protobuf field .google.cloud.scheduler.v1.RetryConfig retry_config = 19; - * @param \Google\Cloud\Scheduler\V1\RetryConfig $var - * @return $this - */ - public function setRetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\RetryConfig::class); - $this->retry_config = $var; - - return $this; - } - - /** - * The deadline for job attempts. If the request handler does not respond by - * this deadline then the request is cancelled and the attempt is marked as a - * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - * execution logs. Cloud Scheduler will retry the job according - * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. - * The default and the allowed values depend on the type of target: - * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the - * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - * minutes]. - * * For [App Engine HTTP - * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - * that the request has the default deadline. The default deadline depends on - * the scaling type of the service: 10 minutes for standard apps with - * automatic scaling, 24 hours for standard apps with manual and basic - * scaling, and 60 minutes for flex apps. If the request deadline is set, it - * must be in the interval [15 seconds, 24 hours 15 seconds]. - * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - * field is ignored. - * - * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; - * @return \Google\Protobuf\Duration|null - */ - public function getAttemptDeadline() - { - return $this->attempt_deadline; - } - - public function hasAttemptDeadline() - { - return isset($this->attempt_deadline); - } - - public function clearAttemptDeadline() - { - unset($this->attempt_deadline); - } - - /** - * The deadline for job attempts. If the request handler does not respond by - * this deadline then the request is cancelled and the attempt is marked as a - * `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - * execution logs. Cloud Scheduler will retry the job according - * to the [RetryConfig][google.cloud.scheduler.v1.RetryConfig]. - * The default and the allowed values depend on the type of target: - * * For [HTTP targets][google.cloud.scheduler.v1.Job.http_target], the - * default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - * minutes]. - * * For [App Engine HTTP - * targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - * that the request has the default deadline. The default deadline depends on - * the scaling type of the service: 10 minutes for standard apps with - * automatic scaling, 24 hours for standard apps with manual and basic - * scaling, and 60 minutes for flex apps. If the request deadline is set, it - * must be in the interval [15 seconds, 24 hours 15 seconds]. - * * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - * field is ignored. - * - * Generated from protobuf field .google.protobuf.Duration attempt_deadline = 22; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setAttemptDeadline($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->attempt_deadline = $var; - - return $this; - } - - /** - * @return string - */ - public function getTarget() - { - return $this->whichOneof("target"); - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php deleted file mode 100644 index 85a4de34afe..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/Job/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.scheduler.v1.Job.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The job is executing normally. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * The job is paused by the user. It will not execute. A user can - * intentionally pause the job using - * [PauseJobRequest][google.cloud.scheduler.v1.PauseJobRequest]. - * - * Generated from protobuf enum PAUSED = 2; - */ - const PAUSED = 2; - /** - * The job is disabled by the system due to error. The user - * cannot directly set a job to be disabled. - * - * Generated from protobuf enum DISABLED = 3; - */ - const DISABLED = 3; - /** - * The job state resulting from a failed - * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob] - * operation. To recover a job from this state, retry - * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob] - * until a successful response is received. - * - * Generated from protobuf enum UPDATE_FAILED = 4; - */ - const UPDATE_FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::PAUSED => 'PAUSED', - self::DISABLED => 'DISABLED', - self::UPDATE_FAILED => 'UPDATE_FAILED', - ]; - - 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(State::class, \Google\Cloud\Scheduler\V1\Job_State::class); - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php deleted file mode 100644 index 48a50cb4738..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.scheduler.v1.ListJobsRequest - */ -class ListJobsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Requested page size. - * The maximum page size is 500. If unspecified, the page size will - * be the maximum. Fewer jobs than requested might be returned, - * even if more jobs exist; use next_page_token to determine if more - * jobs exist. - * - * Generated from protobuf field int32 page_size = 5; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server will return. To - * request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] - * returned from the previous call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an - * error to switch the value of - * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 6; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. Please see - * {@see CloudSchedulerClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\ListJobsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * @type int $page_size - * Requested page size. - * The maximum page size is 500. If unspecified, the page size will - * be the maximum. Fewer jobs than requested might be returned, - * even if more jobs exist; use next_page_token to determine if more - * jobs exist. - * @type string $page_token - * A token identifying a page of results the server will return. To - * request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] - * returned from the previous call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an - * error to switch the value of - * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - * iterating through pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * 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 location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * - * 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; - } - - /** - * Requested page size. - * The maximum page size is 500. If unspecified, the page size will - * be the maximum. Fewer jobs than requested might be returned, - * even if more jobs exist; use next_page_token to determine if more - * jobs exist. - * - * Generated from protobuf field int32 page_size = 5; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. - * The maximum page size is 500. If unspecified, the page size will - * be the maximum. Fewer jobs than requested might be returned, - * even if more jobs exist; use next_page_token to determine if more - * jobs exist. - * - * Generated from protobuf field int32 page_size = 5; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server will return. To - * request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] - * returned from the previous call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an - * error to switch the value of - * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 6; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server will return. To - * request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] - * returned from the previous call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an - * error to switch the value of - * [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 6; - * @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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php deleted file mode 100644 index c79a062affb..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ListJobsResponse.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.scheduler.v1.ListJobsResponse - */ -class ListJobsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of jobs. - * - * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; - */ - private $jobs; - /** - * A token to retrieve next page of results. Pass this value in the - * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in - * the subsequent call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve - * the next page of results. If this is empty it indicates that there are no - * more results through which to paginate. - * The page token is valid for only 2 hours. - * - * 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\Scheduler\V1\Job>|\Google\Protobuf\Internal\RepeatedField $jobs - * The list of jobs. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in the - * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in - * the subsequent call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve - * the next page of results. If this is empty it indicates that there are no - * more results through which to paginate. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * The list of jobs. - * - * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getJobs() - { - return $this->jobs; - } - - /** - * The list of jobs. - * - * Generated from protobuf field repeated .google.cloud.scheduler.v1.Job jobs = 1; - * @param array<\Google\Cloud\Scheduler\V1\Job>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setJobs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Scheduler\V1\Job::class); - $this->jobs = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in the - * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in - * the subsequent call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve - * the next page of results. If this is empty it indicates that there are no - * more results through which to paginate. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. Pass this value in the - * [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in - * the subsequent call to - * [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve - * the next page of results. If this is empty it indicates that there are no - * more results through which to paginate. - * The page token is valid for only 2 hours. - * - * 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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php deleted file mode 100644 index cc63531bac2..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OAuthToken.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.scheduler.v1.OAuthToken - */ -class OAuthToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - */ - protected $scope = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * @type string $scope - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @return string - */ - public function getScope() - { - return $this->scope; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @param string $var - * @return $this - */ - public function setScope($var) - { - GPBUtil::checkString($var, True); - $this->scope = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php deleted file mode 100644 index b1359b688f9..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/OidcToken.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.scheduler.v1.OidcToken - */ -class OidcToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - */ - protected $audience = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * @type string $audience - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the job. The caller - * must have iam.serviceAccounts.actAs permission for the service account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @return string - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @param string $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkString($var, True); - $this->audience = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php deleted file mode 100644 index f91e74580f7..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PauseJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.scheduler.v1.PauseJobRequest - */ -class PauseJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see - * {@see CloudSchedulerClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\PauseJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php deleted file mode 100644 index e8413612185..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/PubsubTarget.php +++ /dev/null @@ -1,172 +0,0 @@ -google.cloud.scheduler.v1.PubsubTarget - */ -class PubsubTarget extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Cloud Pub/Sub topic to which messages will - * be published when a job is delivered. The topic name must be in the - * same format as required by Pub/Sub's - * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - * for example `projects/PROJECT_ID/topics/TOPIC_ID`. - * The topic must be in the same project as the Cloud Scheduler job. - * - * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { - */ - protected $topic_name = ''; - /** - * The message payload for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field bytes data = 3; - */ - protected $data = ''; - /** - * Attributes for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field map attributes = 4; - */ - private $attributes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic_name - * Required. The name of the Cloud Pub/Sub topic to which messages will - * be published when a job is delivered. The topic name must be in the - * same format as required by Pub/Sub's - * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - * for example `projects/PROJECT_ID/topics/TOPIC_ID`. - * The topic must be in the same project as the Cloud Scheduler job. - * @type string $data - * The message payload for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Attributes for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Target::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Cloud Pub/Sub topic to which messages will - * be published when a job is delivered. The topic name must be in the - * same format as required by Pub/Sub's - * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - * for example `projects/PROJECT_ID/topics/TOPIC_ID`. - * The topic must be in the same project as the Cloud Scheduler job. - * - * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getTopicName() - { - return $this->topic_name; - } - - /** - * Required. The name of the Cloud Pub/Sub topic to which messages will - * be published when a job is delivered. The topic name must be in the - * same format as required by Pub/Sub's - * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - * for example `projects/PROJECT_ID/topics/TOPIC_ID`. - * The topic must be in the same project as the Cloud Scheduler job. - * - * Generated from protobuf field string topic_name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopicName($var) - { - GPBUtil::checkString($var, True); - $this->topic_name = $var; - - return $this; - } - - /** - * The message payload for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field bytes data = 3; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * The message payload for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field bytes data = 3; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Attributes for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field map attributes = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Attributes for PubsubMessage. - * Pubsub message must contain either non-empty data, or at least one - * attribute. - * - * Generated from protobuf field map attributes = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->attributes = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php deleted file mode 100644 index d97de2ae4dc..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/ResumeJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.scheduler.v1.ResumeJobRequest - */ -class ResumeJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see - * {@see CloudSchedulerClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\ResumeJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php deleted file mode 100644 index d47986872f8..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RetryConfig.php +++ /dev/null @@ -1,397 +0,0 @@ -google.cloud.scheduler.v1.RetryConfig - */ -class RetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The number of attempts that the system will make to run a job using the - * exponential backoff procedure described by - * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. - * The default value of retry_count is zero. - * If retry_count is zero, a job attempt will *not* be retried if - * it fails. Instead the Cloud Scheduler system will wait for the - * next scheduled execution time. - * If retry_count is set to a non-zero number then Cloud Scheduler - * will retry failed attempts, using exponential backoff, - * retry_count times, or until the next scheduled execution time, - * whichever comes first. - * Values greater than 5 and negative values are not allowed. - * - * Generated from protobuf field int32 retry_count = 1; - */ - protected $retry_count = 0; - /** - * The time limit for retrying a failed job, measured from time when an - * execution was first attempted. If specified with - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job - * will be retried until both limits are reached. - * The default value for max_retry_duration is zero, which means retry - * duration is unlimited. - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - */ - protected $max_retry_duration = null; - /** - * The minimum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 5 seconds. - * - * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; - */ - protected $min_backoff_duration = null; - /** - * The maximum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; - */ - protected $max_backoff_duration = null; - /** - * The time between retries will double `max_doublings` times. - * A job's retry interval starts at - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], - * then doubles `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] - * times. - * For example, if - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] - * is 10s, - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * is 300s, and `max_doublings` is 3, then the a job will first be retried in - * 10s. The retry interval will double three times, and then increase linearly - * by 2^3 * 10s. Finally, the job will retry at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * until the job has been attempted - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * The default value of this field is 5. - * - * Generated from protobuf field int32 max_doublings = 5; - */ - protected $max_doublings = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $retry_count - * The number of attempts that the system will make to run a job using the - * exponential backoff procedure described by - * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. - * The default value of retry_count is zero. - * If retry_count is zero, a job attempt will *not* be retried if - * it fails. Instead the Cloud Scheduler system will wait for the - * next scheduled execution time. - * If retry_count is set to a non-zero number then Cloud Scheduler - * will retry failed attempts, using exponential backoff, - * retry_count times, or until the next scheduled execution time, - * whichever comes first. - * Values greater than 5 and negative values are not allowed. - * @type \Google\Protobuf\Duration $max_retry_duration - * The time limit for retrying a failed job, measured from time when an - * execution was first attempted. If specified with - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job - * will be retried until both limits are reached. - * The default value for max_retry_duration is zero, which means retry - * duration is unlimited. - * @type \Google\Protobuf\Duration $min_backoff_duration - * The minimum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 5 seconds. - * @type \Google\Protobuf\Duration $max_backoff_duration - * The maximum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 1 hour. - * @type int $max_doublings - * The time between retries will double `max_doublings` times. - * A job's retry interval starts at - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], - * then doubles `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] - * times. - * For example, if - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] - * is 10s, - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * is 300s, and `max_doublings` is 3, then the a job will first be retried in - * 10s. The retry interval will double three times, and then increase linearly - * by 2^3 * 10s. Finally, the job will retry at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * until the job has been attempted - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * The default value of this field is 5. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The number of attempts that the system will make to run a job using the - * exponential backoff procedure described by - * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. - * The default value of retry_count is zero. - * If retry_count is zero, a job attempt will *not* be retried if - * it fails. Instead the Cloud Scheduler system will wait for the - * next scheduled execution time. - * If retry_count is set to a non-zero number then Cloud Scheduler - * will retry failed attempts, using exponential backoff, - * retry_count times, or until the next scheduled execution time, - * whichever comes first. - * Values greater than 5 and negative values are not allowed. - * - * Generated from protobuf field int32 retry_count = 1; - * @return int - */ - public function getRetryCount() - { - return $this->retry_count; - } - - /** - * The number of attempts that the system will make to run a job using the - * exponential backoff procedure described by - * [max_doublings][google.cloud.scheduler.v1.RetryConfig.max_doublings]. - * The default value of retry_count is zero. - * If retry_count is zero, a job attempt will *not* be retried if - * it fails. Instead the Cloud Scheduler system will wait for the - * next scheduled execution time. - * If retry_count is set to a non-zero number then Cloud Scheduler - * will retry failed attempts, using exponential backoff, - * retry_count times, or until the next scheduled execution time, - * whichever comes first. - * Values greater than 5 and negative values are not allowed. - * - * Generated from protobuf field int32 retry_count = 1; - * @param int $var - * @return $this - */ - public function setRetryCount($var) - { - GPBUtil::checkInt32($var); - $this->retry_count = $var; - - return $this; - } - - /** - * The time limit for retrying a failed job, measured from time when an - * execution was first attempted. If specified with - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job - * will be retried until both limits are reached. - * The default value for max_retry_duration is zero, which means retry - * duration is unlimited. - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRetryDuration() - { - return $this->max_retry_duration; - } - - public function hasMaxRetryDuration() - { - return isset($this->max_retry_duration); - } - - public function clearMaxRetryDuration() - { - unset($this->max_retry_duration); - } - - /** - * The time limit for retrying a failed job, measured from time when an - * execution was first attempted. If specified with - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count], the job - * will be retried until both limits are reached. - * The default value for max_retry_duration is zero, which means retry - * duration is unlimited. - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRetryDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_retry_duration = $var; - - return $this; - } - - /** - * The minimum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 5 seconds. - * - * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getMinBackoffDuration() - { - return $this->min_backoff_duration; - } - - public function hasMinBackoffDuration() - { - return isset($this->min_backoff_duration); - } - - public function clearMinBackoffDuration() - { - unset($this->min_backoff_duration); - } - - /** - * The minimum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 5 seconds. - * - * Generated from protobuf field .google.protobuf.Duration min_backoff_duration = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMinBackoffDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->min_backoff_duration = $var; - - return $this; - } - - /** - * The maximum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxBackoffDuration() - { - return $this->max_backoff_duration; - } - - public function hasMaxBackoffDuration() - { - return isset($this->max_backoff_duration); - } - - public function clearMaxBackoffDuration() - { - unset($this->max_backoff_duration); - } - - /** - * The maximum amount of time to wait before retrying a job after - * it fails. - * The default value of this field is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration max_backoff_duration = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxBackoffDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_backoff_duration = $var; - - return $this; - } - - /** - * The time between retries will double `max_doublings` times. - * A job's retry interval starts at - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], - * then doubles `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] - * times. - * For example, if - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] - * is 10s, - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * is 300s, and `max_doublings` is 3, then the a job will first be retried in - * 10s. The retry interval will double three times, and then increase linearly - * by 2^3 * 10s. Finally, the job will retry at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * until the job has been attempted - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * The default value of this field is 5. - * - * Generated from protobuf field int32 max_doublings = 5; - * @return int - */ - public function getMaxDoublings() - { - return $this->max_doublings; - } - - /** - * The time between retries will double `max_doublings` times. - * A job's retry interval starts at - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration], - * then doubles `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * up to [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] - * times. - * For example, if - * [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration] - * is 10s, - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * is 300s, and `max_doublings` is 3, then the a job will first be retried in - * 10s. The retry interval will double three times, and then increase linearly - * by 2^3 * 10s. Finally, the job will retry at intervals of - * [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration] - * until the job has been attempted - * [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * The default value of this field is 5. - * - * Generated from protobuf field int32 max_doublings = 5; - * @param int $var - * @return $this - */ - public function setMaxDoublings($var) - { - GPBUtil::checkInt32($var); - $this->max_doublings = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php deleted file mode 100644 index 7bba62951ed..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/RunJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.scheduler.v1.RunJobRequest - */ -class RunJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. Please see - * {@see CloudSchedulerClient::jobName()} for help formatting this field. - * - * @return \Google\Cloud\Scheduler\V1\RunJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php b/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php deleted file mode 100644 index d0030ac59c0..00000000000 --- a/owl-bot-staging/Scheduler/v1/proto/src/Google/Cloud/Scheduler/V1/UpdateJobRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.scheduler.v1.UpdateJobRequest - */ -class UpdateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new job properties. - * [name][google.cloud.scheduler.v1.Job.name] must be specified. - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job = null; - /** - * A mask used to specify which fields of the job are being updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Scheduler\V1\Job $job Required. The new job properties. - * [name][google.cloud.scheduler.v1.Job.name] must be specified. - * - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * @param \Google\Protobuf\FieldMask $updateMask A mask used to specify which fields of the job are being updated. - * - * @return \Google\Cloud\Scheduler\V1\UpdateJobRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Scheduler\V1\Job $job, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setJob($job) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Scheduler\V1\Job $job - * Required. The new job properties. - * [name][google.cloud.scheduler.v1.Job.name] must be specified. - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask used to specify which fields of the job are being updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Scheduler\V1\Cloudscheduler::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new job properties. - * [name][google.cloud.scheduler.v1.Job.name] must be specified. - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Scheduler\V1\Job|null - */ - public function getJob() - { - return $this->job; - } - - public function hasJob() - { - return isset($this->job); - } - - public function clearJob() - { - unset($this->job); - } - - /** - * Required. The new job properties. - * [name][google.cloud.scheduler.v1.Job.name] must be specified. - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * - * Generated from protobuf field .google.cloud.scheduler.v1.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Scheduler\V1\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\Job::class); - $this->job = $var; - - return $this; - } - - /** - * A mask used to specify which fields of the job are being updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * A mask used to specify which fields of the job are being updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php deleted file mode 100644 index cd823779753..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/create_job.php +++ /dev/null @@ -1,74 +0,0 @@ -setParent($formattedParent) - ->setJob($job); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->createJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudSchedulerClient::locationName('[PROJECT]', '[LOCATION]'); - - create_job_sample($formattedParent); -} -// [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php deleted file mode 100644 index 61cad929479..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/delete_job.php +++ /dev/null @@ -1,70 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $cloudSchedulerClient->deleteJob($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - delete_job_sample($formattedName); -} -// [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php deleted file mode 100644 index 7280e6b715b..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_job.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->getJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - get_job_sample($formattedName); -} -// [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php deleted file mode 100644 index 6ad5dccb6a8..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudscheduler_v1_generated_CloudScheduler_GetLocation_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php deleted file mode 100644 index 302f847f3ae..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_jobs.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudSchedulerClient->listJobs($request); - - /** @var Job $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudSchedulerClient::locationName('[PROJECT]', '[LOCATION]'); - - list_jobs_sample($formattedParent); -} -// [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php deleted file mode 100644 index 4a8887666ed..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudscheduler_v1_generated_CloudScheduler_ListLocations_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php deleted file mode 100644 index 0b0b9dfeefd..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/pause_job.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->pauseJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - pause_job_sample($formattedName); -} -// [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php deleted file mode 100644 index 3590328c285..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/resume_job.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->resumeJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - resume_job_sample($formattedName); -} -// [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php deleted file mode 100644 index bd8e0fe5912..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/run_job.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->runJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudSchedulerClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - run_job_sample($formattedName); -} -// [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php b/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php deleted file mode 100644 index dafd14d2d59..00000000000 --- a/owl-bot-staging/Scheduler/v1/samples/V1/CloudSchedulerClient/update_job.php +++ /dev/null @@ -1,71 +0,0 @@ -setJob($job) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $cloudSchedulerClient->updateJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php b/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php deleted file mode 100644 index f7c4dfa8126..00000000000 --- a/owl-bot-staging/Scheduler/v1/src/V1/Client/CloudSchedulerClient.php +++ /dev/null @@ -1,561 +0,0 @@ - createJobAsync(CreateJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) - * @method PromiseInterface pauseJobAsync(PauseJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface resumeJobAsync(ResumeJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface runJobAsync(RunJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface updateJobAsync(UpdateJobRequest $request, array $optionalArgs = []) - * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) - * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) - */ -final class CloudSchedulerClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.scheduler.v1.CloudScheduler'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'cloudscheduler.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudscheduler.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_scheduler_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_scheduler_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_scheduler_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_scheduler_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName(string $project, string $location, string $job): string - { - return self::getPathTemplate('job')->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a topic - * resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted topic resource. - */ - public static function topicName(string $project, string $topic): string - { - return self::getPathTemplate('topic')->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - job: projects/{project}/locations/{location}/jobs/{job} - * - location: projects/{project}/locations/{location} - * - topic: projects/{project}/topics/{topic} - * - * 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. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudscheduler.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 - * $apiEndpoint 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a job. - * - * The async variant is {@see CloudSchedulerClient::createJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/create_job.php - * - * @param CreateJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function createJob(CreateJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); - } - - /** - * Deletes a job. - * - * The async variant is {@see CloudSchedulerClient::deleteJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/delete_job.php - * - * @param DeleteJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Thrown if the API call fails. - */ - public function deleteJob(DeleteJobRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); - } - - /** - * Gets a job. - * - * The async variant is {@see CloudSchedulerClient::getJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/get_job.php - * - * @param GetJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function getJob(GetJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('GetJob', $request, $callOptions)->wait(); - } - - /** - * Lists jobs. - * - * The async variant is {@see CloudSchedulerClient::listJobsAsync()} . - * - * @example samples/V1/CloudSchedulerClient/list_jobs.php - * - * @param ListJobsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListJobs', $request, $callOptions); - } - - /** - * Pauses a job. - * - * If a job is paused then the system will stop executing the job - * until it is re-enabled via - * [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state - * of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if - * paused it will be set to - * [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must - * be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to - * be paused. - * - * The async variant is {@see CloudSchedulerClient::pauseJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/pause_job.php - * - * @param PauseJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function pauseJob(PauseJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('PauseJob', $request, $callOptions)->wait(); - } - - /** - * Resume a job. - * - * This method reenables a job after it has been - * [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state - * of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; - * after calling this method it will be set to - * [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job - * must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] - * to be resumed. - * - * The async variant is {@see CloudSchedulerClient::resumeJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/resume_job.php - * - * @param ResumeJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function resumeJob(ResumeJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('ResumeJob', $request, $callOptions)->wait(); - } - - /** - * Forces a job to run now. - * - * When this method is called, Cloud Scheduler will dispatch the job, even - * if the job is already running. - * - * The async variant is {@see CloudSchedulerClient::runJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/run_job.php - * - * @param RunJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function runJob(RunJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('RunJob', $request, $callOptions)->wait(); - } - - /** - * Updates a job. - * - * If successful, the updated [Job][google.cloud.scheduler.v1.Job] is - * returned. If the job does not exist, `NOT_FOUND` is returned. - * - * If UpdateJob does not successfully return, it is possible for the - * job to be in an - * [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] - * state. A job in this state may not be executed. If this happens, retry the - * UpdateJob request until a successful response is received. - * - * The async variant is {@see CloudSchedulerClient::updateJobAsync()} . - * - * @example samples/V1/CloudSchedulerClient/update_job.php - * - * @param UpdateJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Job - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateJob(UpdateJobRequest $request, array $callOptions = []): Job - { - return $this->startApiCall('UpdateJob', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see CloudSchedulerClient::getLocationAsync()} . - * - * @example samples/V1/CloudSchedulerClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see CloudSchedulerClient::listLocationsAsync()} . - * - * @example samples/V1/CloudSchedulerClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json deleted file mode 100644 index bcd45c81af7..00000000000 --- a/owl-bot-staging/Scheduler/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.scheduler.v1", - "libraryPackage": "Google\\Cloud\\Scheduler\\V1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "CloudSchedulerGapicClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs" - ] - }, - "PauseJob": { - "methods": [ - "pauseJob" - ] - }, - "ResumeJob": { - "methods": [ - "resumeJob" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json deleted file mode 100644 index 466c38cf596..00000000000 --- a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_client_config.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "interfaces": { - "google.cloud.scheduler.v1.CloudScheduler": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteJob": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetJob": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListJobs": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseJob": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeJob": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunJob": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateJob": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php deleted file mode 100644 index 0306dcf2405..00000000000 --- a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_descriptor_config.php +++ /dev/null @@ -1,172 +0,0 @@ - [ - 'google.cloud.scheduler.v1.CloudScheduler' => [ - 'CreateJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListJobs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getJobs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\ListJobsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PauseJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ResumeJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RunJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Scheduler\V1\Job', - 'headerParams' => [ - [ - 'keyName' => 'job.name', - 'fieldAccessors' => [ - 'getJob', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'job' => 'projects/{project}/locations/{location}/jobs/{job}', - 'location' => 'projects/{project}/locations/{location}', - 'topic' => 'projects/{project}/topics/{topic}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php b/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php deleted file mode 100644 index 5f7e537c2c4..00000000000 --- a/owl-bot-staging/Scheduler/v1/src/V1/resources/cloud_scheduler_rest_client_config.php +++ /dev/null @@ -1,150 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.scheduler.v1.CloudScheduler' => [ - 'CreateJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', - 'body' => 'job', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteJob' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetJob' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListJobs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RunJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}:run', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateJob' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{job.name=projects/*/locations/*/jobs/*}', - 'body' => 'job', - 'placeholders' => [ - 'job.name' => [ - 'getters' => [ - 'getJob', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php b/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php deleted file mode 100644 index 97eb440cac7..00000000000 --- a/owl-bot-staging/Scheduler/v1/tests/Unit/V1/Client/CloudSchedulerClientTest.php +++ /dev/null @@ -1,804 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudSchedulerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudSchedulerClient($options); - } - - /** @test */ - public function createJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); - $response = $gapicClient->createJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/CreateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); - try { - $gapicClient->createJob($request); - // 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 deleteJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); - $gapicClient->deleteJob($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/DeleteJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteJob($request); - // 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 getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); - $response = $gapicClient->getJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/GetJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); - try { - $gapicClient->getJob($request); - // 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 listJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listJobs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/ListJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listJobs($request); - // 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 pauseJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new PauseJobRequest()) - ->setName($formattedName); - $response = $gapicClient->pauseJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/PauseJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new PauseJobRequest()) - ->setName($formattedName); - try { - $gapicClient->pauseJob($request); - // 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 resumeJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new ResumeJobRequest()) - ->setName($formattedName); - $response = $gapicClient->resumeJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/ResumeJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new ResumeJobRequest()) - ->setName($formattedName); - try { - $gapicClient->resumeJob($request); - // 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 runJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new RunJobRequest()) - ->setName($formattedName); - $response = $gapicClient->runJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/RunJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runJobExceptionTest() - { - $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->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new RunJobRequest()) - ->setName($formattedName); - try { - $gapicClient->runJob($request); - // 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 updateJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $job = new Job(); - $updateMask = new FieldMask(); - $request = (new UpdateJobRequest()) - ->setJob($job) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateJob($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/UpdateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateJobExceptionTest() - { - $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 - $job = new Job(); - $updateMask = new FieldMask(); - $request = (new UpdateJobRequest()) - ->setJob($job) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateJob($request); - // 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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // 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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // 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 createJobAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $schedule = 'schedule-697920873'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setSchedule($schedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); - $response = $gapicClient->createJobAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.scheduler.v1.CloudScheduler/CreateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -}